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.
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.
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.
It defines the range of addresses used by the protocol. Each networking device will get an address from this address space.
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.
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:
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.
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.
The transit time diagram of Datagram switching is shown below. It shows the delay before receiving the information as a whole.
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.
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.
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.
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|
|Responsivity||Characteristics of Laser|
|SR Flip-Flop||Tie Set Matrix|
|Norton's Theorem||What is Laser?|
|P N Junction Diode||Tellegen's Theorem|
|Classless Addressing||Simple Diode Circuits|