Presentation is loading. Please wait.

Presentation is loading. Please wait.

IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface 140.252.13.65140.252.13.35UGH00emd0 127.0.0.1127.0.0.1UH10lo0.

Similar presentations


Presentation on theme: "IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface 140.252.13.65140.252.13.35UGH00emd0 127.0.0.1127.0.0.1UH10lo0."— Presentation transcript:

1 IP routing

2 Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface 140.252.13.65140.252.13.35UGH00emd0 127.0.0.1127.0.0.1UH10lo0 default140.252.13.33UG00emd0 140.252.13.32140.252.13.34U4250034emd0 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 DestinationGatewayFlagsRefcntUseInterface 140.252.13.65140.252.13.35UGH0170le0 127.0.0.1127.0.0.1UH1766lo0 140.252.1.183140.252.1.29UH00sl0 default140.252.1.183UG12955sl0 140.252.13.32140.252.13.34U8250034emd0

4 ICMP host unreachable sun % traceroute 192.207.117.2 1- 140.252.1.183 227 ms227 ms234 ms 2- 140.252.1.4233 ms229 ms234 ms 3- 140.252.104.2233 ms229 ms234 ms 4- 128.196.128.1264 ms228 ms234 ms 5- 192.80.43.2234 ms228 ms234 ms 6- 192.31.39.233263 ms258 ms264 ms 7- 192.31.39.21263 ms258 ms264 ms 8- 140.222.97.3293 ms258 ms264 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 DestinationGatewayFlagsRefcntUseInterface 127.0.0.1127.0.0.1UH0848lo0 140.252.1.0140.252.1.32U315042le0 244.0.0.0140.252.1.32U30le0 default140.252.1.4UG05747le0 solaris % netstat –rn Routing tables DestinationGatewayFlagsRefcntUseInterface 127.0.0.1127.0.0.1UH0848lo0 140.252.13.35140.252.1.183UGHD02 140.252.1.0140.252.1.32U315042le0 244.0.0.0140.252.1.32U30le0 default140.252.1.4UG05747le0 Solaris % ping bsdi

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 ICMP redirect (cont.) 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

8 Routing Algorithm classification 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.

9 A Link-State Routing Algorithm 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

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 Distance Vector Routing Algorithm 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: D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =

12 Distance Vector Routing: overview 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 Each node:

13 Distance Vector Algorithm: 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 At all nodes, X:

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 w X X X X X w 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)


Download ppt "IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface 140.252.13.65140.252.13.35UGH00emd0 127.0.0.1127.0.0.1UH10lo0."

Similar presentations


Ads by Google