Network Layer – Understanding Packet Delivery and Routing

In this lesson, you will learn about Network layer and its role in delivery, forwarding and routing in a network. You must be familiar with all the layer of OSI and TCP/IP to understand this article, because in computer networks, each layer affect each other during communication.

Delivery of Packet

Network layer supervises the handling of packets by underlying physical networks. We call it delivery of packets to destination. Delivery of packets to final destination is done it two ways.

Advertisements
  1. Direct – when the destination is in the same physical network or delivery between last router and destination.
  2. Indirect – packet goes from router to router until it reaches the one which is connected to same physical network as the destination.

Forwarding of packet

Forwarding means placing the packet in its route to destination and it requires a Routing table. All routes for a routing device is available in the routing table.

Forwarding techniques

  • Next Hop method vs. routing method

In this method, the routing table contains only address of next hop instead of information about the complete route as in routing method.

  • Network specific method vs. Host specific method

In this method, we reduce the size of routing table by replacing every host address on the same network by a single network address.

Where in Host Specific method, information about every host is included in the routing table.

Forwarding, Packet Deliver and Routing
Forwarding, Packet Deliver and Routing

Routing table of Host A based on route method

DestinationRoute
Host BR1, R2, Host B
Host BR2, Host B
Host BHost B

Routing table of Host A based on next hop method

DestinationRoute
Host BR1
Host BR2
Host B—–
Network Specific Method vs Host Specific Method
Network Specific Method vs Host Specific Method

Forwarding Process

When the packet arrives it has a destination address which is not enough to locate the network of destination  host. The routing table needs at least 4 field to find the network address of the destination, in classless addressing.

Mask (/n)Network AddressNext hop addressInterface
/26180.70.65.192M2
/25180.70.65.128M0
/24201.4.22.0M3

For example: suppose a packet came with destination address 180.70.65.140 and is compared with different subnet mask. If the result is a network address in the table, then forwarding happen to that address.

1011 01000100 01100100 00011000 1100

180 70 65 140

1111 11111111 11111111 11111000 0000

= /25

If AND both mask and destination address, we get

1011 01000100 01100100 00011000 0000

180                  70                  65                   128

The packet is routed to 180.70.65.128/25 in this way.

Address Aggregation

Advertisements

Classless addressing increases the size of the routing table because it divides the address space into many blocks.More the entry , more time required for searching the table. Address aggregation assign a common address for a block of address if the it is possible to combine the block of address, otherwise not.

Address Aggregation - Packet Delivery and Routing
Address Aggregation – Packet Delivery and Routing

Longest mask matching

The routing table entries are arranged in order where longest mask comes at top. Suppose we have /24, /26 and /27 . The first comes the /27, /26 and then /24 and so on.

Longest Mask Matching - Packet Deliver and Routing
Longest Mask Matching – Packet Deliver and Routing

Suppose a packet that arrive for destination 140.24.7.200 , then it will be ANDed with /26 and result will be 140.24.7.192 , but if the same address gets ANDed with some other mask , it will get routed to some other router.

Hierarchical Routing

In hierarchical routing, National ISPs have a block of address different from regional ISP address, and local ISP. All of them share a common ipaddress, but using the classless addressing scheme the addresses are subdivided into blocks at each level. Local ISP have a.b.c.d/m as common address , then it will have a block of address x.y.z.v/n as addresses.

Suppose 120.14.64.0/23 means 32-23 = 9
It means there is block size of 29 = 512 addresses.
At each level classless addressing is used and network is divided into blocks of addresses.

Routing table

A routing table is either static or dynamic. In this section we discuss both routing tables.

Static routing table

A static routing table contains information entered manually. When there is a change in the network it does not get updated automatically, administrator has to enter them manually. It can be used in a small internet or experimental internet where we do not have lot of changes.

Dynamic Routing table

A dynamic routing table is updated periodically by one of it’s routing protocol such as RIP, OSPF or BGP. The table gets updated automatically whenever there is a change in the internet hence it is suitable for big internet.

Format of routing table

MaskNetwork AddressNext-hop AddressInterfaceFlagsReference countUse
——–——–——–——–——–——–——–
  1. Mask – mask applied for the entry
  2. Network Address – network address or host address of the destination.
  3. Next-hop Address – address of next-hop router.
  4. Interface – name of the interface
  5. Flags – It is on/off flag that shows presence or absence. There are 5 flags
  6. U(up) – router is up and running.
  7. G(gateway) – destination is another network.
  8. H(host-specific) – entry in network address is host-specific.
  9. D(added by redirection) – added by redirection msg from ICMP.
  10. M(modified by redirection) – modified by redirection msg from ICMP.

Tools /Utilities – Packet Deliver and Routing

There are few important tool which is frequently used to check routing configuration or troubleshooting. These are the most popular ones and available with most of the system by default.

NETSTAT

Netstat is very popular tool among IT people. There are many switches that will tell you a lot about the host and the network.

Netstat
Netstat

IPCONFIG

The ipconfig is the default networking utility for finding ip related information on the host. You can use ipconfig /all, ipconfig/ renew to get new ipaddress and ipconfig /flushdns to clear dns cache.

IPCONFIG UTILITY
IPCONFIG UTILITY

TRACERT UTILITY

Tracert is a special utility that display all hop between the local host( computer) and destination ( google.com) in this example.

TRACERT UTILITY
TRACERT UTILITY

References

Andrew S. Tanenbaum, David Wetherall. n.d. Computer Networks. Pearson, 23-Jul-2013.

Behrouz A. Forouzan, Sophia Chung Fegan. n.d. Data Communications and Networking, Fourth Edition. mcgraw hill education.

Advertisements

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.