Download presentation
Presentation is loading. Please wait.
1
CSS432 Routing Textbook Ch3.3
Prof. Athirai Irissappane CSS 432: Routing
2
What Is Routing? Forwarding vs Routing forwarding: routing:
To map a network # to an outgoing interface and some MAC information in a forwarding table. To send a packet to an interface as consulting a local and static forwarding table OSI Layer 2: data link level Implemented in specialized hardware (switch) routing: To build a dynamic routing table To update table contents in a dynamic and distributed fashion OSI Layer 3: network level (internet) Using complex distributed algorithms CSS 432: Routing
3
The University of Adelaide, School of Computer Science
3 January 2018 Routing Network as a Graph The basic problem of routing is to find the lowest-cost path between any two nodes Where the cost of a path equals the sum of the costs of all the edges that make up the path Chapter 2 — Instructions: Language of the Computer
4
The University of Adelaide, School of Computer Science
3 January 2018 Routing For a simple network, we can calculate all shortest paths and load them into some nonvolatile storage on each node. Such a static approach has several shortcomings It does not deal with node or link failures It does not consider the addition of new nodes or links It implies that edge costs cannot change What is the solution? Need a distributed and dynamic protocol Two main classes of protocols Distance Vector Link State Chapter 2 — Instructions: Language of the Computer
5
Distance Vector Each node maintains a set of triples (Destination, Cost, NextHop) Starting assumption is that each node knows the cost of the link to each of its directly connected neighbors An initial distance vector at node A Destination Cost Next hop B 1 C D ∞ - E F G CSS 432: Routing
6
The University of Adelaide, School of Computer Science
3 January 2018 Distance Vector Initial distances stored at each node (global view) Chapter 2 — Instructions: Language of the Computer
7
The University of Adelaide, School of Computer Science
3 January 2018 Distance Vector The distance vector routing algorithm is sometimes called as Bellman-Ford algorithm Every T seconds each router sends its distances to its neighbor who then updates their table based on the new information Problems include fast response to good news and slow response to bad news. Also too many messages to update Chapter 2 — Instructions: Language of the Computer
8
Distance Vector Exchange updates directly connected neighbors
periodically (on the order of several seconds) whenever table changes/ notices failure (called triggered update) Each update is a list of pairs (the routing table): (Destination, Cost) (and next hop) From B: (A, 1), (C, 1) From C: (A, 1), (B, 1), (D, 1) From E: (A, 1) From F: (A, 1), (G, 1) Update local table if receive a “better” route From B: (C,1) (C, 1, C) < (C, 2, B) From C: (D, 1) (D, ∞, - ) > (D, 2, C) From F: (G, 1) (G, ∞, - ) > (G, 2, F) Refresh existing routes; delete if they are expired Destination Cost Next hop B 1 C D 2 E F G CSS 432: Routing
9
The University of Adelaide, School of Computer Science
3 January 2018 Distance Vector F sends (G, 1) to A F can reach G with cost 1 A can reach F with cost 1 A can reach G with cost 2 (< infinity so update table) C sends (D, 1) to A C can reach D with cost 2 A can reach D with cost 2 (< infinity so update table) C sends (B,1) to A A can reach B with cost 2 (> 1 so do not update table) Chapter 2 — Instructions: Language of the Computer
10
The University of Adelaide, School of Computer Science
3 January 2018 Distance Vector Final distances stored at each node (global view – not known by the routers, who only know their row entry) Chapter 2 — Instructions: Language of the Computer
11
The University of Adelaide, School of Computer Science
3 January 2018 Distance Vector The routing table at each node stabilizes, i.e., become consistent, converges Updates from neighbors Periodically Triggered Node notices a link failure Receives an update from neighbors that causes a change in its routing table Chapter 2 — Instructions: Language of the Computer
12
Routing Loop ∞ Failure-recovering scenario
F detects the link to G has failed F sets distance to G to ∞ and sends an update to A A sets distance to G to ∞ A receives periodic update from C with a 2-hop path to G A sets distance to G to 3 and sends update to F F sets distance to G in 4 hops via A ∞ CSS 432: Routing
13
Count-to-infinity problem
The link from A to E fails (triggered/periodic update) A advertises (to neighbors) , (E, ∞) At same time, C does not know about E, as periodic update, advertises (E, 2) B decides it can reach E in 3 hops (via C) B receives (E, ∞) from A, (E, 2) from C B changes its Routing table (triggers update) B advertises (E, 3) A decides it can reach E in 4 hops (via B) A receives (E, 3) from B Routing table of A has changes (triggered update) A advertises (E, 4) C decides that it can reach E in 5 hops… Cycle goes on until cost get near to infinity A B Destination Cost Next hop B 1 C D 2 E F G Destination Cost Next hop A 1 C B D 2 E F G 3 4 ∞ B E 3 C To see the problem clearly, imagine a subnet connected like A–B–C–D–E–F, and let the metric between the routers be "number of jumps". Now suppose that A is taken offline. In the vector-update-process B notices that the route to A, which was distance 1, is down – B does not receive the vector update from A. The problem is, B also gets an update from C, and C is still not aware of the fact that A is down – so it tells B that A is only two jumps from C (C to B to A), which is false. Since B doesn't know that the path from C to A is through itself (B), it updates its table with the new value "B to A = 2 + 1". Later on, B forwards the update to C and due to the fact that A is reachable through B (From C's point of view), C decides to update its table to "C to A = 3 + 1". This slowly propagates through the network until it reaches infinity (in which case the algorithm corrects itself, due to the relaxation property of Bellman–Ford). Destination Cost Next hop A 1 B D E 2 F G C 5
14
Loop-Breaking Heuristics
Set infinity to 16 Scheme: Stop an infinity loop in 16. Problem: No more 16 hops Split horizon Scheme: Don’t send a neighbor the routing information learned from this neighbor. Ex. B includes (E, 2, A) and thus doesn’t send (E, 2) to A Split horizon with poison reverse Scheme: Send the routing information learned from this neighbor as setting hop count to ∞. Ex. B includes (E, 2, A) and thus sends (E, ∞, A) Problem: Its slow convergence speed for large number of nodes, works for 2 node case CSS 432: Routing
15
Routing Information Protocol (RIP)
Same as Distance Vector Routing (for graph model) RIP for internetwork Instead of cost of reaching other routers, it specifies cost of reaching networks E.g., Router C advertises to Router A It can reach Networks 2, 3 at cost 0. CSS 432: Routing
16
Routing Information Protocol (RIP)
frame header datagram heaader UDP header RIP Message Cmd: 1-6 1: request 2: reply Port: 520 Used by routed Advertisement: 30secs Table entry timeout: 3 mins. Deleted in 60secs Cmd Ver Routing domain Addr family (net addr) Route tag Address of net 1 Subnet mask Next hop address (1-16) Distance to net 1 Addr family (net addr) Route tag Address of net 2 Subnet mask Next hop address Distance to net 2 (1-16) 25 entries
17
The University of Adelaide, School of Computer Science
3 January 2018 Link State Routing Strategy: Send to all nodes (not just neighbors) information about directly connected links (not entire routing table). Reliable flooding: Most recent copy of information about the directly connected links of all nodes Route Calculation: Find the best route to destinations using the available information Chapter 2 — Instructions: Language of the Computer
18
The University of Adelaide, School of Computer Science
3 January 2018 Link State Routing Strategy: Send to all nodes (not just neighbors) information about directly connected links (not entire routing table). Each node creates Link State Packet (LSP) id of the node that created the LSP cost of link to each directly connected neighbor sequence number (SEQNO) time-to-live (TTL) for this packet Reliable Flooding start SEQNO at 0 when reboot generate new LSP periodically; increment SEQNO store most recent LSP (larger the SEQNO, newer the LSP) from each node If received LSP is new forward LSP to all nodes but one that sent it decrement TTL of each LSP before forwarding; discard when TTL=0 Chapter 2 — Instructions: Language of the Computer
19
The University of Adelaide, School of Computer Science
3 January 2018 Link State Reliable Flooding Flooding of link-state packets. (a) LSP arrives at node X; (b) X floods LSP to A and C; (c) A and C flood LSP to B (but not X); (d) flooding is complete Chapter 2 — Instructions: Language of the Computer
20
The University of Adelaide, School of Computer Science
3 January 2018 Shortest Path Routing # Chapter Subtitle In practice, each router computes its routing table directly from the LSP’s it has collected using a realization of Dijkstra’s algorithm called the forward search algorithm Specifically each router maintains two lists, known as Tentative and Confirmed (route already calculated) Each of these lists contains a set of entries of the form (Destination, Cost, NextHop) Chapter 2 — Instructions: Language of the Computer
21
Dijkstra’s Shortest-Path Algorithm
Initialize Confirmed list with (myself, 0, -), Tentative with null list For the node just added to the Confirmed list in the previous step, call it node Next, select its LSP For each neighbor (Neighbor) of Next, calculate the cost (Cost) to reach Neighbor as the sum of the cost from myself to Next and from Next to Neighbor If Neighbor is currently on neither the Confirmed nor the Tentative list, then add (Neighbor, Cost, Nexthop) to the Tentative list, where Nexthop is the direction I go to reach Next, If Neighbor is currently on the Tentative list, and the Cost is less than the currently listed cost for Neighbor, then replace the current entry with (Neighbor, Cost, Nexthop) where Nexthop is the direction I go to reach Next If the Tentative list is empty, stop. Otherwise, pick the entry from the Tentative list with the lowest cost, move it to the Confirmed list, and return to Step 2. Myself: node whose routing table is to be computed Do not consider the LS information for destination nodes already present in the confirmed list CSS 432: Routing
22
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
23
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
24
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
25
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
26
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
27
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
28
Dijkstra’s Shortest-Path Algorithm
CSS 432: Routing
29
OSPF Open Shortest Path first Protocol
OSPF (Protocol uses link state routing) Authenticate information exchanged Hierarchy: divide domains into areas Load Balancing: Multiple routers to same destination same cost to distribute load 5 types of messages OSPF needs to provide information about how to reach networks A router running OSPF generates the following Link State advertisements LSA: Advertisements about networks directly connected to router Cost of the link to another router CSS 432: Routing
30
Open Shortest Path First Protocol (OSPF)
frame header datagram header OSPF header OSPF Message Version Type(=4) AreaId Message Length Checksum Authentication 0-3 Authentication type SourceAddr Authentication 4-7 # of link status advertisements Link-state ID LS Age Options Advertising router LS sequence number Link Checksum Length Flag # of links Type=1 Link ID Link data Metric Num TOS Link type Optional TOS information Header Hello (reachability) (Type=1) Database description (topology) (Type=2) Link status request (Type=3) Link status update (Type=4) Link status acknowledgment (Type=5) Advertisement (header type=4) LS Age: = TTL Type=1: link cost b/w routers Link-State ID = Advertising Router Seq # from the same router Link ID = the other end route ID of link Link data = used if there are two or more links to the same router Metric = link cost Link type = P2P, ethernet, etc TOS = delay-sensitive, etc CSS 432: Routing
31
OSPF Con’td Gated daemon: directly uses IP datagram.
Header Type2: Database description (topology) message Used when the current topology has changed. Sent from an initialized router to another router which has a topology information LS Sequence number Used to determine which message is the latest Send a message with a new sequence number and metric= ∞ when a router or a link fails. CSS 432: Routing
32
Metrics Cost of Links? Original ARPANET metric
All links cost 1 (shortest path = lowest number of hops) Does not consider latency, bandwidth, current traffic Original ARPANET metric measures number of packets queued waiting to be transmitted on each link took neither latency or bandwidth into consideration Moves packets towards the shortest queue than to destination Artificial measure of load CSS 432: Routing
33
Metrics New ARPANET metric
stamp each incoming packet at queue with its arrival time (AT) record departure time (DT) from router when link-level ACK arrives, compute Delay = (DT - AT) + Transmit + Latency if timeout, reset DT to departure time for retransmission link cost = average delay over some time period Fine Tuning (metric should vary smoothly with time, not with very high variation) compressed dynamic range (range at which the metric can fluctuate) replaced Delay with link utilization CSS 432: Routing
34
VPN ‘Virtual’ Private Network
Actually not a private network but virtually private Public network made virtually private IP tunneling Create a tunnel such that hosts have limited connectivity Routers are at the beginning and end of the tunnel At the beginning of the tunnel encapsulate the IP datagram into another IP datagram with destination address of the end router Once the packet reaches the end router, it extracts the original packet from the payload and send it to the destination CSS 432: Routing
35
Virtual Private Networks and Tunnels
Application Level A B Router Dest router Source router Router Level A B To: To: To: To: Internet C A can communicate only with B Even though it uses a router that can send messages to the rest of the internet A’s messages are tunneled and will read which connects to B A can never connect with other members in the internet Company Branch Company Branch Physical Network Level To: A To: To: B To: To: CSS 432: Routing
36
Why VPN? Security Routers Carry No-IP packets Mobile IPs
The final destination/contents of packet cannot be easily intercepted. Routers Routers with special features such as multicasting can form a virtual network. Carry No-IP packets Packets may be non-IP compatible packets. Mobile IPs The final destination may be a mobile computer. CSS 432: Routing
37
NAT Network Address Translation
Reduce the distribution of IP address All hosts need not have a globally unique IP address Hosts need to have a unique address within the private network. Hosts of Private Network have unique addresses within the network If hosts need to communicate they go though the NAT box (implemented on the router, etc) The NAT box translates the private IP into IP address of the device The device implementing NAT is given 1/more globally unique IP While sending data to the internet, the senders address will be masqueraded as the global IP assigned The hosts outside the private network can send data only to the global IP The NAT box then sends the data to the respective receiver Host from the internet, outside the private network cannot communicate (initiate communication) with the hosts inside the private network Hosts inside the private network can initiate communication with hosts in the internet 2 hosts inside the private network can communicate with the internet using the same global address. They will use different ports in the NAT device
38
Mobile IP Sending host, Home Agent, Mobile Host belong to the same private network How Sending host can send data to the Mobile agent? How does the home agent intercept a packet that is destined for the mobile agent? --- Use ARP How does the home agent then deliver the packet to the mobile host? – Use DHCP and VPN Sending host Internet Home agent DHCP server Mobile Host ( ) Mobile Host CSS 432: Routing
39
Mobile IP (Cont’d) Internet 1. ARP request: What’s the physical addr
corresponding to ? Sending host 3. Packet request: sends a packet destined for to the home agent’s MAC address 2. ARP response: sends back MAC of instead of 1. DHCP: receives a new IP in the foreign network. Internet Home agent DHCP server IP tunneling: wraps the packet inside an IP header destined for the mobile host ( ). Mobile Host ( ) Mobile Host 2. Care-of-address: a mobile host informs its Home agent of its original and new IPs. CSS 432: Routing
40
Reviews Exercises in Chapter 3
RIP: distance vector, routing loop and breaking heuristics OSPF: link state, Dijkstra’s shortest path algorithm VPN and mobile IP Exercises in Chapter 3 Ex. 46 (RIP) CSS 432: Routing
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.