To reduce their design complexity, most networks are organized as a stack of layers or levels, each one builtupon the one below it. The number of layers, the name of each layer, the contents of each layer, and thefunction of each layer differ from network to network. The purpose of each layer is to offer certain services to thehigher layers, shielding those layers from the details of how the offered services are actually implemented. In asense, each layer is a kind of virtual machine, offering certain services to the layer above it.
This concept is actually a familiar one and used throughout computer science, where it is variously known asinformation hiding, abstract data types, data encapsulation, and object-oriented programming. The fundamentalidea is that a particular piece of software (or hardware) provides a service to its users but keeps the details of itsinternal state and algorithms hidden from them.
Layer n on one machine carries on a conversation with layer n on another machine. The rules and conventionsused in this conversation are collectively known as the layer n protocol. Basically, a protocol is an agreementbetween the communicating parties on how communication is to proceed. As an analogy, when a woman isintroduced to a man, she may choose to stick out her hand. He, in turn, may decide either to shake it or kiss it,depending, for example, on whether she is an American lawyer at a business meeting or a European princess ata formal ball. Violating the protocol will make communication more difficult, if not completely impossible.
The entities comprising the corresponding layers on differentmachines are called peers. The peers may be processes, hardware devices, or even human beings. In otherwords, it is the peers that communicate by using the protocol.
Layers, protocols, and interfaces.