Presentation on theme: "Chapter 4: Network Layer"— Presentation transcript:
1 Chapter 4: Network Layer 4. 1 Introduction4.2 Virtual circuit and datagram networks4.3 What’s inside a router4.4 IP: Internet ProtocolDatagram formatIPv4 addressingICMPIPv64.5 Routing algorithmsLink stateDistance VectorHierarchical routing4.6 Routing in the InternetRIPOSPFBGP4.7 Broadcast and multicast routing
2 Hierarchical OSPFPerhaps some routers don’t need to know about every link.two-level hierarchy: local area, backbone.Link-state advertisements only within the areaeach nodes has detailed knowledge of its area topologyarea border routers: “summarize” distances to nets in own area, advertise to other Area Border routers.backbone routers: run OSPF routing limited to backbone.boundary routers: connect to other AS’s.ECHGAABR C announces link C<->A to Area 1ABR C announces link C<->E to BackboneABR C announces a summary of Area 1 to the BackboneABR C announces a summary of the Backbone and other areas to Area 1C learns about other areas from the other ABR……
3 Area Border Router Summaries Should the summaries include reachbility information or path metrics?Routers in area 1 do not need to know about the paths used to reach destinations in other areasThey only need to know that they can be reached.In this case, reachbility information is sufficient to compute optimal routesi.e., the ABR only announces which destinations it can reach.However, no one would make a topology as shown in the figureWhy?If a single key links break or router crashes, the network would be partitioned (and the network designer would be fired)CHG
4 Area Border Router Summaries e.g., if summaries only include reachbility informationarea border routerEFCGABDABR C announces to Area 1 that it can reach Area 2 in 1 hops (and includes a list of destinations in Area 2)ABR F announces to Area 1 that it can reach Area 2 in 0 hopsRouter A determines the path to D as followsThe path to Area 2 via F is 2 hops (2 to reach F and then 0 more to Area 2)The path to Area 2 via C is 2 hops (1 to C and then 1 more to Area 2)Either path is good to reach DHowever, the path via F is better. A does not have sufficient information to determine this.
5 Area Border Router Summaries In this case, reachability information is not enough to compute optimal routes.Therefore, ABRs provide distance vector type information, i.e., which destinations can be reached and the cost to reach themarea border routerEFCGABNotice the C does not announce the link CG to Area 1.Notice that C gets a summary from G, which is distances to destinations, like distance vector.C uses the distances from G to determine its distances.C announces these distances to Area 1This is like a one hop distance vector protocolDABR G tells all routers in the Backbone that it can reach D in 2 hop.ABR F tells all routers in the Backbone that it can reach D in 1 hopsABR C tells all routers in Area 1 that it can reach D in 3 hopsABR F tells all routers in Area 1 that it can reach D in 1 hopA decides B is the best next hop toward D
6 Area Border Router Summaries The backbone is completely connected because each router essentially sends distance vector updates directly to its neighborarea border routerEFFA in 1 hopB in 2 hops…C21A in 4 hopB in 5 hops…3GC2AA in 2 hopB in 3 hops…Area 31GArea 1BArea 2DThis is like a one hop distance vector protocolConvergence time: 1Loops are not possible
7 Chapter 4: Network Layer 4. 1 Introduction4.2 Virtual circuit and datagram networks4.3 What’s inside a router4.4 IP: Internet ProtocolDatagram formatIPv4 addressingICMPIPv64.5 Routing algorithmsLink stateDistance VectorHierarchical routing4.6 Routing in the InternetRIPOSPFBGP4.7 Broadcast and multicast routing
9 Subnet part or CIDR-block IP addressing: CIDRCIDR: Classless InterDomain Routingsubnet portion of address of arbitrary lengthaddress format: a.b.c.d/x, where x is # bits in subnet portion of addressSubnet part or CIDR-blockhostpart/23
10 IP addresses: how to get one? Q: How does network get subnet part of IP addr?A: gets allocated portion of its provider ISP’s address spaceISP's block /20Organization /23Organization /23Organization /23… … ….Organization /23
11 Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routinginformation:Organization 0/23Organization 1/23“Send me anythingwith addressesbeginning/20”Organization 2/23.ISP1.Border RouterInternetOrganization 7/23“Send me anythingwith addressesbeginning/16”ISP2This way, the whole 32 bit address does not need to be examined
12 Hierarchical addressing: more specific routes ISP2 has a more specific route to Organization 1Organization 0/23“Send me anythingwith addressesbeginning/20”Organization 2/23.ISP1.Border RouterInternetOrganization 7/23“Send me anythingwith addressesbeginning /16or /23”ISP2Organization 1/23
13 Longest prefix matching Border Router Forwarding TablePrefix Match Link Interface///otherwiseIf a packet with destination address arrives at the boarder router, then is it forwarding to interface 0 or 1?Since interface 1 has a longer match, it goes to interface 1
14 A Problem with Longest Match and subnetting In order to improve reliability, organization 7 has a backup link with ISP1.This way, if ISP1 has problems or ISP1’s provider has problems, then organization 7 is still reachable.Will this work?Organization 0/23Organization 1/23“Send me anythingwith addressesbeginning……”Organization 2/23.ISP1.Border RouterInternetOrganization 7/23“Send me anythingwith addressesbeginning…..ISP2
15 Hierarchical RoutingOur routing study thus far has been an idealizationall routers identicalnetwork “flat”… not true in practicescale: with 200 million destinations:can’t store all dest’s in routing tables!Memory for address table must be very fastHow fast? How long can an address lookup take on a 10GBit interface?E.g., 64B/1010=50nsecrouting table exchange would swamp links!There are ~ 1 million linksIf link state was flooded every 30 minutes seconds and each link state is 20B, then each router receives and processes 100kbps in link announcementsBut, perhaps, only changes in link state could be distributed.administrative autonomyinternet = network of networkseach network admin wants to control routing in its own networkATT does not want Sprint to know what their topology isTrade secretImproves securityATT wants to select a routing protocol and parameters without getting Sprint’s permission
16 Hierarchical Routingaggregate routers into regions, “autonomous systems” (AS)Single administrative domainRouters in the same AS run same routing protocol“intra-AS” routing protocolrouters in different AS can run different intra-AS routing protocolAn ISP may be made of 1 or more ASsATT-USA = 1 AS and ATT-Europe is anotherSome stub networks are an ASUD is an ASSome companies have routers but are not ASsASs have their own number, assigned by ICANNThere are ~50K ASsGateway routerDirect link to router in another ASGateway routers run a common inter-networking routing protocol
17 Simple exampleConnections to other ASs and the rest of the InternetAS2Service provider of AS1 (e.g., AS1=UD and AS2=cogent)E(Recall that ASs (ISPs) sometimes meet at NAPs. E.g., google: MAE-East)An AS could also meet its provider at a POP.The rest of the internetStub network (at the edge of the network)These tables are made with RIP, OSPF, ISIS, etc1BForwarding tableForwarding table3Prefix/243PrefixInterface2/244/243/222/243/222AS114C23/241Forwarding tablePrefixInterface3/243A/242/243/222/22
18 Q: How can routers in AS1 know where to send pkts with destination not in AS1? A: Easy, if a pkt is for an “unknown” address, then send it to B.Specifically, B advertises a link to prefix /0This is called a default route, and it can be statically set (no need for any routing protocol beside OSPF)AS2Service provider of AS1 (e.g., AS1=UD and AS2=cogent)EThe rest of the internetStub network (at the edge of the network)These tables are made with RIP, OSPF, ISIS, etc1BForwarding tableForwarding table3PrefixPrefixInterface/2432/244/243/243/222/222/01/01AS114C23/241Forwarding tablePrefixInterface3/243A/242/243/222/22/01
19 to the rest of the Internet We need to put prefixes /16, /16, /16 in the forwarding tablesHow to get there?B must learn from E that /16 and /16 are reachable through EA must learn that /16 is reachable through DB and A must distribute this information throughout AS1Steps 1 and 2 need a exterior inter-networking routing protocolStep 3 needs an interior inter-networking routing protocolEBGP and IBGP – border gateway routing protocol can accomplish thisto the rest of the Internet/16AS2/16EThese tables are made with RIP, OSPF, ISIS, etc1BForwarding tablePrefixForwarding table32/243PrefixInterface/243/2443/222/24/222AS141C2/2431Forwarding table3PrefixInterfaceA/243/24/24324/222/22DAS3/16
20 Interconnected ASes3b1d3a1c2aAS3AS1AS21a2c2b1bIntra-ASRoutingalgorithmInter-ASForwardingtable3cforwarding table configured by both intra- and inter-AS routing algorithmintra-AS sets entries for internal destsinter-AS & intra-As sets entries for external dests
21 Example: Setting forwarding table in router 1d suppose AS1 learns (via inter-AS protocol) that subnet x is reachable via AS3 (gateway 1c) but not via AS2.inter-AS protocol propagates reachability info to all internal routers.router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c.installs forwarding table entry (x,I)Alternatively, 1d has two table entriesOne entry says x is reachable via 1c (determined by IBGP)A second entry says which is the next hop to reach 1c (determined by intra-routing protocol)…x3c3a2c3b2aAS32b1cAS21a1bAS11d
22 Example: Choosing among multiple ASes now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2.to configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x.this is also job of inter-AS routing protocol!If both gateways are equivalent, then the intra-AS routing protocol will route packets to the best gatewayThis is called hot potato routing: send packet towards closest of two routers.…3b1d3a1c2aAS3AS1AS21a2c2b1b3c…x
23 Hot Potato Routing AS1 A B AS2 /16AS1ABAS2Pkt arrives with dest in /16AS2 could give send the pkt to gateway B – hot potato routing.But AS1 would prefer AS2 to carry its own traffic.So AS1 might require that AS2 gives higher priority to gateway A.But how can AS1 enforce AS2 to do this?
24 Example: Choosing among multiple ASes now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2.to configure forwarding table, router 1d must determine which gateway it should forward packets for dest x.this is also job of inter-AS routing protocol!hot potato routing: send packet towards closest of two routers.Learn from inter-ASprotocol that subnetx is reachable viamultiple gatewaysUse routing infofrom intra-ASprotocol to determinecosts of least-costpaths to eachof the gatewaysHot potato routing:Choose the gatewaythat has theleast costDetermine fromforwarding table theInterface that leadsto least-cost gateway.Enter (x,I) inforwarding tableCpeg 419 strats
25 Internet inter-AS routing: BGP BGP (Border Gateway Protocol): the de facto standardBGP provides each AS a means to:Obtain subnet reachability information from neighboring ASs.Propagate reachability information to all AS-internal routers.Determine “good” routes to subnets based on reachability information and policy.allows subnet to advertise its existence to rest of Internet: “I am here”
26 BGP basicspairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessionsBGP sessions need not correspond to physical links.when AS2 advertises a prefix to AS1:AS2 promises it will forward datagrams towards that prefix.AS2 can aggregate prefixes in its advertisementBut this can cause problems when some prefixes have backup linkseBGP session3ciBGP session2c3a3b2aAS32b1cAS21a1bAS11d
27 Distributing reachability info using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1.1c can then use iBGP do distribute new prefix info to all routers in AS11b can then re-advertise new reachability info to AS2 over 1b-to-2a eBGP sessionwhen router learns of new prefix, it creates entry for prefix in its forwarding table.eBGP session3ciBGP session2c3a3b2aAS32b1cAS21a1bAS11d
28 Aggregation Problem ISP ISP ISP ISP /24/22/24/22ISPISPY/24ISPW/24/24/24ISPISPXISPISPFrom ISP W, the next hop to /24 is X, it should be Y
29 Path attributes & BGP routes advertised prefix includes BGP attributes.prefix + attributes = “route”two important attributes:AS-PATH: contains ASs through which prefix advertisement has passed: e.g, AS 67, AS 17, …NEXT-HOP: indicates specific internal-AS router to next-hop AS. (there may be multiple routers with links from current AS to next-hop-AS. Each router can advertise the path)when gateway router receives route advertisement, uses import policy to accept/decline.
30 BGP route selectionrouter may learn about more than 1 route to some prefix. Router must select route.elimination rules:local preference value attribute: policy decisionshortest AS-PATHclosest NEXT-HOP router: hot potato routingadditional criteria
31 BGP messages TCP reset security risk BGP messages exchanged using TCP. OPEN: opens TCP connection to peer and authenticates senderUPDATE: advertises new path (or withdraws old)KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN requestNOTIFICATION: reports errors in previous msg; also used to close connectionTCP reset security risk
32 BGP routing policy A,B,C are provider networks XYlegend:customernetwork:providernetworkA,B,C are provider networksX,W,Y are customer (of provider networks)X is dual-homed: attached to two networksX does not want to route from B via X to C.. so X will not advertise to B a route to C
33 BGP routing policy (2) A advertises path AW to B XYlegend:customernetwork:providernetworkA advertises path AW to BB advertises path BAW to XShould B advertise path BAW to C?No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customersB wants to force C to route to w via AB wants to route only to/from its customers!
34 BGP route processing configuration configuration routing decision BGP advertises and withdraws paths with the UPDATE messageUPDATE has three fieldsRouter to withdrawAttributes of routes to prefixes in NLRINLRIThe NLRI is a list of prefixes that the list of attributes applies to. If two prefixes have different attributes, then these two prefixes need to be announced with different UPDATE messages.In OSPF each path is a list of routes and a total cost (two attributes). In BGP, routes have many attributes, the cost (in AS hops) is only one of the attributesconfigurationconfigurationroutingdecisionroutingtableinputpolicyengineoutputpolicyenginefrompeerstopeers
35 RIBs Adj-rib-in Adj-rib-out Input Policy engine Routing information base (RIB) – a list of routes (including attributes)Adj-RIB-In: RIB learned from neighbor (many of these)Adj-RIB-Out: RIB to be sent to neighbor (many of these)Loc-RIB: RIB for local use (only one of these)Adj-rib-inpeerInputPolicyengineBGPdecisionLoc-RIBAdj-rib-out
36 Sample routing environment AS3deny 0/0 from AS1Give /24 from AS1 better preferenceAccept other routesAS1Do not propagate 0/0Do not send /24 to AS4Give /24 with metric = 10 to AS3/24 path=(AS5, AS2)/24 path=(AS5, AS1) metric=10/24 path=(AS5)/240/0inputpolicyenginedecisionprocessroutesoutputpolicyengine/24 path=(AS5)/24 path=(AS5 AS1)Use 0/0 from AS2Use /24 from AS1Use /24 from AS2Use /24 from AS5 (this AS)AS4AS2/24/240/0
38 Fun with BGP Routeviews.org collects and archives BGP announcements One way to use routeviews is with digAt the linux promptdig txt aspath.routeviews.orgOutputs various stuff andAnswer section:4.128.aspath.routeviews.org 600 IN TXT “ ” “ ” “16”Syntax = ASPath “Prefix” “prefix length”Now use whois -h whois.arin.net "a ASXX" to learn about ASs where XX is an AS number. E.g., whois -h whois.arin.net "a AS34" gives information about AS34Try with some other AS
39 Check out a collection of path announcements Open bgp030408p39.PartialAn old (2003) partial list of BGP announcements received by several routersCheck which ASs peer with UD (ASN 34)
40 Why different Intra- and Inter-AS routing ? Policy:Inter-AS: admin wants control over how its traffic routed, who routes through its net.Intra-AS: single admin, so no policy decisions neededScale:hierarchical routing saves table size, reduced update trafficPerformance:Intra-AS: can focus on performanceInter-AS: policy may dominate over performance
Your consent to our cookies if you continue to use this website.