Function of Network Layer

By Neeraj Dubey|Updated : October 11th, 2022

The Function of Network Layer in OSI Model is to interconnect the various networks. The Internet is enabled by network-to-network connections, which are performed by exchanging packets of data between different networks at the "network layer." In the 7-layer OSI model, the network layer is layer 3.

Function of Network Layer in OSI Model PDF

In this article, we will discuss various functions offered by a network layer in a computer network. Furthermore, we will look into different techniques to implement these functions and their respective algorithms and concepts.

Download Complete Analog Circuit Formula Notes PDF

Table of Content

Functions of Network Layer in OSI Model

The network layer is primarily responsible for connecting different networks by forwarding packets to network routers, which use algorithms to determine the best paths for data to travel. The function of the network layer is essential for the GATE exam.

State Functions of Network Layer

The function of the network layer includes:

  • Establishing the routes the data packets will take.
  • Looking for up-and-running servers on another network.
  • Using IP packets to address and receive other network packets.

The responsibilities of a network layer are segmented into four major roles. They are listed below.

  • Internetworking
  • Addressing
  • Packetization
  • Routing

Download Formulas for GATE Computer Science Engineering - Operating Systems

Internetworking

A network is made up of multiple small networks that are connected by intermediate networking devices that function as a single large network. It is the most basic service offered as a network layer function. Various questions are seen in the GATE previous years' question papers.

E.g., Connecting multiple LAN and WAN networks.

Type of Internetworking

Internetworking is implemented in the OSI model's Layer 3 (Network Layer). Internetwork can have three different forms depending on who administers and participates in it:

  • Extranet an extranet is an extension of an intranet. It lets approved third parties (vendors or customers) access restricted information.
  • Intranet, an intranet is an online network only company employees can access.
  • In computing, the internet or the world wide web is a collection of computer networks spanning the globe.

Internetworking

Addressing

The other function of the network layer addressing. The network layer adds a logical address that is the source and destination address as a part of the IP header to the segment coming from above the Transport Layer. For example, in layer 3 (Network Layer), the addressing is logical, and the logical addresses are known as IP addresses, which can be either IPv4 or IPv6. The addresses are selected from the address space.

Address Space

It defines the range of addresses used by the protocol. Each networking device will get an address from this address space.

IPv4 Addresses

IPv4 addresses are 32-bit addresses uniquely and universally define a device's connection. Addresses are unique in that each address represents a single internet connection.

Since an IPv4 address is 32 bits in size, the total number of possible addresses is 2^32 = 4,294,967,296. This means that theoretically, 4 billion devices can be connected to the Internet, but practically this number is way less because of some restrictions.

Download Formulas for GATE Computer Science Engineering - Databases

IPv6 Addresses

It is the successor of a previous addressing structure, IPv4, which had limitations IPv6 aims to overcome. IPv6 addresses are alphanumeric values of 128 bits. Notably, IPv6 has drastically increased address space compared to IPv4.

Furthermore, since the IPv6 address is 128 bits in size, the total number of possible addresses is 2^128; thereby, the number of devices that can be addressed is increased hugely.

Representation of Addressing

The representation example of IPv4 and IPv6 in a computer network is shown below:

IP addressing

Packetization

It is one of the crucial functions of the network layer offered by the third layer of the OSI model. The process that encapsulates the payload (bigger size data into packets) at the source (sender computer) via the network layer and decapsulates those packets at the destination (receiver) is called Packetizing.

A packet is a sub-block of an information block, segmented for ease and efficient transmission over the network. These packets are transmitted using switching techniques. The network layer uses Datagram Packet switching techniques.

Packet Switching

Switching is the process of information directed through different nodes in a channel between a sender and a destination. These switching can be connection-oriented or connection-less. We can have two types of packet-switched networks-

  • Datagram Switching Network (Used in Network Layer)
  • Virtual-Circuit Networks (Used in Data Link Layer)

Datagram Switching Network

In the datagram network, each packet is treated independently of all others. Even if a packet is part of the multipacket transmission, the network treats it as though it existed alone.

Datagram switching

The transit time diagram of Datagram switching is shown below. It shows the delay before receiving the information as a whole.

Switching Time diagram

Routing

Network routing is selecting a path across one or more networks. Routing principles can apply to any network, from telephone networks to public transportation. It is counted as the two most important features of a function of the network layer.

A routing protocol determines how IP packets will be transmitted between the information's origin and destination.

Routing

Routers are network hardware devices that make these decisions about internet routing.

Types of Routing in a Network

Routing in a network is done by some having a metric for the transit of datagram or packets. Some of these metrics are listed below:

  • Distance Vector Routing
  • Link State Routing

Distance Vector Routing

A distance vector represents the least cost path in the least cost tree. In this type of routing, each node in a network first creates a distance vector from its neighbor nodes.

Distance Vector Routing Algorithm

The heart of distance-vector routing is the famous Bellman-Ford equation.

Bellman Ford Equation

Link State Routing

In this routing technique, a LInk-State Database is formed by analyzing the least cost routing over a whole network.

Link State Routing Algorithm 

To create a least-cost tree for itself, using the shared LSDB, each node needs to run the famous Dijkstra Algorithm.

Dijkshtra Algorithm

Two Important Key Functions of Network Layer

A network layer provides services like packetization, logical addressing, routing, and internetworking; however, the two most important functions of a network layer are-

  • Packetizing- Segmenting an information block into segments called packets or datagrams.
  • Routing- Deciding the routes that follow and setting priorities of packets.

Functions of Network Layer MCQs

We have discussed the different functions of the network layer and have a general idea about the techniques and algorithms used for implementing these techniques. We will see a few example questions to summarize our discussion-

Question 1: Which of these is the main function of the network layer?

(a) Routing (b) Packetizing (c) Addressing (d) Internetworking

Ans. (a) Routing and (b) Packetizing

Question 2: Which of the following is not a function of the network layer?

(a) Routing (b) Packetizing (c) Addressing (d) Error Control

Ans. (d) Error Control

Question 3: Which of the following switching technique does the network layer using?

(a) Circuit Switching (b) Message Switching (c) Datagram Packet Switching

Ans. (c) Datagram Packet Switching

Important Topics for GATE Exam
ResponsivityCharacteristics of Laser
SR Flip-FlopTie Set Matrix
Norton's TheoremWhat is Laser?
P N Junction DiodeTellegen's Theorem
Classless AddressingSimple Diode Circuits

Comments

write a comment

FAQs on Function of Network Layer

  • Basically, the network layer is responsible for interconnecting different networks by forwarding packets to network routers, which use algorithms to determine the best paths for data transmission.

  • A network layer is primarily concerned with routing data from one network to another. IP addresses are used to identify the source and destination. A network layer provides connectionless, best-effort delivery of data between two networks.

  • In network layer, routing tables are created. Based on these routing tables, the input request is forwarded. Devices used in the network layer include routers, switches-like devices that route and forward data packets based on their IP addresses.

  • As part of the network layer, data packets are routed according to a variety of factors, including network characteristics, best available paths, traffic controls, congestion, and priority of service.

  • The OSI model consists of seven layers, including Physical Layer, Data Link Layer, Network Layer, Transport Layer, Session Layer, Presentation Layer, and Application Layer.

Follow us for latest updates