Title: CSCI 5273 Computer Networks Stevens, Chapter 9 Routing
1CSCI 5273Computer NetworksStevens, Chapter
9Routing
- Dirk GrunwaldAssoc. ProfessorDept. of Computer
ScienceUniversity of Colorado, Boulder
2Processing Done at the IP Layer
TCP
UDP
Routingdaemon
Routecommand
Netstatcommand
Our packet (one of ourIP addresses orbroadcast
addrs?
ICMP
ICMPRedirects
Process IP options
RoutingTable
IP Output(calculate next hoprouter if necessary)
IP input queue
Network interface
3Sample Network
gateway
.1.4
Enet, 140.252.1
.1.183
netb
.1.29
bsdi
sun
slip
svr4
.13.35
.13.34
.13.33
.13.65
Enet, 140.252.13
4Routes from 140.242.13.34
- Destination Gateway Flags Ref Use IF
- 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 25043 emd0
SVR4 is on the samenetwork as BSDI, andBSDI
manages the serialIP connection to SLIP
BSDI
SLIP
U - UPG - Gateway/RouterH - Route to host
5Sending out a UGH route
- The G flag designates an indirect route
- The H flag designates a HOST address
- When a packet is sent out an indirect route, the
IP address specifies the final destination, but
the link layer address specifies the gateway - I.e., send it to final destination via the
gateway - The IP address of the link-layer is specified in
the Gateway entry
6Routes from 140.242.13.34
- Destination Gateway Flags Ref Use IF
- 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 25043 emd0
Localhost is a directconnection to itselfusing
the lo0 interfaceNot a GATEWAYso gateway
lists IP addressof out-going interface
Loopback
Loopback
U - UPH - Route to host
7Routes from 140.242.13.34
- Destination Gateway Flags Ref Use IF
- 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 25043 emd0
SUN is the default routerfor this network since
itcan relay traffic to the internet
Sun
default
U - UPG - Its a router
8Default Routes
- The Host Requirements RFC says that IP must
support multiple default routes. - Many implementations dont do this
- The policy of selecting between routes is not
specified - Solaris uses round-robin
9Routes from 140.242.13.34
- Destination Gateway Flags Ref Use IF
- 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 25043 emd0
All traffic destined forthis network is sent
outthis particular interface. Note that this is
not a ROUTERnor is it a HOSTThus, its a
NETWORK
SVR4 (us!)
network
U - UP
10Sample Routes from Foobar
- Route Tree for Protocol Family 2
- default 128.138.241.65 UG
6 1924942 tu1 - 127.0.0.1 127.0.0.1 UH
1 39091 lo0 - 128.138.192/26 128.138.241.65 UG
0 197 tu1 - 128.138.192.64/26 128.138.241.65 UG
0 64259 tu1 - 128.138.192.128/26 128.138.241.65 UG
0 1091 tu1 - 128.138.192.192/26 128.138.241.65 UG
17 2775625 tu1 - 128.138.193/26 128.138.241.65 UG
0 2552 tu1
Netmask specification
11Sample Search SVR4 -gt SUN
- Sun is resolved as 140.242.13.33
- Search for matching host entry
- Two host entries (SLIP localhost) dont match
- Search for a matching network entry (I.e.,
140.242.13.32) - Match is found
- EMD0 interface is selected
- This is a DIRECT (not Gateway route) and thus the
LINK ADRESS designated the same system as the IP
address - LINK ADDRESS is retrieved from ARP table
- Frame is sent out EMD0
12Sample Search SVR4-gtSLIP
- Host resolves to 140.252.13.65
- Search through table for HOST address
- Find match
- This is a Gateway address. Message will be
forwarded to the 140.252.13.35 IP address - EMD0 interface is selected
- LINK Address is 140.252.13.35, but IP destination
is still 140.252.13.65 - Message arrives at BSDI (13.35) and is routed to
SLIP (13.65)
13SVR4 -gt internet
- Aw.com resolves as 192.207.117.2
- Search for host address - no match
- Search for network address - no match
- Select DEFAULT address
- Indirect route to 140.252.13.33 using EMD0
- Link address is for 13.33, IP destination address
is 192.207.117.2
14SVR4 -gt SVR4
- Via 13.32
- Packet sent to ethernet driver
- Destined for host IP address, so sent to the
loopback driver - via 127.0.0.1
- Search matches host address
- Packet sent to the loopback driver
15Loopback Devices
IP outputFunction
IP inputFunction
Destination IP addressequals broadcast
addressor multicast address?
Place on IPinput queue
Place on IPinput queue
Yes
LoopbackDriver
Yes
Destination IP addressequals interface address?
No, use ARP toget dest. Ethernetaddress
IP
EthernetDriver
Demultiplex based onEthernet frame type
ARP
ARP
16Increasing Complexity of Routing Tables
- Host is not connected - only loopback interface
is available - Host on a single LAN - loopback LAN address
- I.e., like last entry
- Host on internet - usually includes a default
- Host-specific or network-specific routes - looks
like our example here
17Sample Routes from SUN (13.33) Router
- Destination Gateway Flags Ref Use IF
- 140.252.13.65 140.252.13.35 UGH 0 171 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 2995 sl0
- 140.252.13.32 140.252.12.33 U 8 99551 le0
Slip IP
netb
The point-to-pointinterface
U - UPH - Its a direct host
18Sample Routes from SUN (13.33) Router
- Destination Gateway Flags Ref Use IF
- 140.252.13.65 140.252.13.35 UGH 0 171 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 2995 sl0
- 140.252.13.32 140.252.12.33 U 8 99551 le0
SUN
The network route goes through hostspecific
interface
netb
U - UP
19No route?
- If theres no route?
- I.e., not default route specified and no
specified route - If generated on the local machine, a no such
route message is directly returned - If being forwarded, an ICMP host unreachable
message is sent back to the SOURCE ADDRESS
specified in the IP header
20No Destination?
21No destination?
- foobar-22 traceroute 192.82.148.1
- traceroute to 192.82.148.1 (192.82.148.1), 30
hops max, 40 byte packets - 1 cs-gw3-esl (128.138.241.65) 1 ms 1 ms 1 ms
- 2 cs-gw-dmz (128.138.243.193) 2 ms 2 ms 2 ms
- 3 engr-cs.Colorado.EDU (128.138.80.141) 1 ms
2 ms 2 ms - 4 hut-engr.Colorado.EDU (128.138.80.201) 2 ms
2 ms 2 ms - 5 cuatm-gw.Colorado.EDU (128.138.80.2) 1 ms 1
ms 2 ms - 6 den-edge-11.inet.qwest.net (205.169.250.49)
4 ms 2 ms 4 ms - 7 den-edge-04.inet.qwest.net (205.171.16.169)
3 ms 5 ms 5 ms - 8 den-core-01.inet.qwest.net (205.171.16.65) 4
ms 5 ms 5 ms - 9 nyc-core-02.inet.qwest.net (205.171.5.17) 43
ms 44 ms 41 ms - 10 nyc-core-03.inet.qwest.net (205.171.17.81)
42 ms 45 ms 43 ms - 11 nyc-core-02.inet.qwest.net (205.171.17.86)
43 ms 43 ms 44 ms - 12 205.171.17.118 (205.171.17.118) 42 ms 42 ms
44 ms - 13
- 14
22Example of ICMP Redirect
HOST
1
4
2
R1
R2
3
23Example of Redirect
gateway
.1.4
Enet, 140.252.1
.1.183
Proxy ARP for SUN
netb
.1.29
bsdi
sun
slip
svr4
.13.35
.13.34
.13.33
.13.65
Enet, 140.252.13
24Use Default to Get to BSDI
gateway
.1.4
Enet, 140.252.1
.1.183
netb
Solaris
.1.29
bsdi
sun
slip
svr4
.13.35
.13.34
.13.33
.13.65
Enet, 140.252.13
25Redirect Occurs
gateway
.1.4
Enet, 140.252.1
.1.183
netb
Solaris
.1.29
bsdi
sun
slip
svr4
.13.35
.13.34
.13.33
.13.65
Enet, 140.252.13
26140.252.13.35 140.252.1.183 UGHD
gateway
.1.4
Enet, 140.252.1
.1.183
netb
Solaris
.1.29
bsdi
sun
slip
svr4
.13.35
.13.34
.13.33
.13.65
Enet, 140.252.13