CS475 – Networks Lecture 9 Chapter 3 – Internetworking Assignments • Reading for Lecture 10: Section 4.1 • Homework 4 posted; Due October 5 3.3 Routing Forwarding consists of looking at a packets destination, Example Routing Table consulting a table and directing the packet to the corresponding Example Forw arding Table interface. Routing is the process by which forwarding tables are built. Prefix/Length Next Hop 18/8 171.69.245.10 Prefix/Length Interface MAC Address 18/8 if0 8:0:2b:e4:b:1:2 A routing domain is an internetwork under the same Forwarding is a simple process that takes place at a single node. administrative control, e.g. an ISP or university (a network of 10 Routing depends on complex __________________________ - 100 networks). algorithms. Today we will be discussing _____________________ routing We distinguish between the forwarding and routing tables protocols or interior gateway protocols (IGPs). The algorithms although they may be the same in practice. The forwarding table do not scale for use in larger networks. contains information to forward a packet, while the routing table Next chapter we will discuss interdomain routing protocols that contains the information to ____________ the forwarding table. can be used on larger networks (i.e., the Internet). 3.3.1 Network as a Graph For small networks routing tables could be constructed manually. Statically constructed routing tables must be re-built anytime the network changes (node or link failure, addition of nodes or links, cost changes). For these reasons routing tables are usually constructed by We will represent a network as a graph. The nodes represent running routing protocols among the nodes. The protocols routers and the edges are links between routers. A cost may be provide a _______________________, dynamic means for associated with each link. The routing problem is to find the construction of the routing tables. _____________ cost path between any two nodes in the graph. 3.3.2 Distance-Vector (RIP) The distance-vector (DV) algorithm constructs an array (vector) Initially each node is assumed to know only the cost to its containing the distances (costs) to all other nodes in the network. directly connected neighbors. A link that is down is assumed to The vector is then distributed to its immediate neighbors. 09/22/2011 have an ____________________ cost. Page 1 of 7 Dest Cost Next Hop B 1 B C 1 C D ∞ E 1 E F 1 F G ∞ Initial Table at A Example network with cost of 1 along each link (since all costs Dest Cost Next Hop B 1 B C 1 C D 2 C E 1 E F 1 F G 2 F Final Table at A are equal they are not shown). Dest A B D E F G Cost Next Hop Dest A B D E F G Cost Initial Table at C Node A B C D E F G A 0 1 1 ∞ 1 1 ∞ Distance to Reach Node B C D E F 1 1 ∞ 1 1 0 1 ∞ ∞ ∞ 1 0 1 ∞ ∞ ∞ 1 0 ∞ ∞ ∞ ∞ ∞ 0 ∞ ∞ ∞ ∞ ∞ 0 ∞ ∞ 1 ∞ 1 Next Hop Final Table at C G ∞ ∞ ∞ 1 ∞ 1 0 Node A B C D E F G A 0 1 1 2 1 1 2 Initial Distances to Each Node Distance to Reach Node B C D E F 1 1 2 1 1 0 1 2 2 2 1 0 1 2 2 2 1 0 3 2 2 2 3 0 2 2 2 2 2 0 3 2 1 3 1 G 2 3 2 1 3 1 0 Final Distances to Each Node The nodes send their distance vectors to their this is greater than the current cost of 1, so A does not change the ________________________________ neighbors allowing the corresponding entry.) neighbors to update their vectors. Updates are sent out periodically. They may also be Initially A believes that it has no path to D. C has a path of cost ____________________ due to a change in a routing table 1 to D and A and C are directly connected. After A receives C's caused by an update from a neighbor. vector, A determines that it can reach D through C at a cost of 2 The routing tables converge fairly rapidly (both initially and also and updates its table. (A can reach B through C at a cost of 2, but due to any changes). 09/22/2011 Page 2 of 7 3.3.2Distance Vector (RIP): Count to Infinity Problem During this time, all nodes think a path to E still exists. The count to infinity problem can occur if a link goes down. The count to infinity problem can be bounded by using a small Assume link A-to-E goes down. A advertises a distance of value to represent infinity (say 16 hops). infinity, but C might still advertise a distance of two (through Alternatively, in the split horizon method, a node does not send A). B advertises a distance of three through C. A advertises a those routes it learned from a neighbor back to that neighbor. distance of four through B. C updates to advertise a distance of In the split horizon with ________________________ a node five through A and so on. sends back a distance of infinity to those neighbors from which The cycle stops only when the distances reach ______________. it learned a route. 3.3.2 Distance Vector (RIP): RIP The Routing Information Protocol (RIP) is a very widely used routing protocol on IP networks. RIP is based on the DV algorithm. Distances to ___________________ instead of distances to routers are advertised in RIP. RIP packet format. RIP was designed to support other protocols in addition to IP 3.3.3 Link State (OSPF) In DV, routers advertise the cost-to-each-router in the network to When a node X receives an LSP from node Y with a larger their immediate neighbors. In a link state (LS) algorithm, _____________________ number than the one X has in memory routers advertise the cost-to-their-immediate-neighbors to each it stores the new LSP. If it is an older LSP (smaller seq. num. it router in the network. discards it) In LS each node _________________ the network with a link- A sends a new LSP out to all neighbors except the one from state packet (LSP) that contains: which it received the LSP. Each neighbor does the same, • the ID of the node that created the LSP flooding the network with the new LSP. • a list of directly connected nodes with costs Each node will eventually have LSPs from all other nodes stored • a sequence number for the packet in memory. • a time-to-live for the packet 09/22/2011 Page 3 of 7 4.2.3 Link State (OSPF): Dijkstra's algorithm Routing tables at each node are computed using the 3. For each neighbor (Neighbor) of Next, calculate the _____________________ implementation of Dijkstra's cost (Cost) to each Neighbor through Next. algorithm: a) If Neighbor is not in either list, add (Neighbor, Each switch maintains Tentative and Confirmed lists. The lists Cost, NextHop) to Tentative. contain entries of the form (Destination, Cost, NextHop). b) If Neighbor is in Tentative but the Cost through 1. The Confirmed list is initialized with an entry to this Next is less, update entry. switch with a cost of 0. 4. If Tentative is empty, stop. Otherwise pick entry from 2. The node just added to Confirmed is called Next. Tentative with lowest cost, move it to the Confirmed Select its LSP. Step Conf. 1 (D,0,-) 2 (D,0,-) Tent. (B,11,B) (C,2,C) 3 (D,0,-) (C,2,C) (B,11,B) 4 (D,0,-) (C,2,C) (B,5,C) (A,12,C) 5 (D,0,-) (C,2,C) (B,5,C) (D,0,-) (C,2,C) (B,5,C) (D,0,-) (C,2,C) (B,5,C) (A,10,C) (A,12,C) 6 7 (A,10,C) list and return to step 2. Comments Look at D's LSP D's LSP contains routes to B and C that are smaller in costs than any existing routes Move lowest cost member of Tentative to Confirmed. Look at C's LSP C has lower cost route to B, replace existing route in Tentative. Add A route. Move lowest cost member of Tentative to Confirmed. Look at B's LSP There is a lower cost path to A through B Move lowest cost member of Tentative to Confirmed. We are done. Example network used to illustrate LS algorithm. Steps at left illustrate construction of routing table for node D. Steps below illustrate construction of routing table for node A. Step Conf. Tent. Comments Step Conf. 1 2 5 6 3 7 4 09/22/2011 Page 4 of 7 Tent. Comments Node Routing Table A (A,0,-) (B,5,B) (C,8,B) (D,10,B) B (A,5,A) (B,0,-) (C,3,C) (D,5,C) C (A,8,B) (B,3,B) (C,0,-) (D,2,D) D (A,10,C) (B,5,C) (C,2,C) (D,0,-) Routing tables at each node after convergence of LS algorithm. 3.3.3 Link State (OSPF): OSPF OSPF allows for ________________________ of routing The Open Shortest Path First (OSPF) protocol is one of the most messages, partitioning of a domain, and load balancing along popular LS protocols. “Open” refers to the fact that it is an open equal cost paths. standard. SPF is another name for link state. Details of the OSPF packet format can be found in the text. 3.3.4 Metrics Many of the methods used to determine link-costs (__________________) were developed on ARPANET. The original ARPANET used the number of packets waiting to be transmitted on a link as the link cost. This method did not take either BW or latency into account. A second ARPANET algorithm used the packet delay (from time of arrival to delivery at the next hop) as the metric. This worked under light load, but exhibited several problems under heavy load. A third method used a metric based on a non-linear mapping from load to costs. Different links used different mappings. In practice today, most costs are _________________ assigned. A common setting is cost=Constant/BW. 09/22/2011 Page 5 of 7 3.4 Implementation and Performance; 3.4.1 Switch Basics It is possible to use an ordinary PC (with additional Network Performance of a PC based switch is limited since all packets Interface Cards (_____________)) as a switch as shown below: pass through a single point of contention. Aggregate throughput (the total sustainable data rate summed over all inputs) is half the main memory BW or half the I/O bus BW. A PC with a 133 MHz 64-bit I/O bus can transmit at a peak rate of 8 Gbps giving an aggregate throughput of _______________. Fast enough for several 100 Mbps Ethernet ports but not fast enough for a high-end router. 3.4.2 Ports Each input port typically contains a VC mapping table (VC Many modern switches are based on architectures similar to that switches) or a forwarding table (packet switches). shown below. Each port typically contains logic and _________. Ports also provide buffering. Most use either pure output buffering or a mixture of output buffering and internal buffering (buffering in the switching fabric. Simple input only buffers can lead to ______________________ blocking as shown at right. 3.4.3 Fabrics \Switching fabric architectures can be categorized as one of the that can connect any input port to any output port. In following four types: the simplest design each output has to be able to accept • shared bus: This is the PC architecture illustrated earlier. A single I/O bus is shared between all input and output ports. • shared memory: packets are written to memory by an input port and read directly from memory by an output port (similar to shared bus but uses a high speed memory bus instead of an I/O bus) • 09/22/2011 crossbar: This is a __________________ of pathways Page 6 of 7 packet from all inputs at once. • self-routing: Each input port adds a _______________ to each packet to direct it to its correct output In the banyan fabric at left each 2 x 2 switch directs the packet up if the header bit is 0 and down if it is a 1. The banyan fabric requires that the input packets be sorted (by output port number). Multiple packets can be ________________________ routed through the fabric. 3.4.4 Router Implementation IP routers are more complicated than switches in several network part of the IP address is not fixed in size. respects. • • Routers may be implemented using __________________ Routers must be able to handle variable length IP processors instead of general purpose microprocessors. High- packets. performance routers can handle 40 Gbps per interface. The forwarding algorithm is different because the In Class Exercises 1) netstat utility 2) Start homework 09/22/2011 Page 7 of 7