1 / 15

IP routing

IP routing. Simple Routing Table. svr 4% netstat –r n Routing tables Destination Gateway Flags Refcnt Use Interface 140.252.13.65 140.252.13.35 UGH 0 0 emd0 127.0.0.1 127.0.0.1 UH 1 0 lo0 default 140.252.13.33 UG 0 0 emd0 140.252.13.32 140.252.13.34 U 4 250034 emd0.

cathy
Télécharger la présentation

IP routing

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

  2. Simple Routing Table svr 4% netstat –r n Routing tables Destination Gateway Flags Refcnt Use Interface 140.252.13.65 140.252.13.35 UGH 0 0 emd0 127.0.0.1 127.0.0.1 UH 1 0 lo0 default 140.252.13.33 UG 0 0 emd0 140.252.13.32 140.252.13.34 U 4 250034 emd0 • If destination is 140.252.13.33 • If destination is host 140.252.13.65 • If destination is host 192.207.117.2 • If destination is own host • ftp svr4 • ftp 127.0.0.1

  3. Routing table (sun) sun % netstat –rn Routing tables Destination Gateway Flags Refcnt Use Interface 140.252.13.65 140.252.13.35 UGH 0 170 le0 127.0.0.1 127.0.0.1 UH 1 766 lo0 140.252.1.183 140.252.1.29 UH 0 0 sl0 default 140.252.1.183 UG 1 2955 sl0 140.252.13.32 140.252.13.34 U 8 250034 emd0

  4. ICMP host unreachable sun % traceroute 192.207.117.2 1- 140.252.1.183 227 ms 227 ms 234 ms 2- 140.252.1.4 233 ms 229 ms 234 ms 3- 140.252.104.2 233 ms 229 ms 234 ms 4- 128.196.128.1 264 ms 228 ms 234 ms 5- 192.80.43.2 234 ms 228 ms 234 ms 6- 192.31.39.233 263 ms 258 ms 264 ms 7- 192.31.39.21 263 ms 258 ms 264 ms 8- 140.222.97.3 293 ms 258 ms 264 ms ……etc sun % ping 192.82.148.1 (do not exist) ICMP host unreachable from 192.31.32.21 Reaches NSFNET, CIX, NSI, SprintLink, or Ebone backbones

  5. ICMP redirections (revisited) solaris % netstat –rn Routing tables Destination Gateway Flags Refcnt Use Interface 127.0.0.1 127.0.0.1 UH 0 848 lo0 140.252.1.0 140.252.1.32 U 3 15042 le0 244.0.0.0 140.252.1.32 U 3 0 le0 default 140.252.1.4 UG 0 5747 le0 Solaris % ping bsdi solaris % netstat –rn Routing tables Destination Gateway Flags Refcnt Use Interface 127.0.0.1 127.0.0.1 UH 0 848 lo0 140.252.13.35 140.252.1.183 UGHD 0 2 140.252.1.0 140.252.1.32 U 3 15042 le0 244.0.0.0 140.252.1.32 U 3 0 le0 default 140.252.1.4 UG 0 5747 le0

  6. ICMP redirect (cont.) • Solaris after receiving a redirect message should • Check the IP address that caused the redirect (contained in the IP header of the ICMP redirect) • Check the IP address of the IP router that sends the redirect (source IP address of IP datagram) • Check the IP address of the router that should be used (contained in the ICMP message) Rules 1- Redirects only generated by routers, not hosts. 2- Intended to be used by hosts, not routes. 3- A router running a routing protocol should prevent the use of redirection.

  7. Router before sending ICMP redirection checks the following Kernel configured to send redirects. Outgoing interface = incoming interface. Route must not be the router’s default route. Route must not have been created by an ICMP redirect. Datagram must not be source routed? Before updating its table, host performs the following checks. The new router must be on a connected network The modified route must be an indirect route The redirect must be from the specified router The redirect cannot set the router to use as the asking host ICMP redirect (cont.)

  8. Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors No router has complete knowledge of all network links “distance vector” algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes Susceptible to routing loops and oscillation in routes. Routing Algorithm classification

  9. Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest.’s Notation: 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 next v N: set of nodes whose least cost path definitively known A Link-State Routing Algorithm

  10. 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) = infinity 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

  11. iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop asynchronous: Not all nodes need to exchange info/iterate at the same time. distributed: each node communicates only with directly-attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly-attached neighbor to node example: 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

  12. Iterative, asynchronous: each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: 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:

  13. Distance Vector Algorithm: At all nodes, X: 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infinity /* 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

  14. 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 w X X w X w

  15. Inter-AS vs. Intra-AS Routing • Inter-AS: unique standard for inter-AS routing: BGP • Intra-AS: • Also known as Interior Gateway Protocols (IGP) • Most common Intra-AS routing protocols: • RIP: Routing Information Protocol • OSPF: Open Shortest Path First • IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

More Related