+ All Categories
Home > Documents > Handout # 8: Internet Topology and Routing

Handout # 8: Internet Topology and Routing

Date post: 25-Feb-2016
Category:
Upload: tolla
View: 53 times
Download: 2 times
Share this document with a friend
Description:
Handout # 8: Internet Topology and Routing. CSC 458/2209 – Computer Networks. Guest lecture by Phillipa Gill Post-doctoral Researcher @ The Citizen Lab/ Assistant Professor Stony Brook University [email protected] www.cs.toronto.edu/~phillipa Based on slides by Y. Ganjali. - PowerPoint PPT Presentation
46
Handout # 8: The Internet Protocol, Routing and Forwarding Professor Yashar Ganjali Department of Computer Science University of Toronto [email protected] http://www.cs.toronto.edu/~ygan jali CSC 458/2209 – Computer Networks
Transcript

Slide 1

Handout # 8: The Internet Protocol, Routing and ForwardingProfessor Yashar GanjaliDepartment of Computer ScienceUniversity of Toronto

[email protected]://www.cs.toronto.edu/~yganjaliCSC 458/2209 Computer Networks1AnnouncementsDont forget the programming assignment.Due: Friday Oct. 23rd at 5pm.Take advantage of tutorials, and TA office hours.Dont leave it to the last minute.This weeks tutorialProblem set 1.Problem set 1 due this weekFriday Oct. 9th at 5 pm (sharp).Submit electronically on MarkUs.File name: ps1.pdf.

CSC 458/CSC 2209 Computer Networks2University of Toronto Fall 20152Announcements ContdReading for next weekChapter 4 of the textbook

Midterm examSection L0101: Tue. Oct. 27th, 1-3 PM Section L5101: Tue. Oct. 27th, 6-8 PMSection L0201: Thu. Oct. 29th, 1-3 PMSame room and time as the lectureFor undergraduate and graduate students

CSC 458/CSC 2209 Computer Networks3University of Toronto Fall 2015CSC 458/CSC 2209 Computer Networks4University of Toronto Fall 2015The Story So far Layers, and protocolsLink layerInterconnecting LANsHubs, switches, and bridgesThe Internet ProtocolIP datagram, fragmentationNaming and addressingCIDR, DNSThis timeRouting and forwardingPhysicalData LinkNetworkTransportSessionPresentationApplication4Packet Routing and ForwardingForwarding IP datagramsClass-based vs. CIDR

Routing TechniquesNave: FloodingDistance vector: Distributed Bellman Ford AlgorithmLink state: Dijkstras Shortest Path First-based AlgorithmCSC 458/CSC 2209 Computer Networks5University of Toronto Fall 20155Hop-by-Hop Packet ForwardingEach router has a forwarding tableMaps destination addresses to outgoing interfacesUpon receiving a packetInspect the destination IP address in the headerIndex into the tableDetermine the outgoing interfaceForward the packet out that interfaceThen, the next router in the path repeatsAnd the packet travels along the path to the destinationCSC 458/CSC 2209 Computer Networks6University of Toronto Fall 2015

6CSC 458/CSC 2209 Computer Networks7University of Toronto Fall 2015Inside a RouterLink 1, ingressLink 1, egressLink 2, ingressLink 2, egressLink 3, ingressLink 3, egressLink 4, ingressLink 4, egressChooseEgressChooseEgressChooseEgressChooseEgress7CSC 458/CSC 2209 Computer Networks8University of Toronto Fall 2015Inside a RouterLink 1, ingressLink 1, egressLink 2, ingressLink 2, egressLink 3, ingressLink 3, egressLink 4, ingressLink 4, egressChooseEgressChooseEgressChooseEgressForwardingDecisionForwardingTable8Forwarding in an IP RouterLookup packet DA in forwarding table.If known, forward to correct port.If unknown, drop packet.Decrement TTL, update header Checksum.Forward packet to outgoing interface.Transmit packet onto link.

CSC 458/CSC 2209 Computer Networks9University of Toronto Fall 2015Question: How is the address looked up in a real router?9Separate Table Entries Per AddressIf a router had a forwarding entry per IP addressMatch destination address of incoming packet to the forwarding-table entry to determine the outgoing interface

CSC 458/CSC 2209 Computer Networks10University of Toronto Fall 2015hosthosthostLAN 1...hosthosthostLAN 2...routerrouterrouterWANWAN1.2.3.45.6.7.82.4.6.81.2.3.55.6.7.92.4.6.91.2.3.41.2.3.5Forwarding Table10Separate Entry Class-based AddressIf the router had an entry per class-based prefixMixture of Class A, B, and C addressesDepends on the first couple of bits of the destinationIdentify the mask automatically from the addressFirst bit of 0: class A address (/8)First two bits of 10: class B address (/16)First three bits of 110: class C address (/24)Then, look in the forwarding table for the matchE.g., 1.2.3.4 maps to 1.2.3.0/24Then, look up the entry for 1.2.3.0/24 to identify the outgoing interfaceCSC 458/CSC 2209 Computer Networks11University of Toronto Fall 201511CSC 458/CSC 2209 Computer Networks12University of Toronto Fall 2015Example Class-based AddressingClass AClass BClass CD212.17.9.4Class AClass BClass C212.17.9.0Port 4Exact MatchRouting Table:IP Address Space212.17.9.0Exact Match: There are many well-known ways to find an exact match in a table.12CIDR Makes Packet Forwarding HarderTheres no such thing as a free lunchCIDR allows efficient use of the limited address spaceBut, CIDR makes packet forwarding much harderForwarding table may have many matchesE.g., table entries for 201.10.0.0/21 and 201.10.6.0/23The IP address 201.10.6.17 would match both!

CSC 458/CSC 2209 Computer Networks13University of Toronto Fall 2015201.10.0.0/21201.10.0.0/22201.10.4.0/24201.10.5.0/24201.10.6.0/23Provider 1Provider 213Longest Prefix Match ForwardingForwarding tables in IP routersMaps each IP prefix to next-hop link(s)Destination-based forwardingPacket has a destination addressRouter identifies longest-matching prefixCute algorithmic problem: very fast lookupsCSC 458/CSC 2209 Computer Networks14University of Toronto Fall 201514How a Router Forwards DatagramsCSC 458/CSC 2209 Computer Networks15University of Toronto Fall 2015128.9/16128.9.16/20128.9.176/20128.9.19/24128.9.25/24142.12/1965/8PrefixPort3227213128.17.14.1128.17.14.1128.17.20.1128.17.10.1128.17.14.1128.17.16.1128.17.16.1Next-hopR1R2R3R4123128.17.20.1128.17.16.1e.g. 128.9.16.14 => Port 2Forwarding Table15Simplest Algorithm is Too SlowScan the forwarding table one entry at a timeSee if the destination matches the entryIf so, check the size of the mask for the prefixKeep track of the entry with longest-matching prefixOverhead is linear in size of the forwarding tableToday, that means 400,000-500,000 entries!And, the router may have just a few nanoseconds before the next packet is arrivingNeed greater efficiency to keep up with line rateBetter algorithmsHardware implementationsCSC 458/CSC 2209 Computer Networks16University of Toronto Fall 201516CSC 458/CSC 2209 Computer Networks17University of Toronto Fall 2015Lookup Performance Required LineLine RatePktsize=40BPktsize=240BT11.5Mbps4.68 Kpps0.78 KppsOC3155Mbps480 Kpps80 KppsOC12622Mbps1.94 Mpps323 KppsOC482.5Gbps7.81 Mpps1.3 MppsOC19210 Gbps31.25 Mpps5.21 Mpps17Fast LookupsThe are algorithms that are faster than linear scanProportional to number of bits in the addressWe can use special hardwareContent Addressable Memories (CAMs)Allows look-ups on a key rather than flat addressHuge innovations in the mid-to-late 1990sAfter CIDR was introduced (in 1994) and longest-prefix match was a major bottleneck

CSC 458/CSC 2209 Computer Networks18University of Toronto Fall 201518Where do Forwarding Tables Come From?Routers have forwarding tablesMap prefix to outgoing link(s)Entries can be statically configuredE.g., map 12.34.158.0/24 to Serial0/0.1But, this doesnt adapt To failuresTo new equipmentTo the need to balance loadThat is where other technologies come inRouting protocols, DHCP, and ARPCSC 458/CSC 2209 Computer Networks19University of Toronto Fall 201519Packet Routing and ForwardingForwarding IP datagramsClass-based vs. CIDR

Routing TechniquesNave: FloodingDistance vector: Distributed Bellman Ford AlgorithmLink state: Dijkstras Shortest Path First-based AlgorithmCSC 458/CSC 2209 Computer Networks20University of Toronto Fall 2015Routing is a very complex subject, and has many aspects. Here, we will concentrate on the basics.20The ProblemCSC 458/CSC 2209 Computer Networks21University of Toronto Fall 2015

ABR1R2R3R4How does R1 choose a next-hop on the path towards host B?21What is Routing?A famous quotation from RFC 791 A name indicates what we seek.An address indicates where it is.A route indicates how we get there. -- Jon PostelCSC 458/CSC 2209 Computer Networks22University of Toronto Fall 2015

22Forwarding vs. RoutingForwarding: data planeDirecting a data packet to an outgoing linkIndividual router using a forwarding tableRouting: control planeComputing paths the packets will followRouters talking amongst themselvesIndividual router creating a forwarding tableCSC 458/CSC 2209 Computer Networks23University of Toronto Fall 201523Why Does Routing Matter?End-to-end performanceQuality of the path affects user performancePropagation delay, throughput, and packet lossUse of network resourcesBalance of the traffic over the routers and linksAvoiding congestion by directing traffic to lightly-loaded linksTransient disruptions during changesFailures, maintenance, and load balancingLimiting packet loss and delay during changesCSC 458/CSC 2209 Computer Networks24University of Toronto Fall 201524Example NetworkCSC 458/CSC 2209 Computer Networks25University of Toronto Fall 2015Objective: Determine the route from A to B that minimizes the path cost.

R7R6R4R2R11142422323R8Examples of link cost: Distance, data rate, price, congestion/delay, ABR5R325CSC 458/CSC 2209 Computer Networks26University of Toronto Fall 2015Example NetworkIn this simple case, solution is clear from inspection

R7R6R4R2R11142422323R8ABR5R326CSC 458/CSC 2209 Computer Networks27University of Toronto Fall 2015What about this Network...!?The public Internet in 1999

Learn more athttp://www.lumeta.com27CSC 458/CSC 2209 Computer Networks28University of Toronto Fall 2015Technique 1: Nave ApproachAdvantages:SimpleEvery destination in the network is reachable.Disadvantages:Some routers receive a packet multiple times.Packets can go round in loops forever.Inefficient.Flood! -- Routers forward packets to all ports except the ingress port.R128CSC 458/CSC 2209 Computer Networks29University of Toronto Fall 2015Lowest Cost RoutesObjective: Find the lowest cost route from each of (R1, , R7) to R8.

R5R3R7R6R4R2R11142422323R829CSC 458/CSC 2209 Computer Networks30University of Toronto Fall 2015A Spanning TreeThe solution is a spanning tree with R8 as the root of the tree. Tree: There are no loops. Spanning: All nodes included. Well see two algorithms that build spanning trees automatically:The distributed Bellman-Ford algorithmDijkstras shortest path first algorithmR3R1R5R4R8R6R2R7114242232330Technique 2: Distance VectorDistributed Bellman-Ford AlgorithmDefine distances at each node x dx(y) = cost of least-cost path from x to yUpdate distances based on neighbors dx(y) = min {c(x,v) + dv(y)} over all neighbors vCSC 458/CSC 2209 Computer Networks31University of Toronto Fall 20153221141453uvwxyzstdu(z) = min{c(u,v) + dv(z), c(u,w) + dw(z)}31CSC 458/CSC 2209 Computer Networks32University of Toronto Fall 2015Distance Vector Algorithm c(x,v) = cost for direct link from x to vNode x maintains costs of direct links c(x,v)Dx(y) = estimate of least cost from x to yNode x maintains distance vector Dx = [Dx(y): y N ]Node x maintains its neighbors distance vectorsFor each neighbor v, x maintains Dv = [Dv(y): y N ]Each node v periodically sends Dv to its neighborsAnd neighbors update their own distance vectorsDx(y) minv{c(x,v) + Dv(y)} for each node y NOver time, the distance vector Dx converges32Iterative, asynchronous: each local iteration caused by: Local link cost change Distance vector update message from neighborDistributed:Each node notifies neighbors only when its DV changesNeighbors then notify their neighbors if necessaryDistance Vector AlgorithmCSC 458/CSC 2209 Computer Networks33University of Toronto Fall 2015wait for (change in local link cost or message from neighbor)

recompute estimates

if DV to any destination has changed, notify neighbors

Each node:33CSC 458/CSC 2209 Computer Networks34University of Toronto Fall 2015Distance Vector Example: Step 1AEFCDB23641113Table for ADstCstHopA0AB4BCDE2EF6FTable for BDstCstHopA4AB0BCD3DEF1FTable for CDstCstHopABC0CD1DEF1FTable for DDstCstHopAB3BC1CD0DEFTable for EDstCstHopA2ABCDE0EF3FTable for FDstCstHopA6AB1BC1CDE3EF0FOptimum 1-hop paths34CSC 458/CSC 2209 Computer Networks35University of Toronto Fall 2015Distance Vector Example: Step 2Table for ADstCstHopA0AB4BC7FD7BE2EF5ETable for BDstCstHopA4AB0BC2FD3DE4FF1FTable for CDstCstHopA7FB2FC0CD1DE4FF1FTable for DDstCstHopA7BB3BC1CD0DEF2CTable for EDstCstHopA2AB4FC4FDE0EF3FTable for FDstCstHopA5BB1BC1CD2CE3EF0FOptimum 2-hop pathsAEFCDB2364111335CSC 458/CSC 2209 Computer Networks36University of Toronto Fall 2015Distance Vector Example: Step 3Table for ADstCstHopA0AB4BC6ED7BE2EF5ETable for BDstCstHopA4AB0BC2FD3DE4FF1FTable for CDstCstHopA6FB2FC0CD1DE4FF1FTable for DDstCstHopA7BB3BC1CD0DE5CF2CTable for EDstCstHopA2AB4FC4FD5FE0EF3FTable for FDstCstHopA5BB1BC1CD2CE3EF0FOptimum 3-hop pathsAEFCDB2364111336Bellman-Ford AlgorithmQuestions: How long can the algorithm take to run?How do we know that the algorithm always converges?What happens when link costs change, or when routers/links fail?

Topology changes make life hard for the Bellman-Ford algorithm CSC 458/CSC 2209 Computer Networks37University of Toronto Fall 201537CSC 458/CSC 2209 Computer Networks38University of Toronto Fall 2015A Problem with Bellman-FordBad news travels slowlyR4R3R2R1111Consider the calculation of distances to R4:5,R24,R35,R233,R24,R33,R223,R22,R33,R211, R42,R33,R20R3R2R1TimeCounting to infinityR3R4 fails38Counting to Infinity Problem SolutionsSet infinity = some small integer (e.g. 16). Stop when count = 16.Split Horizon: Because R2 received lowest cost path from R3, it does not advertise cost to R3Split-horizon with poison reverse: R2 advertises infinity to R3There are many problems with (and fixes for) the Bellman-Ford algorithm.CSC 458/CSC 2209 Computer Networks39University of Toronto Fall 201539Technique 3: Link State Dijkstras Shortest Path First AlgorithmRouters send out update messages whenever the state of an incident link changes. Called Link State Updates

Based on all link state updates received each router calculates lowest cost path to all others, starting from itself.Use Dijkstras single-source shortest path algorithmAssume all updates are consistent

At each step of the algorithm, router adds the next shortest (i.e. lowest-cost) path to the tree.

Finds spanning tree rooted at the router.CSC 458/CSC 2209 Computer Networks40University of Toronto Fall 201540CSC 458/CSC 2209 Computer Networks41University of Toronto Fall 2015Dijsktras Algorithm1 Initialization: 2 S = {u} 3 for all nodes v 4 if v adjacent to u {5 D(v) = c(u,v) 6 else D(v) = 7 8 Loop 9 find w not in S with the smallest D(w)10 add w to S 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min{D(v), D(w) + c(w,v)} 13 until all nodes in S 41CSC 458/CSC 2209 Computer Networks42University of Toronto Fall 2015Dijkstras Algorithm ExampleFind Routes to the Red (Leftmost) Node322114145332211414533221141453322114145342CSC 458/CSC 2209 Computer Networks43University of Toronto Fall 2015Dijkstras Algorithm Example322114145332211414533221141453322114145343CSC 458/CSC 2209 Computer Networks44University of Toronto Fall 2015Shortest-Path TreeShortest-path tree from uForwarding table at u

3221141453uvwxyzstv(u,v)w(u,w)x(u,w)y(u,v)z(u,v)links(u,w)t(u,w)44Reliable Flooding of LSPThe Link State Packet:The ID of the router that created the LSPList of directly connected neighbors, and costSequence numberTTL

Reliable FloodingResend LSP over all links other than incident link, if the sequence number is newer. Otherwise drop it.

Link State Detection: Link layer failure Loss of hello packetsCSC 458/CSC 2209 Computer Networks45University of Toronto Fall 201545Message complexityLS: with n nodes, E links, O(nE) messages sent DV: exchange between neighbors onlyConvergence time varies

Speed of ConvergenceLS: O(n2) algorithm requires O(nE) messagesDV: convergence time variesMay be routing loopsCount-to-infinity problemRobustness: what happens if router malfunctions?LS: Node can advertise incorrect link costEach node computes only its own tableDV:DV node can advertise incorrect path costEach nodes table used by others (error propagates)Comparison of LS and DV algorithmsCSC 458/CSC 2209 Computer Networks46University of Toronto Fall 201546


Recommended