Border gateway protocol
1 / 46

Border Gateway Protocol - PowerPoint PPT Presentation

  • Uploaded on

Border Gateway Protocol. This lecture is largely based on a BGP tutorial by T. Griffin from AT&T Research. Internet Infrastructure. Internet Infrastructure. Location where a network (ISP, corporate network, or regional network) gets access to the Internet is called a Point-of-Presence (POP).

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Border Gateway Protocol' - zoie

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Border gateway protocol

Border Gateway Protocol

This lecture is largely based on a BGP tutorial by T. Griffin from AT&T Research.

Internet infrastructure1
Internet Infrastructure

  • Location where a network (ISP, corporate network, or regional network) gets access to the Internet is called a Point-of-Presence (POP).

  • Locations where Tier-1 or Tier-2 networks exchange traffic are called peering points.

    • Public peering: Traffic is swapped in a specific location, called Internet exchange points (IXPs)

    • Private peering: Two networks establish a direct link to each other.

Review autonomous systems
Review: Autonomous Systems

  • An autonomous system (AS) is a region of the Internet that is administered by a single entity and that has a unified routing policy

  • Each autonomous system is assigned an Autonomous System Number (ASN).

    • UofT’s campus network (AS239)

    • Rogers Cable Inc. (AS812)

    • Sprint (AS1239, AS1240, AS 6211, …)

  • Interdomain routing is concerned with determining paths between autonomous systems (interdomain routing)

  • Routing protocols for interdomain routing are called exterior gateway protocols (EGP)

  • Review interdomain and intradomain routing
    Review: Interdomain and Intradomain Routing

    • Routing protocols for intradomain routing are called interior gateway protocols (IGP)

      • Objective: shortest path

    • Routing protocols for interdomain routing are called exterior gateway protocols (EGP)

      • Objective: satisfy policy of the AS

    Egp and igp
    EGP and IGP

    • Interior Gateway Protocol

      • Routing is done based on metrics

      • Routing domain is one autonomous system

    • Exterior Gateway Protocol

      • Routing is done based on policies

      • Routing domain is the entire Internet


    • Interdomain routing is based on connectivity between autonomous systems

    • Interdomain routing can ignore many details of router interconnection

    As graphs
    AS Graphs

    AT&T North America

    From: T. Griffin, BGP Tutorial

    Multiple routing protocols

    Multiple routing protocols can run on the same router

    Each routing protocol updates the routing table

    Multiple Routing Protocols

    Autonomous systems terminology
    Autonomous Systems Terminology

    • local traffic = traffic with source or destination in AS

    • transit traffic = traffic that passes through the AS

    • Stub AS = has connection to only one AS, only carry local traffic

    • Multihomed Stub AS = has connection to >1 AS, but does not carry transit traffic

    • Transit AS = has connection to >1 AS and carries transit traffic

    Stub and transit networks


    AS 1 is a multi-homed stub network

    AS 3 and AS 4 are transit networks

    AS 2 and AS 5 are is a stub networks

    Stub and Transit Networks

    Selective transit


    AS 3 carries traffic between AS 1 and AS 4 and between AS 2 and AS 4

    But AS 3 does not carry traffic between AS 1 and AS 2

    The example shows a routing policy.

    Selective Transit

    Customer provider and peers

    A stub network typically obtains access to the Internet through a transit network.

    Transit network that is a provider may be a customer for another network

    Customer pays provider for service

    Customer/Provider and Peers

    Customer provider and peers1

    Transit networks can have a peer relationship through a transit network.

    Peers provide transit between their respective customers

    Peers do not provide transit between peers

    Peers normally do not pay each other for service

    Customer/Provider and Peers

    Shortcuts through peering

    Note that peering reduces upstream traffic through a transit network.

    Delays can be reduced through peering

    But: Peering may not generate revenue

    Shortcuts through peering

    Border gate protocol bgp
    Border Gate Protocol (BGP) through a transit network.

    • Border Gateway Protocol is the interdomain routing protocol for the Internet for routing between autonomous systems

    • Currently in version 4 (1995)

      • Network administrators can specify routing policies

      • BGP is a path vector protocol (Like distance vector, but routing messages in BGP contain complete routes)

    • Uses TCP to transmit routing messages

    Border gate protocol bgp1
    Border Gate Protocol (BGP) through a transit network.

    • An autonomous system uses BGP to advertise its network address(es) to other AS’s

    • BGP helps an AS to:

      • Learn about reachable networks from neighboring AS’s

      • Distribute the information about reachable networks to routers inside the AS

      • Select a route if there are multiple routes to reach the same network

    Bgp message types
    BGP Message Types through a transit network.

    • Open: Establishes a peering session

    • Notification: Closes a peering session

    • Keep Alive: Handshake at regular intervals to maintain peering session

    • Update: Announces new routes or withdraws previously announced routes. Each announced route is specified as a network prefix with attribute values

    Bgp interactions

    The networks that are advertised are network IP addresses with a prefix, E.g.,

    Prefixesreachable from AS 1

    Prefixesreachablefrom AS 3

    BGP interactions

    Bgp interactions1

    BGP is executed between two routers with a prefix, E.g.,

    BGP session

    BGP peers or BGP speakers


    Establishes TCP connection (port 175) to BGP peer

    Exchange all BGP routes

    As long as connection is alive: Periodically send incremental updates

    Note: Not all autonomous systems need to run BGP. On many stub networks, the route to the provider can be statically configured

    BGP interactions

    Bgp interactions2

    BGP peers advertise reachability of IP networks with a prefix, E.g.,

    A advertises a path to a network (e.g., to B only if it is willing to forward traffic going to that network


    A advertises the complete path AS A, …., AS X

     this avoids loops

    BGP interactions

    Bgp sessions

    External BGP session (eBGP): with a prefix, E.g., are in different AS’es

    Internal BGP session (iBGP)Peers are in the same AS

    Note that iBGP sessions use routes constructed by an intradomain routing protocol to exchange messages !

    BGP Sessions

    Ibgp sessions

    All iBGP peers in the same autonomous system are fully meshed

    Peer announces routes received via eBGP to iBGP peers

    But: iBGP peers do not announce routes received via iBGP to other iBGP peers

    iBGP sessions

    Route reflectors

    Full mesh of iBGP routers is difficult to maintain meshed

    Router Reflectors (RR) present an alternative

    All iBGP routers peer with the RR

    RR acts as a server

    Other iBGP routers become clients

    Route Reflectors

    Content of advertisements
    Content of Advertisements meshed

    • A BGP routers route advertisement is sent in a BGP UPDATE message

    • A route is announced as a Network Prefix and Attributes

    • Attributes specify details about a route:

      • Mandatory attributes:




      • many other attributes

    Origin attribute

    Originating domain sends a route with ORIGIN attribute meshed, ORIGIN {1}, ORIGIN {1}, ORIGIN {1}, ORIGIN {1}, ORIGIN {1}

    ORIGIN attribute

    As path attributes

    Each AS that propagates a route prepends its own AS number meshed

    AS-PATH collects a path to reach the network prefix

    Path information prevents routing loops from occuring

    Path information also provides information on the length of a path (By default, a shorter route is preferred)

    Note: BGP aggregates routes according to CIDR rules, AS-PATH {4,2,1}, AS-PATH {1}, AS-PATH {2,1}, AS-PATH {1}, AS-PATH {3,1}

    AS-PATH attributes

    Next hop attributes

    Each router that sends a route advertisement it includes its own IP address in a NEXT-HOP attribute

    The attribute provides information for the routing table of the receiving router., NEXT-HOP {}, NEXT-HOP {}

    NEXT-HOP attributes

    Connecting next hop with igp information, own IP address in a NEXT-HOP attribute NEXT-HOP {}, NEXT-HOP {}

    Connecting NEXT-HOP with IGP information

    At R1:

    Routing table

    Routing table

    BGP info

    Route selection

    An AS may get more than one route to an address own IP address in a NEXT-HOP attribute

    Needs to select a route

    Route Selection Criteria (in order of preference)

    Highest Local Preference

    Shortest AS-Path

    Lowest MED (multi-exit discriminator) ( called “metric” in BGP)

    Prefer iBGP over eBGP routes

    Lowest IGP cost to leave AS (“hot potato”)

    Lowest router ID ( used as tie breaker)

    Route Selection

    Local preference
    Local Preference own IP address in a NEXT-HOP attribute

    • If there are multiple exit points from the AS, the local preference attribute is used to select the exit point for a specific route

    • Local Preference is used only for iBGP sessions

    • Value is set locally

    Local pref = 100

    Local pref = 10

    Local pref = 80

    Local pref = 50

    Hot potato routing

    Router R3 in autonomous system A receives two advertisements to AS A

    Which route should it pick?

    Hot Potato Rule: Select the iBGP peer that has the shortest IGP route

    Analogy: Get the packet out of one’s own AS as quickly as possible, i.e., on the shortest path

    Hot Potato Routing

    Hot potato routing1

    Finding the cheapest IGP route: to AS A

    Compare the cost of the two paths

    R3 R1

    R3 R2

    according to the IGP protocol

    Here: R1 has the shortest path

    Add a routing table entry for destination X

    Hot Potato Routing

    Hot potato routing can backfire
    Hot Potato Routing can backfire! to AS A

    • AS1 would serve its customer (source) better by not picking the shortest route to AS 2

    • In fact, customer may have paid for a high-bandwidth service!

    Processing in bgp
    Processing in BGP to AS A

    Best entry is entered in IP routing table

    BGP updates arrive

    Filter routes and change attributes

    Filter routes and change attributes

    BGP updates arrive

    Based on attributes

    Importing and exporting routes
    Importing and Exporting Routes to AS A

    • An AS may not accept all routes that are advertised

    • An AS may not advertise certain routes

    • Route policies determines which routes are filtered

    • If an AS wants to have less inbound traffic it should adapt its export rules

    • If an AS wants to control its outbound traffic, it adapts its import rules

    Routing policies
    Routing Policies to AS A

    • Since AS 5 is a stub network it should not advertise routes to networks other than networks in AS 5

    • When AS 3 learns about the path {AS1, AS4}, it should not advertise the route {AS3, AS1, AS4} to AS 2.

    Traffic often follows aspath

    In many cases, packets are routed according to the AS-PATH to AS A

    However, in some cases this is not true

    (Here: AS 2 filters routes with a long prefix)

    Traffic Often Follows ASPATH

    Short as path does not mean that route is short

    From AS 6’s perspective to AS A

    Path {AS2, AS1} is short

    Path {AS5, AS4, AS3, AS1} is long

    But the number of traversed routers is larger when using the shorter AS-PATH

    Short AS-PATH does not mean that route is short

    Bgp table growth
    BGP Table Growth to AS A

    Source: Geoff Huston. on August 8, 2001

    Bgp table growth1
    BGP Table Growth to AS A

    Source:, 2010

    Bgp issues
    BGP Issues to AS A

    • BGP is a simple protocol but it is very difficult to configure

    • BGP has severe stability issue due to policies  BGP is known to not converge

    • As of July 2005, 39,000 AS numbers (of available 64,510) are consumed