What is the Network Layer

In this article, we will learn about network layer of the OSI model. Also, the responsibilities of the network layer.


The Internet is only conceivable because to network-to-network connectivity.

Sending data packets back and forth between various networks is how these connections are made at the “network layer” of the Internet communications process. The network layer is layer 3 in the seven-layer OSI model (see below).

One of the primary protocols used at this layer is the Internet Protocol (IP), along with a number of others for routing, testing, and encryption.

Say Bob wishes to send Alice a message, and Bob and Alice are both connected to the same local area network (LAN). Bob could transfer it immediately to Alice’s computer through the network as they are both on the same network. Bob’s message will first need to be addressed and sent to Alice’s network before it can reach her computer, which is a process done at the network layer, if Alice is situated on a different LAN that is several miles away.

What is a network?

A group of two or more linked computing devices is referred to as a network. Typically, a router or other central hub serves as the connection point for all networked devices. Subnetworks, or more compact sections of the network, are another type of network. Subnetworking is the mechanism used by extremely large networks, like those offered by ISPs, to control thousands of IP addresses and associated devices.

Consider the Internet as a network of networks, where computers are linked to one another through various networks that in turn connect to other networks. This makes it possible for these computers to link with both nearby and distant computers.

What happens at the network layer?

The network layer is where everything that has to do with inter-network connections happens. Setting up the routes that data packets will follow, determining whether a server on another network is operational, and addressing and receiving IP packets from other networks are all included in this. Given that IP is used to transmit the great bulk of Internet data, the last process is likely the most crucial.

The network layer is considered the backbone of the OSI Model. It sends packets end-to-end from the source to the destination through the Internet. A packet is a crucial fundamental component of networks. We refer to a self-contained group of data along with a header that explains what the data is, where it is going, and where it came from as a packet.

Datagrams are a name for network layer packets. Like we place the “To:” and “From:” addresses on a letter, they are made up of some data and a head that contains the “To” and “From” addresses. Giving the datagram to the connection Layer below and instructing it to send it via the first connection is what the Network does. In other words, the Link Layer is giving the Network Layer a service. The Link Layer essentially says, “If you give me a datagram to send, I will transmit it over one link for you.”

Each piece of data that is transmitted via the Internet is divided into smaller units called “packets.” For instance, when Bob sends Alice a message, Alice’s computer disassembles and then reassembles Bob’s message. The header, which includes details about the packet, and the body, which is the actual data being transferred, make up a packet.

When a packet is sent over the Internet, networking software adds a header at the network layer so that networking software on the receiving end can use the header to determine how to handle the packet.

Each packet’s content, source, and destination are listed in a header (similar to the stamping of an envelope’s destination and return address). An IP header, for instance, comprises the destination IP address of each packet, its total size, whether or not it was fractured (split up into even smaller pieces) during transit, and the number of networks the packet has passed through.

A router is located at the other end of the link. The router’s Link Layer receives the datagram from the link and passes it on to the Network Layer. The network layer on the router looks at the datagram’s destination address and is in charge of routing it one hop at a time to its final destination. To do this, it sends the data back to the Link Layer for transmission over the subsequent link. and so forth until it reaches the destination’s Network Layer.

It is important to note that the Network Layer need not worry about the manner in which the Link Layer sends the datagram through the link. In actuality, several Link Layers operate in wildly dissimilar ways; Ethernet and WiFi, for example, are obviously extremely different. Each layer may concentrate on doing its task without worrying about how the other layer functions because to the separation of concerns between the Network Layer and the Link Layer. It also means that by simply giving them datagrams to send, a single Network Layer can communicate with several different Link Layers in a similar method. The modularity of each layer and a common, clearly defined API to the layer below enable this separation of responsibilities.

The network layer of the internet is unique in that we must employ the Internet Protocol when sending packets into it. The Internet is held together by the Internet Protocol, or IP. IP offers an intentionally basic service. It is a basic, stupid, minimum service with the following four features: Datagrams are sent via the Internet one hop at a time. The service is unreliable and best-effort; the protocol is connectionless because there is no per-flow state.

What is the OSI model?

An explanation of how the Internet functions is provided by the Open Systems Interconnection (OSI) Model. It divides the seven layers of tasks involved in delivering data via the Internet. Each layer performs a different task that gets the data ready to be transmitted as a stream of bits through wires, cables, and radio waves.

The OSI model’s seven layers are:

  1. Application layer: Information produced by and useable by software programmes. HTTP is the primary protocol utilised at this tier.
  2. Presentation layer: The application-acceptable version of the data is transformed. According to some authorities, this layer is where HTTPS encryption and decryption happens.
  3. Session layer: controls the connections between computers (TCP can also handle this at layer 4).
  4. Transport layer: This layer offers the means for data transmission between the two linked parties and manages service quality. TCP and UDP are the two primary protocols in use here.
  5. Network layer: Manages data routing and transmission between various networks. IP and ICMP are the two most significant protocols at this layer.
  6. Data link layer: Communicates with devices connected to the same network. Layer 2 is comparable to providing the office or flat number at that address if Layer 3 is like the address on a piece of mail. The most common protocol used here is Ethernet.
  7. Physical layer: The smallest units of information, known as bits, are transferred as electrical, radio, or optical pulses through wires, radio waves, or cables in place of packets.

The OSI model is an abstract picture of the mechanisms that sustain the Internet, and it can be difficult to grasp and apply to the actual Internet.

The OSI model is helpful for illustrating generally how the Internet functions, identifying which protocols are utilised by which software and hardware, and helping people converse about networking devices and protocols. However, it does not provide a strict, step-by-step explanation of how Internet connections always work.

OSI model vs. TCP/IP model

An alternate theory of how the Internet functions is the TCP/IP model. Instead of seven layers, the processes are divided into four layers. The OSI model is still frequently used to comprehend the Internet, however some would argue that the TCP/IP model more accurately captures how it works today. Both models have advantages and disadvantages.

The four layers in the TCP/IP model are:

  1. Application layer: This roughly relates to layer 7 of the OSI model.
  2. Transport layer: relates to layer 4 of the OSI model.
  3. Internet layer: relates to layer 3 of the OSI model.
  4. Network access layer: This is a combination of layers 1 and 2 of the OSI model.

Protocols used at the Network Layer:

A protocol is a set of rules for how data should be formatted so that two or more devices can talk to and understand one another. At the network layer, connections, testing, routing, and encryption are made possible via a variety of protocols, including:

  • IP
  • IPsec
  • ICMP
  • IGMP
  • GRE

Responsibilities of the Network Layer

  1. Routing: Routers are an essential component at this layer because they literally route information between networks. The router will transfer packets to the router’s output link once they have reached the router’s input link. For instance, the following router on the way to S2 must receive a packet from S1 to R1.The connecting devices (routers and switches) route and switch the packets from source to destination when there are multiple separate networks joined to form a bigger network.To send packets from source to destination, there may be more than one path available. Therefore, utilising routing protocols, the network layer is in charge of selecting the optimum way or route to send packets.To store the details of the quickest route from host to destination, the network layer constructed a routing table. This table is also utilised throughout the switching process. The routing table is used during switching to direct packets to various networking devices:
  2. Logical Addressing: Physical addressing is implemented at the data connection layer, while logical addressing is implemented at the network layer. To distinguish between source and destination systems, logical addressing is also used. The logical addresses of the sender and the recipient are added as a header to the packet by the network layer.
  3. Internetworking: The network layer’s primary function is to establish a logical connection between various types of networks.
  4. Fragmentation: To lessen the overload on the routes, it fractures the packets. It is possible that the amount of data is greater than what the router can handle. This layer breaks the data up into smaller pieces before sending it on. Additionally, it is in charge of gathering the fragmented data on the receiving host. But only the destination node experiences the accumulation of fragmented data: The technique of fragmenting packets into the smallest possible individual data units allows them to pass over various networks.
  5. The network layer is in charge of taking frames from the data link layer and sending them to the correct locations based on the addresses they contain.
  6. Using logical addresses like IP (Internet Protocol) addresses, the network layer locates the destination.

Leave a Comment