Routing and Delivery of Packet
Routing and Delivery of Packet
Forwarding of
IP Packets
1
OBJECTIVES:
To discuss the delivery of packets in the network layer and
distinguish between direct and indirect delivery.
To discuss the forwarding of packets in the network layer and
distinguish between destination-address–based forwarding and
label-based forwarding.
To discuss different forwarding techniques, including next-hop,
network-specific, host-specific, and default.
To discuss the contents of routing tables in classful and classless
addressing and some algorithms used to search the tables.
To introduce MPLS technology and show how it can achieve
label based forwarding.
To list the components of a router and explain the purpose of
each component and their relations to other components.
2
DELIVERY
3
Topics Discussed in the Section
Direct Delivery
Indirect Delivery
4
Direct delivery
Direct delivery
Direct delivery
5
Indirect delivery
A B
6
FORWARDING
8
Next-hop method
9
Network-specific method
Network-specific
routing table for host S
Destination Next Hop
Host-specific
routing table for host S N2 R1
10
Host-specific routing
N1
R1 R3
Host B
N2 R2 N3
11
Default routing
Default
R2
router
12
Simplified forwarding module in classful address without subnetting
13
Example
Figure shows an imaginary part of the Internet.
Show the routing tables for router R1.
Solution
Figure shows the three tables used by router R1.
Note that some entries in the next-hop address
column are empty because in these cases, the
destination is in the same network to which the
router is connected (direct delivery).
14
Configuration for routing, Example
15
Figure Tables for Example
16
Example
Router R1 in Figure receives a packet with
destination address 192.16.7.14. Show how the
packet is forwarded.
Solution
The destination address is
11000000 00010000 000001110 0001110.
A copy of the address is shifted 28 bits to the
right. The result is
00000000 00000000 00000000 00001100 or 12.
The destination network is class C. The network
address is extracted by masking off the leftmost
24 bits of the destination address; the result is
192.16.7.0. The table for Class C is searched. The
network address is found in the first row. The
next-hop address 111.15.17.32. and the interface 17
Example
Router R1 in Figure 6.8 receives a packet with
destination address 167.24.160.5. Show how the
packet is forwarded.
Solution
The destination address in binary is
10100111 00011000 10100000 00000101.
A copy of the address is shifted 28 bits to the
right. The result is
00000000 00000000 00000000 00001010 or 10.
The class is B. The network address can be found
by masking off 16 bits of the destination address,
the result is 167.24.0.0. The table for Class B is
searched. No matching network address is found.
The packet needs to be forwarded to the default
router (the network is somewhere else in the
18
Internet). The next-hop address 111.30.31.18 and
Figure Simplified forwarding module in classful address with subnetting
19
Example
Figure shows a router connected to four subnets.
Note several points. First, the site address is
145.14.0.0/16 (a class B address). Every packet
with destination address in the range 145.14.0.0
to 145.14.255.255 is delivered to the interface
m4 and distributed to the final destination subnet
by the router. Second, we have used the address
x.y.z.t/n for the interface m4 because we do not
know to which network this router is connected.
Third, the table has a default entry for packets
that are to be sent out of the site. The router is
configured to apply the subnet mask /18 to any
destination address.
20
Figure Configuration for Example 6.4
Solution
The mask is /18. After applying the mask, the
subnet address is 145.14.0.0. The packet is
delivered to ARP (see Chapter 8) with the next-
hop address 145.14.32.78 and the outgoing
interface m0.
Solution
The router receives the packet and applies the
mask (/18). The network address is 7.22.64.0. The
table is searched and the address is not found.
The router uses the address of the default router
(not shown in figure) and sends the packet to
that router.
Solution
Table 6.1 shows the corresponding table
Solution
The router performs the following steps:
1. The first mask (/26) is applied to the
destination address. The result is
180.70.65.128, which does not match the
corresponding network address.
2. The second mask (/25) is applied to the
destination address. The result is
180.70.65.128, which matches the
corresponding network address. The next-hop
address (the destination address of the packet
in this case) and
TCP/IP Protocol Suite
the interface number m0 are 29
Example 6.9
Show the forwarding process if a packet arrives
at R1 in Figure 6.13 with the destination address
201.4.22.35.
Solution
The router performs the following steps:
1. The first mask (/26) is applied to the
destination address. The result is 201.4.22.0,
which does not match the corresponding
network address (row 1).
2. The second mask (/25) is applied to the
destination address. The result is 201.4.22.0,
which does not match the corresponding
network address (row 2).
3. The third mask (/24) is applied to the
destination
TCP/IP Protocol Suite
address. The result is 201.4.22.0,
30
Example 6.10
Show the forwarding process if a packet arrives
at R1 in Figure 6.13 with the destination address
18.24.32.78.
Solution
This time all masks are applied to the destination
address, but no matching network address is
found. When it reaches the end of the table, the
module gives the next-hop address 180.70.65.200
and interface number m2 to ARP (see Chapter 8).
This is probably an outgoing package that needs
to be sent, via the default router, to someplace
else in the Internet.
Routing Table
Mask Network Next-hop Interface
(/n) address address
Legend
32 NF
32 NF
31 NF : Compare
31 NF NF:Not found
31 NF F :Found
31 NF
31 NF
Destination
30 F y 2
address 29 interface and
next-hop address
1
x
y
2
x
Switch 1
0004
2
0012