0% found this document useful (0 votes)
12 views67 pages

Delivery Forwarding 2025

The document discusses the delivery and forwarding of IP packets within the TCP/IP protocol suite, highlighting two methods of delivery: direct and indirect. Direct delivery occurs when the source and destination are on the same physical network, while indirect delivery involves routing through multiple routers. Additionally, it covers forwarding techniques, including the next-hop method, network-specific method, and default method, as well as the differences between classful and classless addressing in routing tables.

Uploaded by

Vasu Narula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views67 pages

Delivery Forwarding 2025

The document discusses the delivery and forwarding of IP packets within the TCP/IP protocol suite, highlighting two methods of delivery: direct and indirect. Direct delivery occurs when the source and destination are on the same physical network, while indirect delivery involves routing through multiple routers. Additionally, it covers forwarding techniques, including the next-hop method, network-specific method, and default method, as well as the differences between classful and classless addressing in routing tables.

Uploaded by

Vasu Narula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

Delivery and Forwarding of IP Packets

TCP/IP Protocol Suite 1


Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP Protocol Suite 2
6-1 DELIVERY

The network layer supervises the handling of the packets by the


underlying physical networks.

We define this handling as the delivery of a packet.

Delivery of a packet to its final destination is accomplished using


two different methods of delivery:
direct
indirect.

TCP/IP Protocol Suite 3


Direct delivery

In a direct delivery, the final destination of the packet is a host


connected to the same physical network as the deliverer.

Direct delivery occurs when the source and destination of the packet
are located on the same physical network or if the delivery is
between the last router and the destination host

TCP/IP Protocol Suite 4


Figure 6.1 Direct delivery

Direct delivery

Direct delivery

TCP/IP Protocol Suite 5


Direct delivery

The sender can easily determine if the delivery is direct.

It can extract the network address of the destination (using the mask)
and compare this address with the addresses of the networks to which
it is connected.

If a match is found, the delivery is direct.

In direct delivery, the sender uses the destination IP address to find the
destination physical address.

The IP software then gives the destination IP address with the


destination physical address to the data link layer for actual delivery.

TCP/IP Protocol Suite 6


Indirect delivery

If the destination host is not on the same network as the deliverer,


the packet is delivered indirectly.

In an indirect delivery, the packet goes from router to route reaches


the one connected to the same physical network as its final
destination.

TCP/IP Protocol Suite 7


Figure 6.2 Indirect delivery

A B

Link Link Link

Indirect delivery Indirect delivery

TCP/IP Protocol Suite 8


Indirect delivery

In an indirect delivery, the sender uses the destination IP address and


a routing table to find the IP address of the next router to which the
packet should be delivered.

The sender then uses ARP to find the physical address of the next
router.

In direct delivery, the address mapping is between the IP address of the final
destination and the physical address of the final destination.

In an indirect delivery, the address mapping is between the IP address of the


next router and the physical address of the next router.

Delivery always involves one direct delivery but zero or more indirect
deliveries.

TCP/IP Protocol Suite 9


6-2 FORWARDING

Forwarding means to place the packet in its route to its destination.

Internet today is made of a combination of links (networks), forwarding means


to deliver the packet to the next hop (which can be the final destination or the
intermediate connecting device).

IP protocol was originally designed as a connectionless protocol, today the tendency is


to use IP as a connection-oriented protocol.

When IP is used as a connectionless protocol, forwarding is based on the


destination address of the IP datagram;

when the IP is used as a connection-oriented protocol, forwarding is based on the


label attached to an IP datagram

TCP/IP Protocol Suite 10


Forwarding Based on Destination Address

In this case, forwarding requires a host or a router to have a routing


table.

When a host has a packet to send or when a router has received a


packet to be forwarded, it looks at this table to find the route to the
final destination.

This simple solution is inefficient today in an internetwork such as the


Internet because the number of entries needed in the routing table
would make table lookups inefficient.

TCP/IP Protocol Suite 11


TCP/IP Protocol Suite 12
Forwarding Techniques
Several techniques can make the size of the routing table manageable
and also handle issues such as security.

Next-Hop Method
One technique to reduce the contents of a routing table.

Here, the routing table holds only the address of the next hop instead of
information about the complete route.

TCP/IP Protocol Suite 13


Figure 6.3 Next-hop method

TCP/IP Protocol Suite 14


Network-specific method

Another techniques to reduce the routing table and simplilify the


searching process.

Here, instead of having an entry for every destination host connected


to the same physical network, we have only one entry that defines the
address of the destination network itself.

Treat all hosts connected to the same network as one single entity.

TCP/IP Protocol Suite 15


Figure 6.4 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

TCP/IP Protocol Suite 16


Host-specific Method

In the host-specific method, the destination host address is given in the


routing table.

Here efficiency is sacrificed for other advantages: There are occasions


in which the administrator wants to have more control over routing.

For example, if the administrator wants all packets arriving for host B
delivered to router R3 instead of R1, one single entry in the routing
table of host A can explicitly define the route.

Host-specific routing is used for purposes such as checking the route or


providing security measures.

TCP/IP Protocol Suite 17


Figure 6.5 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

TCP/IP Protocol Suite 18


Default Method

Another technique to simplify routing is called the default method.

In Figure 6.6 host A is connected to a network with two routers.


Router R1 routes the packets to hosts connected to network N2.
However, for the rest of the Internet, router R2 is used.

So instead of listing all networks in the entire Internet, host A can just
have one entry called the default (normally defined as network
address 0.0.0.0).

TCP/IP Protocol Suite 19


Figure 6.6 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

TCP/IP Protocol Suite 20


Forwarding with classful addressing

classful addressing has several disadvantages.

However, the existence of a default mask in a classful address makes the


forwarding process simple.

Discuss
Forwarding without subnetting : contents of a routing table and forwarding
module for the situation in which there is no subnetting.

Forwarding with subnetting

TCP/IP Protocol Suite 21


Forwarding without Subnetting

In classful addressing, most of the routers in the global Internet are


not involved in subnetting.

Subnetting happens inside the organization.

A typical forwarding module in this case can be designed using three


tables, one for each unicast class (A, B, C).

If the router supports multicasting, another table can be added to handle


class D addresses.

Having three different tables makes searching more efficient

TCP/IP Protocol Suite 22


Forwarding without Subnetting

Each routing table has a minimum of three columns:

1. The network address of the destination network.

2. The next-hop address tells us to which router the packet must be


delivered for an indirect delivery. This column is empty for a direct
delivery.

3. The interface number defines the outgoing port from which the
packet is sent out.

TCP/IP Protocol Suite 23


Figure 6.7 Simplified forwarding module in classful address without subnetting

TCP/IP Protocol Suite 24


Forwarding without Subnetting
The forwarding module follows these steps:

1. The destination address of the packet is extracted.

2. A copy of the destination address is used to find the class of the


address. This is done by shifting the copy of the address 28 bits to the
right. The result is a 4-bit number between 0 and 15. If the result is
0 to 7, the class is A.
8 to 11, the class is B.
12 or 13, the class is C .
14, the class is D.
15, the class is E.

3. The result of Step 2 for class A, B, or C and the destination address are
used to extract the network address. This is done by masking off
(changing to 0s) the rightmost 8, 16, or 24 bits based on the class

TCP/IP Protocol Suite 25


Forwarding without Subnetting

4. The class of the address and the network address are used to find next-
hop information. The class determines which table is to be searched. The
module searches this table for the network address. If a match is found,
the next-hop address and the interface number of the output port are
extracted from the table. If no match is found, the default is used.

5. The ARP module uses the next-hop address and the interface number
to find the physical address of the next router. It then asks the data link
layer to deliver the packet to the next hop.

TCP/IP Protocol Suite 26


Figure 6.8 Configuration for routing, Example 6.1

Figure 6.8 shows an imaginary part of the Internet. Show the routing tables
for router R1.

TCP/IP Protocol Suite 27


Example 6.1
Solution
The three tables used by router R1.

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).

TCP/IP Protocol Suite 28


Example 6.2
Router R1 in Figure receives a packet with destination address 192.16.7.14.
Show how the packet is forwarded.

TCP/IP Protocol Suite 29


Example 6.2
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.

TCP/IP Protocol Suite 30


Example 6.3
Router R1 in Figure receives a packet with destination address 167.24.160.5.
Show how the packet is forwarded.

TCP/IP Protocol Suite 31


Example 6.3

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.

TCP/IP Protocol Suite 32


Forwarding with Subnetting

In classful addressing, subnetting happens inside the organization.

The routers that handle subnetting are either at the border of the
organization site or inside the site boundary.

If the organization is using variable-length subnetting, we need


several tables; otherwise, we need only one table.

TCP/IP Protocol Suite 33


Figure 6.10 Simplified forwarding module in classful address with subnetting

Figure 6.10 shows a simplified module for fixed-length subnetting

TCP/IP Protocol Suite 34


Forwarding with Subnetting

1. The module extracts the destination address of the packet.

2. If the destination address matches any of the host-specific


addresses in the table, the next-hop and the interface number is
extracted from the table.

3. The destination address and the mask are used to extract the
subnet address.

4. The table is searched using the subnet address to find the next-hop
address and the interface number. If no match is found, the default
is used.

5. The next-hop address and the interface number are given to ARP .

TCP/IP Protocol Suite 35


Figure 6.11 Configuration for Example 6.4

Figure shows a router connected to four subnets.

36
Example 6.4

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, 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.

TCP/IP Protocol Suite 37


Example 6.5
The router in Figure receives a packet with destination address 145.14.32.78.
Show how the packet is forwarded.

TCP/IP Protocol Suite 38


Example 6.5

Solution

The mask is /18. After applying the mask, the subnet address is 145.14.0.0.

The packet is delivered to ARP with the next-hop address 145.14.32.78 and the
outgoing interface m0.

TCP/IP Protocol Suite 39


Example 6.6
A host in network 145.14.0.0 in Figure has a packet to send to the host with
address 7.22.67.91. Show how the packet is routed.

TCP/IP Protocol Suite 40


Example 6.6
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.

TCP/IP Protocol Suite 41


Forwarding with Classless Addressing

Destination address in the packet gives no clue about the network address.

Need to include the mask (/n) in the table;

Need to have an extra column that includes the mask for the corresponding
block.

classless routing table needs at least four columns.

TCP/IP Protocol Suite 42


Note

In classful addressing we can have a


routing table with three columns;
in classless addressing,
we need at least four columns.

TCP/IP Protocol Suite 43


Figure 6.12 Simplified forwarding module in classless address

TCP/IP Protocol Suite 44


Example 6.7
Make a routing table for router R1 using the configuration in Figure.

TCP/IP Protocol Suite 45


Example 6.7
Make a routing table for router R1 using the configuration in Figure 6.13.

Solution

TCP/IP Protocol Suite 46


Example 6.8
Show the forwarding process if a packet arrives at R1 in Figure with the
destination address 180.70.65.140.

TCP/IP Protocol Suite 47


Example 6.8
Show the forwarding process if a packet arrives at R1 in Figure 6.13 with the
destination address 180.70.65.140.

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
the interface number m0 are passed to ARP for further processing.

TCP/IP Protocol Suite 48


Example 6.9
Show the forwarding process if a packet arrives at R1 in Figure with the
destination address 201.4.22.35.

TCP/IP Protocol Suite 49


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 .

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.

3. The third mask (/24) is applied to the destination address. The result is
201.4.22.0, which matches the corresponding network address.

The destination address of the packet and the interface number m3 are passed
to ARP

TCP/IP Protocol Suite 50


Example 6.10
Show the forwarding process if a packet arrives at R1 in Figure with the
destination address 18.24.32.78.

TCP/IP Protocol Suite 51


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.

This is probably an outgoing package that needs to be sent, via the default
router, to someplace else in the Internet.

TCP/IP Protocol Suite 52


Example 6.11

The routing table for router R1 is given in Table 6.2. Draw its topology?

TCP/IP Protocol Suite 53


Figure 6.14 Guessed topology for Example 6.11

TCP/IP Protocol Suite 54


Address aggregation

TCP/IP Protocol Suite 55


Longest mask matching

Example: Packet arrived at R2: 140.24.7.200 .

TCP/IP Protocol Suite 56


Hierarchical routing with ISPs
To solve the problem of gigantic routing tables, we can create a hierarchy in the
routing tables.

The Internet today has a sense of hierarchy. Internet is divided into backbone,
regional and local ISPs.

If the routing table has a sense of hierarchy like the Internet architecture, the
routing table can decrease in size.

Let us take the case of a local ISP. A local ISP can be assigned a single, but large,
block of addresses with a certain prefix length.

The local ISP can divide this block into smaller blocks of different sizes, and
assign these to individual users and organizations.

If the block assigned to the local ISP starts with a.b.c.d/n, the ISP can create
blocks starting with e.f.g.h/m, where m may vary for each customer and is
greater than n.

TCP/IP Protocol Suite 57


Hierarchical routing with ISPs
How to reduce the size of the routing table ?

All customers of the local ISP are defined as a.b.c.d/n to the rest of the
Internet.

Every packet destined for one of the addresses in this large block is
routed to the local ISP. There is only one entry in every router in the
world for all of these customers.

Inside the local ISP, the router must recognize the subblocks and route
the packet to the destined customer.

TCP/IP Protocol Suite 58


Figure 6.17 Hierarchical routing with ISPs

TCP/IP Protocol Suite 59


Geographical Routing

To decrease the size of the routing table even further, we need to extend
hierarchical routing to include geographical routing.

We must divide the entire address space into a few large blocks.

We assign a block to America, a block to Europe, a block to Asia, a block to


Africa, and so on.

The routers of ISPs outside of Europe will have only one entry for packets to
Europe in their routing tables.

TCP/IP Protocol Suite 60


Routing Table Search Algorithms

Searching in Classful Addressing

• In classful addressing, the routing table is organized as a list.

• To make searching more efficient, the routing table can be divided into three
tables (called buckets), one for each class.

• When the packet arrives, the router applies the default mask to find the
corresponding bucket (A, B, or C).

• The router then searches the corresponding bucket instead of the whole
table.

TCP/IP Protocol Suite 61


Searching in Classless Addressing

In classless addressing, there is no network information in the destination


address.

The simplest, but not the most efficient, search method is called the longest
prefix match.

The routing table can be divided into buckets, one for each prefix. The router first
tries the longest prefix.

If the address is not found, the next prefix is searched. And so on.

It is obvious that this type of search takes a long time. One solution is to change
the data structure used for searching.

Instead of a list, other data structures (such as a tree or a binary tree) can be
used.
TCP/IP Protocol Suite 62
Forwarding Based on Label

In a connectionless network (datagram approach), a router forwards a packet


based on the destination address.

In a connection-oriented network (virtual-circuit approach), a switch forwards a


packet based on the label attached to a packet.

Routing is normally based on searching the contents of a table; switching can


be done by accessing a table using an index.

In other words, routing involves searching; switching involves accessing.

TCP/IP Protocol Suite 63


Figure 6.18 Example 6.13: Forwarding based on destination address

Destination interface and


address
next-hop address

x
y
x

TCP/IP Protocol Suite 65


Figure 6.19 Example 6.14: 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

TCP/IP Protocol Suite 67


MPLS (Multi Protocol Label Switching)

Here some conventional routers in the Internet can be replaced by MPLS routers
that can behave like a router and a switch.

When behaving like a router, MPLS can forward the packet based on the
destination address; when behaving like a switch, it can forward a packet based
on the label.

To simulate connection-oriented switching using a protocol like IP, the first thing
needed is to add a field to the packet that carry the label.

The whole IP packet is encapsulated as the payload in an MPLS packet and


MPLS header is added.

Figure 6.20 MPLS header added to an IP packet


TCP/IP Protocol Suite 68
END.

TCP/IP Protocol Suite 69

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy