Add json examples for bgp-user-guide-pmsi-attribute.rst
[bgpcep.git] / docs / bgp / bgp-user-guide-evpn-family.rst
1 .. _bgp-user-guide-evpn-family:
2
3 EVPN Family
4 ===========
5 The BGP MPLS-Based Ethernet VPN (BGP EVPN) Multiprotocol extension can be used to distribute Ethernet L2VPN service related routes in order to support a concept of MAC routing.
6 A major use-case for BGP EVPN is data-center interconnection (DCI), where advantage of BGP EVPN are MAC/IP address advertising across MPLS network, Multihoming functionality including Fast Convergence, Split Horizon and Aliasing support, VM (MAC) Mobility, support Multicast and Broadcast traffic.
7 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
8 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
9
10 .. contents:: Contents
11    :depth: 2
12    :local:
13
14 Configuration
15 ^^^^^^^^^^^^^
16 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
17
18 BGP Speaker
19 '''''''''''
20 To enable EVPN 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 **RFC8040 URL:** ``/rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/protocols``
25
26 **Method:** ``POST``
27
28 .. tabs::
29
30    .. tab:: XML
31
32       **Content-Type:** ``application/xml``
33
34       **Request Body:**
35
36       .. code-block:: xml
37
38          <protocol xmlns="http://openconfig.net/yang/network-instance">
39              <name>bgp-example</name>
40              <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
41              <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
42                  <global>
43                      <config>
44                          <router-id>192.0.2.2</router-id>
45                          <as>65000</as>
46                      </config>
47                      <afi-safis>
48                          <afi-safi>
49                              <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
50                          </afi-safi>
51                      </afi-safis>
52                  </global>
53              </bgp>
54          </protocol>
55
56    .. tab:: JSON
57
58       **Content-Type:** ``application/json``
59
60       **Request Body:**
61
62       .. code-block:: json
63
64          {
65              "protocol": [
66                  {
67                      "identifier": "openconfig-policy-types:BGP",
68                      "name": "bgp-example",
69                      "bgp-openconfig-extensions:bgp": {
70                          "global": {
71                              "config": {
72                                  "router-id": "192.0.2.2",
73                                  "as": 65000
74                              },
75                              "afi-safis": {
76                                  "afi-safi": [
77                                      {
78                                          "afi-safi-name": "openconfig-bgp-types:L2VPN-EVPN"
79                                      }
80                                  ]
81                              }
82                          }
83                      }
84                  }
85              ]
86          }
87
88 BGP Peer
89 ''''''''
90 Here is an example for BGP peer configuration with enabled EVPN family.
91
92 **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``
93
94 **Method:** ``POST``
95
96 .. tabs::
97
98    .. tab:: XML
99
100       **Content-Type:** ``application/xml``
101
102       **Request Body:**
103
104       .. code-block:: xml
105
106          <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
107              <neighbor-address>192.0.2.1</neighbor-address>
108              <afi-safis>
109                  <afi-safi>
110                      <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
111                  </afi-safi>
112              </afi-safis>
113          </neighbor>
114
115    .. tab:: JSON
116
117       **Content-Type:** ``application/json``
118
119       **Request Body:**
120
121       .. code-block:: json
122
123          {
124              "neighbor": [
125                  {
126                      "neighbor-address": "192.0.2.1",
127                      "afi-safis": {
128                          "afi-safi": [
129                              {
130                                  "afi-safi-name": "openconfig-bgp-types:L2VPN-EVPN"
131                              }
132                          ]
133                      }
134                  }
135              ]
136          }
137
138 EVPN Route API
139 ^^^^^^^^^^^^^^
140 Following tree illustrate the BGP EVPN route structure.
141
142 .. code-block:: console
143
144    :(evpn-routes-case)
145       +--ro evpn-routes
146          +--ro evpn-route* [route-key path-id]
147             +--ro route-key                     string
148             +--ro path-id                       path-id
149             +--ro (evpn-choice)
150             |  +--:(ethernet-a-d-route-case)
151             |  |  +--ro ethernet-a-d-route
152             |  |     +--ro (esi)
153             |  |     |  +--:(arbitrary-case)
154             |  |     |  |  +--ro arbitrary
155             |  |     |  |     +--ro arbitrary    binary
156             |  |     |  +--:(lacp-auto-generated-case)
157             |  |     |  |  +--ro lacp-auto-generated
158             |  |     |  |     +--ro ce-lacp-mac-address    yang:mac-address
159             |  |     |  |     +--ro ce-lacp-port-key       uint16
160             |  |     |  +--:(lan-auto-generated-case)
161             |  |     |  |  +--ro lan-auto-generated
162             |  |     |  |     +--ro root-bridge-mac-address    yang:mac-address
163             |  |     |  |     +--ro root-bridge-priority       uint16
164             |  |     |  +--:(mac-auto-generated-case)
165             |  |     |  |  +--ro mac-auto-generated
166             |  |     |  |     +--ro system-mac-address     yang:mac-address
167             |  |     |  |     +--ro local-discriminator    uint24
168             |  |     |  +--:(router-id-generated-case)
169             |  |     |  |  +--ro router-id-generated
170             |  |     |  |     +--ro router-id              inet:ipv4-address
171             |  |     |  |     +--ro local-discriminator    uint32
172             |  |     |  +--:(as-generated-case)
173             |  |     |     +--ro as-generated
174             |  |     |        +--ro as                     inet:as-number
175             |  |     |        +--ro local-discriminator    uint32
176             |  |     +--ro ethernet-tag-id
177             |  |     |  +--ro vlan-id    uint32
178             |  |     +--ro mpls-label             netc:mpls-label
179             |  +--:(mac-ip-adv-route-case)
180             |  |  +--ro mac-ip-adv-route
181             |  |     +--ro (esi)
182             |  |     |  +--:(arbitrary-case)
183             |  |     |  |  +--ro arbitrary
184             |  |     |  |     +--ro arbitrary    binary
185             |  |     |  +--:(lacp-auto-generated-case)
186             |  |     |  |  +--ro lacp-auto-generated
187             |  |     |  |     +--ro ce-lacp-mac-address    yang:mac-address
188             |  |     |  |     +--ro ce-lacp-port-key       uint16
189             |  |     |  +--:(lan-auto-generated-case)
190             |  |     |  |  +--ro lan-auto-generated
191             |  |     |  |     +--ro root-bridge-mac-address    yang:mac-address
192             |  |     |  |     +--ro root-bridge-priority       uint16
193             |  |     |  +--:(mac-auto-generated-case)
194             |  |     |  |  +--ro mac-auto-generated
195             |  |     |  |     +--ro system-mac-address     yang:mac-address
196             |  |     |  |     +--ro local-discriminator    uint24
197             |  |     |  +--:(router-id-generated-case)
198             |  |     |  |  +--ro router-id-generated
199             |  |     |  |     +--ro router-id              inet:ipv4-address
200             |  |     |  |     +--ro local-discriminator    uint32
201             |  |     |  +--:(as-generated-case)
202             |  |     |     +--ro as-generated
203             |  |     |        +--ro as                     inet:as-number
204             |  |     |        +--ro local-discriminator    uint32
205             |  |     +--ro ethernet-tag-id
206             |  |     |  +--ro vlan-id    uint32
207             |  |     +--ro mac-address            yang:mac-address
208             |  |     +--ro ip-address?            inet:ip-address
209             |  |     +--ro mpls-label1            netc:mpls-label
210             |  |     +--ro mpls-label2?           netc:mpls-label
211             |  +--:(inc-multi-ethernet-tag-res-case)
212             |  |  +--ro inc-multi-ethernet-tag-res
213             |  |     +--ro ethernet-tag-id
214             |  |     |  +--ro vlan-id    uint32
215             |  |     +--ro orig-route-ip?     inet:ip-address
216             |  +--:(es-route-case)
217             |     +--ro es-route
218             |        +--ro (esi)
219             |        |  +--:(arbitrary-case)
220             |        |  |  +--ro arbitrary
221             |        |  |     +--ro arbitrary    binary
222             |        |  +--:(lacp-auto-generated-case)
223             |        |  |  +--ro lacp-auto-generated
224             |        |  |     +--ro ce-lacp-mac-address    yang:mac-address
225             |        |  |     +--ro ce-lacp-port-key       uint16
226             |        |  +--:(lan-auto-generated-case)
227             |        |  |  +--ro lan-auto-generated
228             |        |  |     +--ro root-bridge-mac-address    yang:mac-address
229             |        |  |     +--ro root-bridge-priority       uint16
230             |        |  +--:(mac-auto-generated-case)
231             |        |  |  +--ro mac-auto-generated
232             |        |  |     +--ro system-mac-address     yang:mac-address
233             |        |  |     +--ro local-discriminator    uint24
234             |        |  +--:(router-id-generated-case)
235             |        |  |  +--ro router-id-generated
236             |        |  |     +--ro router-id              inet:ipv4-address
237             |        |  |     +--ro local-discriminator    uint32
238             |        |  +--:(as-generated-case)
239             |        |     +--ro as-generated
240             |        |        +--ro as                     inet:as-number
241             |        |        +--ro local-discriminator    uint32
242             |        +--ro orig-route-ip          inet:ip-address
243             +--ro route-distinguisher           bgp-t:route-distinguisher
244             +--ro attributes
245                +--ro extended-communities*
246                |  +--ro transitive?                              boolean
247                |  +--ro (extended-community)?
248                |     +--:(encapsulation-case)
249                |     |  +--ro encapsulation-extended-community
250                |     |     +--ro tunnel-type    encapsulation-tunnel-type
251                |     +--:(esi-label-extended-community-case)
252                |     |  +--ro esi-label-extended-community
253                |     |     +--ro single-active-mode?   boolean
254                |     |     +--ro esi-label             netc:mpls-label
255                |     +--:(es-import-route-extended-community-case)
256                |     |  +--ro es-import-route-extended-community
257                |     |     +--ro es-import    yang:mac-address
258                |     +--:(mac-mobility-extended-community-case)
259                |     |  +--ro mac-mobility-extended-community
260                |     |     +--ro static?       boolean
261                |     |     +--ro seq-number    uint32
262                |     +--:(default-gateway-extended-community-case)
263                |     |  +--ro default-gateway-extended-community!
264                |     +--:(layer-2-attributes-extended-community-case)
265                |        +--ro layer-2-attributes-extended-community
266                |           +--ro primary-pe?     boolean
267                |           +--ro backup-pe?      boolean
268                |           +--ro control-word?   boolean
269                |           +--ro l2-mtu          uint16
270                +--ro pmsi-tunnel!
271                   +--ro leaf-information-required    boolean
272                   +--ro mpls-label?                  netc:mpls-label
273                   +--ro (tunnel-identifier)?
274                      +--:(rsvp-te-p2mp-lsp)
275                      |  +--ro rsvp-te-p2mp-lps
276                      |     +--ro p2mp-id               uint32
277                      |     +--ro tunnel-id             uint16
278                      |     +--ro extended-tunnel-id    inet:ip-address
279                      +--:(mldp-p2mp-lsp)
280                      |  +--ro mldp-p2mp-lsp
281                      |     +--ro address-family       identityref
282                      |     +--ro root-node-address    inet:ip-address
283                      |     +--ro opaque-value*
284                      |        +--ro opaque-type             uint8
285                      |        +--ro opaque-extended-type?   uint16
286                      |        +--ro opaque                  yang:hex-string
287                      +--:(pim-ssm-tree)
288                      |  +--ro pim-ssm-tree
289                      |     +--ro p-address            inet:ip-address
290                      |     +--ro p-multicast-group    inet:ip-address
291                      +--:(pim-sm-tree)
292                      |  +--ro pim-sm-tree
293                      |     +--ro p-address            inet:ip-address
294                      |     +--ro p-multicast-group    inet:ip-address
295                      +--:(bidir-pim-tree)
296                      |  +--ro bidir-pim-tree
297                      |     +--ro p-address            inet:ip-address
298                      |     +--ro p-multicast-group    inet:ip-address
299                      +--:(ingress-replication)
300                      |  +--ro ingress-replication
301                      |     +--ro receiving-endpoint-address?   inet:ip-address
302                      +--:(mldp-mp2mp-lsp)
303                         +--ro mldp-mp2mp-lsp
304                            +--ro opaque-type             uint8
305                            +--ro opaque-extended-type?   uint16
306                            +--ro opaque
307                      ...
308
309 Usage
310 ^^^^^
311 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
312
313 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/evpn-routes``
314
315 **Method:** ``GET``
316
317 .. tabs::
318
319    .. tab:: XML
320
321       **Response Body:**
322
323       .. code-block:: xml
324
325          <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
326             <evpn-route>
327                <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
328                <path-id>0</path-id>
329                <route-distinguisher>192.168.100.1:1000</route-distinguisher>
330                <inc-multi-ethernet-tag-res>
331                   <ethernet-tag-id>
332                      <vlan-id>256</vlan-id>
333                   </ethernet-tag-id>
334                   <orig-route-ip>192.168.100.1</orig-route-ip>
335                </inc-multi-ethernet-tag-res>
336                <attributes>
337                   <ipv4-next-hop>
338                      <global>172.23.29.104</global>
339                   </ipv4-next-hop>
340                   <as-path/>
341                   <origin>
342                      <value>igp</value>
343                   </origin>
344                   <extended-communities>
345                      <extended-communities>
346                         <transitive>true</transitive>
347                         <route-target-extended-community>
348                            <global-administrator>65504</global-administrator>
349                            <local-administrator>AAAD6A==</local-administrator>
350                         </route-target-extended-community>
351                      </extended-communities>
352                   </extended-communities>
353                   <pmsi-tunnel>
354                      <leaf-information-required>true</leaf-information-required>
355                      <mpls-label>20024</mpls-label>
356                      <ingress-replication>
357                         <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
358                      </ingress-replication>
359                   </pmsi-tunnel>
360                </attributes>
361             </evpn-route>
362          </evpn-routes>
363
364    .. tab:: JSON
365
366       **Response Body:**
367
368       .. code-block:: json
369
370          {
371              "bgp-evpn:evpn-routes": {
372                  "evpn-route": {
373                      "route-key": "AxEAAcCoZAED6AAAAQAgwKhkAQ==",
374                      "path-id": 0,
375                      "route-distinguisher": "192.168.100.1:1000",
376                      "inc-multi-ethernet-tag-res": {
377                          "ethernet-tag-id": {
378                          "vlan-id": 256
379                          },
380                          "orig-route-ip": "192.168.100.1"
381                      },
382                      "attributes": {
383                          "ipv4-next-hop": {
384                              "global": "172.23.29.104"
385                          },
386                          "origin": {
387                              "value": "igp"
388                          },
389                          "extended-communities": {
390                              "extended-communities": {
391                                  "transitive": true,
392                                  "route-target-extended-community": {
393                                      "global-administrator": 65504,
394                                      "local-administrator": "AAAD6A=="
395                                  }
396                              }
397                          },
398                          "pmsi-tunnel": {
399                              "leaf-information-required": true,
400                              "mpls-label": 20024,
401                              "ingress-replication": {
402                                  "receiving-endpoint-address": "192.168.100.1"
403                              }
404                          }
405                      }
406                  }
407              }
408          }
409
410 Programming
411 ^^^^^^^^^^^
412 This examples show how to originate and remove EVPN routes via programmable RIB.
413 There are four different types of EVPN routes, and several extended communities.
414 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
415 Make sure the *Application Peer* is configured first.
416
417 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes``
418
419 **Method:** ``POST``
420
421 .. tabs::
422
423    .. tab:: XML
424
425       **Content-Type:** ``application/xml``
426
427       **Request Body:**
428
429       .. code-block:: xml
430          :linenos:
431          :emphasize-lines: 4,5,15
432
433          <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
434              <route-key>evpn</route-key>
435              <path-id>0</path-id>
436              <route-distinguisher>172.12.123.3:200</route-distinguisher>
437              ....
438              <attributes>
439                  <ipv4-next-hop>
440                      <global>199.20.166.41</global>
441                  </ipv4-next-hop>
442                  <as-path/>
443                  <origin>
444                      <value>igp</value>
445                  </origin>
446                  <extended-communities>
447                  ....
448                  </extended-communities>
449              </attributes>
450          </evpn-route>
451
452       @line 4: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
453
454       @line 5: One of the EVPN route must be set here.
455
456       @line 15: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
457
458    .. tab:: JSON
459
460       **Content-Type:** ``application/json``
461
462       **Request Body:**
463
464       .. code-block:: json
465          :linenos:
466          :emphasize-lines: 5,14
467
468          {
469              "bgp-evpn:evpn-route": {
470                  "route-key": "evpn",
471                  "path-id": 0,
472                  "route-distinguisher": "172.12.123.3:200",
473                  "attributes": {
474                      "ipv4-next-hop": {
475                          "global": "199.20.166.41"
476                      },
477                      "origin": {
478                          "value": "igp"
479                      },
480                      "extended-communities": [
481                          "..."
482                      ]
483                  }
484              }
485          }
486
487       @line 4: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
488
489       @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
490
491 -----
492
493 EVPN Routes
494 ^^^^^^^^^^^
495
496 * **Ethernet AD per ESI**
497
498 .. tabs::
499
500    .. tab:: XML
501
502       .. code-block:: xml
503
504          <ethernet-a-d-route>
505              <mpls-label>0</mpls-label>
506              <ethernet-tag-id>
507                  <vlan-id>4294967295</vlan-id>
508              </ethernet-tag-id>
509              <arbitrary>
510                  <arbitrary>AAAAAAAAAAAA</arbitrary>
511              </arbitrary>
512          </ethernet-a-d-route>
513
514    .. tab:: JSON
515
516       .. code-block:: json
517
518          {
519              "ethernet-a-d-route" : {
520                  "mpls-label": 0,
521                  "ethernet-tag-id": {
522                      "vlan-id": "4294967295"
523                  },
524                  "arbitrary": {
525                      "arbitrary": "AAAAAAAAAAAA"
526                  }
527              }
528          }
529
530 * **Ethernet AD per EVI**
531
532 .. tabs::
533
534    .. tab:: XML
535
536       .. code-block:: xml
537
538          <ethernet-a-d-route>
539              <mpls-label>24001</mpls-label>
540              <ethernet-tag-id>
541                  <vlan-id>2200</vlan-id>
542              </ethernet-tag-id>
543              <arbitrary>
544                  <arbitrary>AAAAAAAAAAAA</arbitrary>
545              </arbitrary>
546          </ethernet-a-d-route>
547
548    .. tab:: JSON
549
550       .. code-block:: json
551
552          {
553              "ethernet-a-d-route" : {
554                  "mpls-label": 24001,
555                  "ethernet-tag-id": {
556                      "vlan-id": "2200"
557                  },
558                  "arbitrary": {
559                      "arbitrary": "AAAAAAAAAAAA"
560                  }
561              }
562          }
563
564 * **MAC/IP Advertisement**
565
566 .. tabs::
567
568    .. tab:: XML
569
570       .. code-block:: xml
571
572          <mac-ip-adv-route>
573              <arbitrary>
574                  <arbitrary>AAAAAAAAAAAA</arbitrary>
575              </arbitrary>
576              <ethernet-tag-id>
577                  <vlan-id>2100</vlan-id>
578              </ethernet-tag-id>
579              <mac-address>f2:0c:dd:80:9f:f7</mac-address>
580              <ip-address>10.0.1.12</ip-address>
581              <mpls-label1>299776</mpls-label1>
582          </mac-ip-adv-route>
583
584    .. tab:: JSON
585
586       .. code-block:: json
587
588          {
589              "mac-ip-adv-route" : {
590                  "arbitrary": {
591                      "arbitrary": "AAAAAAAAAAAA"
592                  },
593                  "ethernet-tag-id": {
594                      "vlan-id": "2100"
595                  },
596                  "mac-address": "f2:0c:dd:80:9f:f7",
597                  "ip-address": "10.0.1.12",
598                  "mpls-label1": 299776
599              }
600          }
601
602 * **Inclusive Multicast Ethernet Tag**
603
604 .. tabs::
605
606    .. tab:: XML
607
608       .. code-block:: xml
609
610          <inc-multi-ethernet-tag-res>
611              <ethernet-tag-id>
612                  <vlan-id>2100</vlan-id>
613              </ethernet-tag-id>
614              <orig-route-ip>43.43.43.43</orig-route-ip>
615          </inc-multi-ethernet-tag-res>
616
617    .. tab:: JSON
618
619       .. code-block:: json
620
621          {
622              "inc-multi-ethernet-tag-res" : {
623                  "ethernet-tag-id": {
624                      "vlan-id": "2100"
625                  },
626                  "orig-route-ip": "43.43.43.43"
627              }
628          }
629
630 * **Ethernet Segment**
631
632 .. tabs::
633
634    .. tab:: XML
635
636       .. code-block:: xml
637
638          <es-route>
639              <orig-route-ip>43.43.43.43</orig-route-ip>
640              <arbitrary>
641                  <arbitrary>AAAAAAAAAAAA</arbitrary>
642              </arbitrary>
643          </es-route>
644
645    .. tab:: JSON
646
647       .. code-block:: json
648
649          {
650              "es-route" : {
651                  "orig-route-ip": "43.43.43.43",
652                  "arbitrary": {
653                      "arbitrary": "AAAAAAAAAAAA"
654                  }
655              }
656          }
657
658 **EVPN Ethernet Segment Identifier (ESI):**
659
660 * **Type 0**
661    Indicates an arbitrary 9-octet ESI.
662
663 .. tabs::
664
665    .. tab:: XML
666
667       .. code-block:: xml
668
669          <arbitrary>
670              <arbitrary>AAAAAAAAAAAA</arbitrary>
671          </arbitrary>
672
673    .. tab:: JSON
674
675       .. code-block:: json
676
677          {
678              "arbitrary" : {
679                  "arbitrary": "AAAAAAAAAAAA"
680              }
681          }
682
683 * **Type 1**
684    IEEE 802.1AX LACP is used.
685
686 .. tabs::
687
688    .. tab:: XML
689
690       .. code-block:: xml
691
692          <lacp-auto-generated>
693              <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
694              <ce-lacp-port-key>22</ce-lacp-port-key>
695          </lacp-auto-generated>
696
697    .. tab:: JSON
698
699       .. code-block:: json
700
701          {
702              "lacp-auto-generated" : {
703                  "ce-lacp-mac-address": "f2:0c:dd:80:9f:f7",
704                  "ce-lacp-port-key": 22
705              }
706          }
707
708 * **Type 2**
709    Indirectly connected hosts via a bridged LAN.
710
711 .. tabs::
712
713    .. tab:: XML
714
715       .. code-block:: xml
716
717          <lan-auto-generated>
718              <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
719              <root-bridge-priority>20</root-bridge-priority>
720          </lan-auto-generated>
721
722    .. tab:: JSON
723
724       .. code-block:: json
725
726          {
727              "lan-auto-generated" : {
728                  "root-bridge-mac-address": "f2:0c:dd:80:9f:f7",
729                  "root-bridge-priority": 20
730              }
731          }
732
733 * **Type 3**
734    MAC-based ESI.
735
736 .. tabs::
737
738    .. tab:: XML
739
740       .. code-block:: xml
741
742          <mac-auto-generated>
743              <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
744              <local-discriminator>2000</local-discriminator>
745          </mac-auto-generated>
746
747    .. tab:: JSON
748
749       .. code-block:: json
750
751          {
752              "mac-auto-generated" : {
753                  "system-mac-address": "f2:0c:dd:80:9f:f7",
754                  "local-discriminator": 2000
755              }
756          }
757
758 * **Type 4**
759    Router-ID ESI
760
761 .. tabs::
762
763    .. tab:: XML
764
765       .. code-block:: xml
766
767          <router-id-generated>
768              <router-id>43.43.43.43</router-id>
769              <local-discriminator>2000</local-discriminator>
770          </router-id-generated>
771
772    .. tab:: JSON
773
774       .. code-block:: json
775
776          {
777              "router-id-generated" : {
778                  "router-id": "43.43.43.43",
779                  "local-discriminator": 2000
780              }
781          }
782
783 * **Type 5**
784    AS-based ESI
785
786 .. tabs::
787
788    .. tab:: XML
789
790       .. code-block:: xml
791
792          <as-generated>
793              <as>16843009</as>
794              <local-discriminator>2000</local-discriminator>
795          </as-generated>
796
797    .. tab:: JSON
798
799       .. code-block:: json
800
801          {
802              "as-generated" : {
803                  "as": 16843009,
804                  "local-discriminator": 2000
805              }
806          }
807
808 **Attributes:**
809
810 .. include:: bgp-user-guide-pmsi-attribute.rst
811
812 **Extended Communities:**
813
814 * **ESI Label Extended Community**
815
816 .. tabs::
817
818    .. tab:: XML
819
820       .. code-block:: xml
821
822          <extended-communities>
823              <transitive>true</transitive>
824              <esi-label-extended-community>
825                  <single-active-mode>false</single-active-mode>
826                  <esi-label>24001</esi-label>
827              </esi-label-extended-community>
828          </extended-communities>
829
830    .. tab:: JSON
831
832       .. code-block:: json
833
834          {
835              "extended-communities" : {
836                  "transitive": true,
837                  "esi-label-extended-community": {
838                      "single-active-mode": false,
839                      "esi-label": 24001
840                  }
841              }
842          }
843
844 * **ES-Import Route Target**
845
846 .. tabs::
847
848    .. tab:: XML
849
850       .. code-block:: xml
851
852          <extended-communities>
853              <transitive>true</transitive>
854              <es-import-route-extended-community>
855                  <es-import>f2:0c:dd:80:9f:f7</es-import>
856              </es-import-route-extended-community>
857          </extended-communities>
858
859    .. tab:: JSON
860
861       .. code-block:: json
862
863          {
864              "extended-communities" : {
865                  "transitive": "true",
866                  "es-import-route-extended-community": {
867                      "es-import": "f2:0c:dd:80:9f:f7"
868                  }
869              }
870          }
871
872 * **MAC Mobility Extended Community**
873
874 .. tabs::
875
876    .. tab:: XML
877
878       .. code-block:: xml
879
880          <extended-communities>
881              <transitive>true</transitive>
882              <mac-mobility-extended-community>
883                  <static>true</static>
884                  <seq-number>200</seq-number>
885              </mac-mobility-extended-community>
886          </extended-communities>
887
888    .. tab:: JSON
889
890       .. code-block:: json
891
892          {
893              "extended-communities" : {
894                  "transitive": true,
895                  "mac-mobility-extended-community": {
896                      "static": true,
897                      "seq-number": 200
898                  }
899              }
900          }
901
902 * **Default Gateway Extended Community**
903
904 .. tabs::
905
906    .. tab:: XML
907
908       .. code-block:: xml
909
910          <extended-communities>
911              <transitive>true</transitive>
912              <default-gateway-extended-community>
913              </default-gateway-extended-community>
914          </extended-communities>
915
916    .. tab:: JSON
917
918       .. code-block:: json
919
920          {
921              "extended-communities" : {
922                  "transitive": "true",
923                  "default-gateway-extended-community": []
924              }
925          }
926
927 * **EVPN Layer 2 attributes extended community**
928
929 .. tabs::
930
931    .. tab:: XML
932
933       .. code-block:: xml
934
935          <extended-communities>
936              <transitive>false</transitive>
937              <layer-2-attributes-extended-community>
938                  <primary-pe>true</primary-pe>
939                  <backup-pe>true</backup-pe>
940                  <control-word >true</control-word>
941                  <l2-mtu>200</l2-mtu>
942              </layer-2-attributes-extended-community>
943          </extended-communities>
944
945    .. tab:: JSON
946
947       .. code-block:: json
948
949          {
950              "extended-communities" : {
951                  "transitive": false,
952                  "layer-2-attributes-extended-community": {
953                      "primary-pe": true,
954                      "backup-pe": true,
955                      "control-word": true,
956                      "l2-mtu": 200
957                  }
958              }
959          }
960
961 * **BGP Encapsulation extended community**
962
963 .. tabs::
964
965    .. tab:: XML
966
967       .. code-block:: xml
968          :linenos:
969          :emphasize-lines: 4
970
971          <extended-communities>
972              <transitive>false</transitive>
973              <encapsulation-extended-community>
974                  <tunnel-type>vxlan</tunnel-type>
975              </encapsulation-extended-community>
976          </extended-communities>
977
978       @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
979
980    .. tab:: JSON
981
982       .. code-block:: json
983          :linenos:
984          :emphasize-lines: 5
985
986          {
987              "extended-communities" : {
988                  "transitive": "false",
989                  "encapsulation-extended-community": {
990                      "tunnel-type": "vxlan"
991                  }
992              }
993          }
994
995       @line 5: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
996
997 -----
998
999 To remove the route added above, following request can be used:
1000
1001 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes/evpn-route/evpn/0``
1002
1003 **Method:** ``DELETE``
1004
1005 -----
1006
1007 .. table:: EVPN Routes Usage.
1008
1009    +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
1010    | EVN Route Type                       | Extended Communities                                | Usage                                     |
1011    +======================================+=====================================================+===========================================+
1012    | **Ethernet Auto-discovery**          | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
1013    +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
1014    | **MAC/IP Advertisement**             | BGP Encapsulation, MAC Mobility, Default Gateway    | MAC address reachability                  |
1015    +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
1016    | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation                      | Handling of Multi-destination traffic     |
1017    +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
1018    | **Ethernet Segment**                 | BGP Encapsulation, ES-Import Route Target           | Designated Forwarder Election             |
1019    +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
1020
1021 References
1022 ^^^^^^^^^^
1023 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
1024 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
1025 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
1026 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
1027 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
1028 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_