ery, you need to know which shelf you are looking for. This
is the same sort of thing
with ports. Once you have found your bakery with the IP address, you then need to
find the shelf in the bakery, which is your port. The port will connect you to a service
(program) that is running and has attached itself to that shelf (port). There are well-
known ports that particular services run on.
These are registered, and while the serv‐
ices (e.g., web server) can bind to a different port and listen on that, the well-known
port is common because it’s what everyone knows to look for.
At layer five, it becomes challenging, simply because this layer is not always well
understood. The fifth layer is strawberry, because we need some fruit in our cake,
even if it’s just fruit flavoring. This is the
session layer
. The
session layer is all about
coordinating long-standing communications to make sure everything is synchron‐
ized. You can think about it as the session layer making sure that when you and I are
eating our slices of cake at the same time (communicating), we are going at the same
pace, so we start and finish at the same time. If we need to stop and take a drink of
water, the session layer will make sure we do that at the same time. If we want to
drink milk rather than water, the session layer will make
sure that we are completely
in sync so that we can start and finish at the same time and essentially look the same
while we are eating. Because it’s all about how it looks.
Which brings us to the peanut butter layer, because what’s a cake without peanut but‐
ter? Especially if we have jam in our cake. This is the
presentation layer
. The presenta‐
tion layer takes care of making everything look okay and correct. The presentation
layer will make sure that there aren’t crumbs all over the place,
for instance, making
sure that what you are putting in your mouth actually looks like cake.
Finally, we have the amaretto layer. This is the
application layer
. Ultimately, this is the
layer that sits closest to the eater (user). This takes what comes out of the presentation
layer and gets it to the user in a way that it can be consumed
as the user expects it to
be consumed. One element of the cake analogy here that’s important is that when you
use your fork to get a mouthful, you cut through the layers from amaretto down to
pistachio. That’s how you load it onto the fork. When it’s consumed, however, it goes
into your mouth pistachio end first. This is the same
way we send and receive data
messages. They are constructed from the application layer down and sent along.
When they are received, they are
consumed
from the physical layer up, pulling off the
headers at each layer to expose the next layer.
As we are working on network testing, we may be working
at different layers of our
cake. This is why it’s important to understand what each layer is. You need to under‐
stand the expectations of each layer so you can determine whether the behavior you
are seeing is correct. We will be dealing with testing across multiple layers as we go
forward, but generally each tool we will look at will target a specific layer. Network
communication is about consuming the entire cake, but sometimes we need to focus
our efforts (taste buds) on a specific layer to make sure that
it tastes correctly all by