LDP/LDP/inprogress/Linux-Networking/Layering.xml

226 lines
8.2 KiB
XML

<sect1 id="Layering">
<title>Layering</title>
<para>
Using a virtual machine concept, each layer of a network stack
is a virtual machine, with layer one being the physical machine and
the top layer providing the highest level functionality or the
functions that are most abstracted from the physical world. The
top layer is directly interpreted by human beings. The bottom layer
provides the lowest level functionality, ie. it is strongly related
to the physical world and (preferably) is not interpreted by human
beings.
</para>
<para>
In a layered model, entities forming the corresponding layers on different
machines are called peers and protocols form a central part of network
software. The layered approach to networks and general software engineering
principles adopted add to the structure of network software with each layer
performing a small set of well defined functions (services) required by the
layer above it.
</para>
<para>
This layered approach offers a communication setting where layer n on one
machine can have a conversation with layer n on another machine. Layer
n-protocol is essentially a set of rules and conventions facilitating
this conversation. This includes addressing and specification of necessary
DU's (Data Units).
</para>
<para>
You should note that the communication between layers is virtual. There is
no physical or direct communication taking place between layers of two
layer-n hosts. The actual communication takes place at the lowest layer
(usually called the physical layer). The conglomeration of layers and
corresponding layer protocols form a network architecture/network stack.
</para>
<para>
The general consensus in computing is that a typical data unit exchanged
between systems should consist of the address of the transmitting computer,
the address of the receiving computer, the actual data being transmitted, as
well as a checksum.
</para>
<para>
This leads us to the problem of addressing. In order for computers to
communicate properly it was generally agreed by Ethernet card manufacturers
that all NIC cards would possess a 48 bit unique address. This is called a
MAC address but is often called the hardware address of these cards. This
aids portability and modularity of LAN (Local Area Network) technology and
software to a major extent. The data units here are called as frames. This
is all you need really to have a small network.
</para>
<para>
However, there exists a fundamental problem if you were to extend this idea
to larger systems (ie. greater than 100 nodes). It is extremely difficult to
keep track of and maintain such a network due to administrators having to keep
track of the name of each and every system and deciding what the name of new
computers on the network will be.
</para>
<para>
For this reason, the idea of hostnames and network addresses were developed.
For example, on the LAN a computer may be called "computer" but on the internet
it may be referred to as "computer.network.com". The idea behind network
addressing came to be known simply now as IP (Internet Prococol) addressing.
</para>
<para>
You could say that the idea behind computer network addressing is roughly
synonymous with that of the rather mundane telephone network. To call a number
in your region all you have to do is dial that number. To call a number in another
state you must add a number of other digits to the start of the number. To call a
number that is overseas you must add further digits to the beginning of the now
burgeoning number. The only difference between telephone and network addressing is
that you add numbers to the front rather than at the end of the address.
</para>
<para>
To this day, it has been found that by utilising so called layer architecture for
networks, suitable protocols and appropriate communication technologies the issues
of network application interfacing, network addressing and network functionality
can be addressed successfully.
</para>
<para>
There are eight main network technology issues that must be addressed at each layer
in the architecture though. These are outlined below:
</para>
<para>
<screen>
1. Mechanism of identifying senders and receivers: addressing.
2. Rules for data transfer: simplex, half-duplex, or full-duplex.
3. Logical channels: sharing a link among a number of connections.
4. Error control strategies: correction and detection.
5. Sequencing protocols for the correct order of messages: put messages in the correct order.
6. Incompatible speed between fast sender and slow receiver.
7. Message fragmentation and assembly.
8. Strategies for choosing routes.
</screen>
</para>
<para>
To study the above issues in detail please consult, Tannenbaum 4th edition.
</para>
<para>
These design issues become recurring themes that are usually addressed by
each and every layer in the architecture. As a stark example, although error
detection and correction is undertaken by the low level transmission protocol
that sends characters from a terminal to the display, the user will also
implement error detection and correction at the highest level by deleting an
incorrect character and retyping.
</para>
<para>
A concept of an interface is central to layered network architecture. It is important
to recognise implementation and design issues and pertaining to interfaces of layers
and their respective functions and services.
</para>
<para>
<screen>
entity:
in software, it is sometimes called a process;
in hardware in hardware it could mean in pratice an I/O chip
peer enties:
entities at the same layer in different machines/devices
service provider:
eg. layer n, a layer that provides a service
service receiver:
eg. layer n + 1, a layer that receives a service
service access point (SAP):
a point where service is accessed, for example a function call
in software, or the telephone for a telephone company
protocol data unit (PDU):
a data unit that is communicated between peer entities
service data unit (SDU):
the PDU from the serice receiver
protocol control information (PCI):
is appended by a service receiver to an SDU in order to
indicated the type of service required and forms the IDU
interface data unit (IDU):
the data unit that is given from a service receiver to a
service provider.
</screen>
</para>
<para>
The term "service" can be deemed to mean a number of things. These are outlined
below.
</para>
<para>
Quality of Service: each service is chractereised by a quality of service. For example,
reliable service by such applications as file transfer - the data must be delivered
correctly but it may be unusually delayed. However, voice and video transmission may
allow some error in the data but does not allow delayed data.
</para>
<para>
Connection and connectionless services are the two fundamental categories. The
distinctions between them may be intuitive but there are subtle differences. For
example, a connection-orientated services allows two communicating parties to make
use of the connection in any way they like - a telephone connection can even be
used for transmitting fax and digital information as the service provider doesn't
process the communication at any point through the network.
</para>
<para>
However a connectionless services does not provide such a convenience because
for example a letter may be packaged and processed along the way, being stamped
for accounting, delivered using a car or plane, etc....
</para>
<para>
A service is formally specified by a set of primitives (operations) that define
the service interface. The primitives differ for different services. As a simple
example, a service may provide the following primitives:
</para>
<para>
<screen>
LISTEN:
listen for an incoming communication request
CONNECT:
make a communication request
RECEIVE:
receive data of a communication
SEND:
send data of a communication
DISCONNECT:
disconnect or discontinue a communication
</screen>
</para>
<para>
As discussed before, each layer has specfic functions and offers certain services
to the layer above it. A service is a set of primitives (operations) that a layer
provides to the layer above it. In the definition of services, we do not specify
their implementation. The implementation is only visible to the provider of the
service. A protocol defines the implementation of the service and is not visible
to the user of the service.
</para>
</sect1>