The Network Layer, from above.
The network layer concerns itself with getting data (that is, packets of data) all the way from
the source to the destination, over intermediate nodes if necessary. In the OSI reference
model, this layer lies above the datalink layer and below the transport layer - an understanding
of these two layers will make the function of the network layer more lucid. Before we discuss
the relationship between the network layer and its vertical neighbours, let us muse over the
very concept of having a "protocol stack".
Networks are designed in layered hierarchies (protocol stacks) simply to reduce complexity in
the design. The purpose of each layer in the hierarchy is to provice services to the layer above
it, while shielding the upper level from what happens below. In this way, each level provides
an abstraction to the level above it. This abstraction is quite desireable - for example, we
might wish to issue the message "Shut down the reactor" at a certain level, and not have to
worry about how the message is routed, what medium the message is routed on, whether the
message will be suitably fortified against transmission errors, whatever.
In such a hierarchy, any level is thus defined by the services it gives to the level above. For
the network layer, this is no exception. The network layer is however in a very special
position in the hierarchy, because it forms the interface between the users machine and the
network. That is to say, the network is controlled by the network layer and the two layers
below it. The four layers above this (transport, session , presentation and application) run on
the user's machine. So: the network layer defines the service provided by the network to the
user - it is the interface between the user and the outside world. When we consider the Public
network in this context, where the user pays for a network service (for example via telephone
bills). we can appreciate the importance of the term "service definition". The design of the
network layer was not just directed by a desire to provide a programming extraction - it was
motivated towards providing a service that could be sold to the user. The factors that went
into the design of the layer are interesting and involve the well worn dispute between
providing a Connection Oriented or a Connectionless service.
How does the network layer interact with the transport layer?
The interaction between the network and transport layers is defined in terms of the service
proviced to the transport layer. For details of this service, see the Service Primitives . The
network layer also provides an addressing scheme for machines.
How does the network layer interact with the datalink layer?
The datalink layer’s responsibility is to take a raw communication channel (provided by the
physical layer) and transform it into an error free transmission facility. To do this, it breaks
data up into frames, and uses acknowledgements and other devices to make the channel
reliable. Now, the important thing to note here is that this "raw" communication channel is
built over a single link between two nodes. It is often the case that two machines wishing to
communicate will not be directly connected in such a way - any communications between the
two will have to be routed first through one or more intermediate nodes. This is routing of
data is an everyday phenomena - every time we make a telephone call, we are being routed
through a number of switch boards, while being given the impression that we have a direct
"line" between ourselves and our colleagues. This routing of information is handled by the
network layer. The network layer thus conspires with the datalink layer by using many
datalink connections to provide one transparentlink between the source and the destination.
So, for the network layer to function, it must know of the underlying topology of the
communication network, and choose appropriate paths throught it. Routes must be chosen
carefully so as to avoid overloading certain lines while leaving others idle. In the event that
the destination (receiving) node in a communication cannot absorb the incoming data as fast
as it is being delivered, the network layer must provide mechanisms to correct this. Finally -
consider the case where the destination node is on a completely different type of network - it
is up to the network layer to resolve the differences between the two networks and ensure
good transmission.
The functionality of the network layer can thus be divided into three areas: