
Theprotocol stack ornetwork stack is animplementation of acomputer networkingprotocol suite orprotocol family. Some of these terms are used interchangeably, but strictly speaking, thesuite is the definition of thecommunication protocols, and thestack is thesoftware implementation of them.[1]
Individual protocols within a suite are often designed with a single purpose in mind. Thismodularization simplifies design and evaluation. Because each protocol module usually communicates with two others, they are commonly imagined aslayers in a stack of protocols. The lowest protocol always deals with low-level interaction with the communications hardware. Each higher layer adds additional capabilities. User applications usually deal only with the topmost layers.[2]
T ~ ~ ~ T [A] [B]_____[C]
Imagine three computers:A,B, andC.A andB both have radio equipment and can communicate via the airwaves using a suitable network protocol (such asIEEE 802.11).B andC are connected via a cable, using it to exchange data (again, with the help of a protocol, for examplePoint-to-Point Protocol). However, neither of these two protocols will be able to transport information fromA toC, because these computers are conceptually on different networks. Aninter-network protocol is required to connect them.
One could combine the two protocols to form a powerful third, mastering both cable and wireless transmission, but a different super-protocol would be needed for each possible combination of protocols. It is easier to leave the base protocols alone and design a protocol that can work on top of any of them (theInternet Protocol is an example). This will make two stacks of two protocols each. The inter-network protocol will communicate with each of the base protocols in their simpler language; the base protocols will not talk directly to each other.
A request on computerA to send a chunk of data toC is taken by the upper protocol, which (through whatever means) knows thatC is reachable throughB. It, therefore, instructs the wireless protocol to transmit the data packet toB. On this computer, the lower-layer handlers will pass the packet up to the inter-network protocol, which, on recognizing thatB is not the final destination, will again invoke lower-level functions. This time, the cable protocol is used to send the data toC. There, the received packet is again passed to the upper protocol, which (withC being the destination) will pass it on to a higher protocol or application onC.
In practical implementation, protocol stacks are often divided into three major sections: media, transport, and applications. A particularoperating system or platform will often have two well-defined software interfaces: one between the media and transport layers, and one between the transport layers and applications. The media-to-transport interface defines how transport protocol software makes use of particular media and hardware types and is associated with adevice driver. For example, this interface level would define howTCP/IP transport software would talk to thenetwork interface controller. Examples of these interfaces includeODI andNDIS in theMicrosoft Windows andDOS environment. The application-to-transport interface defines how application programs make use of the transport layers. For example, this interface level would define how aweb browser program would talk to TCP/IP transport software. Examples of these interfaces includeBerkeley sockets and System VSTREAMS inUnix-like environments, andWinsock for Microsoft Windows.

| Protocol | Layer |
|---|---|
| HTTP | Application |
| TCP | Transport |
| IP | Internet ornetwork |
| Ethernet | Link ordata link |
| IEEE 802.3ab | Physical |
An important feature of many communities of interoperability based on a common protocol stack is aspanning layer, a term coined byDavid Clark[3]
Certain protocols are designed with the specific purpose of bridging differences at the lower layers, so that common agreements are not required there. Instead, the layer provides the definitions that permit translation to occur between a range of services or technologies used below. Thus, in somewhat abstract terms, at and above such a layer common standards contribute to interoperation, while below the layer translation is used. Such a layer is called aspanning layer in this paper. As a practical matter, real interoperation is achieved by the definition and use of effective spanning layers. But there are many different ways that a spanning layer can be crafted.
In the Internet protocol stack, theInternet Protocol Suite constitutes a spanning layer that defines abest-effort service for global routing ofdatagrams atLayer 3. TheInternet is the community ofinteroperation based on this spanning layer.
A [protocol stack is a] set of network protocol layers that work together. TheOSI Reference Model that defines seven protocol layers is often called a stack, as is the set of TCP/IP protocols that define communication over the Internet.
The Application layer is the topmost layer of the OSI model, and it provides services that directly support user applications, such as database access, e-mail, and file transfers.
{{cite book}}:|work= ignored (help)