Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 421 Computer Networks. Chapter 4 Network Layer Thanks to you All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Computer.

Similar presentations


Presentation on theme: "CSE 421 Computer Networks. Chapter 4 Network Layer Thanks to you All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Computer."— Presentation transcript:

1 CSE 421 Computer Networks

2 Chapter 4 Network Layer Thanks to you All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 6 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2012.

3 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

4 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into packets r network layer protocols in every host, router r router examines header fields in all IP packets passing through it r on rcving side, delivers segments to transport layer application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical

5 Two Key Network-Layer Functions r forwarding: move packets from router’s input to appropriate router output r routing: determine route taken by packets from source to dest. m routing algorithms analogy: r routing: process of planning trip from source to dest r forwarding: process of getting through single interchange

6 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 32213221 Interplay between routing and forwarding

7 Network Layer4-7 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

8 Network Layer4-8 Network layer connection and connection-less service r Datagram network => network-layer connectionless service r VC network => network-layer connection service m analogous to the transport-layer services, but: m service: host-to-host m no choice: network provides one or the other m implementation: in network core

9 Network Layer4-9 Virtual circuits: signaling protocols r used to setup, maintain teardown VC r used in ATM, frame-relay, X.25 r not used in today’s Internet application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data

10 Network Layer4-10 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection” r packets forwarded using destination host address m packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data

11 Network Layer4-11 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

12 Network Layer4-12 Router Functions: r Run routing algorithms/protocol (RIP, OSPF, BGP) r Forwarding datagrams from incoming to outgoing link

13 Network Layer4-13 Input Port Functions Decentralized switching: r given datagram dest., lookup output port using forwarding table in input port memory r goal: complete input port processing at ‘line speed’ r queuing: if datagrams arrive faster than forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5

14 Network Layer4-14 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP

15 Routing Algorithms r Given a set of routers and links connecting the routers. r Routing algorithm finds a “good” path from the source and destination router. r Good path = Least cost path

16 Routing Algorithm classification Global or Decentralized Global: r all routers have complete topology and link cost info r “link state” algorithms Decentralized: r router knows physically-connected neighbors, link costs to neighbors r iterative process of computation, exchange of info with neighbors r “distance vector” algorithms

17 Routing Algorithm classification Static or dynamic? Static: r routes change slowly over time r Manually configured Dynamic: r routes change more quickly m in response to link cost changes

18 Routing on a Graph r Essentially a graph theory problem m Network is a directed graph; routers are vertices r Find “best” path between every pair of vertices m In the simplest case, best path is the shortest path Network Layer4-18

19 Network Layer4-19 u y x wv z 2 2 1 3 1 1 2 5 3 5 Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Graph abstraction

20 Network Layer4-20 Graph abstraction: costs u y x wv z 2 2 1 3 1 1 2 5 3 5 c(x,x’) = cost of link (x,x’) - e.g., c(w,z) = 5 Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path

21 Distance Vector Algorithm

22 Network Layer4-22 Distance Vector Algorithm Distributed: r each node receives info from one or more of its directly connected neighbors r Performs a calculations r Distributes the results back to its neighbors Iterative r Process continues until no more info to exchange Asynchronous: r All nodes operate independently

23 Network Layer4-23 Distance Vector Algorithm

24 4-24 Distance Vector Algorithm Bellman-Ford Equation Algorithm  computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph.  Distributed route computation using only neighbor’s info

25 Objective: d x (y) := cost of least-cost path from x to y Then where min is taken over all neighbors v of x Network Layer4-25 d x (y) = min v {c(x,v) + d v (y) } Distance Vector Algorithm

26 r c(x,v)= cost for direct link from x to v Node x maintains costs of direct links c(x,v). r D x (y)= estimate of least cost from x to y Node x maintains distance vector D x = [D x (y): y є N ] r Node x maintains its neighbor’s distance vectors For each neighbor v, x maintains Dv= [Dv(y): y єN ] Network Layer4-26 Distance Vector Algorithm

27 Network Layer4-27 Bellman-Ford example from u to z u y x wv z 2 2 1 3 1 1 2 5 3 5 Clearly, d v (z) = 5, d x (z) = 3, d w (z) = 3 d u (z) = min { c(u,v) + d v (z), c(u,x) + d x (z), c(u,w) + d w (z) } = min {2 + 5, 1 + 3, 5 + 3} = 4  Node that achieves minimum is the next hop in shortest path to a destination,  To go to z from u, x in the next hop in the forwarding table B-F equation says: U has 3 neighbors v,x and w

28 Network Layer4-28 Distance vector algorithm Basic idea: r Each node periodically sends its own distance vector estimate to neighbors r When a node x receives new DV estimate from neighbor; r It updates its own DV using B-F equation:

29 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time x z 1 2 7 y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 32

30 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time x z 1 2 7 y node x table node y table node z table Dy(x) = min{c(y,x) + Dx(x), c(y,z) + D z (x)} = min{2+0, 1+7} = 2 Dy(z) = min{c(y,x) + Dx(z), c(y,z) + D z (z)} = min{2+7, 1+0} = 1 32 x y z x y z 0 2 7 1 7 1 0 2 0

31 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time x z 1 2 7 y node x table node y table node z table Dz(x) = min{c(z,x) + Dx(x), c(z,y) + Dy(x)} = min{7+0, 1+2} = 3 Dz(y) = min{c(z,x) + Dx(y), c(z,y) + Dy(y)} = min{7+2, 1+0} = 1 32 x y z x y z 0 2 7 1 7 1 0 2 0 x y z x y z 0 2 7 from 2 0 1 from 31 0

32 x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z 0 2 7 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 7 from cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 2 0 1 7 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 time x z 1 2 7 y node x table node y table node z table

33 Operation of Distance Vector r Periodic Updates: m Periodically broadcast the entire routing table to each of its neighbors (RIP – every 30 seconds). –Inefficient m Router is only aware of the: –Network addresses of its –Network addresses of its own interfaces. –Network addresses of the. –Network addresses of the neighbors running the same routing protocol.

34 Operation of Distance Vector r Periodic Updates: R1 Update Timer expires Neighbour of R1 R1 is unaware of R3 and its networks Updates sent. Broadcast!

35 Distance Vector Routing Protocols Network Discovery

36 Cold Start r Network Discovery: m Is part of the process of the routing protocol algorithm that enables routers to learn about remote networks for the first time.

37 Cold Start r When a router powers up: m Knows nothing about the network topology. m Knows only the information saved in NVRAM. m Sends updates about its known networks out all ports.

38 Initial Exchange of Routing Information r Sends an update about network 10.1.0.0 out the Serial 0/0/0 interface with a metric of 1. r Sends an update about network 10.2.0.0 out the Fa0/0 interface with a metric of 1. 10.1.0.0

39 Initial Exchange of Routing Information 10.1.0.0 10.3.0.010.2.0.0

40 10.1.0.0 10.3.0.010.2.0.0 10.4.0.0

41 R1 Receives the update from R2 about network 10.3.0.0 and adds it to its routing table. R1 Receives the update from R2 about network 10.3.0.0 and adds it to its routing table. R3 Receives the update from R2 about network 10.2.0.0 and adds it to its routing table. R3 Receives the update from R2 about network 10.2.0.0 and adds it to its routing table. 10.3.0.0 10.2.0.0

42 Initial Exchange of Routing Information R2 Receives the update from R1 about network 10.1.0.0 and adds it to its routing table. R2 Receives the update from R1 about network 10.1.0.0 and adds it to its routing table. R2 Receives the update from R3 about network 10.4.0.0 and adds it to its routing table. R2 Receives the update from R3 about network 10.4.0.0 and adds it to its routing table. 10.1.0.010.4.0.0

43 Initial Exchange of Routing Information r First round of update exchanges: Each router knows about the connected networks of its directly connected neighbors.

44 Next Exchange of Routing Information r Sends an update about network 10.1.0.0 out the S0/0/0 interface with a metric of 1 - AGAIN! r When R2 receives the update, there is no change in information so the update is ignored. 10.1.0.0

45 Next Exchange of Routing Information r Sends an update about networks 10.3.0.0 with a metric of 1 and 10.4.0.0 with a metric of 2 out the Serial 0/0/0 interface. r Similarly sends updates about networks 10.1.0.0 with a metric of 2 and 10.2.0.0 with a metric of 1 out the Serial 0/0/1 interface. 10.4.0.010.3.0.010.2.0.010.1.0.0 NEW NEW

46 Initial Exchange of Routing Information 10.4.0.0 r Sends an update about network 10.4.0.0 out the S0/0/0 interface with a metric of 1 - AGAIN! r When R2 receives the update, there is no change in information so the update is ignored.

47 Next Exchange of Routing Information R1 receives an update from R2 about network 10.3.0.0 and there is no change – update ignored. R1 receives an update from R2 about network 10.3.0.0 and there is no change – update ignored. R1 receives an update from R2 about network 10.4.0.0 (new) and adds it to its routing table. R1 receives an update from R2 about network 10.4.0.0 (new) and adds it to its routing table. 10.4.0.010.3.0.0

48 Next Exchange of Routing Information R3 receives an update from R2 about network 10.2.0.0 and there is no change – update ignored. R3 receives an update from R2 about network 10.2.0.0 and there is no change – update ignored. R3 receives an update from R2 about network 10.1.0.0 (new) and adds it to its routing table. R3 receives an update from R2 about network 10.1.0.0 (new) and adds it to its routing table. 10.2.0.010.1.0.0

49 Next Exchange of Routing Information The network has CONVERGED! The network has CONVERGED! All routers now know about all of the networks attached to all of their neighbouring routers. All routers now know about all of the networks attached to all of their neighbouring routers.

50 Convergence r The amount of time it takes for a network to converge is directly proportional to the size of that network. r Routing protocols are compared based on how fast they can propagate this information - their speed to convergence. r A network is not completely operable until it has converged. m Network administrators prefer routing protocols with shorter convergence times.

51 Network Layer4-51 Node c ab c df e c53 0 23 1 Node e ab c df e e∞∞ 1 12 0 Node f ab c df e f∞∞ 5 ∞0 2 For the above figure no. 1, the table represents the routing table of node “c”, “f” and “e” at a certain instant. Node f receives updates from node c and node e only. All routers are running Distance Vector algorithm. What will be the status of the routing table of node f be after receiving the updates by node c and e as shown above? (Use Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} for explaining your answer)


Download ppt "CSE 421 Computer Networks. Chapter 4 Network Layer Thanks to you All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Computer."

Similar presentations


Ads by Google