Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Network Layer Chapter 5. Routing: Determines the path of a message from source to destination. Path is indirect (not broadcast network, ring, fully.

Similar presentations


Presentation on theme: "The Network Layer Chapter 5. Routing: Determines the path of a message from source to destination. Path is indirect (not broadcast network, ring, fully."— Presentation transcript:

1 The Network Layer Chapter 5

2 Routing: Determines the path of a message from source to destination. Path is indirect (not broadcast network, ring, fully meshed network). Goals: Low transfer time: Few nodes along path Lowly utilized links/nodes Preferably links of high throughput Even distribution of utilization if alternative paths exist Adaptability to changes: Load change Crashes, repair Network configuration (e.g. mobile network) Simple, fair, robust algorithms with low information need Routing Algorithms

3 Characteristics: Exchanged Information: About nodes, links, transfer time, throughput, optimal routes, … Cost function for optimality: Dependent on nodes, links, waiting time, … Non-adaptive(or static) algorithm: Does not consider changes of load/availability Adaptive (or dynamic) algorithm : Considers changes of load/availability Centralized algorithm: Some node(s) run(s) the algorithm Decentralized algorithm: Isolated/collective (distributed) Restart of algorithm: Periodically/event-driven Routing Algorithms

4 Routing Non-adaptive Adaptive Isolated Centralized (or offline complete information) Flooding Centralized Isolated Collective Decentralized Periodic Link State Routing Event-driven (or periodic) Periodic Routing Center In practice: Hierarchical routing e.g. non-adaptive centralized at country level and beneath another algorithm Fixed routing tables Multi-path routing Hot Potato Distance Vector Routing Event-driven

5 Shortest Path Routing (Dijkstra Algorithm) (C, , -1) (A, , -1) (B, , -1) (E, , -1) (F, , -1) (D, , -1) (H, , -1) (G, , -1) Input: Network (of routers) with link weights.. Output: shortest path between Source and Destination Initialization: Permanent nodes/tentative nodes Steps: Let X be the last permanent node For all Y in neighbor(X) If XY yields “better” path from Source to Y then Update Y.Opt and Y.P Find the tentative node Min with minimum Opt value Set X to Min If X = Destination then Stop Else Goto first Step Print path backwards using the P values O(n 2 ) algorithm Data structure: (N: node, Opt: optimal distance to source, P: previous optimal node) (B, , A) (G, 6, A) (B, , A) (E, , B) (C, , B) (E, , B) (F, , E) (G, 5, E) (H, , G) (F, , E) (H, , F) (C, , F) (H, , F) (D, , H) (C, , F) (D, , H) Source: Destination:

6 Routing Algorithms Fixed Routing Tables: After each network reconfiguration/change all routing tables are centrally or offline computed and sent to all nodes Advantage: Optimal routing tables, network is not used for routing traffice Disadvantage: Not robust against crashes or load changes Rather acceptable in the version of multi-path routing: For each packet a random number in [0, 1] is generated, which is used to select the neighbor to which the pack is sent, Example (routing table in node Z): TargetNeighbor XNeighbor Y A [0, 70%[ [70%, 1[ B [0, 60%[ [60%, 1[ Alternatives paths are used for: Dividing traffic (no probabilities): e.g. even utilization, divide depending on packet type (e.g. file transfer uses satellite, video uses ATM) Fault tolerance: crash of neighbor or its link means the use of another (good if alternative paths are disjoint) Multi-path routing is a general method not dependent on fixed routing tables

7 Routing Algorithms Flooding : Simple non-adaptive, isolated, non-informed algorithm Each router forwards each packet to all its neighbors (except source neighbor) To avoid packets circulating forever: A hop counter is initialized by the sender to the maximum path length (in hops) and is decremented in each router. Any packet is destroyed, if its hop counter reaches 0. A time stamp is initialized by the sender to the expected transfer time of the packet. Any packet is destroyed, if its delay is greater than its time stamp. Each router remembers (using a per source sequence number) which packets have been received before, and destroys duplicates Flooding has the advantage that it finds the shortest path to the destination, however, the search lasts a long time (since network is full). More important: If there is a path, then flooding will find it. In practice good if: Extreme fault tolerance is needed (e.g. military area) Topology is highly variable (e.g. wireless networks) For initialization of routing tables For broadcast (e.g. of time, updates)

8 Routing Algorithms Hot Potato: Fully isolated In each router, the packet is forwarded along the link with the shortest queue. (router tries to get rid of packet as fast as possible – hot potato) Not reliable, packet does not always reach destination Distance Vector Routing: Isolated with some information from neighbors Bad but historically interesting algorithm (old ARPA routing) Each router computes for each destination the optimal neighbor using periodically exchanged messages among neighbors.  Exchanged information about ALL nodes but among neighbors ONLY Problems: High exchanged information volume Information disseminates slowly in the network Count-to-infinity problem (see below)

9 Routing Algorithms Example for Distance Vector Routing: Distances: (A, J) = 8, (I, J) = 10, (K, J) = 6, (H, J) = 12 Old routing tables are not used (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

10 Routing Algorithms Distance Vector Routing: Count-to-Infinity Problem Good news propagate fast Bad news propagate very slowly Example: (a)Good news: A is up (and was down): propagation speed 1 hop / period (b)Bad news: A is down (and was up): very slow propagation Means router thinks that A is down (  ) 3 because C says 2 (+1) 4 because C’s neighbors are 3 (+1) rows rows: number of exchanged messages until all realize that A is down. rows should be bounded up by e.g. maximum path length in the network +1

11 Routing Algorithms Link State Routing: Collective dynamic routing algorithm New ARPA routing algorithm Well-used in practice Each router computes for each destination the optimal neighbor using periodically/event-driven exchanged messages among all routers.  Exchanged information about neighbors ONLY but among ALL routers Each router must do the following: Discover its neighbors, learn their network address. Measure the delay or cost to each of its neighbors. Construct a packet telling all it has just learned. Send this packet to all other routers. Compute the shortest path to every other router.

12 Routing Algorithms Distributing Link State Packets: Flooding Duplicates detected using sequence numbers Age field is used to invalidate information after some time (e.g. if source router X is down, age will become eventually 0 and entry of X in other routers is deleted) Computing New Routes: Based on Dijkstra algorithm (a)Subnet. (b) Packets exchanged between routers. Example for Link State Routing: Packet format e.g. (Source router, Sequence number, Age, Data about neighbors)

13 Routing for Mobile Hosts A WAN to which LANs, MANs, and wireless cells are attached. Registration with foreign agent (if new host enters its domain): Periodically: FA  all (in LAN): “I am here” or MH  all: “Is there a FA” (after migration) MH  FA: Home address (HAddr), current layer-2 address (CAddr), Security data (SData) FA  HA: “one of your MH is here”, FA address, Sdata (to convince HA that FA is not lying) HA  FA: “Ok” if Sdata acceptable “No” if not FA  MH: “You are (not) registered” (FA remembers Caddr of MH in a table) Mobile Hosts: Migratory host: stationary ones that move from time to time (e.g. plug in in another LAN) Roaming host: able to maintain connections while moving (e.g. laptops in a wireless LAN) HA FA MH

14 Routing for Mobile Hosts Packet routing for mobile users. Sender Home Agent Foreign Agent A sender connecting to a mobile host: 1.Sender  HA: packet1 (HA intercepts any packet destined to MH) 2.HA  FA: [header1, packet1] (Tunneling: packet1 is in payload of a new packet!) 3.HA  Sender: “Please tunnel subsequent packets to FA” 4.Sender  FA: [header2, packet2], …

15 Routing in Ad Hoc Networks Unlike routing for mobile hosts, the routing in ad hoc networks does not assume that the routers are fixed (in the WAN). Everything can move (hosts & routers); in other words: every node is router (and host) Example for mobile routers: Military vehicles on battle field (no infrastructure) A fleet of ships at sea (all moving all the time) Emergency works at earthquake (infrastructure destroyed) A gathering of people with notebook computers Traditional routing algorithms cannot be applied, since: No fixed topology: No fixed and no known neighbors No fixed mapping network address (e.g. IP address) to location … AODV (Ad hoc On-demand Distance Vector) routing protocol: Main idea (see textbook for details): A sender that does not know how to reach a destination generates a ROUTE REQUEST packet that is broadcast hop by hop in the network until it reaches the destination or a node that knows how to get to destination. Each intermediate node memorizes where the request came from (to build the backward path). Destination (or intermediate node) replies by ROUTE REPLY packet that goes back to the sender through the memorized backward path.

16 Routing in Ad Hoc Networks A wants to send to I: (a) A broadcasts ROUTE REQUEST (only B and D are in the range of A's broadcast). (b) B and D receive packet; since they do not know how to get to I, they further broadcast the packet and memorize how to get to A (backward arrow). (c) New receivers of packet are C, F, and G, and they broadcast the packet further. (d) Among the new receivers is I, the destination, thus I sends a unicast ROUTE REPLY to G. Each node on the reverse path updates its tables and unicasts packet further in direction of source.

17 Routing in Ad Hoc Networks (a) D's routing table before G goes down. (b) The graph after G has gone down. Failure (and out of range) detection: To cope with nodes that fail or go out of the range of their neighbors the protocol includes the exchange of periodic packets. Consider node D if G goes down: D detects failure because G does not react. For each destination, D maintains in a routing table the set of predecessors (active neighbors) that recently have had traffic with that destination (here e.g. I has been recently destination for traffic from predecessors A, B using successor G) D finds out that G is used for traffic destined to {E, G, I} and this traffic comes from {A, B}. Thus, D sends a packet to A and B saying that G is no longer reachable (through D).

18 Routing in Peer-to-Peer Networks Users (or nodes) in a P2P Network: Are symmetric (no hierarchy or central control). Do not know each other. Want to share resources (public domain programs, videos, music, …). Know names of resources (e.g. zipX.Y). Do not know where a resource of specific name is stored. Their number is large if not very large ( e.g. >10 millions). Example (see figure): B A E G F D C Zip1.0 Acrobat 1.4 Zip2.0 Acrobat 1.4 VideoX Acrobat 2.0 Song1 Song2 VideoY Java1.4 GameA Java1.3 Logo3.4 Search Java1.4 Naive solution: Each node has a routing table that includes addresses of all nodes in the network. Node B asks then all nodes sequentially. Problems: 1)Search is linear (inefficient) 2)Routing table too large 3)Violation of 2 nd requirement (of above)

19 Routing in Peer-to-Peer Networks Routing Protocol in Chord: Let n be the number of nodes in the network. Each node address (e.g. IP address) is hashed using SHA-1 algorithm in order to get an m-bit node ID (i.e. node ID = hash(IP address)) Each resource name is also hashed in the same manner in order to get a m-bit key (i.e. key = hash(resource_name)) The 2 m node IDs arranged in ascending order in a circle (m=160 in current implementation) Node ID name space = key name space (name both NS e.g. NS = {0, …, 2 m –1}) Since n << 2 m the node ID space includes (many) IDs without actual nodes assigned to them. Define the total function successor: NS  NS, where: successor(x) = ID of the first actual node following x (in the circle) and the partial function IP: NS  NS of IP, where: IP(x) = IP address of x if x corresponds to an actual node, and undefined otherwise Insertion of a new resource with name name at node x: Store (name, IP(x)) in node with address IP(successor(hash(name))) Search of resource with name name from node y: Get (name, IP(x)) from node with address IP(successor(hash(name))) Contact x using IP(x) to get the resource with name name Problem: How to find IP(x)?  Each node maintains a (small) routing table (called finger table in Chord).

20 Routing in Peer-to-Peer Networks (a) m = 32 node identifiers arranged in a circle (shaded ones correspond to actual machines) (b) Examples of the finger tables. 1) Finger table FT at node x: FT[i] = (id[i], ip[i] ), where: id[i] = x + 2 i (mod 2 m ) and ip[i] = IP(successor(id[i])) and 0 <= i < m 2) Also held by x: (successor(x), IP(successor(x))) 3) FT size small e.g. m=160 (or log(n)) 4) IDs in FT increase exponentially, hence search is O(log(n)) 5) Examples for search at node 1: a) key=3: since 1 < 3 < successor(1)=4, node 1 contacts IP(4) directly. b) key=14: 1 gets the closest predecessor of 14 from FT (9) and asks IP(successor(9)) = IP(12) to search further. Node 12 sees that 12 < 14 < successor(12)=15 and returns IP(15) c) key=16: 1 asks 12, 12 asks 15, and node 15 returns IP(20), since 15 < 16 < 20

21 Congestion Congestion (traffic jam) occurs because: Queues build-ups in links (e.g. bridges) and routers. Loss (destruction) of packets because of finite buffers for queues  even with infinite buffers problem still existent since packet will time out and will be resent Slow processors in routers. Low-bandwidth lines (connected to higher ones)  Problem is very complex because of different factors Congestion control vs flow control: Congestion control is a global issue that concerns measures controlling end systems, routers, and links in the network with the aim of making the network able to carry the offered traffic. Flow control operates only locally between a pair of (adjacent) sender and receiver and tries to protect slow receivers from being overwhelmed with messages. Principles of congestion control: Open-loop control: constructively avoid congestion by good design without relying on network state Closed-loop control: Monitoring network state (e.g. queue length, packet transfer times, lost packets,..) Passing information to places where actions may be taken (e.g. choke packets to sources) Adjusting system to end congestion (e.g. reduce sending rate of host)

22 Congestion When too much traffic is offered, congestion sets in and performance degrades sharply. (e.g. because of finite buffers, packet loss, congestion signals)

23 Congestion Control in Virtual-Circuit Subnets (a) A congested subnet. (b) A redrawn subnet, eliminates congestion and a virtual circuit from A to B. Admission control: If network congested, reject new connection requests until problem is resolved. Avoid congested areas: Connection from A to B normally goes through congested areas but routers decide for another (longer but congestion-free) path. Service level agreement (SLA): Sender has a “contract” with network, which specifies traffic shape, volume etc. Network reserves resources for sending host (e.g. at connection time) to avoid congestion.  tends to waste resources (and not to mention delay because of setup time)

24 Congestion Control in Datagram Subnets Warning bit in packet header: Routers should be able to detect congestion on their output links If e.g. output link utilization is above a threshold, router sets a warning bit in header. Receiver host (on transport layer) adds this bit to the ACK (going back to sender). Sender monitors amount of ACKs (per time unit) that have the warning bit set. Sender keeps decreasing its rate until the monitored amount decreases (no router in trouble). Only then sender is allowed to increase traffic rate again.  used e.g. in Frame Relay Router-to-Sender choke packets: Idea: If in trouble, a router contacts sender directly (unlike above, where traffic goes first to receiver) If router detects congestion, it sends a choke packet to sender. Choke packet: Has a bit set (to avoid generating more choke packets on the way to sender), and it includes the destination (so that sender can identify the meant data stream). Sender then reduces its traffic to specified destination by a fixed amount (e.g. 10%) Sender ignores choke packets for that destination for a specified time (e.g. 60 sec) After time has expired, sender waits another time interval, if no choke packet arrives, sender increases its traffic, if some come sender reduces its traffic further.

25 Congestion Control in Datagram Subnets Problem with Router-to-Sender choke packets in high-bandwidth networks (see figure (a)): Router (D) may be far away from sender (A) (e.g. Toronto to Calgary)  Reaction is too slow Example: Choke packet needs 30 ms to arrive to sender. At a rate of 155 Mbps, ca. 4.6 Mb have been sent in these 30 ms. Even if sender immediately shuts down, network must deal with the poured 4.6 Mb! Hop-by-hop choke packets (see figure (b)): Idea: Immediate effect of choke packet on each hop it passes through on its way to the sender. +: better relief at congestion points (locally) - : More congestion in routers upstream for a while

26 Load Shedding If overwhelmed, routers start to throw packets away (a nicer word: load shedding) Policies of packet destruction: Random: Select a packet at random Milk: “New better than old” e.g. in a multimedia stream, it is better to discard an older packet and let a newer one live further. Wine: “Old better than new” e.g. in file transfer, discarding an older packet may mean its retransmission later. Thus, it is better to discard a newer one. Priority: Senders assign packets priorities, which are used by router to conduct discard policy. RED (Random Early Detection): Preventive method: Start discarding packets before congestion really happens. Packet selection (for discard) is done randomly No choke packet back to sender, but rather sender (transport layer) will time out (waiting for ACK from receiver) and will slow down and resend packet again.  Main assumption: timeout = packet loss (!= packet received incorrectly)  Ok for (reliable) fixed networks, but not suitable for wireless networks (which are in general less reliable)

27 Jitter Control Jitter: Variance of delay. Very important for multimedia applications. Example: Video on Demand (VoD) Buffering is done at the receiver to cope with the jitter problem. However, for interactive real-time applications like video conferencing, routers are responsible for buffering: If packet behind of schedule, router forwards it quickly. If packet ahead of schedule, router buffers it for a while, and forwards it later.

28 The Internet The Internet is an interconnected collection of many networks.

29 The Internet and OSI (again)

30 The IP Protocol The IPv4 (Internet Protocol) header. VER: version e.g. 4 (IPv4) HLEN: header length (in words = 4 bytes) Service type: e.g. priority, reliability, max. delay Total length: total length of the datagram (max.. 65,535) Identification: sequence number of fragment Flags: datagram fragmentation info (e.g. datagram cannot be fragmented, is last fragment, etc.) Time to live (TTL): # hops until datagram is discarded Protocol: upper-layer protocol (e.g. TCP, UDP, ICMP) Header checksum: checksum for header only Source IP address: 4 bytes source IP address Destination IP address: 4 bytes destination IP address Option: multiple of 4 bytes; see table below

31 The IP Protocol IP address format: Dotted decimal notation: Special IP addresses:

32 The IP Protocol Address ranges for the classes:

33 The IP Protocol Example network:

34 The IP Protocol Without subnets (2 hierarchy levels): With subnets (3 hierarchy levels): Router R1 knows how to forward to actual subnet (but rest of Internet sees still a flat site with Netid )

35 The IP Protocol Subnetting: Mask (is ANDed to IP address):

36 ICMP: Internet Control Message Protocol Main ICMP message types. 5-61

37 ARP: The Address Resolution Protocol

38 DHCP: Dynamic Host Configuration Protocol DHCP (replaced RARP: Reverse ARP). My physical address is A46EF45983AB. Does anyone out there know my IP address? Your IP address is

39 Receive datagram Header and checksum ok? Decrement TTL TTL > 0? Routing table Lookup Route found? Default route found? Send ICMP error message to sender Discard datagram Search MAC address in ARP table MAC address found? Modify datagram and forward it Send ARP datagram Write address mapping in ARP table ARP reply received? Yes No Yes No Yes No Yes No Typical Steps in an IP Router

40 IPv6 Main New Features (compared with IPv4): Has longer Addresses (16 bytes instead of 4 bytes) Leverages real-time traffic Leverages multicasting (broadcast, multicast, anycast) Supports resource reservation (Flow labels) Has fixed-length header with extension headers (instead of options) Supports automatic configuration (PnP) Supports security (authentication and encryption) Supports mobile hosts Is backward compatible (with IPv4) Is forward compatible (since extensible) Still not used (will take time) In meantime: island solutions NAT (Network Address Translation) to support more hosts (more IP addresses) Mobile IP to support mobile hosts IGMP (Internet Group Management Protocol) for multicasting RSVP (Resource reSerVation Protocol) for resource reservation …


Download ppt "The Network Layer Chapter 5. Routing: Determines the path of a message from source to destination. Path is indirect (not broadcast network, ring, fully."

Similar presentations


Ads by Google