Migrate bgpcep docs to the bgpcep project
[bgpcep.git] / docs / pcep / pcep-user-guide-test-tools.rst
1 .. _pcep-user-guide-test-tools:
2
3 Test tools
4 ==========
5
6 PCC Mock
7 ^^^^^^^^
8 The PCC Mock is a stand-alone Java application purposed to simulate a PCC(s).
9 The simulator is capable to report sample LSPs, respond to delegation, LSP management operations and synchronization optimization procedures.
10 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
11
12 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/pcep-pcc-mock``
13
14 Usage
15 '''''
16 The application can be run from command line:
17
18 .. code-block:: console
19
20    java -jar pcep-pcc-mock-*-executable.jar
21
22
23 with optional input parameters:
24
25 .. code-block:: console
26
27    --local-address <Address:Port> (optional, default 127.0.0.1)
28       The first PCC IP address. If more PCCs are required, the IP address will be incremented. Port number can be optionally specified.
29
30    --remote-address <Address1:Port1,Address2:Port2,Address3:Port3,...> (optional, default 127.0.0.1:4189)
31       The list of IP address for the PCE servers. Port number can be optionally specified, otherwise default port number 4189 is used.
32
33    --pcc <N> (optional, default 1)
34       Number of mocked PCC instances.
35
36    --lsp <N> (optional, default 1)
37       Number of tunnels (LSPs) reported per PCC, might be zero.
38
39    --pcerr (optional flag)
40       If the flag is present, response with PCErr, otherwise PCUpd.
41
42    --log-level <LEVEL> (optional, default INFO)
43       Set logging level for pcc-mock.
44
45    -d, --deadtimer <0..255> (optional, default 120)
46       DeadTimer value in seconds.
47
48    -ka, --keepalive <0.255> (optional, default 30)
49       KeepAlive timer value in seconds.
50
51    --password <password> (optional)
52       If the password is present, it is used in TCP MD5 signature, otherwise plain TCP is used.
53
54    --reconnect <seconds> (optional)
55       If the argument is present, the value in seconds, is used as a delay before each new reconnect (initial connect or connection re-establishment) attempt.
56       The number of reconnect attempts is unlimited. If the argument is omitted, pcc-mock is not trying to reconnect.
57
58    --redelegation-timeout <seconds> (optional, default 0)
59       The timeout starts when LSP delegation is returned or PCE fails, stops when LSP is re-delegated to PCE.
60       When timeout expires, LSP delegation is revoked and held by PCC.
61
62    --state-timeout <seconds> (optional, default -1 (disabled))
63       The timeout starts when LSP delegation is returned or PCE fails, stops when LSP is re-delegated to PCE.
64       When timeout expires, PCE-initiated LSP is removed.
65
66    --state-sync-avoidance <disconnect_after_x_seconds> <reconnect_after_x_seconds> <dbVersion>
67       Synchronization avoidance capability enabled.
68          - disconnect_after_x_seconds: seconds that will pass until disconnections is forced. If set to smaller number than 1, disconnection wont be performed.
69          - reconnect_after_x_seconds: seconds that will pass between disconnection and new connection attempt. Only happens if disconnection has been performed.
70          - dbVersion: dbVersion used in new Open and must be always equal or bigger than LSP. If equal than LSP skip synchronization will be performed,
71            if not full synchronization will be performed taking in account new starting dbVersion desired.
72     --incremental-sync-procedure <disconnect_after_x_seconds> <reconnect_after_x_seconds> <dbVersion>
73       Incremental synchronization capability enabled.
74          - dbVersion: dbVersion used in new Open and must be always bigger than LSP. Incremental synchronization will be performed taking in account new starting dbVersion desired.
75
76     --triggered-initial-sync
77       PCE-triggered synchronization capability enabled. Can be combined combined with state-sync-avoidance/incremental-sync-procedure.
78
79     --triggered-re-sync
80       PCE-triggered re-synchronization capability enabled.
81
82 Data Change Counter Tool
83 ^^^^^^^^^^^^^^^^^^^^^^^^
84
85 Data Change Counter tool registers a Data Change Listener to a specified topology's subtree.
86 This will allow us to know the quantity of changes produced under it, with each data change event counter will be incremented.
87
88 Installation
89 ''''''''''''
90 Installing data change counter tool
91
92 .. code-block:: console
93
94    feature:install odl-restconf odl-bgpcep-data-change-counter
95
96 Configuration
97 '''''''''''''
98 Once we set the configuration, a new data change counter will be created and registers to example-linkstate-topology.
99
100 .. important:: **Clustering** - Each Counter Identifier should be unique.
101
102 **URL:** ``/restconf/config/odl-data-change-counter-config:data-change-counter-config/data-change-counter``
103
104 **Method:** ``PUT``
105
106 **Content-Type:** ``application/xml``
107
108 **Request Body:**
109
110 .. code-block:: xml
111    :linenos:
112    :emphasize-lines: 2,3
113
114    <data-change-counter-config xmlns="urn:opendaylight:params:xml:ns:yang:bgpcep:data-change-counter-config">
115        <counter-id>data-change-counter</counter-id>
116        <topology-name>example-linkstate-topology</topology-name>
117    </data-change-counter-config>
118
119 @line 2: **Counter Id** - Unique counter change identifier.
120
121 @line 3: **Topology Name** - An identifier for a topology.
122
123 Usage
124 '''''
125
126 Counter state for topology
127
128 **URL:** ``/restconf/operational/data-change-counter:data-change-counter/counter/data-change-counter``
129
130 **Method:** ``GET``
131
132 **Response Body:**
133
134 .. code-block:: xml
135    :linenos:
136    :emphasize-lines: 2,3
137
138    <counter xmlns="urn:opendaylight:params:xml:ns:yang:bgp-data-change-counter">
139        <id>data-change-counter</id>
140        <count>0</count>
141    </counter>
142
143 @line 2: **Counter Id** - Unique counter change identifier.
144
145 @line 3: **Count** - Number of changes under registered topology's subtree.