required check. It assumes that the first byte is an address, and checks whether the data is addressed to itself or maybe has to be forwarded. It assumes that the next
byte is a packet number, and so on. But what if the sending computer ordered the headers and the corresponding layers in the protocol stack differently?
In order to be able to communicate, computers must agree on the structure and functionality of their protocol stacks, and on the format of the headers used by each
one. This leads to the creation of open systems, that can accept external data and assimilate it correctly.
The OSI model defines seven layers
The International Standards Organization ISO has defined a protocol stack with seven layers called the Open Systems Interconnect OSI. The layers are
1. Physical: the network interface hardware, including connectors, signaling con- ventions, etc.
2. Data link: flow control over a single link, buffering, and error correction. Higher levels can assume a reliable communication medium.
3. Network: routing. This is the top layer used in intermediate routing nodes. Higher levels need not know anything about the network topology.
4. Transport: packetization and end-to-end verification. If a node fails along the way, the end-to-end checks will rectify the situation and re-send the required
packet. Higher levels can assume a reliable connection. 5. Session: control over the dialog between end stations often unused.
6. Presentation: handling the representation of data, e.g. compression and encryp- tion.
7. Application: an interface for applications providing generally useful services, e.g. distributed database support, file transfer, and remote login.
In the context of operating systems, the most important are the routing and trans- port functions.
To read more: The OSI model is described briefly in Silberschatz and Galvin [5] section 15.6. Much more detailed book-length descriptions were written by Tanenbaum [9] and Stallings
[6].
13.1.3 The TCPIP Protocol Suite
IP was there first
In practice, the TCPIP protocol suite became a de-facto standard before the OSI model was defined. It actually handles the central part of the OSI stack.
217
physical physical
data link network
transport session
presentation application
application TCPUDP
IP network
access
IP, the Internet Protocol, is essentially concerned with routing data across multi- ple networks, thus logically uniting these networks into one larger network. Hence
it corresponds to the network layer of OSI. However, the networks used may have their own routing facility, so IP may be said to correspond to the “top part” of the
network layer. The lower layers are not handled at all by the TCPIP suite — instead, whatever is available on each network is used.
TCP and UDP provide end-to-end services based on IP, and therefore correspond roughly to the transport layer and possibly part of the session layer of OSI. In ad-
dition, they are responsible for delivering the data to the correct application. This is done by associating each application with a port number.
The top layer is the application layer, which corresponds to the session, presenta- tion, and application layers of OSI. Some basic applications such as ftp and telnet
are an integral part of the standard TCPIP suite, and thus make these services avail- able around the world.
An internet links many different networks
As mentioned, the main feature of the Internet Protocol IP is that it creates an internet
: a network that is composed of networks. IP performs the routing of messages across the different networks, until they reach their final destination. For example,
the message may go over an Ethernet from its origin to a router, and then over a token ring from the router to its destination. Of course, it can also go through a
larger number of such hops. All higher levels, including the application, need not be concerned with these details.
218
host B
access token ring
access ethernet
IP application
TCP IP
access token ring
ethernet token ring
application TCP
IP access
ethernet host A
router
Exercise 163 Does IP itself have to know about all the different networks a message will traverse in advance?
The worldwide amalgamation of thousands of public networks connecting millions of computers is called the Internet, with a capital I.
UDP provides direct access to datagrams
IP transfers data in datagrams — the “atomic” units in which data is transferred. The size of IP datagrams is not fixed, and can range up to 64 KB. Various networks,
however, have a smaller maximal transfer unit MTU; for example, on an Ethernet the MTU is 1536 bytes. Therefore IP must fragment and reassemble datagrams along
the way.
UDP User Datagram Protocol provides a relatively direct access to IP datagrams. It allows users to send datagrams of up to a fixed size, with no additional overhead
for reliability. The datagrams are simply sent in a “best effort” style, with the hope that they will indeed arrive. However, a checksum is included, so that corrupted
datagrams can be detected and discarded. UDP also has other features that do not exist in TCP, such as a broadcast capability.
Exercise 164 Is UDP useful? What can you do with a service that may silently loose datagrams?
TCP provides a reliable stream service
TCP Transmission Control Protocol uses IP to provide a reliable stream interface. This means that applications can write data into the connection, and read data from
it, in an unstructured manner, and in unlimited sizes. TCP breaks it up into data- grams, and ensures that they all arrive at the other end and are united into a se-
quence correctly. To do so it keeps each datagram in a buffer until it is acknowledged.
Exercise 165 Why doesn’t TCP provide broadcast? 219
And there are some useful applications too
Several useful applications have also become part of the TCPIP protocol suite. These include
• SMTP Simple Mail Transfer Protocol, with features like mailing lists and mail forwarding. It just provides the transfer service to a local mail service that takes
care of things like editing the messages. • FTP File Transfer Protocol, used to transfer files across machines. This uses
one TCP connection for control messages such as user information and which files are desired, and another for the actual transfer of each file.
• Telnet, which provides a remote login facility for simple terminals.
To read more: The TCPIP suite is described in Stallings [7] section 13.2, and very briefly also in Silberschatz and Galvin [5] section 15.6. It is naturally described in more detail in
textbooks on computer communications, such as Tanenbaum [9] and Stallings [6]. Finally, ex- tensive coverage is provided in books specific to these protocols, such as Comer [2] or Stevens
[8].
13.2 Implementation Issues