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.
Contents
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: /restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols
RFC8040 URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/protocols
Method: POST
Content-Type: application/xml
Request Body:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <protocol xmlns="http://openconfig.net/yang/network-instance">
<name>bgp-example</name>
<identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
<bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<global>
<config>
<router-id>192.0.2.2</router-id>
<as>65000</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
<receive>true</receive>
<send-max>2</send-max>
</afi-safi>
</afi-safis>
</global>
</bgp>
</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 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {
"protocol": [
{
"identifier": "openconfig-policy-types:BGP",
"name": "bgp-example",
"bgp-openconfig-extensions:bgp": {
"global": {
"config": {
"router-id": "192.0.2.2",
"as": 65000
},
"afi-safis": {
"afi-safi": [
{
"afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
"receive": true,
"send-max": 2
}
]
}
}
}
}
]
}
|
@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: /restconf/config/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: /restconf/config/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: /restconf/config/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: /restconf/operational/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
Method: GET
Response Body:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
<ipv4-route>
<path-id>1</path-id>
<prefix>193.0.2.1/32</prefix>
<attributes>
<as-path></as-path>
<origin>
<value>igp</value>
</origin>
<local-pref>
<pref>100</pref>
</local-pref>
<ipv4-next-hop>
<global>10.0.0.1</global>
</ipv4-next-hop>
</attributes>
</ipv4-route>
<ipv4-route>
<path-id>2</path-id>
<prefix>193.0.2.1/32</prefix>
<attributes>
<as-path></as-path>
<origin>
<value>igp</value>
</origin>
<local-pref>
<pref>100</pref>
</local-pref>
<ipv4-next-hop>
<global>10.0.0.2</global>
</ipv4-next-hop>
</attributes>
</ipv4-route>
</ipv4-routes>
|
@line 3: The routes with the same destination are distinguished by path-id attribute.
Response Body:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {
"bgp-inet:ipv4-routes":{
"ipv4-route": [
{
"path-id": 1,
"prefix": "193.0.2.1/32",
"attributes": {
"origin": {
"value": "igp"
},
"local-pref": {
"pref": 100
},
"ipv4-next-hop": {
"global": "10.0.0.1"
}
}
},
{
"path-id": 2,
"prefix": "193.0.2.1/32",
"attributes": {
"origin": {
"value": "igp"
},
"local-pref": {
"pref": 100
},
"ipv4-next-hop": {
"global": "10.0.0.2"
}
}
}
]
}
}
|
@line 5: The routes with the same destination are distinguished by path-id attribute.