You are on page 1of 35

6-1

Chapter 6

Delivery and
Routing of
IP Packets
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-2

Connection-Oriented Services
The network layer protocol first makes a connection
between the source and destination hosts, then starts
transmission of data. After the transmission of data is
over, the network layer tears down the connection.

Connectionless Services
The network layer protocol treats each packet
independently, with each packet having no relationship
to any other packet.
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-3

Direct delivery

Hosts are on the same (physical) network (no routing involved)

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-4

Indirect delivery

Hosts are not on the same


network (routing necessary)
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-5

Routing Methods:
Next-Hop Routing
! Network-Specific Routing
! Host-Specific Routing
! Default Routing
!

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-6

Next-hop routing

Only the next router is specified in the RT for each destination host
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-7

(The following seven slides explain the essence of the next-hop routing)

Routing is the relaying (forwarding) of packets generated by a source station,


across the network in order to deliver them to their destination station. When
a routing node gets a packet, it should know which neighboring node to forward the packet.
All routing strategies optimize some kind of performance criteria. This can
be a minimal number of intermediate links along the path (minimum hop
criteria), or a minimum cost criteria, which minimizes the total cost along
the route (cost could be delay associated with each link, the inverse of
the link's bit rate, etc.) Note that the minimal cost criteria is a generalization of the minimum hop, i.e. if we assign a cost = 1 to each link we get
the minimum hop criteria.
The optimal routes from a set of source stations to corresponding destination
stations are defined through routing tables (RT). Each node has a routing table which tells how a node can forward a package with a specified destina
tiontion.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-8

Suppose that the costs associated with the internode links are as shown.
(The minimal cost routes are shown on the next slide).

B
3

C
2
1

4
6

4
1

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-9
B
3

C
2

1
2

4
6

4
1
5

RT at node 1

RT at node 2

Dest.
node

Next
node

Dest.
node

Next
node

1
2
3
4
5
6

2
6
2
6
6

1
2
3
4
5
6

1
4
4
4
1

4
6

McGraw-Hill

3
5

The McGraw-Hill Companies, Inc., 2000

6-10
B
3

C
2

1
2

4
6

4
1
5

RT at node 6

RT at node 4

Dest.
node

Next
node

Dest.
node

Next
node

1
2
3
4
5
6

1
1
5
5
5
-

1
2
3
4
5
6

2
2
3
5
5

4
6

3
5

McGraw-Hill

3
5

The McGraw-Hill Companies, Inc., 2000

6-11
B
3

C
2
1

4
6

4
1
5

RT at node 5

RT at node 3

Dest.
node

Next
node

Dest.
node

Next
node

1
2
3
4
5
6

6
4
3
4
6

1
2
3
4
5
6

5
4
4
5
5

4
6

3
5

McGraw-Hill

3
5

The McGraw-Hill Companies, Inc., 2000

6-12
RT at node 1

Dest.
node

Next
node

1
2
3
4
5
6

2
6
2
6
6

What justifies this?

4
6

Is it suffitient to give in RT the address of the next node only instead


of the entire route? For example, the first diagram contains five optimal
routes emanating from the node "1":
Source: 1, destination: 2, optimal route: 1,2
Source: 1, destination: 3, optimal route: 1,6,5,3
Source: 1, destination: 4, optimal route: 1,2,4
Source: 1, destination: 5, optimal route: 1,6,5
Source: 1, destination: 6, optimal route: 1,6

This is possible because of the principle of optimality


(stated by Richard Bellman in 1950s):

"An optimal policy has the property that whatever the initial state and
the initial decision are, the remaining decisions must constitute an
optimal policy with regard the state resulting from the first decision"

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-13

This can be applied to the optimal routes:


If the route a-x-b is optimal, then the remaining route x-b is optimal too, i.e. we would
obtain exactly the same optimal route x-b if we started only from x. Therefore, the node
a doesn't have to worry about the entire path, its is enough that it routes the packet to
the optimal neighboring node x. This saves a lot of memory, because each node need
to store only the optimal route to the next (neighboring) node.

a
First link of
the optimal
route a-x-b

McGraw-Hill

Remaining part
of the optimal
route a-x-b
The McGraw-Hill Companies, Inc., 2000

6-14

Network-specific routing
Only one entry exists in RT for all hosts
connected to the same physical network
(the most common method)

Imagine 1000 hosts connected


to the same network
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

Host-specific routing

6-15

Less efficiency, but the


administrator has more
control over routing.
Example: administrator wants to rout
specifically the packets for B via router
R1 instead of R3, then the RT for A
needs an entry: Host B " R1.
This entry should precede the entry
N3 " R3

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-16

Default routing
Anything not
specified above

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-17

Static vs. Dynamic Routing


A static routing table contains information
entered manually.
Used in small internetworks that do not change very often

A dynamic routing table is updated


periodically using one of the dynamic
routing protocols such as RIP, OSPF, or
BGP.
Used in large internetworks that change very often.
Automatic updates of RT makes the network manageable and scalable.
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-18

Routing module and routing table

Receiving the packet from the link


layer and its basic processing (see chapter 8)
McGraw-Hill

Packet has DA (besides SA),


which is not necessarily equal
to the next-hop address
(see next slide)
The McGraw-Hill Companies, Inc., 2000

6-19

IP datagram: SA=A, DA=B, payload


Next hop: Router S

Host
A

Router
R

IP datagram: SA=A, DA=B, payload


Next hop: Router R

Router
S

Host
B

IP datagram: SA=A, DA=B, payload


Next hop: direct delivery

IP datagram stays basically the same all the way (exception: TTL)
McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

Routing Table

6-20

Interface name (like eth0,


fddi0), identifies the port

U The router is up and running.


G The destination is in another network (Gateway).
H Host-specific address.
Number of packets transmitted
D Added by redirection (see chapter 9).
to this destination via this
M Modified by redirection (see chapter 9).
router

Number of users that connected to


this destination via this router

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

Routing Table (cont.)

6-21

Routing table of a host can be displayed by commands:


route PRINT
(Windows)
netstat nr
(UNIX)

Windows has a specific way of displaying the routing table: 1st line shows the default router, the
2nd line is loopback route, the 3rd line defines the range of addresses on the local network
segment, the line with 224.0.0.0 is for multicast addresses, the line with 255.255.255.255 is for
broadcast.
McGraw-Hill
The McGraw-Hill Companies, Inc., 2000

6-22

Routing Module
Get the packet;
for (each entry in RT) {
Apply the mask to packet destination address;
if (the result matches the value in destination field) {
if (G flag present)
Use the next-hop address from the RT;
(indirect delivery)
else
Use the destination address from the packet;
(direct delivery)
Send the packet to the fragmentation module;
return; // Routing done
}
}
// No match is found
Send an ICMP error message;
return;

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

Configuration for routing example

McGraw-Hill

6-23

The McGraw-Hill Companies, Inc., 2000

6-24

Mask

Destination

Next Hop

I/f

255.0.0.0

111.0.0.0

--

m0

255.255.255.224

193.14.5.160

m2

255.255.255.224

193.14.5.192

m1

-------------------------------------------------------------------------------255.255.255.255
194.17.21.16
111.20.18.14
m0
--------------------------------------------------------------------------------255.255.255.0

192.16.7.0

111.15.17.32

m0

255.255.255.0

194.17.21.0

111.20.18.14

m0

--------------------------------------------------------------------------------0.0.0.0
McGraw-Hill

0.0.0.0

111.30.31.18

m0

The McGraw-Hill Companies, Inc., 2000

6-25

Example 1
Router R1 receives 500 packets for destination 192.16.7.14; the
algorithm applies the masks row by row to the destination address
until a match (with the value in the second column) is found:
Direct delivery
192.16.7.14 & 255.0.0.0

# 192.0.0.0 no match

192.16.7.14 & 255.255.255.224 # 192.16.7.0 no match


192.16.7.14 & 255.255.255.224 # 192.16.7.

no match

Host-specific
192.16.7.14 & 255.255.255.255 #192.16.7.14 no match
Network-specific
192.16.7.14 & 255.255.255.0
McGraw-Hill

#192.16.7.0 match
The McGraw-Hill Companies, Inc., 2000

Example 2

6-26

Router R1 receives 100 packets for destination 193.14.5.176; the


algorithm applies the masks row by row to the destination address
until a match is found:
Direct delivery
193.14.5.176 & 255.0.0.0

# 193.0.0.0

193.14.5.176 & 255.255.255.224 #193.14.5.160

McGraw-Hill

no match
match

The McGraw-Hill Companies, Inc., 2000

6-27

Example 3

Router R1 receives 20 packets for destination


200.34.12.34; the algorithm applies the masks row by
row to the destination address until a match is found:
Direct delivery
200.34.12.34 & 255.0.0.0

#200.0.0.0

no match

200.34.12.34 & 255.255.255.224 #200.34.12.32

no match

200.34.12.34 & 255.255.255.224 #200.34.12.32

no match

Host-specific
200.34.12.34 & 255.255.255.255 #200.34.12.34
McGraw-Hill

no match

The McGraw-Hill Companies, Inc., 2000

6-28

Example 3 (cont.)

Router R1 receives 20 packets for destination


200.34.12.34; the algorithm applies the masks row by
row to the destination address until a match is found:
Network-specific
200.34.12.34 & 255.255.255.0 # 200.34.12.0

no match

200.34.12.34 & 255.255.255.0 # 200.34.12.0

no match

Default
200.34.12.34 & 0.0.0.0
McGraw-Hill

# 0.0.0.0.

match
The McGraw-Hill Companies, Inc., 2000

6-29

Example 4
Make the routing table for router R1 in this figure:

Mask

Destination

Next Hop

I.

255.255.0.0

134.18.0.0

--

m0

255.255.0.0

129.8.0.0

222.13.16.40

m1

255.255.255.0

220.3.6.0

222.13.16.40

m1

0.0.0.0

0.0.0.0

134.18.5.2

m0

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-30

Example 5

Make the routing table for router R1 in this network:

Mask

Destination

Next Hop

Interface

255.255.255.0

200.8.4.0

----

m2

255.255.255.0

80.4.5.0

201.4.10.3 (or 200.8.4. 12)

m1 (or m2)

255.255.255.0

80.4.6.0

201.4.10.3 (or 200.4.8.12 )

m1 (or m2)

0.0.0.0

0.0.0.0

McGraw-Hill

?????????

m0
The McGraw-Hill Companies, Inc., 2000

6-31

Example 6
Mask
255.255.0.0
255.255.0.0
255.255.0.0
255.255.0.0
255.255.0.0
0.0.0.0

McGraw-Hill

The routing table for router R1 is given


below. Draw its topology
Destination
110.70.0.0
180.14.0.0
190.17.0.0
130.4.0.0
140.6.0.0
0.0.0.0

Next Hop
190.17.6.5
180.14.2.5
110.70.4.6

Interface
m0
m2
m1
m1
m2
m0

The McGraw-Hill Companies, Inc., 2000

Classless Addressing and CIDR

6-32

(CIDR = Classless Inter Domain Routing)

Routing Table Size


Way to decrease
the size of RTs

Geographical Routing

The size of RT is generally increasing


(division of classes A and B into smaller
blocks increase the number of RT entries.)
Only the supernetting would decrease the
number of entries (grouping of C blocks).

Hierarchical Routing
Further decrease of RT size
(large blocks: North America,
Europe, Asia, Africa,)

RT is divided in buckets in order to localize


the table search (in classful addressing the
buckets are classes, in classless addressing
the buckets are different prefix lengths. First
is searched the bucket with the largest prefix
= /32 (the host-specific routing), then the
next prefix /31 is searched, etc.
McGraw-Hill

RT Search Algorithms

The McGraw-Hill Companies, Inc., 2000

6-33

Internet today
ISP = Internet Service Provider
National ISPs (backbone networks):
SprintLink,
PSINet,
UUNet
Technology,
AGIS,
Internet MCI
Local ISPs

NAP = Network Access Point


Internet interconnection points,
typically work with ATM at speeds
DS-3 (T3) 44.736 Mbps
OC-3 155.52 Mbps
OC-9 466.56 Mbps
OC-12 622.08 Mbps
OC-48 2488.32 Mbps

McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-34

Hierarchical Routing
Way to keep RTs smaller and more manageable

R1
R2
X1

X2 X3
X

X1

AXA2

Y
Y1

Z
R3
Y2

Y
X3

Y1 Y2

R4
Z1

Z2

Z
Z1

Z2

Router R2 can see only networks X1, X2, X3


McGraw-Hill

The McGraw-Hill Companies, Inc., 2000

6-35

Hierarchical Routing (cont.)


This part of the network
doesnt have to be aware
of the division
in the network X

X
X1

X2 X3

Y1

X
X1
McGraw-Hill

A XA2

Y2

Z1

Y
X3

Y1 Y2

Z2

Z
Z1

Z2

The McGraw-Hill Companies, Inc., 2000

You might also like