Hands-On Network Programming with C# and .NET Core
上QQ阅读APP看书,第一时间看更新

The layers of the network stack

As we examine each layer of the network stack and what it is ultimately responsible for, there are some key things to bear in mind. First, remember that the model is abstract at its core, and is only meant to serve as a reference. For this reason, there may be times where it's not obvious which layer a given responsibility or task belongs to. Second, bear in mind that as we discuss the responsibilities of each layer in the stack, we're speaking specifically about the responsibilities of that layer with respect to the successful transmission of data over the network. So, the responsibilities of the session layer in the context of the network stack are completely independent of, say, the management of a user session in the context of a web application.

Finally, it's useful to remember that the farther down the stack we go, the closer we get to the physical transmission of data over a physical mediumWe'll be numbering the layers in our stack in descending order, from top to bottom, so that the smaller the number, the closer we are to the signals on the wire. This will be helpful when considering why one layer is lower than another, and how its responsibilities are distinct from those of the layer above it. With all of this in mind, let's dive in, top to bottom, through the OSI network stack.