Network layer can provide host-to-host communication service. Unlike the transport and application layers, there is a piece of the network layer in each and every host and router in the network.

There’s a lot to cover in network layer, and it can be broken into 2 parts: the data plane and the control plane. Data plane is the per router functions in the network layer that determine how a datagram arriving on one of a router’s input links is forwarded to one of that router’s output links(In this section, IP forwarding and a more generalized forwarding is covered). We will also discuss IPv4 and IPv6 protocol and addressing in detail.

In the next chapter, the control plane is the network-wide logic that controls how a datagram is routed among routers along an end-to-end path from the source to the destination.

Overview of Network Layer

Forward and Routing: The Data and Control Planes

The primary role of the network layer is deceptively simple — to move packets from a sending host to a receiving host. To do so, 2 important network-layer functions can be identified:

A key element in every network router is its forwarding table. A router forwards a packet by examining the value of one or more fields in the arriving packet’s header, and then using these header values to index into its forwarding table. Values stored in the forwarding table would indicates the outgoing link interface.

Control Plane: The Traditional Approach

So how can one configure the forwarding table? A routing algorithm runs in each and every router and both forwarding and routing functions are contained within a router. For special cases, forwarding table can also be configured directly by human network operators physically present at the routers.

The SDN Approach

There’s an alternative approach in which a physically separate, remote controller computes and distributes the forwarding tables to be used by each and every router. Routers and the remote controller can communicate by exchanging messages containing forward table and other pieces This approach is the software-defined networking(SDN), where the network is “software-defined” with routers is implemented in software.

Network Service Model

When the transport layer at a sending host transmits a packet into the network, what exactly would happen and how would the network layer handle them? The network service model defines the characteristics of end-to-end delivery of packets between sending and receiving hosts.

The Internet’s network layer provides a single service known as the best-effort service. In such service, packets are neither guaranteed to be received in order they were sent nor is their eventual delivery guaranteed.

What’s Inside a Router?

A high-level view of a generic router architecture looks like this

Untitled

4 router components can be identified: