2BGP Border Gateway Protocol Routing between Autonomous Systems (ASes) Currently version 4RFC 4271TCP port 179Routing between Autonomous Systems (ASes)Decentralised routingAllows an AS to advertise that it existsEach AS advertises routes it has, leaves decision about whether to use them or not to peerOriginally supported IPv4; these days multi-protocol
3Autonomous System set of routers under same administrative control owned/operated by same entityidentified by a unique numberautonomous system number (ASN)historically a 16-bit valuepublic range:private range:
6BGP Path-Vector protocol Routing information includes the AS path a route has traversedA router prepends its AS number to any route it receives before advertising itA router discards any AS path that includes its ASN in itWhy?
7Autonomous Systems AS3 AS4 AS1 AS2 192.168.0.0/24 AS5 AS6
8BGP message types OPEN KEEPALIVE UPDATE NOTIFICATION Establish BGP session with peer; negotiate hold time, advise ASN.KEEPALIVEPeriodic message sent so a router knows a peer is still up in absence of updatesUPDATERoutes added or withdrawnNOTIFICATIONError condition encountered
9BGP Message Format marker length type Marker: all ones in most cases; can be used for MD5 authentication.Length: bytesType: one of four values (open, update, notification, keepalive)
10UPDATE MessageAn exterior gateway protocol calls for incremental changes to routing table.reduce volume of traffic to synchronise routing through the networkAn UPDATE message adviseswhen new routes are availableNetwork Layer Reachability Information (NLRI)when a route is withdrawn
11IP address prefix| Length (1 octet) || Prefix (variable) |IPv4 routes are described in CIDR format and encoded as <Length, Prefix>; e.g./15(15) (130) (216)
13Withdrawing RoutesThe prefixes to withdraw (if any) are specified in the withdrawn routes sectionThe receiver finds the appropriate prefix previously announced by the peer and removes that oneWhen a BGP connection is closed, all routes advertised from that connection are withdrawn by the peers
14Advertising RoutesNew routes, and their attributes, are specified in the NLRI and path attributes sectionsMandatory attributes:origin: IGP, EGP, ?AS path: seq. of ASes in path to prefixnext hop: IP address of router to use
17Classes of Attributes Well-known mandatory Well-known discretionary BGP speaker MUST understand it and MUST include it in NLRIWell-known discretionaryBGP speaker MUST understand it and MAY include it in NLRIOptional transitiveBGP speaker MAY understand it but MUST forward attribute if received in NLRI – sets partial bit to 1Optional non-transitiveBGP speaker MAY understand it but MUST NOT forward attribute received in NLRI
18Multiprotocol BGP (MBGP) BGP was designed to organise global IPv4 routingMBGP: a set of extensions to enable other types of routes to be chucked around using the attributes sectionOptional, non-transitiveHas to be negotiated at OPEN.MP-Reach-NLRI (type 14)MP-Unreach-NLRI (type 15)RFC 4760
19MP-Reach-NLRI| Address Family Identifier (2 octets) || Subsequent Address Family Identifier (1 octet) || Length of Next Hop Network Address (1 octet) || Network Address of Next Hop (variable) || Reserved (1 octet) || Network Layer Reachability Information (variable) |Source: Page 3, RFC 4760
20BGP decision process Step Attribute Controlled by local or neighbour AS?1Highest LocalPreflocal2Lowest AS path lengthneighbour3Lowest origin typeneither4Lowest MED5eBGP-learned over iBGP-learned6Lowest IGP cost to border router7Lowest router ID (to break ties)Source: BGP routing policies in ISP networks, Caesar and Rexford.
21BGP Communities Administrative tag used to associate routes together Assists in implementing administrative routing policyOptional transitive attribute.Well-known communities:No-Export; do not advertise outside of this ASNo-Advertise; do not advertise furtherNo-Export-Subconfed; do not advertise outside selected portion of AS.
22Processing Route Advertisements Applying Policy Import policyFilter routes from going furtherAppend or modify attributesDecision processExport policyWhich neighbours will receive the routeDon’t want to carry traffic you aren’t being paid to carrySource: BGP routing policies in ISP networks, Caesar and Rexford.
23Routing Policy Import policy Protect network from bad advertisements Advertising private or unallocated address spaceCustomer advertising default route to providerPromote aggregation through filtering NLRI with prefixes longer than particular value
24Configuring Local Policies Preferenceadd/delete/modify route attributesFilteringEliminate certain routes from consideration; control who they will be exported to;TaggingAssociate additional state with a route using community attribute
25Further ReadingBGP routing policies in ISP networks; Matthew Caesar and Jennifer RexfordRFC 4760: Multiprotocol Extensions for BGP-4RFC 4271: A Border Gateway Protocol 4 (BGP-4)