Skip to content

BGP LS support

edigheorghiu edited this page Apr 9, 2018 · 24 revisions

Overview

BGP Link State, as defined in RFC 7752, defines a way in which an IGP node can export and transport its link state database using BGP. In the context of MPLS TE this database contains not only topology information but also the extensions required to perform traffic engineering. Making these bits available to a northbound entity (hence the "North-Bound Distribution" in the RFC title) can be useful in areas like LSP optimization, custom path computation, monitoring, etc.

ExaBGP can be used as such northbound entity, receiving and decoding BGP-LS information from a device and then probably feeding this data to a separate process. With the information received you could then perform offline CSPF computations, link monitoring and many more.

If your device supports segment routing, ExaBGP is also able to parse IS-IS segment routing extensions through BGP-LS. This means that you can effectively receive segment identifiers, both node and adjacency ids, through the same BGP-LS session. With label information available your ExaBGP instance is ready to program those infrastructure LSPs for you via BGP-LU session with the PEs!

Configuration

The exact name of the family and JSON fields may change slightly before the next release during the 4.0 development process.

A working ExaBGP configuration could look like the following:

process parsed-route-backend {
	run /home/ruissalo/exabgp/etc/exabgp/processes/file.py;
	encoder json;
}
neighbor 10.30.4.3 {
	local-address 10.30.4.2;
	local-as 65050;
	peer-as 65000;
	family bgpls { 
	           bgp-ls;
	}

	api {
		processes [ parsed-route-backend ];
		receive {
			parsed;
			update;
		}
	}  
}

Json output format

There are basically three types of JSON structures in the current implementation, one for each NRLI type: NODE, LINK and PREFIX. They are uniquely identified by the value in "ls-nlri-type" according to the following table:

                               __________________
                              | ID | NLRI Type   |
                              | ---|-------------|
                              | 1  | Node NLRI   |
                              | 2  | Link NLRI   |
                              | 3  | Prefix NLRI |
                              --------------------

Examples of each of these data types follow below, please note that they do not represent the full set of possible TLVs.

Node JSON:

{  
   "exabgp":"4.0.1",
   "time":1498264977.29,
   "host":"ruissalo",
   "pid":83836,
   "ppid":60690,
   "counter":1,
   "type":"update",
   "neighbor":{  
      "address":{  
         "local":"192.0.2.5",
         "peer":"192.0.2.79"
      },
      "asn":{  
         "local":"65000",
         "peer":"65000"
      },
      "direction":"in",
      "message":{  
         "update":{  
            "attribute":{  
               "origin":"igp",
               "as-path":[  
                  65000
               ],
               "confederation-path":[  

               ],
               "bgp-ls":{  
                  "node-flags":{  
                     "B":0,
                     "E":0,
                     "T":0,
                     "O":0
                  },
                  "area-id":"490002",
                  "local-te-router-id":"192.0.2.88",
                  "sr-capability-flags":{  
                     "I":1,
                     "RSV":0,
                     "V":0
                  },
                  "sids":[  
                     [  
                        501,
                        1000000
                     ]
                  ]
               }
            },
            "announce":{  
               "bgpls bgp-ls":{  
                  "192.0.2.52":[  
                     {  
                        "ls-nlri-type":1,
                        "l3-routing-topology":0,
                        "protocol-id":2,
                        "node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160088"
                        },
                        "nexthop":"192.0.2.52"
                     }
                  ]
               }
            }
         }
      }
   }
}

Link JSON

{  
   "exabgp":"4.0.1",
   "time":1498265291.09,
   "host":"ruissalo",
   "pid":84580,
   "ppid":60690,
   "counter":1,
   "type":"update",
   "neighbor":{  
      "address":{  
         "local":"192.0.2.5",
         "peer":"192.0.2.79"
      },
      "asn":{  
         "local":"65000",
         "peer":"65000"
      },
      "direction":"in",
      "message":{  
         "update":{  
            "attribute":{  
               "origin":"igp",
               "as-path":[  
                  65000
               ],
               "confederation-path":[  

               ],
               "bgp-ls":{  
                  "admin-group-mask":[  
                     0
                  ],
                  "maximum-link-bandwidth":125000000.0,
                  "maximum-reservable-link-bandwidth":125000000.0,
                  "unreserved-bandwidth":[  
                     125000000.0,
                     125000000.0,
                     125000000.0,
                     125000000.0,
                     125000000.0,
                     125000000.0,
                     125000000.0,
                     125000000.0
                  ],
                  "te-metric":10,
                  "igp-metric":10,
                  "sr-adj-flags":{  
                     "B":0,
                     "F":0,
                     "L":1,
                     "P":0,
                     "S":0,
                     "V":1,
                     "RSV":0
                  },
                  "sids":[  
                     299808
                  ],
                  "sr-adj-weight":0
               }
            },
            "announce":{  
               "bgpls bgp-ls":{  
                  "192.0.2.52":[  
                     {  
                        "ls-nlri-type":2,
                        "l3-routing-topology":0,
                        "protocol-id":2,
                        "local-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160002"
                        },
                        "remote-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160001"
                        },
                        "interface-address":{  
                           "interface-address":"192.0.2.25"
                        },
                        "neighbor-address":{  
                           "neighbor-address":"192.0.2.24"
                        }
                     },
                     {  
                        "ls-nlri-type":2,
                        "l3-routing-topology":0,
                        "protocol-id":2,
                        "local-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160001"
                        },
                        "remote-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160002"
                        },
                        "interface-address":{  
                           "interface-address":"192.0.2.24"
                        },
                        "neighbor-address":{  
                           "neighbor-address":"192.0.2.25"
                        }
                     },
                     {  
                        "ls-nlri-type":2,
                        "l3-routing-topology":0,
                        "protocol-id":2,
                        "local-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160033"
                        },
                        "remote-node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"172000160001"
                        },
                        "interface-address":{  
                           "interface-address":"192.0.2.9"
                        },
                        "neighbor-address":{  
                           "neighbor-address":"192.0.2.8"
                        }
                     }
                  ]
               }
            }
         }
      }
   }
}

Prefix JSON

{  
   "exabgp":"4.0.1",
   "time":1498265704.66,
   "host":"ruissalo",
   "pid":84678,
   "ppid":60690,
   "counter":1,
   "type":"update",
   "neighbor":{  
      "address":{  
         "local":"192.0.2.5",
         "peer":"192.0.2.5"
      },
      "asn":{  
         "local":"65000",
         "peer":"65000"
      },
      "direction":"in",
      "message":{  
         "update":{  
            "attribute":{  
               "origin":"igp",
               "local-preference":100,
               "bgp-ls":{  
                  "sr-prefix-flags":{  
                     "E":0,
                     "L":0,
                     "N":1,
                     "P":0,
                     "R":0,
                     "V":0,
                     "RSV":0
                  },
                  "sids":[  
                     200
                  ],
                  "sr-algorithm":0
               }
            },
            "announce":{  
               "bgpls bgp-ls":{  
                  "192.0.2.1":[  
                     {  
                        "ls-nlri-type":3,
                        "l3-routing-topology":0,
                        "protocol-id":2,
                        "node-descriptors":{  
                           "autonomous-system":65000,
                           "router-id":"100000000004"
                        },
                        "ip-reachability-tlv":"192.0.2.100",
                        "nexthop":"192.0.2.1"
                     }
                  ]
               }
            }
         }
      }
   }
}

(Data above doesn't represent any real topology, it was taken from real routers but was anonymized)

Router configuration

  • Juniper

You can check here for details on how to set up a Juniper device to enable the distribution of link state information.

  • Cisco

Config guide for PCEP and BGP-LS can be found here

Submitting bugs

Before submitting any bug report make sure link state data is actually being exported from the TED (Junos) or IS-IS database (Cisco):

  • Junos:
show route table lsdist.0 

lsdist.0: 37 destinations, 37 routes (37 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

NODE { AS:65000 ISO:1720.0000.0202.00 ISIS-L2:0 }/1152              
                   *[IS-IS/18] 00:27:31
                      Fictitious  
LINK { Local { AS:65000 ISO:1720.0016.0088.00 }.{ IPv4:172.24.248.79 } Remote { AS:65000 ISO:1720.0016.0011.00 }.{ IPv4:172.24.248.52 } ISIS-L2:0 }/1152              
                   *[IS-IS/18] 00:28:29
                      Fictitious
PREFIX { Node { AS:65000 ISO:1720.0016.0001.00 } { IPv4:172.16.0.1/32 } ISIS-L2:0 }/1152              
                   *[IS-IS/18] 00:27:26
                      Fictitious
PREFIX { Node { AS:65000 ISO:1720.0016.0002.00 } { IPv4:172.16.0.2/32 } ISIS-L2:0 }/1152     

And that it is also being advertised to the ExaBGP neighbor:

show route advertising-protocol bgp 10.30.4.3 | match "NODE|LINK|PREFIX"

  • Cisco
RP/0/RP0/CPU0:ios#show bgp link-state link-state

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Prefix codes: E link, V node, T IP reacheable route, u/U unknown
              I Identifier, N local node, R remote node, L link, P prefix
              L1/L2 ISIS level-1/level-2, O OSPF, D direct, S static/peer-node
              a area-ID, l link-ID, t topology-ID, s ISO-ID,
              c confed-ID/ASN, b bgp-identifier, r router-ID,
              i if-address, n nbr-address, o OSPF Route-type, p IP-prefix
              d designated router address
   Network            Next Hop            Metric LocPrf Weight Path
*> [V][L2][I0x0][N[c1.119][b172.24.248.230][s1720.0000.0202.00]]/328
                      0.0.0.0                                0 i
*> [V][L2][I0x0][N[c1.119][b172.24.248.230][s1720.0016.0001.00]]/328
                      0.0.0.0                                0 i
*> [V][L2][I0x0][N[c1.119][b172.24.248.230][s1720.0016.0002.00]]/328
                      0.0.0.0                                0 i
*> [V][L2][I0x0][N[c1.119][b172.24.248.230][s1720.0016.0011.00]]/328
                      0.0.0.0                                0 i
*> [V][L2][I0x0][N[c1.119][b172.24.248.230][s1720.0016.0013.00]]/328
                      0.0.0.0                                0 i

(...)

If you still think the problem is a bug, please open an issue and include the console output using the -d flag:

exabgp -d config.ini

InterOp Report

   +--------+---------+--------+
   |        | IOS-XR* | JUNOS* |
   +--------+---------+--------+
   | Rcv.N1 |  YES    |  YES   |
   | Org.N1 |  NO     |   NO   |
   | Rcv.N2 |  YES    |  YES   |
   | Org.N2 |  NO     |   NO   |
   | Rcv.N3 |  YES    |  YES   |
   | Org.N3 |  NO     |   NO   | 
   | Rcv.N4 |  NO     |   NO   |
   | Org.N4 |  NO     |   NO   |
   +--------+---------+--------+
  • N1: Node NLRI
  • N2: Link NLRI
  • N3: IPv4 Topology Prefix NLRI
  • N4: IPv6 Topology Prefix NLRI
  • Rcv: Receive and decode capability
  • Org: Encode and Originate Capability

ExaBGP should work with any other BGP-LS implementation, in particular the following systems:

  • IOS-XR 6.1.1 (There is a bug in the TLV 1158 implementation on this version where V and L are not set correctly)
  • Junos 15.1F6.9 (This version doesn't originate N3/N4 NLRIs)
  • Junos 17.2R1.13 (First version that supports Prefix NLRI)

Implementation status

ExaBGP is able to receive and decode the following TLV types:

  • LINK NLRI
   TLV 256:  Local Node Descriptor

   TLV 257:  Remote Node Descriptor

   TLV 258:  Link Local/Remote Identifier

   TLV 259:  IPv4 Interface address

   TLV 260:  IPv4 Neighbor address

   TLV 263:  Multi-Topology IDs

   TLV 512:  Autonomous System

   TLV 513:  BGP-LS Identifier

   TLV 514:  Area ID

   TLV 515:  IGP Router ID

   TLV 1028:  IPv4 router-ID of Local Node

   TLV 1030:  IPv4 router-ID of Remote Node

   TLV 1088:  Administrative group (color)

   TLV 1089:  Maximum link bandwidth

   TLV 1090:  Maximum reservable link bandwidth

   TLV 1091:  Unreserved link bandwidth

   TLV 1092:  TE default Metric

   TLV 1093:  Link Protection Type

   TLV 1094:  MPLS Protocol Mask

   TLV 1095:  IGP Metric

   TLV 1096:  Shared Risk Link Group

   TLV 1098:  Link name attribute
  • NODE NLRI
   TLV 256:  Local Node Descriptor

   TLV 263:  Multi-Topology IDs

   TLV 512:  Autonomous System

   TLV 513:  BGP-LS Identifier

   TLV 514:  Area ID

   TLV 515:  IGP Router ID

   TLV 1024:  Node flag bits

   TLV 1026:  Node name

   TLV 1027:  IS-IS Area Identifier

   TLV 1028:  IPv4 router-ID of Local Node
  • PREFIX NLRI:
   TLV 263:  Multi-Topology IDs

   TLV 264:  OSPF route type

   TLV 265:  IP Reachability information

   TLV 1152:  IGP Flags

   TLV 1153:  Route Tag

   TLV 1154:  Extended Tag

   TLV 1155:  Prefix Metric

   TLV 1156:  OSPF Forwarding Address

Segment routing IS-IS extensions https://datatracker.ietf.org/doc/draft-gredler-idr-bgp-ls-segment-routing-ext/03/

  • NODE NLRI:
   TLV 1034:  SR Capabilities
   TLV 1035:  SR Algorithm 
  • LINK NLRI:
   TLV 1099:  Adjacency Segment Identifier (Adj-SID) TLV
   TLV 1100: LAN Adjacency Segment Identifier (Adj-SID) TLV

  • PREFIX NLRI:
    TLV 1158:     Prefix SID
    TLV 1170:     IGP Prefix Attributes
    TLV 1171:     Source Router-ID
    TLV 1161:     SID/Label TLV

Development roadmap

  • Encoding and sending capabilities for all NLRIs.

  • Decoding for the following TLVs:

    NODE NLRI:


    TLV 1029:  IPv6 router-ID of Local Node

    TLV 1025:  Opaque Node properties

LINK NLRI:

    TLV 1029:  IPv6 router-ID of Local Node

    TLV 1031:  IPv6 router-ID of Remote Node

    TLV 261:  IPv6 Interface address

    TLV 262:  IPv6 Neighbor address

PREFIX NLRI:

    TLV 1157:  Opaque Prefix Attribute