The Wayback Machine - https://web.archive.org/web/20250123121139/https://www.geeksforgeeks.org/network-layer-services-packetizing-routing-and-forwarding/
Open In App

Network Layer Services- Packetizing, Routing and Forwarding

Last Updated : 28 Dec, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The network Layer is the third layer in the OSI model of computer networks. Its main function is to transfer network packets from the source to the destination. It involves both the source host and the destination host.

Key among these services are packetizing, routing, and forwarding. Packetizing involves encapsulating data into packets suitable for transmission. Routing determines the optimal path for these packets through the network, ensuring they navigate through multiple nodes and networks efficiently. Forwarding is the process of directing these packets to their next hop along the selected path.

In this article, we will discuss these topics in detail, along with the services provided by the network layer, etc.

What is the Network?

A network is a group of two or more connected computers or devices. These devices usually connect to a central hub, like a router. Networks can also have subnetworks, which are smaller sections of the main network. Subnetworks help large networks, such as those used by Internet Service Providers (ISPs), manage many IP addresses and devices.

The Internet is like a network of networks. Computers connect within their own networks and then connect to other networks. This allows computers to communicate with each other, no matter where they are.

What is the Network Layer?

The network layer is a part of the communication process in computer networks. Its main job is to move data packets between different networks. It helps route these packets from the sender to the receiver across multiple paths and networks. Network-to-network connections enable the Internet to function. These connections happen at the “network layer,” which sends data packets between different networks. In the 7-layer OSI model, the network layer is layer 3. The Internet Protocol (IP) is a key protocol used at this layer, along with other protocols for routing, testing, and encryption.

Features of Network Layer

  • The main responsibility of the Network layer is to carry the data packets from the source to the destination without changing or using them.
  • If the packets are too large for delivery, they are fragmented i.e., broken down into smaller packets.
  • It decides the route to be taken by the packets to travel from the source to the destination among the multiple routes available in a network (also called routing).
  • The source and destination addresses are added to the data packets inside the network layer.

Services Offered by Network Layer

The services which are offered by the network layer protocol are as follows: 

1. Packetizing

The process of encapsulating the data received from the upper layers of the network (also called payload) in a network layer packet at the source and decapsulating the payload from the network layer packet at the destination is known as packetizing. 

The source host adds a header that contains the source and destination address and some other relevant information required by the network layer protocol to the payload received from the upper layer protocol and delivers the packet to the data link layer. 

The destination host receives the network layer packet from its data link layer, decapsulates the packet, and delivers the payload to the corresponding upper layer protocol. The routers in the path are not allowed to change either the source or the destination address. The routers in the path are not allowed to decapsulate the packets they receive unless they need to be fragmented.  

Packetizing

Packetizing

2. Routing

Routing is the process of moving data from one device to another device. These are two other services offered by the network layer. In a network, there are a number of routes available from the source to the destination. The network layer specifies some strategies which find out the best possible route. This process is referred to as routing. There are a number of routing protocols that are used in this process and they should be run to help the routers coordinate with each other and help in establishing communication throughout the network.

Routing

Routing

3. Forwarding

Forwarding is simply defined as the action applied by each router when a packet arrives at one of its interfaces. When a router receives a packet from one of its attached networks, it needs to forward the packet to another attached network (unicast routing) or to some attached networks (in the case of multicast routing). Routers are used on the network for forwarding a packet from the local network to the remote network. So, the process of routing involves packet forwarding from an entry interface out to an exit interface.

Forwarding

Forwarding

Differences Between Routing and Forwarding

Routing                                                                 Forwarding                           
Routing is the process of moving data from one device to another device. Forwarding is simply defined as the action applied by each router when a packet arrives at one of its interfaces.
Operates on the Network Layer. Operates on the Network Layer.
Work is based on Forwarding Table. Checks the forwarding table and work according to that.
Works on protocols like Routing Information Protocol (RIP) for Routing. Works on protocols like UDP Encapsulating Security Payloads

Other Services Expected from Network Layer

1. Error Control

Although it can be implemented in the network layer, it is usually not preferred because the data packet in a network layer may be fragmented at each router, which makes error-checking inefficient in the network layer.

2. Flow Control

It regulates the amount of data a source can send without overloading the receiver. If the source produces data at a very faster rate than the receiver can consume it, the receiver will be overloaded with data. To control the flow of data, the receiver should send feedback to the sender to inform the latter that it is overloaded with data. 
There is a lack of flow control in the design of the network layer. It does not directly provide any flow control. The datagrams are sent by the sender when they are ready, without any attention to the readiness of the receiver. 

3. Congestion Control

Congestion occurs when the number of datagrams sent by the source is beyond the capacity of the network or routers. This is another issue in the network layer protocol. If congestion continues, sometimes a situation may arrive where the system collapses and no datagrams are delivered. Although congestion control is indirectly implemented in the network layer, still there is a lack of congestion control in the network layer. 

Advantages of Network Layer Services

  • Packetization service in the network layer provides ease of transportation of the data packets.
  • Packetization also eliminates single points of failure in data communication systems.
  • Routers present in the network layer reduce network traffic by creating collision and broadcast domains.
  • With the help of Forwarding, data packets are transferred from one place to another in the network.

Disadvantages of Network Layer Services

  • There is a lack of flow control in the design of the network layer.
  • Congestion occurs sometimes due to the presence of too many datagrams in a network that is beyond the capacity of the network or the routers. Due to this, some routers may drop some of the datagrams, and some important pieces of information may be lost.
  • Although indirect error control is present in the network layer, there is a lack of proper error control mechanisms as due to the presence of fragmented data packets, error control becomes difficult to implement.

Conclusion

The network layer provides essential services like packetizing, routing, and forwarding. Packetizing breaks data into smaller packets for easy transmission. Routing determines the best path for these packets to travel across networks. Forwarding ensures that packets move from one network to another until they reach their destination. These services work together to ensure efficient and reliable data communication over the Internet.

Frequently Asked Questions on Network Layer Services – FAQs

How do routers decide the best path for data packets?

Routers use routing tables and protocols to decide the best path. They consider factors like distance, speed, and network congestion to choose the most efficient route.

What information is in a packet header?

A packet header contains information about the packet, such as the source and destination IP addresses, packet size, and routing information. This helps the network layer manage the packet’s journey.

Why is packetizing important?

Packetizing allows data to be transmitted efficiently and reliably. Smaller packets can navigate network paths more easily and can be reassembled at the destination even if they take different routes.

What happens if a packet gets lost?

If a packet gets lost, the network protocols detect the loss and request retransmission of the missing packet. This ensures that the complete data reaches its destination accurately.

Can packets take different routes to the same destination?

Yes, packets can take different routes to the same destination. This is known as packet switching, and it helps in optimizing network traffic and avoiding congestion.



Next Article

Similar Reads

three90RightbarBannerImg