11-bgp

41
15-441 Computer Networking Inter-Domain Routing BGP (Border Gateway Protocol)

Upload: andaihiep

Post on 03-Sep-2015

218 views

Category:

Documents


0 download

DESCRIPTION

11-BGP

TRANSCRIPT

  • 15-441 Computer NetworkingInter-Domain Routing

    BGP (Border Gateway Protocol)

  • SummaryThe Story So Far Routing protocols generate the forwarding tableTwo styles: distance vector, link stateScalability issues: Distance vector protocols suffer from count-to-infinityLink state protocols must flood information through networkTodays lectureHow to make routing protocols support large networksHow to make routing protocols support business policies

  • Outline

    Routing hierarchy

    Internet structure

    External BGP (E-BGP)

    Internal BGP (I-BGP)

  • Routing HierarchiesFlat routing doesnt scaleStorage Each node cannot be expected to store routes to every destination (or destination network)Convergence times increaseCommunication Total message count increasesKey observationNeed less information with increasing distance to destinationNeed lower diameters networksSolution: area hierarchy

  • AreasDivide network into areasAreas can have nested sub-areasHierarchically address nodes in a networkSequentially number top-level areasSub-areas of area are labeled relative to that areaNodes are numbered relative to the smallest containing area

  • Routing HierarchyPartition Network into AreasWithin areaEach node has routes to every other nodeOutside areaEach node has routes for other top-level areas onlyInter-area packets are routed to nearest appropriate border routerConstraint: no path between two sub-areas of an area can exit that area

    Backbone AreasLower-level AreasArea-BorderRouter

  • Area Hierarchy Addressing1231.11.22.12.23.13.22.2.12.2.21.2.11.2.2

  • Path Sub-optimality1231.11.22.12.23.13.22.2.13 hop red pathvs.2 hop green pathstartend3.2.11.2.1Can result in sub-optimal paths

  • Outline

    Routing hierarchy

    Internet structure

    External BGP (E-BGP)

    Internal BGP (I-BGP)

  • A Logical View of the Internet?After looking a RIP/OSPF descriptionsEnd-hosts connected to routersRouters exchange messages to determine connectivityNOT TRUE!

  • Internets Area HierarchyWhat is an Autonomous System (AS)?A set of routers under a single technical administration, using an interior gateway protocol (IGP) and common metrics to route packets within the AS and using an exterior gateway protocol (EGP) to route packets to other ASsSometimes ASs use multiple IGPs and metrics, but appear as single ASs to other ASsEach AS assigned unique IDASs peer at network exchanges

  • AS Numbers (ASNs)ASNs are 16 bit values64512 through 65535 are privateGenuity: 1 MIT: 3JANET: 786UC San Diego: 7377AT&T: 7018, 6341, 5074, UUNET: 701, 702, 284, 12199, Sprint: 1239, 1240, 6211, 6242, ASNs represent units of routing policyCurrently over 15,000 in use

  • Example1231.11.22.12.23.13.22.2.144.14.255.15.2EGPIGPEGPEGPIGPIGPIGPIGPEGPEGP

  • A Logical View of the Internet?RIP/OSPF not very scalable area hierarchies

    NOT TRUE EITHER!ISPs arent equalSizeConnectivity

    ISPISP

  • A Logical View of the InternetTier 1Tier 1Tier 2Tier 2Tier 2Tier 3Tier 1 ISPDefault-free with global reachability infoTier 2 ISPRegional or country-wideTier 3 ISPLocalCustomerProvider

  • Transit vs. PeeringISP XISP YISP ZISP PTransit ($)Transit ($$$)Transit ($$ 1/2)Transit ($$)PeeringTransit ($$$)Transit ($)Transit ($$)Transit ($$$)

  • Policy ImpactValley-free routingNumber links as (+1, 0, -1) for provider, peer and customerIn any path should only see sequence of +1, followed by at most one 0, followed by sequence of -1WHY?Consider the economics of the situation

  • Outline

    Routing hierarchy

    Internet structure

    External BGP (E-BGP)

    Internal BGP (I-BGP)

  • ChoicesLink state or distance vector?No universal metric policy decisionsProblems with distance-vector:Bellman-Ford algorithm may not convergeProblems with link state:Metric used by routers not the same loopsLS database too large entire InternetMay expose policies to other ASs

  • Solution: Distance Vector with PathEach routing update carries the entire pathLoops are detected as follows:When AS gets route check if AS already in pathIf yes, reject routeIf no, add self and (possibly) advertise route furtherAdvantage:Metrics are local - AS chooses path, protocol ensures no loops

  • Interconnecting BGP PeersBGP uses TCP to connect peersAdvantages:Simplifies BGPNo need for periodic refresh - routes are valid until withdrawn, or the connection is lostIncremental updatesDisadvantagesCongestion control on a routing protocol?Poor interaction during high load

  • Hop-by-hop ModelBGP advertises to neighbors only those routes that it usesConsistent with the hop-by-hop Internet paradigme.g., AS1 cannot tell AS2 to route to other ASs in a manner different than what AS2 has chosen (need source routing for that)

  • Policy with BGPBGP provides capability for enforcing various policiesPolicies are not part of BGP: they are provided to BGP as configuration informationBGP enforces policies by choosing paths from multiple alternatives and controlling advertisement to other ASs

  • Examples of BGP PoliciesA multi-homed AS refuses to act as transitLimit path advertisementA multi-homed AS can become transit for some ASsOnly advertise paths to some ASsAn AS can favor or disfavor certain ASs for traffic transit from itself

  • BGP MessagesOpenAnnounces AS IDDetermines hold timer interval between keep_alive or update messages, zero interval implies no keep_aliveKeep_aliveSent periodically (but before hold timer expires) to peers to ensure connectivity.Sent in place of an UPDATE messageNotificationUsed for error notificationTCP connection is closed immediately after notification

  • BGP UPDATE MessageList of withdrawn routesNetwork layer reachability informationList of reachable prefixesPath attributesOriginPathMetricsAll prefixes advertised in message have same path attributes

  • Path Selection CriteriaInformation based on path attributesAttributes + external (policy) informationExamples:Hop countPolicy considerationsPreference for ASPresence or absence of certain ASPath originLink dynamics

  • LOCAL PREFLocal (within an AS) mechanism to provide relative priority among BGP routersR1R2R3R4I-BGPAS 256AS 300Local Pref = 500Local Pref =800AS 100R5AS 200

  • LOCAL PREF Common UsesHandle routes advertised to multi-homed transit customersShould use direct connectionPeering vs. transitPrefer to use peering connection, why?In general, customer > peer > providerUse LOCAL PREF to ensure this

  • AS_PATHList of traversed ASsAS 500AS 300AS 200AS 100180.10.0.0/16 300 200 100170.10.0.0/16 300 200170.10.0.0/16180.10.0.0/16

  • Multi-Exit Discriminator (MED)Hint to external neighbors about the preferred path into an AS Non-transitive attribute (we will see later why)Different AS choose different scalesUsed when two ASs connect to each other in more than one place

  • MEDHint to R1 to use R3 over R4 linkCannot compare AS40s values to AS30s

    R1R2R3R4AS 30AS 40180.10.0.0MED = 120180.10.0.0MED = 200AS 10180.10.0.0MED = 50

  • MEDMED is typically used in provider/subscriber scenariosIt can lead to unfairness if used between ISP because it may force one ISP to carry more traffic:SFNYISP1 ignores MED from ISP2ISP2 obeys MED from ISP1ISP2 ends up carrying traffic most of the wayISP1ISP2

  • Decision ProcessProcessing order of attributes:Select route with highest LOCAL-PREFSelect route with shortest AS-PATHApply MED (if routes learned from same neighbor)

  • Outline

    Routing hierarchy

    Internet structure

    External BGP (E-BGP)

    Internal BGP (I-BGP)

  • Internal vs. External BGPR3R4R1R2E-BGPBGP can be used by R3 and R4 to learn routesHow do R1 and R2 learn routes?AS1AS2

  • Internal BGP (I-BGP)Same messages as E-BGPDifferent rules about re-advertising prefixes:Prefix learned from E-BGP can be advertised to I-BGP neighbor and vice-versa, but Prefix learned from one I-BGP neighbor cannot be advertised to another I-BGP neighborReason: no AS PATH within the same AS and thus danger of looping.

  • Internal BGP (I-BGP)R3R4R1R2E-BGPI-BGPR3 can tell R1 and R2 prefixes from R4R3 can tell R4 prefixes from R1 and R2R3 cannot tell R2 prefixes from R1

    R2 can only find these prefixes through a direct connection to R1Result: I-BGP routers must be fully connected (via TCP)!contrast with E-BGP sessions that map to physical linksAS1AS2

  • Important ConceptsWide area Internet structure and routing driven by economic considerationsCustomer, providers and peersBGP designed to:Provide hierarchy that allows scalabilityAllow enforcement of policies related to structureMechanismsPath vector scalable, hides structure from neighbors, detects loops quicklyIBGP structure/requirements reuse of BGP, need for a fully connected mesh

  • Next Lecture: Multicast & DNS

    How to send packets to multiple destinations

    How to resolve names like www.google.com into IP addresses

  • EXTRA SLIDESThe rest of the slides are FYI

  • HistoryMid-80s: EGPReachability protocol (no shortest path)Did not accommodate cycles (tree topology)Evolved when all networks connected to NSF backboneResult: BGP introduced as routing protocolLatest version = BGP 4BGP-4 supports CIDRPrimary objective: connectivity not performance

  • Link FailuresTwo types of link failures:Failure on an E-BGP linkFailure on an I-BGP LinkThese failures are treated completely different in BGPWhy?

  • Failure on an E-BGP LinkAS1R1AS2R2Physical linkE-BGP session138.39.1.1/30138.39.1.2/30If the link R1-R2 goes downThe TCP connection breaksBGP routes are removedThis is the desired behavior

  • Failure on an I-BGP LinkR1R2R3Physical linkI-BGP connection138.39.1.1/30138.39.1.2/30If link R1-R2 goes down, R1 and R2 should still be able to exchange traffic The indirect path through R3 must be usedThus, E-BGP and I-BGP must use different conventions with respect to TCP endpoints

  • BGP Common HeaderLength (2 bytes)Type (1 byte)0123Marker (security and message delineation)16 bytesTypes: OPEN, UPDATE, NOTIFICATION, KEEPALIVE

  • CIDR and BGPAS X197.8.2.0/24AS Y197.8.3.0/24AS T (provider)197.8.0.0/23AS ZWhat should T announce to Z?

  • OptionsAdvertise all paths:Path 1: through T can reach 197.8.0.0/23Path 2: through T can reach 197.8.2.0/24Path 3: through T can reach 197.8.3.0/24But this does not reduce routing tables! We would like to advertise:Path 1: through T can reach 197.8.0.0/22

  • Sets and SequencesProblem: what do we list in the route?List T: omitting information not acceptable, may lead to loopsList T, X, Y: misleading, appears as 3-hop pathSolution: restructure AS Path attribute as:Path: (Sequence (T), Set (X, Y))If Z wants to advertise path:Path: (Sequence (Z, T), Set (X, Y))In practice used only if paths in set have same attributes

  • Other AttributesORIGINSource of route (IGP, EGP, other)NEXT_HOPAddress of next hop router to useCheck out http://www.cisco.com for full explanation

    Where would you use this? Between ISPs? At edges?What are some choices?