Merge "BGPCEP-781: Add path-id to all AFI/SAFI guides"
[docs.git] / docs / user-guide / bgpcep-guide / bgp / bgp-user-guide-additional-path-capability.rst
1 .. _bgp-user-guide-additional-path-capability:
2
3 Additional Path Capability
4 ==========================
5 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
6 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
7
8 .. contents:: Contents
9    :depth: 2
10    :local:
11
12 Configuration
13 ^^^^^^^^^^^^^
14 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
15
16 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
17
18 BGP Speaker
19 '''''''''''
20 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
21
22 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
23
24 **Method:** ``POST``
25
26 **Content-Type:** ``application/xml``
27
28 **Request Body:**
29
30 .. code-block:: xml
31    :linenos:
32    :emphasize-lines: 14
33
34    <protocol xmlns="http://openconfig.net/yang/network-instance">
35        <name>bgp-example</name>
36        <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
37        <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
38            <global>
39                <config>
40                    <router-id>192.0.2.2</router-id>
41                    <as>65000</as>
42                </config>
43                <afi-safis>
44                    <afi-safi>
45                        <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
46                        <receive>true</receive>
47                        <send-max>2</send-max>
48                    </afi-safi>
49                </afi-safis>
50            </global>
51        </bgp>
52    </protocol>
53
54 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
55
56 Here is an example for update a specific family with enable ADD-PATH capability
57
58 **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``
59
60 **Method:** ``PUT``
61
62 **Content-Type:** ``application/xml``
63
64 **Request Body:**
65
66 .. code-block:: xml
67
68    <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
69       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
70       <receive>true</receive>
71       <send-max>0</send-max>
72    </afi-safi>
73
74 BGP Peer
75 ''''''''
76 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
77
78 **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``
79
80 **Method:** ``POST``
81
82 **Content-Type:** ``application/xml``
83
84 **Request Body:**
85
86 .. code-block:: xml
87
88    <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
89        <neighbor-address>192.0.2.1</neighbor-address>
90        <afi-safis>
91            <afi-safi>
92                <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
93            </afi-safi>
94            <afi-safi>
95                <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
96                <receive>true</receive>
97                <send-max>0</send-max>
98            </afi-safi>
99        </afi-safis>
100    </neighbor>
101
102 .. 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.
103
104 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
105
106 **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``
107
108 **Method:** ``PUT``
109
110 **Content-Type:** ``application/xml``
111
112 **Request Body:**
113
114 .. code-block:: xml
115
116    <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
117       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
118       <receive>true</receive>
119       <send-max>0</send-max>
120    </afi-safi>
121
122 Usage
123 ^^^^^
124 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
125
126 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
127
128 **Method:** ``GET``
129
130 **Response Body:**
131
132 .. code-block:: xml
133    :linenos:
134    :emphasize-lines: 3
135
136    <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
137        <ipv4-route>
138            <path-id>1</path-id>
139            <prefix>193.0.2.1/32</prefix>
140            <attributes>
141                <as-path></as-path>
142                <origin>
143                    <value>igp</value>
144                </origin>
145                <local-pref>
146                    <pref>100</pref>
147                </local-pref>
148                <ipv4-next-hop>
149                    <global>10.0.0.1</global>
150                </ipv4-next-hop>
151            </attributes>
152        </ipv4-route>
153        <ipv4-route>
154            <path-id>2</path-id>
155            <prefix>193.0.2.1/32</prefix>
156            <attributes>
157                <as-path></as-path>
158                <origin>
159                    <value>igp</value>
160                </origin>
161                <local-pref>
162                    <pref>100</pref>
163                </local-pref>
164                <ipv4-next-hop>
165                    <global>10.0.0.2</global>
166                </ipv4-next-hop>
167            </attributes>
168        </ipv4-route>
169    </ipv4-routes>
170
171 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
172
173 References
174 ^^^^^^^^^^
175 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
176 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_