Additional Path Capability¶
The ADD-PATH capability allows to advertise multiple paths for the same address prefix. It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
Configuration¶
This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
Note
The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
BGP Speaker¶
To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/protocols
Method: POST
Content-Type: application/xml
Request Body:
1<protocol xmlns="http://openconfig.net/yang/network-instance">
2 <name>bgp-example</name>
3 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
4 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
5 <global>
6 <config>
7 <router-id>192.0.2.2</router-id>
8 <as>65000</as>
9 </config>
10 <afi-safis>
11 <afi-safi>
12 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
13 <receive>true</receive>
14 <send-max>2</send-max>
15 </afi-safi>
16 </afi-safis>
17 </global>
18 </bgp>
19</protocol>
@line 14: Defines path selection strategy: send-max > 1 -> Advertise N Paths or send-max = 0 -> Advertise All Paths
Content-Type: application/json
Request Body:
1{
2 "protocol": [
3 {
4 "identifier": "openconfig-policy-types:BGP",
5 "name": "bgp-example",
6 "bgp-openconfig-extensions:bgp": {
7 "global": {
8 "config": {
9 "router-id": "192.0.2.2",
10 "as": 65000
11 },
12 "afi-safis": {
13 "afi-safi": [
14 {
15 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
16 "receive": true,
17 "send-max": 2
18 }
19 ]
20 }
21 }
22 }
23 }
24 ]
25}
@line 17: Defines path selection strategy: send-max > 1 -> Advertise N Paths or send-max = 0 -> Advertise All Paths
Here is an example for update a specific family with enable ADD-PATH capability
URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP,bgp-example/bgp/global/afi-safis/afi-safi=openconfig-bgp-types:IPV4%2DUNICAST
Method: PUT
Content-Type: application/xml
Request Body:
<afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
<receive>true</receive>
<send-max>0</send-max>
</afi-safi>
Content-Type: application/json
Request Body:
{
"bgp-openconfig-extensions:afi-safi": [
{
"afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
"receive": true,
"send-max": 0
}
]
}
BGP Peer¶
Here is an example for BGP peer configuration with enabled ADD-PATH capability.
URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP,bgp-example/bgp/neighbors
Method: POST
Content-Type: application/xml
Request Body:
<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<neighbor-address>192.0.2.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
</afi-safi>
<afi-safi>
<afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
<receive>true</receive>
<send-max>0</send-max>
</afi-safi>
</afi-safis>
</neighbor>
Content-Type: application/json
Request Body:
{
"neighbor": [
{
"neighbor-address": "192.0.2.1",
"afi-safis": {
"afi-safi": [
{
"afi-safi-name": "openconfig-bgp-types:IPV4-LABELLED-UNICAST"
},
{
"afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
"receive": true,
"send-max": 0
}
]
}
}
]
}
Note
The path selection strategy is not configurable on per peer basis. The send-max presence indicates a willingness to send ADD-PATH NLRIs to the neighbor.
Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP,bgp-example/bgp/neighbors/neighbor=192.0.2.1/afi-safis/afi-safi=openconfig-bgp-types:IPV4%2DUNICAST
Method: PUT
Content-Type: application/xml
Request Body:
<afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
<receive>true</receive>
<send-max>0</send-max>
</afi-safi>
Content-Type: application/json
Request Body:
{
"bgp-openconfig-extensions:afi-safi": [
{
"afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
"receive": true,
"send-max": 0
}
]
}
Usage¶
The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker’s Loc-RIB can be verified via REST:
URL: /rests/data/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables=bgp-types:ipv4-address-family,bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes?content=nonconfig
Method: GET
Response Body:
1<ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
2 <ipv4-route>
3 <path-id>1</path-id>
4 <prefix>193.0.2.1/32</prefix>
5 <attributes>
6 <as-path></as-path>
7 <origin>
8 <value>igp</value>
9 </origin>
10 <local-pref>
11 <pref>100</pref>
12 </local-pref>
13 <ipv4-next-hop>
14 <global>10.0.0.1</global>
15 </ipv4-next-hop>
16 </attributes>
17 </ipv4-route>
18 <ipv4-route>
19 <path-id>2</path-id>
20 <prefix>193.0.2.1/32</prefix>
21 <attributes>
22 <as-path></as-path>
23 <origin>
24 <value>igp</value>
25 </origin>
26 <local-pref>
27 <pref>100</pref>
28 </local-pref>
29 <ipv4-next-hop>
30 <global>10.0.0.2</global>
31 </ipv4-next-hop>
32 </attributes>
33 </ipv4-route>
34</ipv4-routes>
@line 3: The routes with the same destination are distinguished by path-id attribute.
Response Body:
1{
2 "bgp-inet:ipv4-routes":{
3 "ipv4-route": [
4 {
5 "path-id": 1,
6 "prefix": "193.0.2.1/32",
7 "attributes": {
8 "origin": {
9 "value": "igp"
10 },
11 "local-pref": {
12 "pref": 100
13 },
14 "ipv4-next-hop": {
15 "global": "10.0.0.1"
16 }
17 }
18 },
19 {
20 "path-id": 2,
21 "prefix": "193.0.2.1/32",
22 "attributes": {
23 "origin": {
24 "value": "igp"
25 },
26 "local-pref": {
27 "pref": 100
28 },
29 "ipv4-next-hop": {
30 "global": "10.0.0.2"
31 }
32 }
33 }
34 ]
35 }
36}
@line 5: The routes with the same destination are distinguished by path-id attribute.