3.1.5 Session Layer
This layer is concerned with management of a session, i.e. the duration of a connection between two network
nodes. The word connection here does not mean something physical, but rather refers to an agreement
between two nodes that some chunks of data with some relation to each other will be exchanged for some
time. Actually, TCP does this in some senses, as does the socket interface to TCP, which is very much like
the interfaces for reading or writing a file (described in more detail later).
3.1.6 Presentation Layer
This layer deals with such matters as translating between character codes, if the source uses one and the
destination the other. In the old days, this could mean ASCII at one end and EBCDIC on the other end.
Today, though, it could mean for example two different coding systems for Chinese characters, Big 5 and
GB.
3.1.7 Application Layer
You can write programs at the application layer yourself, and of course you use many programs written by
others, such as ftp, Web browsers, e-mail utilities, and so on.
3.2 How the Layers Interact
The Physical Layer is obviously implemented in hardware. So is the Data Layer, in the sense that the NIC
will handle this layer and is hardware.8 These days the Network Layer is also usually hardware; as noted
above, Ethernet hubs are now common in the home, and include routing capabilities. The Transport Layer
and above are usually implemented in software, actually as part of the OS.
Information is communicated from one layer to the next.9 For instance, think of the file-transfer example
presented earlier. The file-transfer program, say ftp, works in the Application Layer. It will call socket
service functions in the Session Layer, such as the socket() function, which opens a network connection in
a manner very similar to the open() function which opens a file. These functions will in turn call functions
7The "users" here are the application programs being run, e.g. ftp at saturn and ftpd (the FTP server) at holstein.
8More technically, firmware-software stored in ROM.
9In some cases a layer is "skipped." At the Session Layer, a raw socket can be opened, in which the socket communicates
directly with IP in the Network Layer.
7
for TCP operations in the Transport Layer, which will themselves call functions for IP operations at the
Network layer. The latter will then-say we are on an Ethernet-issue machine instructions (e.g. IN and
OUT in the case of Intel CPUs) to the Ethernet NIC, which will use the Data Link and Physical Layers to
put frames out onto the LAN. At any given layer, a function passes the message in a packet of bits to the
next lower layer. The packet grows larger at each layer, because each layer adds more information.
Say we are using the put command in ftp to copy a file named zyx to the destination machine. When we do
this, ftp calls the write() function to send data,10 A typical call to write() will contain the actual data to be
Overview of Computer Networks
Start from the beginning
