You are on page 1of 33

Delivery and Forwarding of

IP Packets
Delivery, Forwarding and Routing

Delivery: It refers to the way a packet is handled by


the underlying networks under the control of the
network layer.

Forwarding: It refers to the way a packet is delivered


to the next station.

Routing: It refers to the way routing tables are


created to help in forwarding.
Types of Delivery

1. Direct Delivery

(i)Source and destination are in the same network

(ii)Delivery is between the last router and destination

2. Indirect Delivery

Destination is not in the same destination


Direct Delivery

Direct delivery

Direct delivery
Indirect Delivery

A B

Link Link Link

Indirect delivery Indirect delivery Direct delivery


FORWARDING

Forwarding Based on Destination Address (IP is used as


a connectionless protocol)

Forwarding Based on Label (IP is used as a connection oriented


protocol)

Forwarding based on destination address


Forwarding Techniques:
1. Next hop method
2. Network specific method
3.Host specific method
4. Default method
Next-hop method

7
Network-specific method

Network-specific
routing table for host S
Destination Next Hop
Host-specific
routing table for host S N2 R1

Destination Next Hop


A R1
B R1
C R1
D R1
Host-specific routing

Routing table for host A


Host A
Destination Next Hop
Host B R3
N2 R1
N3 R3
...... ......

N1

R1 R3
Host B

N2 R2 N3
Default routing

Routing table for host A N1 N2


Host A
Destination Next Hop
N2 R1 R1
...... ......
Default R2

Default
R2
router

Rest of the Internet


Forwarding with classful addressing (without subnetting)
Example 6.1

Routing tables for Router R1?


Routing tables by R1
Example 2
Router R1 receives a packet with destination address 192.16.7.14.
Show how the packet is forwarded.
Example 2
Router R1 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 m0 are passed to ARP
Example 3
Router R1 receives a packet with destination address 167.24.160.5.
Show how the packet is forwarded.
Example 6.3
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 Internet). The next-hop address
111.30.31.18 and the interface number m0 are passed to ARP.
Forwarding with classful addressing (with subnetting)
Example 4:
Example 4

Router is connected with four subnets.

Site address is 145.14.0.0/16

Destination address (145.14.0.0 to


145.14.255.255) - m4

The address x.y.z.t/n for the interface m4

Default entry for packets - sent out of the


site.

The router is configured to apply the


subnet mask /18 to any destination
address.
Example 5
The router receives a packet with destination address
145.14.32.78. Show how the packet is forwarded.
Example 5
The router receives a packet with destination address
145.14.32.78. Show how the packet is forwarded.

Mask is /18.
Subnet address

-
145.14.0.0.
Outgoing interface
Example 6
A host in network 145.14.0.0 in Figure 6.11 has a packet to send to
the host with address 7.22.67.91. Show how the packet
is routed.
Example 6
A host in network 145.14.0.0 in Figure 6.11 has a packet to send to
the host with address 7.22.67.91. Show how the packet
is routed.

Solution:
The mask is (/18)
Network address is 7.22.64.0.
No address is found.
Default router is used.

00000111 00010110 01000011 01011011


11111111 11111111 11000000 00000000 Bitwise AND

00000111 00010110 01000000 00000000 7.22.64.0


Forwarding with classless addressing
Example 7
Make a routing table for router R1 using the configuration in the
following figure.

Solution
Table 6.1 shows the corresponding table
Address Aggregation
Figure 6.17 Hierarchical routing with ISPs
16,384 addresses starting from 120.14.64.0.
4 subblocks, each with 4096 addresses.
3 subblocks to 3 local ISPs
2nd subblock is reserved
Mask(Block) is /20
Original block with mask /18
Longest mask matching
Example for Longest mask matching

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
Forwarding using Label
Example for forwarding based on label

Label used Switching Table


as index Interface Next label
0000
0001
0002
0003
0004 2 0012
0005
0006
Label
interface and
1000 label address
0

Switch 1
0004

2
0012

You might also like