1 / 40

CSS432 Routing Textbook Ch3.3

CSS432 Routing Textbook Ch3.3. Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu. What Is Routing?. Forwarding vs Routing forwarding: To map a network # to an outgoing interface and some MAC information in a forwarding table.

cthurber
Télécharger la présentation

CSS432 Routing Textbook Ch3.3

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. CSS432 RoutingTextbook Ch3.3 Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu CSS 432: Routing

  2. What Is Routing? • Forwarding vs Routing • forwarding: • 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. 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

  4. 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

  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 CSS 432: Routing

  6. Distance Vector Initial distances stored at each node (global view)

  7. 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

  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 CSS 432: Routing

  9. 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)

  10. Distance Vector Final distances stored at each node (global view – not known by the routers, who only know their row entry)

  11. 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

  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 B A B C 3 4 ∞ E 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 RIP Message UDP header Ver Routing domain Cmd • Cmd: 1-6 • 1: request • 2: reply • Port: 520 • Used by routed • Advertisement: 30secs • Table entry timeout: 3 mins. • Deleted in 60secs Route tag Addr family (net addr) Address of net 1 Subnet mask Next hop address (1-16) Distance to net 1 Route tag Addr family (net addr) Address of net 2 Subnet mask Next hop address Distance to net 2 (1-16) 25 entries https://tools.ietf.org/html/rfc2453

  17. 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

  18. 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

  19. 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

  20. 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)

  21. Dijkstra’s Shortest-Path Algorithm • Initialize Confirmedlist 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 Nexthopis 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 Nexthopis 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. 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. frame header datagram header OSPF Message OSPF header # of link status advertisements Type(=4) Message Length Version Options LS Age Type=1 SourceAddr Link-state ID AreaId Advertising router Authentication type Checksum LS sequence number Authentication 0-3 Length Link Checksum Authentication 4-7 0 Flag 0 # of links Link ID Link data Metric Link type Num TOS Optional TOS information Open Shortest Path First Protocol (OSPF) • 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? • 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. To: 20.0.0.1 To: 215.0.0.1 To: 215.0.0.1 To: 215.0.0.1 Virtual Private Networks and Tunnels 10.0.0.1 20.0.0.1 A Application Level B Router Dest router Source router 10.0.0.1 20.0.0.1 Router Level B A To: 20.0.0.1 To: 215.0.0.1 To: 20.0.0.1 To: 10.0.0.2 Internet C 215.0.0.1 Company Branch Company Branch Physical Network Level To: 20.0.0.1 A B 20.0.0.1 10.0.0.1 CSS 432: Routing

  36. Why VPN? • Security • 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. Sending host Mobile Host 10.0.0.9 (12.0.0.7) Mobile Host 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 10.0.0.3 Internet DHCP server Home agent 12.0.0.6 CSS 432: Routing

  39. Sending host Mobile Host 10.0.0.9 (12.0.0.7) Mobile Host Mobile IP (Cont’d) 1. ARP request: What’s the physical addr corresponding to 10.0.0.9? 3. Packet request: sends a packet destined for 10.0.0.9 to the home agent’s MAC address 2. ARP response: sends back MAC of 10.0.0.3 instead of 10.0.0.9 1. DHCP: receives a new IP in the foreign network. 10.0.0.3 Internet DHCP server Home agent 12.0.0.6 IP tunneling: wraps the packet inside an IP header destined for the mobile host (12.0.0.7). 2. Care-of-address: a mobile host informs its Home agent of its original and new IPs. CSS 432: Routing

  40. Reviews • 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

More Related