.. _bgp-user-guide-test-tools: Test Tools ========== BGP test tools serves to test basic BGP functionality, scalability and performance. .. contents:: Contents :depth: 2 :local: BGP Test Tool ^^^^^^^^^^^^^ The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes. This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version): ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool`` Usage ''''' The application can be run from command line: .. code-block:: console java -jar bgp-testtool-*-executable.jar with optional input parameters: .. code-block:: console -i , --active Active initialisation of the connection, by default false. -ho , --holdtimer In seconds, value of the desired holdtimer, by default 90. -sc , --speakersCount Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0. -ra , --remote-address A list of IP addresses of remote BGP peers, that the tool can accept or initiate connect to that address (based on the mode), by default 192.0.2.2:1790. -la , --localAddress IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0. -pr , --prefixes Number of prefixes to be advertised by each simulated speaker -mp , --multiPathSupport Active ADD-PATH support, by default false. -as , --as Local AS Number, by default 64496. -ec , --extended_communities Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty. -ll , --log_level Log level for console output, by default INFO. BGP Application Peer Benchmark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes. This application is part of the OpenDaylight Karaf distribution. Configuration ''''''''''''' As a first step install BGP and RESTCONF, then configure *Application Peer*. Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following: **URL:** ``/rests/data/odl-bgp-app-peer-benchmark-config:config`` **Method:** ``PUT`` .. tabs:: .. tab:: XML **Content-Type:** ``application/xml`` **Request Body:** .. code-block:: xml :linenos: :emphasize-lines: 2 10.25.1.9 @line 2: The *Application Peer* identifier. .. tab:: JSON **Content-Type:** ``application/json`` **Request Body:** .. code-block:: json :linenos: :emphasize-lines: 3 { "odl-bgp-app-peer-benchmark-config": { "app-peer-id": "10.25.1.9" } } @line 3: The *Application Peer* identifier. Inject routes ''''''''''''' Routes injection can be invoked via RPC: **URL:** ``/rests/operations/odl-bgp-app-peer-benchmark:add-prefix`` **Method:** ``POST`` .. tabs:: .. tab:: XML **Content-Type:** ``application/xml`` **Request Body:** .. code-block:: xml :linenos: :emphasize-lines: 2,3,4,5 1.1.1.1/32 100000 2000 192.0.2.2 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes. @line 3: An amount of routes to be added to *Application Peer's* programmable RIB. @line 4: A size of the transaction batch. @line 5: A NEXT_HOP attribute value used in all injected routes. **Response Body:** .. code-block:: xml :linenos: :emphasize-lines: 3,4,5 4301 25000 100000 @line 3: Request duration in milliseconds. @line 4: Writes per second rate. @line 5: An amount of routes added to *Application Peer's* programmable RIB. .. tab:: JSON **Content-Type:** ``application/json`` **Request Body:** .. code-block:: json :linenos: :emphasize-lines: 3,4,5,6 { "odl-bgp-app-peer-benchmark:input": { "prefix": "1.1.1.1/32", "count": 100000, "batchsize": 2000, "nexthop": "192.0.2.2" } } @line 3: A initial IPv4 prefix carried in route. Value is incremented for following routes. @line 4: An amount of routes to be added to *Application Peer's* programmable RIB. @line 5: A size of the transaction batch. @line 6: A NEXT_HOP attribute value used in all injected routes. **Response Body:** .. code-block:: json :linenos: :emphasize-lines: 4,5,6 { "output": { "result": { "duration": 4757, "rate": 25000, "count": 100000 } } } @line 4: Request duration in milliseconds. @line 5: Writes per second rate. @line 6: An amount of routes added to *Application Peer's* programmable RIB. Remove routes ''''''''''''' Routes deletion can be invoked via RPC: **URL:** ``/rests/operations/odl-bgp-app-peer-benchmark:delete-prefix`` **Method:** ``POST`` .. tabs:: .. tab:: XML **Content-Type:** ``application/xml`` **Request Body:** .. code-block:: xml :linenos: :emphasize-lines: 2,3,4 1.1.1.1/32 100000 2000 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes. @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB. @line 4: A size of the transaction batch. **Response Body:** .. code-block:: xml 1837 54500 100000 .. tab:: JSON **Content-Type:** ``application/json`` **Request Body:** .. code-block:: json :linenos: :emphasize-lines: 3,4,5 { "odl-bgp-app-peer-benchmark:input": { "prefix": "1.1.1.1/32", "count": 100000, "batchsize": 2000 } } @line 3: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes. @line 4: An amount of routes to be removed from *Application Peer's* programmable RIB. @line 5: A size of the transaction batch. **Response Body:** .. code-block:: json { "odl-bgp-app-peer-benchmark:output": { "result": { "duration": 1837, "rate": 54500, "count": 100000 } } }