1.21k likes | 1.38k Views
Computer Networks (Graduate level). Lecture 10: Inter-domain Routing. University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani. Inter-Domain Routing. Border Gateway Protocol (BGP) Assigned reading [LAB00] Delayed Internet Routing Convergence Sources
E N D
Computer Networks(Graduate level) Lecture 10: Inter-domain Routing University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Computer Network
Inter-Domain Routing • Border Gateway Protocol (BGP) • Assigned reading • [LAB00] Delayed Internet Routing Convergence • Sources • RFC1771: main BGP RFC • RFC1772-3-4: application, experiences, and analysis of BGP • RFC1965: AS confederations for BGP • Christian Huitema: “Routing in the Internet”, chapters 8 and 9. • John Stewart III: “BGP4 - Inter-domain routing in the Internet” Computer Network
Outline • External BGP (E-BGP) • Internal BGP (I-BGP) • Multi-Homing • Stability Issues • Scalability Issues Computer Network
Internet Routing • Internet organized as a two level hierarchy • First level – autonomous systems (AS’s) • AS – region of network under a single administrative domain • Each AS assigned unique ID • AS’s peer at network exchange routing information. • AS’s run an intra-domain routing protocols • Distance Vector, e.g., RIP • Link State, e.g., OSPF • Between AS’s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) • De facto standard today, BGP-4 Computer Network
Example Interior router BGP router AS-1 AS-3 AS-2 Computer Network
Inter-domain Routing basics • Internet is composed of over 16000 autonomous systems • BGP = Border Gateway Protocol • Is a Policy-Based routing protocol • Is the de facto inter-domain routing protocol of today’s global Internet • Relatively simple protocol, but configuration is complex and the entire world can see, and be impacted by, your mistakes.
Inter-domain Routing • Use TCP • Border Gateway Protocol (BGP), based on Bellman-Ford path vector • AS’s exchange reachability information through their BGP routers, only when routes change • BGP routing information – a sequence of AS’s indicating the path traversed by a route; next hop • General operations of a BGP router: • Learns multiple paths • Picks best path according to its AS policies • Install best pick in IP forwarding tables Computer Network
History • Mid-80s: EGP • Reachability protocol (no shortest path) • Did not accommodate cycles (tree topology) • Evolved when all networks connected to NSF backbone • Result: BGP introduced as routing protocol • Latest version = BGP 4 • BGP-4 supports CIDR • Primary objective: connectivity not performance Computer Network
Choices • Link state or distance vector? • No universal metric – policy decisions • Problems with distance-vector: • Bellman-Ford algorithm may not converge • Problems with link state: • Metric used by routers not the same – loops • LS database too large – entire Internet • May expose policies to other AS’s Computer Network
Solution: Distance Vector with Path • Each routing update carries the entire path • Loops are detected as follows: • When AS gets route check if AS already is in path • If yes, reject route • If no, add self and (possibly) advertise route further • Advantage: • Metrics are local - AS chooses path, protocol ensures no loops Computer Network
Interconnecting BGP Peers • BGP uses TCP to connect peers • Advantages: • Simplifies BGP • No need for periodic refresh - routes are valid until withdrawn, or the connection is lost • Incremental updates • Disadvantages • Congestion control on a routing protocol? • Poor interaction during high load Computer Network
BGP Operations (Simplified) AS1 Establish session on TCP port 179 BGP session Exchange all active routes AS2 While connection is ALIVE exchange route UPDATE messages Exchange incremental updates
provider customer IP traffic Customers and Providers provider customer Customer pays provider for access to the Internet Computer Network
peer peer provider customer The “Peering” Relationship Peers provide transit between their respective customers Peers do not provide transit between peers Peers (often) do not exchange $$$ traffic allowed traffic NOT allowed Computer Network
peer peer provider customer Peering Provides Shortcuts Peering also allows connectivity between the customers of “Tier 1” providers. Computer Network
Reduces upstream transit costs Can increase end-to-end performance May be the only way to connect your customers to some part of the Internet (“Tier 1”) You would rather have customers Peers are usually your competition Peering relationships may require periodic renegotiation Peering Wars Peer Don’t Peer Peering struggles are by far the most contentious issues in the ISP world! Peering agreements are often confidential. Computer Network
Hop-by-hop Model • BGP advertises to neighbors only those routes that it uses • Consistent with the hop-by-hop Internet paradigm • e.g., AS1 cannot tell AS2 to route to other AS’s in a manner different than what AS2 has chosen (need source routing for that) Computer Network
AS Categories • Stub: an AS that has only a single connection to one other AS - carries only local traffic. • Multi-homed: an AS that has connections to more than one AS, but does not carry transit traffic • Transit: an AS that has connections to more than one AS, and carries both transit and local traffic (under certain policy restrictions) Computer Network
AS Categories AS1 AS3 AS1 AS2 AS1 AS3 AS2 Transit Stub AS2 Multi-homed Computer Network
Policy with BGP • BGP provides capability for enforcing various policies • Policies are not part of BGP: they are provided to BGP as configuration information • BGP enforces policies by choosing paths from multiple alternatives and controlling advertisement to other AS’s Computer Network
Examples of BGP Policies • A multi-homed AS refuses to act as transit • Limit path advertisement • A multi-homed AS can become transit for some AS’s • Only advertise paths to some AS’s • An AS can favor or disfavor certain AS’s for traffic transit from itself Computer Network
Routing Information Bases (RIB) • Routes are stored in RIBs • Adj-RIBs-In: routing info that has been learned from other routers (unprocessed routing info) • Loc-RIB: local routing information selected from Adj-RIBs-In (routes selected locally) • Adj-RIBs-Out: info to be advertised to peers (routes to be advertised) Computer Network
Architecture of Dynamic Routing OSPF BGP AS 1 EIGRP IGP = Interior Gateway Protocol Metric based: OSPF, IS-IS, RIP, EIGRP (cisco) AS 2 EGP = Exterior Gateway Protocol Policy based: BGP The Routing Domain of BGP is the entire Internet Computer Network
AS-Path • Sequence of AS’s a route traverses • Used for loop detection and to apply policy AS-3 AS-4 130.10.0.0/16 120.10.0.0/16 AS-5 AS-2 110.10.0.0/16 120.10.0.0/16 AS-2 AS-3 AS-4 AS-1 130.10.0.0/16 AS-2 AS-3 110.10.0.0/16 AS-2 AS-5 Computer Network
Four Types of BGP Messages • Open : Establish a peering session. • Keep Alive : Handshake at regular intervals. • Notification : Shuts down a peering session. • Update : Announcing new routes or withdrawing previously announced routes. announcement = prefix + attributes values
Two Types of BGP Neighbor Relationships • External Neighbor (eBGP) in a different Autonomous Systems • Internal Neighbor (iBGP) in the same Autonomous System AS1 iBGP is routed using Interior Gateway Protocol (IGP)! eBGP iBGP AS2
eBGP update iBGP updates iBGP Peers Must be Fully Meshed • iBGP is needed to avoid routing loops within an AS • Injecting external routes into IGP does not scale and causes BGP policy information to be lost • BGP does not provide “shortest path” routing iBGP neighbors do not announce routes received via iBGP to other iBGP neighbors.
Important BGP attributes • LocalPREF • Local preference policy to choose “most” preferred route • Multi-exit Discriminator (MED) • Which peering point to choose? • Import Rules • What route advertisements do I accept? • Export Rules • Which routes do I forward to whom? Computer Network
Implementing Customer/Provider and Peer/Peer relationships • Enforce transit relationships • Outbound route filtering • Enforce order of route preference • provider < peer < customer Two parts: Computer Network
provider route peer route customer route ISP route Import Routes From provider From provider From peer From peer From customer From customer Computer Network
filters block Export Routes provider route peer route customer route ISP route To provider From provider To peer To peer To customer To customer Computer Network
BGP Common Header 1 2 3 0 Marker (security and message delineation) 16 bytes Length (2 bytes) Type (1 byte) Types: OPEN, UPDATE, NOTIFICATION, KEEPALIVE Computer Network
BGP OPEN message 1 2 3 0 Marker (security and message delineation) Length Type: open version My autonomous system Hold time BGP identifier Optional parameters <type, length, value> Parameter length My AS: id assigned to that AS Hold timer: max interval between KEEPALIVE or UPDATE messages interval implies no keep_alive. BGP ID: IP address of one interface (same for all messages) Computer Network
BGP UPDATE message 1 2 3 0 Marker (security and message delineation) Length Type: update Withdrawn.. ..routes len Withdrawn routes (variable) ... Path attribute len Path attributes (variable) Network layer reachability information (NLRI) (variable) • Many prefixes may be included in UPDATE, but must • share same attributes. • UPDATE message may report multiple withdrawn routes. Computer Network
BGP UPDATE Message • List of withdrawn routes • Network layer reachability information • List of reachable prefixes • Path attributes • Origin • Path • Metrics • All prefixes advertised in a message have same path attributes Computer Network
NLRI • Network Level Reachability Information • list of IP address prefixes encoded as follows: Length (1 byte) Prefix (variable) Computer Network
Path attributes Type-Length-Value encoding Attribute type (2 bytes) Attribute length (1-2 bytes) Attribute Value (variable length) Attribute type field Attribute flags (1 byte) Attribute type code (1 byte) Flags: optional, v.s. well-known transitive, partial, extended length Computer Network
BGP NOTIFICATION message 1 2 3 0 Marker (security and message delineation) Length Type: NOTIFICATION Error code Data Error sub-code • Used for error notification • TCP connection is closed immediately after notification Computer Network
BGP KEEPALIVE message 1 2 3 0 Marker (security and message delineation) Length Type: KEEPALIVE Sent periodically to peers to ensure connectivity. If hold_time is zero, messages are not sent.. Sent in place of an UPDATE message Computer Network
Path Selection Criteria • Information based on path attributes • Attributes + external (policy) information • Examples: • Hop count • Policy considerations • Preference for AS • Presence or absence of certain AS • Path origin • Link dynamics Computer Network
Route Selection Summary Highest Local Preference Enforce relationships Shortest ASPATH Lowest MED traffic engineering i-BGP < e-BGP Lowest IGP cost to BGP egress Throw up hands and break ties Lowest router ID Computer Network
peer peer provider customer Back to Frank … Local preference only used in iBGP AS 4 local pref = 80 AS 3 local pref = 90 local pref = 100 AS 2 AS 1 Higher Local preference values are more preferred 13.13.0.0/16
Backup Links with Local Preference (Outbound Traffic) AS 1 primary link backup link Set Local Pref = 100 for all routes from AS 1 Set Local Pref = 50 for all routes from AS 1 AS 65000 Forces outbound traffic to take primary link, unless link is down. We’ll talk about inbound traffic soon …
Multihomed Backups (Outbound Traffic) AS 1 AS 3 provider provider primary link backup link Set Local Pref = 100 for all routes from AS 1 Set Local Pref = 50 for all routes from AS 3 AS 2 Forces outbound traffic to take primary link, unless link is down.
AS 1239 Sprint ASPATH Attribute AS 1129 135.207.0.0/16 AS Path = 1755 1239 7018 6341 Global Access AS 1755 135.207.0.0/16 AS Path = 1239 7018 6341 135.207.0.0/16 AS Path = 1129 1755 1239 7018 6341 Ebone AS 12654 RIPE NCC RIS project 135.207.0.0/16 AS Path = 7018 6341 AS7018 135.207.0.0/16 AS Path = 3549 7018 6341 135.207.0.0/16 AS Path = 6341 AT&T AS 3549 AS 6341 135.207.0.0/16 AS Path = 7018 6341 AT&T Research Global Crossing 135.207.0.0/16 Prefix Originated
COMMUNITY Attribute to the Rescue! AS 3: normal customer local pref is 100, peer local pref is 90 AS 1 AS 3 provider provider 192.0.2.0/24 ASPATH = 2 COMMUNITY = 3:70 192.0.2.0/24 ASPATH = 2 primary backup Customer import policy at AS 3: If 3:90 in COMMUNITY then set local preference to 90 If 3:80 in COMMUNITY then set local preference to 80 If 3:70 in COMMUNITY then set local preference to 70 customer 192.0.2.0/24 AS 2
Hot Potato Routing: Go for the Closest Egress Point 192.44.78.0/24 egress 2 egress 1 IGP distances 56 15 This Router has two BGP routes to 192.44.78.0/24. Hot potato: get traffic off of your network as Soon as possible. Go for egress 1!
Heavy Content Web Farm Getting Burned by the Hot Potato 2865 High bandwidth Provider backbone 17 SFF NYC Low bandwidth customer backbone 56 15 San Diego Many customers want their provider to carry the bits! tiny http request huge http reply
Heavy Content Web Farm Cold Potato Routing with MEDs(Multi-Exit Discriminator Attribute) 2865 Prefer lower MED values 17 192.44.78.0/24 MED = 56 192.44.78.0/24 MED = 15 56 15 192.44.78.0/24 This means that MEDs must be considered BEFORE IGP distance! Note1 : some providers will not listen to MEDs Note2 : MEDs need not be tied to IGP distance
MED • Hint to R1 to use R3 over R4 link • Cannot compare AS40’s values to AS30’s 180.10.0.0 MED = 50 R1 R2 AS 10 AS 40 180.10.0.0 MED = 120 180.10.0.0 MED = 200 R3 R4 AS 30 Computer Network