Figure 121 TCPIP and Isoosi reference models

The various layers perform the following tasks:

□ The host-to-network layer is responsible for transferring information from one computer to a distant computer. It deals with the physical properties of the transmission medium1 and with dividing the data stream into frames of a certain size to permit retransmission of data chunks if transmission errors occur. If several computers are sharing a transmission line, the network adapters must have a unique ID number known as a MAC address that is usually burned into the hardware. An agreement between manufacturers ensures that this number is globally unique. An example of a MAC address is 08:00:46:2B:FE:E8.

In the view of the kernel, this layer is implemented by device drivers for network cards.

□ The network layer of the OSI model is called the Internet layer in the TCP/IP model, but both refer basically to the same task of exchanging data between any computers in a network, not necessarily computers that are directly connected, as shown in Figure 12-2.

A direct transmission link between computers A and B is not possible because they are not physically connected to each other. The task of the network layer is therefore to find a route via which the computers can talk to each other; for example, A-E-B or A-E-C-B.

Network-linked computers.

Network-linked computers.

1 Predominantly coaxial cable, twisted-pair cable, and fiber optic links are used, but there is an increasing trend toward wireless transmission.

Application (HTTP, FTP etc.)

Transport (TCP, UDP)

Internet (IP)

Host-to-host

The network layer is also responsible for additional connection details such as splitting the data to be transported into packets of a specific size. This is necessary because the computers along the route may have different maximum limits to the size of the data packets they can accept. When data are sent, the data stream is split into packets that are reassembled upon receipt. This is done so that higher-level protocols can operate transparently with data units of a guaranteed size without having to bother with the specific properties of the Internet or network layer.

The network layer also assigns unique addresses within the network so that computers can talk to each other (these are not the same as the abovementioned hardware addresses because networks are usually made up of physical subnets).

In the Internet, the network layer is implemented by means of the Internet Protocol (IP), which comes in two versions (v4 and v6). At the moment, most connections are handled by IPv4, but IPv6 will replace it in the future.2 When I speak of IP connections below, I always mean IPv4 connections.

IP uses addresses formatted like this — 192.168.1.8 or 62.26.212.10 — to address computers. These addresses are assigned by official registration authorities or providers (sometimes dynamically) or can be freely selected (within defined private ranges).

IP allows networks to be divided flexibly into subnets on the address level by supporting various address categories, which, depending on requirements, hold tens of millions of computers and more. However, it is not my intention to deal with this topic in detail. See the wealth of literature on network and system administration, for example, [Ste00] and [Fri02].

□ In both models, the fourth layer is the transport layer. Its task is to regulate data transport between applications running on two linked computers. It is not sufficient to establish communication between the computers themselves; it is also necessary to set up a connection between the client and the server application, and this presupposes, of course, that there is an existing link between the computers. In the Internet, TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) is used for this purpose. Each application interested in data in the IP layer uses a unique port number that uniquely identifies it on the target system. Typically, port 80 is used for web servers. Browser clients must send requests to this address to obtain the desired data. (Naturally, the client must also have a unique port number so that the web server can respond to the request, but this port number is generated dynamically.) To fully define a port address, the port number is usually appended to the IP address after a colon; for example, a web server on the computer with the address 192.168.1.8 is uniquely identifiable by the address 192.168.1.8:80.

An additional task of this layer can (but need not) be the provision of a reliable connection over which data are transmitted in a given sequence. The above feature and the TCP protocol are discussed in Section 12.9.2.

□ The application layer in the TCP/IP reference model is represented by layers 5 to 7 (session layer, presentation layer, and application layer) of the OSI model. As the name suggests, this layer represents the application view of a network connection. Once a communication connection has been established between two applications, this layer is responsible for the actual contents to be transferred. After all, web servers communicate with their clients differently than mail servers.

2 The move to IPv6 should have already have taken place, but this is very slow in happening, particularly in the academic and commercial sectors. Perhaps the impending exhaustion of IPv4 address space will act as a spur.

A very large number of standard protocols are defined for the Internet. Usually, they are defined in Request for Comments (RFC) documents and must be implemented by applications wishing to use or offer a particular service. Most protocols can be tested with the telnet tool because they operate with simple text commands. A typical example of the communication flow between a browser and web server is shown below.

[email protected]> telnet 192.168.1.20 80 Trying 192.168.1.20... Connected to 192.168.1.20. Escape character is ,A]'.

GET /index.html HTTP/1.1 Host: www.sample.org Connection: close

HTTP/1.1 200 OK

Date: Wed, 09 Jan 2002 15:24:15 GMT Server: Apache/1.3.22 (Unix) Content-Location: index.html.en Vary: negotiate,accept-language,accept-charset TCN: choice

Last-Modified: Fri, 04 May 2001 00:00:38 GMT

ETag: "83617-5b0-3af1f126;3bf57446"

Accept-Ranges: bytes

Content-Length: 1456

Connection: close

Content-Type: text/html

Content-Language: en

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

telnet is used to set up a TCP connection on port 80 of computer 192.168.1.20. All user input is forwarded via the network connection to the process associated with this address (which is uniquely identified by the IP address and the port number). A response is sent once the request has been received. The contents of the desired HTML page are output together with a header with information on the document and other stuff. Web browsers use exactly the same procedure to access data transparently to users.

As a result of the systematic division of network functionality into layers, applications wishing to communicate with other computers need concern themselves with only a very few details. The actual link between the computers is implemented by lower layers, and all the application has to do is read and generate text strings — regardless of whether the two computers are sitting side by side in the same room or are located on different continents.

The layer structure of the network is reflected in the kernel by the fact that the individual levels are implemented in separate sections of code that communicate with each other via clearly defined interfaces to exchange data or forward commands.

Was this article helpful?

+1 0

Post a comment