Or Data Communications revision...
Upper level protocols are carried by lower level protocols. Each layer addresses a different problem.
This really means that the Protocol Data Units (PDUs or "packets") of the higher level protocol are encapsulated (contained within) in the PDUs of the lower level protocol.
For example:
| Preamble | 7 bytes of 10101010 |
| Start of Frame |
1 byte, of 10101011 |
| Source and Destination Address |
These consists of 3 bytes of "Manufacturer ID", allocated by the IEEE and 3 bytes of "serial number". They are usually written as colon-separated hexadecimal byte values, eg: 08:00:20:0c:a3:55 |
| Type/Length field |
If less than or equal to 1500 decimal (0x5DC), then this is the length of
an 802.3 packet. If more than 1500, this is the type of an
"DIX (DEC/Intel/Xerox) Ethernet V2" packet. For example,
0x0800 indicates that the Ethernet
frame encapsulates an IP (Internet Protocol) packet.
|
| Data field | From 46 (preserves CSMA/CD minimum frame size requirement) to 1500 bytes. |
The IEEE 802 standards committee wanted a way of indicating what higher level protocol was carried by an 802.3 data packet (in Ethernet V2, the type field already carries this information). To allow this, a new Logical Link Control layer was created between the MAC layer and higher layers, thus:
DSAP, SSAP are
Service Access Point addresses which specify the network
layer protocol which generated this frame (SSAP) and the
protocol for which it is destined (DSAP). IEEE specifies
that 0xFE is used for the OSI network layer.
It became obvious after a short time that the 8-bit DSAP/SSAP field was clearly inadequate for all the possible "higher layer" protocols which might wish to use 802.2 encapsulation.
IEEE solved this problem by defining the Sub Network Access Protocol (SNAP) subset of 802.2 type-1 service.
An 802.2 SNAP frame looks like:
Note that for IP encapsulation in 802.2/SNAP, the "Protocol/Org ID"
field is all zeros, and the "Type" field is the standard Ethertype
value, 0x0800.
For Appletalk, which uses 802.2 SNAP encapsulation exclusively,
the SNAP field is 0x080007809B.
An IP datagram is encapsulated in an underlying protocol frame (eg, MAC layer (Ethernet)) for delivery.
For local delivery the datagram is normally arranged to fit into a single frame: for example, for delivery on an Ethernet a datagram should be <1500 bytes. This is called the Maximum Transmission Unit (or MTU) of the network.
All IP gateways (routers) are required to support an MTU of at least 576 bytes on all of their interfaces.
Where the datagram has to cross an unknown number of routers to arrive at its destination, the MTU of each of the networks traversed will generally be unknown. The IP protocol uses the Identification, Fragment Offset and Flags fields to allow a datagram to be fragmented for delivery across a network having a smaller MTU than the size of the datagram. The fragments are reassembled at the final destination (host or end-node), not within the network itself.
For example, the following datagram is to be transferred across a network having an MTU of 500 bytes:
This datagram is fragmented thus:
Note that each of the fragments has a full IP header; in fact, it is a datagram with a bit set in the Flags field set to indicate that it is a fragment. The Fragment Offset field specifies which part of the original datagram this fragment forms. The Identification field is the same for all of the fragments of a fragmented datagram.
Another Flag bit indicates the last fragment, and still another is set if this datagram is not permitted to be fragmented.
IP data transfer across an internet is based on three fundamental principles:
These specifications allow the IP service to concentrate on its job: delivering packets. Higher level protocols (usually TCP) transform the IP service into a reliable, sequenced interprocess communications mechanism.
The Internet Control Message Protocol is used by the IP datagram delivery system to communicate with the IP delivery system on another host - its operation is internal to the IP software on the hosts.
A router can fail to deliver a datagram for several reasons, including:
The IP software encapsulates ICMP messages into the data field of an ordinary datagram. For example, when a router drops a datagram, it sends an ICMP message to the originator of the datagram explaining the reason. It is up to the originator to take appropriate action to ensure that subsequent datagrams are not droppped.
There are several ICMP message types. The echo request and
echo reply types are used by the ping
utility to test reachability. Ping is by far the single
most valuable tool available to the network manager.
A datagram can be delivered in two ways:
Hosts need to know enough of the network structure to know which of several routers (if a choice is available) to use to deliver a datagram. Additionally, routers themselves need to know to which other router they should forward datagrams for delivery.
TCP provides an interprocess delivery system, so it needs to identify processes in the two "end systems" which it connects. To do this, it defines a port number.
Two processes can communicate by agreeing on the port numbers they will use for communication. Port numbers are the addresses of the TCP protocol - each segment contains port numbers for each of the sending and receiving processes.
In order to set up a TCP connection, a process notifies the TCP software that it is waiting for connections "at" some particular port number. By definition, such a process is called a server. A client process which needs to connect to the server asks its local TCP software to allocate an unused port number and establish the connection. Once the connection is established, the two processes can communicate.
In order to manage TCP connections, a group of port numbers (0 to 1023) have been defined to be used by processes providing well known services. Most UNIX systems provide server processes corresponding to all the well-known services.
UDP provides a connectionless alternative transport service to TCP for applications where reliable stream service is not needed. UDP datagrams can be droppped, duplicated or delivered out of order, exactly as for IP.
The UDP transport service add to IP the ability to deliver a datagram to a specified destination process using a port abstraction, in an analogous way to that used by TCP.