1 / 41

Network Layer Lecture 10 Imran Ahmed University of Management & Technology

Network Layer Lecture 10 Imran Ahmed University of Management & Technology. Agenda. Introduction & Network layer functions Routing principles Hierarchical routing The Internet protocol (IP) Connectivity device - Router What’s inside a router Summary.

Download Presentation

Network Layer Lecture 10 Imran Ahmed University of Management & Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Layer Lecture 10 Imran Ahmed University of Management & Technology

  2. Agenda • Introduction & Network layer functions • Routing principles • Hierarchical routing • The Internet protocol (IP) • Connectivity device - Router • What’s inside a router • Summary

  3. Transport segment from sending to receiving host. 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. 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 application transport network data link physical application transport network data link physical Network layer

  4. Key Network-Layer Functions • Forwarding: Move packets from router’s input to appropriate router output. • Routing: Determine route taken by packets from source to destination. • Routing algorithms

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

  6. Host, router network layer functions: • ICMP protocol • error reporting • router “signaling” • IP protocol • addressing conventions • datagram format • packet handling conventions • Routing protocols • path selection • RIP, OSPF, BGP forwarding table The Internet Network layer Transport layer: TCP, UDP Network layer Link layer physical layer

  7. Agenda • Introduction & Network layer functions • Routing principles • Hierarchical routing • The Internet protocol (IP) • Connectivity device - Router • What’s inside a router

  8. IP Packet Delivery • Two Processes are required to accomplish IP packet delivery, namely the Routing Process and the Forwarding Process • Routing is the process of discovering and selecting the path to the destination according to some metrics. This is a layer 3 functionality. • Forwarding is the process of inserting the IP packet into a Layer-2 frame and forwarding the frame to the next hop (which could be the destination host or another intermediate router). This is a layer 2/layer 3 functionality.

  9. Routing and Forwarding Control plane: run routing protocols: (RIP, OSPF, BGP) Data plane:forwarding packets from incoming to outgoing link

  10. Routing Tables • All IP packet delivery starts with a router table lookup. • Every host/router that is part of the TCP/IP network has a routing table. • Routing tables are created either statically or dynamically.

  11. Typical Components of Routing Tables • Routing Tables are built up by the routing algorithms. They generally consist of: • Destination Network Address: The network portion of the IP address for the destination network. • Subnet Mask: used to distinguish the network address from the host address. • The IP address of the next hop: to which the interface forwards the IP packet for delivery. • The Interface: with which the route is associated.

  12. Forwarding Tables • After the routing lookup is completed and the next hop is determined, The IP packet is forwarded according to a local or remote delivery models. • Local delivery model is when the destination and the host are on the same local network. In this case, the IP packet is inserted into a MAC-frame which is forwarded directly to the destination. • Remote delivery model is when the destination and the host are on different networks. In this case, the IP packet is inserted into a Layer-2 frame which is forwarded to the next hop router.

  13. Static Routing Tables are entered manually. Strengths of Static Routing: Ease of use Reliability Control Security Efficiency Weaknesses of Static Routing: Not Scalable Not adaptable to link failures Dynamic Routing Tables are created through the exchange of information between routers on the availability and status of the networks to which an individual router is connected to. Two Types: Distance Vector Protocols Link State Protocols Static v.s. Dynamic Routing

  14. Overview Routing Protocols Routing Algorithm Routing protocol

  15. Routing Metrics • Routing metrics are used by dynamic routing protocols to establish preference for a particular route. • Goal of routing metrics is to provide the capability to the routing protocol to support Route Diversity and Load Balancing. • Most Common routing metrics include: • Hop Count (# of hops) • Bandwidth/Throughput (maximum throughput) • Load (actual usage) • Delay (shortest delay) • Reliability • Cost

  16. Distance Vector Routing Protocols • Distance Vector (DV) Protocols • Based on an algorithm by Bellman-Ford • Each router on the network compiles a list of the networks it can reach (in the form of a distance vector) and exchange this list with its neighboringrouters only. • Upon receiving vectors from each of its neighbors, the router computes its own distanceto each neighbor. • Then, for every network X, router finds that neighbor who is closer to X than to any other neighbor. Router updates its cost to X. After doing this for all X, router goes to the first step.

  17. Distance Table data structures Each node has its own routing table Row for each possible destination Column for each directly-attached neighbor to node e.g., in node X, for dest. Y via neighbor Z : distance from X to Y, via Z as next hop X = D (Y,Z) Z c(X,Z) + min {D (Y,w)} = w Distance Vector Routing Algorithm

  18. Distance Vector Algorithm: At all nodes, X: 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infty /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w

  19. Distance Vector Algorithm (cont.): 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever X X X X X

  20. Each local iteration caused by: Local link cost change Message from neighbor: its least cost path change from neighbor Each node notifies neighbors only when its least cost path to any destination changes neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Distance Vector Routing: overview Each node:

  21. 1 Distance to node B C Info at node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 ~ 2 0 Example: Initial Distances

  22. Router E receives Router D Table 1 Distance to node B C Info at node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 ~ 2 0

  23. 1 Distance to node B C Info at node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E 4 E 1 8 2 0 Router E updates cost to Router C

  24. 1 Distance to node B C Info at node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0 Router A receives Router B Table

  25. 1 Distance to node B C Info at node A B C D E 7 8 0 7 ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0 Router A updates Cost to Router C

  26. 1 Distance to node B C Info at node A B C D E 7 0 7 8 ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0 Router A receives Router E Table

  27. 1 Distance to node B C Info at node A B C D E 7 5 3 0 7 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0 Router A updates Costs to Routers C&D

  28. 1 Distance to node B C Info at node A B C D E 7 0 6 5 3 1 A 8 2 B A 6 0 1 3 5 C 5 1 0 2 4 1 2 D 3 3 2 0 2 D E E 1 5 4 2 0 Final Distances

  29. 1 Distance to node B C Info at node A B C D E 7 0 7 8 10 1 A 8 2 B 7 0 1 3 8 A C 8 1 0 2 9 1 2 D 10 3 2 0 11 D E E 1 8 9 11 0 Final Distances after a Link failure

  30. Characteristics of D.V. Routing Protocols • Periodic Updates: Updates to the routing tables are sent at the end of a certain time period. A typical value is 30 seconds. • Triggered Updates: If a metric changes on a link, a router immediately sends out an update without waiting for the end of the update period. • Full Routing Table Update: Most distance vector routing protocol send their neighbors the entire routing table (not only entries which change). • Route invalidation timers: Routing table entries are invalid if they are not refreshed. A typical value is to invalidate an entry if no update is received after 3-6 update periods.

  31. Link State Routing Protocols • Link-State (LS) Protocols • Based on an algorithm by Dijkstra • Each router on the network is assumed to know the state of the links to all its neighbors (Cost, Operating Status, Bandwidth, Delay, etc…). • Each router will disseminate (via reliable flooding of link state packets, LSPs) the information about its link states to all routers in the network. • In this case, every router will have enough information to build a complete map of the network and therefore is able to construct a Shortest Path Spanning Tree from itself to every other router.

  32. Link State Packets • The link state packets consist of the following information: • The addressof the node creating the LSP. • A list of directly connected neighbors to that node with the cost of the link to each neighbor. • A sequence number to make sure it is the most recent one. • A time-to-live to insure that an LSP doesn’t circulate indefinitely. • A node (router) will only send an LSP if there is a failure (change of status) to some of its links or if a timer expires.

  33. Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

  34. Dijkstra Algorithm • Notations: • C(i,j) = link cost from node I to j. Cost infinite, if not direct neighbors. • D(v) = current value of cost of path from source to dest. V. • P(v) = predecessor node along path from source to v, that is neighbor of v. • N = set of nodes whose least cost path definitely known.

  35. 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example 5 1

  36. 5 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example (Continued) 1

  37. 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example (Continued) 1

  38. 5 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example (Continued) 1

  39. 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example (Continued) 5 1

  40. 3 B C 5 2 1 A 2 F 3 1 2 D E B C D E F Example (Continued) 5 1

  41. Message complexity LS: with n nodes, E links, O(nE) msgs sent each DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n**2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node’s table used by others error propagate thru network Comparison of LS and DV algorithms

More Related