EEC484584 Computer Networks Lecture 9 Wenbing Zhao wenbingzgmail
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao wenbingz@gmail. com (Part of the slides are based on Drs. Kurose & Ross’s slides for their Computer Networking book)
Outline n n Quiz#2 result Introduction to network layer q n n Routing and forwarding, etc. Router architecture Routing algorithm q q Link state routing Distance vector routing 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
EEC 584 Quiz#2 Result n High 95, low 32, average: 70. 7 n Q 1: 34. 5/50, Q 2: 15. 3/20, Q 3: 6. 1/10, Q 4: 14. 7/20 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Network Layer n Main concern: end-to-end transmission q n Services provided to transport layer q q q n n Perhaps over many hops at intermediate nodes application Transport segment from sending transport network to receiving host data link physical On sending side encapsulates segments into datagrams On receiving side, delivers segments to transport layer Network layer protocols in every host, router Router examines header fields in all IP datagrams passing through it 11/27/2020 EEC-484/584: Computer Networks network data link physical network data link physical application transport network data link physical Wenbing Zhao
Two Key Network-Layer Functions n n Routing: determine route taken by packets from source to destination Forwarding: move packets from router’s input to appropriate router output 11/27/2020 Analogy: • Routing: process of planning trip from source to destination • Forwarding: process of getting through single intersection EEC-484/584: Computer Networks Wenbing Zhao
Interplay between Routing & Forwarding routing algorithm Forwarding table is also referred to as routing table local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Network Service Model Q: What service model for “channel” transporting datagrams from sender to receiver? Example services for individual datagrams: n Guaranteed delivery with less than 40 msec delay n Best effort 11/27/2020 Example services for a flow of datagrams: n In-order datagram delivery n Guaranteed minimum bandwidth to flow n Restrictions on changes in inter-packet spacing n No guarantee whatsoever EEC-484/584: Computer Networks Wenbing Zhao
Network Layer Connection and Connection-less Service n n Datagram network provides network-layer connectionless service Virtual Circuit network provides network-layer connection-oriented service (omitted) 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Datagram Networks n n No call setup at network layer Routers: no state about end-to-end connections q n no network-level concept of “connection” Packets forwarded using destination host address q packets between same source-dest pair may take different paths application transport network data link 1. Send data physical 11/27/2020 EEC-484/584: Computer Networks application transport network 2. Receive data link physical Wenbing Zhao
Routing within a Datagram Subnet n n n Router has forwarding table telling which outgoing line to use for each possible destination router Each datagram has full destination address When packet arrives, router looks up outgoing line to use and transmits packet 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Datagram or VC Network: Why? Internet (datagram) n n data exchange among computers q “elastic” service, no strict timing requirement “smart” end systems (computers) q can adapt, perform control, error recovery q simple inside network, complexity at “edge” 11/27/2020 ATM (VC) n n n evolved from telephony human conversation: q strict timing, reliability requirements q need for guaranteed service “dumb” end systems q telephones q complexity inside network EEC-484/584: Computer Networks Wenbing Zhao
What’s in a Router? n n Run routing algorithms/protocol (RIP, OSPF, BGP) Forwarding datagrams from incoming to outgoing link 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Input Port Functions Physical layer: bit-level reception Data link layer: e. g. , Ethernet Decentralized switching: n n 11/27/2020 given datagram dest. , lookup output port using forwarding table in input port memory queuing: newly arrived datagrams might be queued before processing EEC-484/584: Computer Networks Wenbing Zhao
Output Ports n n Buffering required when datagrams arrive from fabric faster than the transmission rate Scheduling discipline chooses among queued datagrams for transmission 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Routing Algorithms Routing algorithm: algorithm that finds least-cost path n Least-cost in what sense? q n Number of hops, geographical distance, least queueing and transmission delay Desirable properties q q q Correctness, simplicity Robustness to faults Stability – converge to equilibrium 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Routing Algorithm Classification Static or dynamic? n Non-adaptive (static) - Route computed in advance, off-line, downloaded to routers n Adaptive (dynamic) - Route based on measurements or estimates of current traffic and topology 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Routing Algorithm Classification Global or decentralized information? n Global: q q n all routers have complete topology & link cost info “link state” algorithms Decentralized: q q q router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Link State Routing Basic idea n Assumes net topology & link costs known to all nodes q Accomplished via “link state broadcast” q All nodes have same info n Computes least cost paths from one node (‘source”) to all other nodes, using Dijkstra’s Algorithm q Gives forwarding table for that node 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Dijkstra’s Algorithm n n n Each node labeled with distance from source node along best known path Initially, no paths known so all nodes labeled with infinity As algorithm proceeds, labels may change reflecting shortest path Label may be tentative or permanent, initially, all tentative When label represents shortest path from source to node, label becomes permanent 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Compute Shortest Path from A to D n n n Start with node A as the initial working node Examine each of the nodes adjacent to A, i. e. , B and G, relabeling them with the distance to A Examine all the tentatively labeled nodes in the whole graph and make the one with the smallest label permanent, i. e. , B. B is the new working node 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Compute Shortest Path from A to D 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Step Permanently labeled B G E C F H D 1 A 2, A 6, A ∞ ∞ ∞ 2 AB 6, A 4, B 9, B ∞ ∞ ∞ 3 ABE 5, E 9, B 6, E ∞ ∞ 4 ABEG 9, B 6, E 9, G ∞ 5 ABEGF 9, B 8, F ∞ 6 ABEGFH 9, B 7 ABEGFHC 8 ABEGFHCD 11/27/2020 10, H EEC-484/584: Computer Networks Wenbing Zhao
Computation Results C B E A F H G Routing Table in A Destination B C D E F G H 11/27/2020 D link (A, B) (A, B) EEC-484/584: Computer Networks Wenbing Zhao
Dijkstra’s Algorithm: Exercise n Given the subnet shown below, using the Dijkstra’s Algorithm, determine the shortest path tree from node u and its routing table 5 2 u 2 1 11/27/2020 v x 3 w 3 1 5 z 1 y EEC-484/584: Computer Networks 2 Wenbing Zhao
Distance Vector Routing n n Also called Bellman-Ford or Ford-Fulkerson Each router maintains a table, giving best known distance to each destination and which line to use to get there q q Table is updated by exchanging info with neighbors Table contains one entry for each router in network with n n q Preferred outgoing line to that destination Estimate of time or distance to that destination Once every T msec, router sends to each neighbor a list of estimated delays to each destination and receives same from those neighbors 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing: How each entry is updated A d(A, Y) Y d(Y, Z) d(A, X) X At router A, for Z Compute d(A, X) + d(X, Z) and d(A, Y) + d(Y, Z), take minimum d(X, Z) Z d(A, Z) = min {d(A, v) + d(v, Z) } where min is taken over all neighbors v of A 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
from x 0 2 7 y ∞∞ ∞ z ∞∞ ∞ node y table cost to x y z d(x, z) = min{d(x, y) + d(y, z), d(x, z) + d(z, z)} = min{2+1 , 7+0} = 3 x 0 2 3 y 2 0 1 z 7 1 0 x from x ∞ ∞ ∞ y 2 0 1 z ∞∞ ∞ node z table cost to x y z from d(x, y) = min{d(x, y) + d(y, y), d(x, z) + d(z, y)} = min{2+0 , 7+1} = 2 node x table cost to x y z x ∞∞ ∞ y ∞∞ ∞ z 71 0 11/27/2020 2 y 7 1 z Each node keeps track of the following info: 1. Its own distance vector: least-cost to each of other routers 2. Each of its neighbor’s distance vector received most recently If there is a change in distance vector, a node sends the update to all its neighbors time EEC-484/584: Computer Networks Wenbing Zhao
11/27/2020 from from from d(x, z) = min{d(x, y) + d(x, y) = min{d(x, y) + d(y, y), d(x, z) + d(z, y)} d(y, z), d(x, z) + d(z, z)} = min{2+0 , 7+1} = 2 = min{2+1 , 7+0} = 3 node x table cost to x y z x 0 2 7 x 0 2 3 y ∞∞ ∞ y 2 0 1 z 7 1 0 z ∞∞ ∞ z 3 1 0 node y table cost to x y z y x y z 2 1 x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z y 2 0 1 7 y 2 0 1 z ∞∞ ∞ z 7 1 0 z 3 1 0 node z table cost to x y z x 0 2 7 x 0 2 3 x ∞∞ ∞ y 2 0 1 y ∞∞ ∞ z 3 1 0 z 71 0 time EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing n n n Distance from A to B 12 ms, to C 25 ms, to D 40 ms, to G 18 ms Distance from J to A 8 ms, to I 10 ms, to H 12 ms, to K 6 ms Distance from J to A to G 8+18 = 26 ms to I to G 10+31 = 41 ms to H to G 12+6=18 ms to K to G 6+31=37 ms 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing n n n Good news travels fast Bad news travels slow Count to infinity problem: Takes too long to converge upon router failure × Routers’ knowledge about the cost to A 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Hierarchical Routing n Problem: Bigger network => bigger routing table q n Use hierarchical structure to solve the problem q q n As network size increases, more router memory used to store routing table, more time to process routing tables, more bandwidth to transmit states reports Regions: router knows details of how to route packets within its region, does not know internals of other regions Clusters of regions, zones of clusters, groups of zones Tradeoff: savings in memory space may result in longer path 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing: Exercise n Consider the subnet shown below. Distance vector routing is used, and the following vectors have just come in to router C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12, 6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The measured delays to B, D, and E, are 6, 3, and 5, respectively. What is C's new routing table? Give both the outgoing line to use and the expected delay. 11/27/2020 EEC-484/584: Computer Networks Wenbing Zhao
- Slides: 32