Fix MRI project list
[docs.git] / docs / user-guide / bgpcep-guide / bgp / bgp-user-guide-labeled-family.rst
1 .. _bgp-user-guide-labeled-family:
2
3 IP Labeled Unicast Family
4 =========================
5 The BGP Labeled Unicast (BGP-LU) Multiprotocol extension is used to distribute a MPLS label that is mapped to a particular route.
6 It can be used to advertise a MPLS transport path between IGP regions and Autonomous Systems.
7 Also, BGP-LU can help to solve the Inter-domain traffic-engineering problem and can be deployed in large-scale data centers along with MPLS and Spring.
8 In addition, IPv6 Labeled Unicast can be used to interconnect IPv6 islands over IPv4/MPLS networks using 6PE.
9
10 .. contents:: Contents
11    :depth: 2
12    :local:
13
14 Configuration
15 ^^^^^^^^^^^^^
16 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
17
18 BGP Speaker
19 '''''''''''
20 To enable IPv4 and IPv6 Labeled Unicast support 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
32    <protocol xmlns="http://openconfig.net/yang/network-instance">
33        <name>bgp-example</name>
34        <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
35        <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
36            <global>
37                <config>
38                    <router-id>192.0.2.2</router-id>
39                    <as>65000</as>
40                </config>
41                <afi-safis>
42                    <afi-safi>
43                        <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
44                    </afi-safi>
45                    <afi-safi>
46                        <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
47                    </afi-safi>
48                </afi-safis>
49            </global>
50        </bgp>
51    </protocol>
52
53 BGP Peer
54 ''''''''
55 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Labeled Unicast family.
56
57 **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``
58
59 **Method:** ``POST``
60
61 **Content-Type:** ``application/xml``
62
63 **Request Body:**
64
65 .. code-block:: xml
66
67    <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
68        <neighbor-address>192.0.2.1</neighbor-address>
69        <afi-safis>
70            <afi-safi>
71                <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
72            </afi-safi>
73            <afi-safi>
74                <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
75            </afi-safi>
76        </afi-safis>
77    </neighbor>
78
79 IP Labeled Unicast API
80 ^^^^^^^^^^^^^^^^^^^^^^
81 Following trees illustrate the BGP IP Labeled Unicast routes structures.
82
83 IPv4 Labeled Unicast Route
84 ''''''''''''''''''''''''''
85 .. code-block:: console
86
87    :(labeled-unicast-routes-case)
88      +--ro labeled-unicast-routes
89         +--ro labeled-unicast-route* [route-key path-id]
90            +--ro route-key      string
91            +--ro label-stack*
92            |  +--ro label-value?   netc:mpls-label
93            +--ro prefix?        inet:ip-prefix
94            +--ro path-id        path-id
95            +--ro attributes
96            ...
97
98
99 IPv6 Labeled Unicast Route
100 ''''''''''''''''''''''''''
101 .. code-block:: console
102
103    :(labeled-unicast-ipv6-routes-case)
104       +--ro labeled-unicast-ipv6-routes
105          +--ro labeled-unicast-route* [route-key path-id]
106             +--ro route-key      string
107             +--ro label-stack*
108             |  +--ro label-value?   netc:mpls-label
109             +--ro prefix?        inet:ip-prefix
110             +--ro path-id        path-id
111             +--ro attributes
112             ...
113
114 Usage
115 ^^^^^
116 The IPv4 Labeled Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
117
118 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes``
119
120 **Method:** ``GET``
121
122 **Response Body:**
123
124 .. code-block:: xml
125
126    <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
127        <labeled-unicast-route>
128            <path-id>0</path-id>
129            <route-key>MAA+gRQAAA==</route-key>
130            <attributes>
131                <local-pref>
132                    <pref>100</pref>
133                </local-pref>
134                <ipv4-next-hop>
135                    <global>200.10.0.101</global>
136                </ipv4-next-hop>
137                <as-path></as-path>
138                <origin>
139                    <value>igp</value>
140                </origin>
141            </attributes>
142            <label-stack>
143                <label-value>1000</label-value>
144            </label-stack>
145            <prefix>20.0.0.0/24</prefix>
146        </labeled-unicast-route>
147    </labeled-unicast-routes>
148
149 Programming
150 ^^^^^^^^^^^
151 IPv4 Labeled
152 ''''''''''''
153 This examples show how to originate and remove IPv4 labeled route via programmable RIB.
154 Make sure the *Application Peer* is configured first.
155
156 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes``
157
158 **Method:** ``POST``
159
160 **Content-Type:** ``application/xml``
161
162 **Request Body:**
163
164 .. code-block:: xml
165
166    <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
167        <route-key>label1</route-key>
168        <prefix>1.1.1.1/32</prefix>
169        <path-id>0</path-id>
170        <label-stack>
171            <label-value>800322</label-value>
172        </label-stack>
173        <attributes>
174            <ipv4-next-hop>
175                <global>199.20.160.41</global>
176            </ipv4-next-hop>
177            <origin>
178                <value>igp</value>
179            </origin>
180            <as-path/>
181            <local-pref>
182                <pref>100</pref>
183            </local-pref>
184        </attributes>
185    </labeled-unicast-route>
186
187 -----
188
189 In addition, BGP-LU Spring extension allows to attach BGP Prefix SID attribute to the route, in order to signal the BGP-Prefix-SID, where the SR is applied to MPLS dataplane.
190
191 .. code-block:: xml
192
193    <bgp-prefix-sid>
194        <bgp-prefix-sid-tlvs>
195            <label-index-tlv xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">322</label-index-tlv>
196        </bgp-prefix-sid-tlvs>
197        <bgp-prefix-sid-tlvs>
198            <srgb-value xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
199                <base>800000</base>
200                <range>4095</range>
201            </srgb-value>
202        </bgp-prefix-sid-tlvs>
203    </bgp-prefix-sid>
204
205 -----
206
207 To remove the route added above, following request can be used:
208
209 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes/bgp-labeled-unicast:labeled-unicast-route/label1/0``
210
211 **Method:** ``DELETE``
212
213 IPv6 Labeled
214 ''''''''''''
215 This examples show how to originate and remove IPv6 labeled route via programmable RIB.
216
217 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-ipv6-routes``
218
219 **Method:** ``POST``
220
221 **Content-Type:** ``application/xml``
222
223 **Request Body:**
224
225 .. code-block:: xml
226
227    <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
228        <route-key>label1</route-key>
229        <prefix>2001:db8:30::3/128</prefix>
230        <path-id>0</path-id>
231        <label-stack>
232            <label-value>123</label-value>
233        </label-stack>
234        <attributes>
235            <ipv6-next-hop>
236                <global>2003:4:5:6::7</global>
237            </ipv6-next-hop>
238            <origin>
239                <value>igp</value>
240            </origin>
241            <as-path/>
242            <local-pref>
243                <pref>100</pref>
244            </local-pref>
245        </attributes>
246    </labeled-unicast-route>
247
248 -----
249
250 To remove the route added above, following request can be used:
251
252 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-ipv6-routes/bgp-labeled-unicast:labeled-unicast-route/label1/0``
253
254 **Method:** ``DELETE``
255
256 References
257 ^^^^^^^^^^
258 * `Carrying Label Information in BGP-4 <https://tools.ietf.org/html/rfc3107>`_
259 * `Segment Routing Prefix SID extensions for BGP <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_
260 * `Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers (6PE) <https://tools.ietf.org/html/rfc4798>`_
261 * `BGP-Prefix Segment in large-scale data centers <https://tools.ietf.org/html/draft-ietf-spring-segment-routing-msdc-01>`_
262 * `Egress Peer Engineering using BGP-LU <https://tools.ietf.org/html/draft-gredler-idr-bgplu-epe-06>`_