2.3 Horizontal communication
In the OSI reference model there is a clear separation of services and protocols, but this separation is not always evident in practical applications, so it is worthwhile spending some more time on the differences between them. A service is provided by one layer to the layer above, and the capabilities of a service are defined in terms of primitives and their parameters. A service relates to two adjacent layers in the same system. In contrast, a protocol defines the communication between two peer entities in different systems. To complete a service request, an entity may need to communicate with a peer entity via a protocol, but the protocol chosen by a layer should not be apparent to the service user.
You should bear in mind that the communicating systems may be quite different, and the protocols facilitate the transfer of information between them. Protocols define how data is transferred between systems and perhaps it is for this reason that the features of protocols tend to dominate discussions rather than the underlying services.
As Figure 7 illustrated, the information an (N)-entity receives from an (N + l)-entity is transferred to an (N)-entity in another system by an (N)-layer protocol. Figure 8 shows in more detail how this is done. The data is placed in a data unit called a protocol data unit. This is simply a generic term for a packet that applies to all of the seven layers. A protocol data unit contains the service-related data from the (N + l)-entity, plus some protocol control information which is necessary to co-ordinate the transfer of data. This construction of protocol data units may be repeated in all the layers in the OSI reference model whenever data is transferred between two systems. The process of adding protocol control information to the data is called encapsulation. A very important point to remember is that the entity associated with the lower-layer protocol does not interpret the service-related data associated with the higher layer; to the lower layer, it is just data passed to or received from the higher layer. In Figure 8 the protocol control information is added as a single header to the left of the higher-layer data to illustrate the process of encapsulation, but in actual protocols the information may be placed anywhere in the protocol data unit.
The communication between peer entities through a virtual connection in different systems is sometimes referred to as horizontal communication.