Network Layer

The Network layer is the third layer in the OSI model. The network layer controls host and network addressing, sub-network management, and internetworking.

The network layer is in charge of routing packets from a source to a destination within or outside of a subnet.
Different addressing schemes or non-compatible addressing types may exist between two subnets.
In the same way, two separate subnets may use different protocols that are incompatible with one another.
The network layer is in charge of routing packets from source to destination while mapping various addressing schemes and protocols.

  • The Network Layer is the OSI model’s third layer.
  • It takes care of service requests coming in from the transport layer and passes them on to the data link layer.
  • The logical addresses are translated into physical addresses by the network layer.
  • It determines the path from the source to the destination, as well as managing traffic issues such as switching, routing, and controlling data packet congestion.
  • The network layer’s primary function is to transport packets from a sending host to a receiving host.

The network layer’s primary functions are as follows:

  • Routing: When a packet arrives at the router’s input link, it is forwarded to the router’s output link.
    A packet sent from S1 to R1 must, for example, be sent to the next router on the path to S2.
  • Physical addressing is implemented by the data connection layer, whereas logical addressing is implemented by the network layer.
    To distinguish between the source and destination systems, logical addressing is also used.
    The network layer adds a header to the packet that includes the sender and receiver’s logical addresses.
  • Internetworking: The network layer’s primary function is to enable logical connections between various types of networks.
  • Fragmentation is the process of breaking down packets into the smallest individual data units that can travel across multiple networks.
  •  Fragmentation is a process of breaking the packets into the smallest individual data units that travel through different networks.

Forwarding & Routing

A router is used to forward packets to the network layer. A forwarding table is found on every router. A router passes a packet by checking the header field and then indexing it into the forwarding table using the header field value. The router’s outgoing interface link to which the packet is to be sent is indicated by the value recorded in the forwarding table corresponding to the header field value.

For example, if a router arrives with a header field value of 0111, the router indexes this value into the forwarding table, which determines that the output link interface is 2. The packet is forwarded to interface 2 by the router. The values that are entered into the forwarding table are determined by the routing algorithm. It is possible to have a centralized or decentralized routing algorithm.

The Network Layer Provides Services

  • Guaranteed delivery: This layer provides a service that ensures the packet arrives at its intended location.
  • Guaranteed delivery with bounded delay: This service ensures that the packet arrives within a defined host-to-host delay bound.
  • In-Order Packets: With this service, packets arrive at their destination in the order in which they were sent.
  • Guaranteed maximum jitter: With this service, the time between two consecutive transmissions at the sender is the same as the time between their receipt at the destination.
  • Services of security:
    A session key between the source and destination hosts is used by the network layer to guarantee security.
    The payloads of datagrams delivered to the destination host are encrypted by the network layer of the source host.
    The payload would then be decrypted by the network layer on the target host.
    The data integrity and source authentication services are maintained by the network layer in this manner.
  •  The network layer provides security by using a session key between the source and destination host. The network layer in the source host encrypts the payloads of datagrams being sent to the destination host. The network layer in the destination host would then decrypt the payload. In such a way, the network layer maintains the data integrity and source authentication services.