• No results found

The TCP/IP protocol stack

In document IP Storage Networking: (Page 85-90)

Chapter 2. IP storage networking technical details

2.2 TCP/IP technical overview

2.2.2 The TCP/IP protocol stack

Figure 2-2 shows the TCP/IP stack used by all systems connected to the Internet, and by the many corporate networks which deploy IP networks, such as Ethernet. It compares it to the OSI reference model. You can see that it

comprises only four layers. The application layer and the subnet layer combine several functions represented by OSI as separate layers.

Data link and physical layer

At the bottom of the OSI model are the data link and physical layers which consist of a network interface card and a device driver. The physical layer deals with voltages. The data link layer provides services like framing, error detection, error correction, and flow control. Together they are responsible for getting raw bits across a physical link. One important aspect of the Internet Protocol is that it has no restrictions about the physical medium over which it runs. This

characteristic provides the TCP/IP protocol its adaptability and flexibility. For instance, LAN technologies, such as Ethernet, Token Ring, and FDDI, operate at the data link subnet layer. So do Wide Area Networks, such as ATM, X.25, and Switched Multi-megabit Data Services (SMDS). Routers can interconnect all these different media technologies, and the Internet Protocol can communicate over all of these lower level subnetworks.

Figure 2-2 Comparing the TCP/IP stack with the OSI reference model

Application

Transport

TCP or UDP

Network

(Internet Protocol)

Data Link and Physical (Subnet) TCP/IP Stack Application Presentation Session Transport Network Data Link Physical

OSI Reference Model

Each of the subnetworks has its own internal addressing and framing formats. To accommodate these the subnetworks encapsulate IP packets with headers and trailer information according to the specific subnet protocol. This enables IP packets to be transmitted over just about any type of network media today. Layering and encapsulation are illustrated in Figure 2-3.

Network layer (Internet Protocol)

The network layer protocol below the transport layer is known as the Internet Protocol (IP). It is the common thread running through the Internet and most LAN technologies, including Ethernet. It is responsible for moving data from one host to another, using various “routing” algorithms. Layers above the network layer break a data stream into chunks of a predetermined size, known as packets or datagrams. The datagrams are then sequentially passed to the IP network layer.

Figure 2-3 Layering and encapsulation in protocol stacks

The job of the IP layer is to route these packets to the target destination. IP packets consist of an IP header, together with the higher level TCP protocol and the application datagram. IP knows nothing about the TCP and datagram contents. Prior to transmitting data, the network layer might further subdivide it into smaller packets for ease of transmission. When all the pieces reach the destination, they are reassembled by the network layer into the original datagram. Application TCP Internet Protocol Subnet TCP/IP Stack Application datagram TCP Header IP Header Subnet Header Subnet Trailer IP Header TCP Header Application data IP Packet IP Packet Subnetwork Frame

IP connectionless service

The IP is the standard that defines the manner in which the network layers of two hosts interact. These hosts may be on the same network, or reside on physically remote heterogeneous networks. IP was designed with inter-networking in mind. It provides a connectionless, best-effort packet delivery service. Its service is called

connectionless

because it is like the postal service rather than the telephone system. IP packets, like telegrams or mail, are treated independently. Each packet is stamped with the addresses of the receiver and the sender. Routing decisions are made on a packet-by-packet basis. On the other hand, connection-oriented, circuit switched telephone systems explicitly establish a connection between two users before any conversation takes place. They also maintain the connection for the entire duration of conversation.

A

best-effort

delivery service means that packets might be discarded during transmission, but not without a good reason. Erratic packet delivery is normally caused by the exhaustion of resources, or a failure at the data link or physical layer. In a highly reliable physical system such as an Ethernet LAN, the best-effort approach of IP is sufficient for transmission of large volumes of information. However, in geographically distributed networks, especially the Internet, IP delivery is insufficient. It needs to be augmented by the higher-level TCP protocol to provide satisfactory service.

The IP Packet

All IP packets or datagrams consist of a header section and a data section (payload). The payload may be traditional computer data or, as is common today, it may be digitized voice or video traffic. Using the postal service analogy again, the “header” of the IP packet can be compared with the envelope and the “payload” with the letter inside it. Just as the envelope holds the address and information necessary to direct the letter to the desired destination, the header helps in the routing of IP packets.

The payload has a maximum size limit of 65,536 bytes per packet. It contains error and/or control protocols, like the Internet Control Message Protocol (ICMP). To illustrate control protocols, suppose that the postal service fails to find the destination of your letter. It would be necessary to send you a message

indicating that the recipient's address was incorrect. This message would reach you through the same postal system that tried to deliver your letter. ICMP works the same way: it packs control and error messages inside IP packets.

IP addressing

An IP packet contains a source and a destination address. The source address designates the originating node's interface to the network, and the destination address specifies the interface for an intended recipient or multiple recipients (for broadcasting).

Every host and router on the wider network has an address that uniquely identifies it. It also denotes the subnetwork on which it resides. No two machines can have the same IP address. To avoid addressing conflicts, the network numbers are assigned by an independent body.

The network part of the address is common for all machines on a local network. It is similar to a postal code, or zip code, that is used by a post office to route letters to a general area. The rest of the address on the letter (i.e., the street and house number) are relevant only within that area. It is only used by the local post office to deliver the letter to its final destination.

The host part of the IP address performs a similar function. The host part of an IP address can further be split into a subnetwork address and a host address. IP network addressing is a large and intricate subject. It is not within the scope of this book to describe it in any further detail.

Time to Live (TTL)

The IP packet header also includes a Time to Live (TTL) that is used to limit the life of the packet on the network. Imagine a situation in which an IP packet gets caught in the system and becomes undeliverable. It would then consume the resources indefinitely. The entire network could be brought to a halt by a blizzard of such reproducing but undeliverable packets. The TTL field maintains a counter that is decremented each time the packet arrives at a routing step. If the counter reaches zero, the packet is discarded.

Transport layer (TCP)

Two commonly used protocols operate in the transport layer. One is

Transmission Control Protocol (TCP) and the other is User Datagram Protocol (UDP), which provides more basic services. For the purposes of this book we assume the use of TCP.

The application data has no meaning to the transport layer. On the source node, the transport layer receives data from the application layer and splits it into chunks. The chunks are then passed to the network layer. At the destination node, the transport layer receives these data packets and reassembles them before passing them to the appropriate process or application. Further details about how data travels through the protocol stack follow.

The transport layer is the first end-to-end layer of the TCP/IP stack. This

characteristic means that the transport layer of the source host can communicate directly with its peer on the destination host, without concern about how data is moved between them. These matters are handled by the network layer. The layers below the transport layer understand and carry information required for moving data across links and subnetworks.

In contrast, at the transport layer or above, one node can specify details that are only relevant to its peer layer on another node. For example, it is the job of the transport layer to identify the exact application to which data is to be handed over at the remote end. This detail is irrelevant for any intermediate router. But it is essential information for the transport layers at both ends.

Figure 2-4 shows how the client side and the server side TCP/IP stack

implementation adds increasing overhead to the transmission of data through the network.

Figure 2-4 TCP/IP stack encapsulation overheads

Application layer

The application layer is the layer with which end users normally interact. This layer is responsible for formatting the data so that its peers can understand it. Whereas the lower three layers are usually implemented as a part of the OS, the application layer is a user process. Some application-level protocols that are included in most TCP/IP implementations include the following:

򐂰 Telnet for remote login 򐂰 FTP for file transfer 򐂰 SMTP for mail transfer

Application

Transport

Network

Data Link and Physical

Application

Transport

Network

Data Link and Physical

In

crea

sin

g

o

v

erh

ead

Client stack

(source)

Server stack

(target)

Data

Add Transport header Add Network header\ (source + destination)

Add Network header

Data encapsulation

The Network

In

cr

easi

ng ove

rhea

d

In document IP Storage Networking: (Page 85-90)