Introduction to Networking

Network Layer

The network layer is the 5th Layer from the sender and the 3rd layer from the receiving side in the OSI model.

At the Sender Side, the Network layer receives segments from the transport layer, converts these segments into packets/datagrams, and transmits these packets/datagrams to the data link layer.

At the Receiver Side, the Network layer receives frames from the data link layer, converts these frames to packets/datagrams, and then transmits them to the transport layer.

Functionality of Network Layer

The network layer has various functions. Let’s explain all functions one by one,

1. Source to Destination Delivery

The network layer provides Source to destination Delivery, which is also called HOST-to-HOST delivery. The following figure shows host-to-host delivery

2. Routing 

The networking layer uses the Router device to determine the best optimal path out of the multiple paths from the source to the destination. The router uses routing protocols (i.e., RIP, OSPF, etc.)

3. Addressing

 As we know, the Network layer is used when source-to-destination delivery is required in different networks or over the Internet. The network layer uses the Logical (IP) Address to communicate over the internet. IP address contains the network ID and Host ID of the destination machine. The network layer uses IPV4 or IPV6 for addressing purposes.

4. Fragmentation

 Sometimes, when a sender sends a packet to a router, the router may not have enough space to accommodate the entire packet. So, it is necessary to break these packets into fragments (parts).

So, the fragmentation of packets/datagrams is also the responsibility of the network layer.

5. Congestion Control

In the case when maximum nodes send the data at a time to the same router even with fragmentations, then the buffer of the router may be out of capacity. In this case, traffic must be controlled. Controlling traffic is called congestion control.  So, in some cases, congestion control is required, which is also the responsibility of the Network layer.

6. Flooding

When a data packet arrives at a router, the router sends this data to all the outgoing links from the router except the link from which the data arrived.

Explain with example

Suppose there are 5 routers (A, B, C, D, and E) which are connected through transmission lines as given below.

By using the flooding technique

  • An incoming data packet from the sender will be sent to Router A.
  • Router A will forward the data packet to other routers B, C, and D.
  • B will send the packet to C.
  • C will send the packet to B, D, and E.
  • D will send the packet to C and E.
  • E will send the packet to D.

Note: The main advantage of flooding is that the shortest path is always chosen by flooding because, in flooding, each router holds the information of its neighbors.

In the upcoming lectures, we will see the details of network Layer functionalities.