Application Layer TCPIP Layers and Protocols

Figure 14.10: TCP segment format. Connection−oriented protocol means that TCP establishes a logical end−to−end connection between the two hosts that communicate in a procedure known as a handshake. The handshake is an exchange of the control information between two end points to establish a dialogue before data is transmitted. TCP indicates the control function of a segment by setting the appropriate bit in the Flags field in the header segment. TCP used a so−called three−way handshake in which three segments are exchanged. The handshake procedure is presented in the Figure 14.11. Figure 14.11: Three−way handshake. Finally, a byte−stream protocol means that each TCP segment presents a multiple−byte data stream. As a transport protocol, TCP is also responsible for a proper delivery of data received from the Internet layer to the correct application. A 16−bit number in the source port and destination port fields in the header segment identify applications. To pass data correctly to and from the application layer is an important part of what the transport layer services do.

14.4.4 Application Layer

The application layer is at the top of the TCPIP protocol architecture. Everything mentioned for the ISO OSI Application Layer is also valid here. There are many different application protocols, and most of them provide user services. This is the layer under continuous upgrade, and new services are frequently added to this layer. The application layer fully relies on the three underlying layers for data delivery. 335 TELNET • The network terminal protocol, which provides remote login access over the network FTP • The file transfer protocol, which provides interactive file transfer over the network SMTP • The simple mail transfer protocol, which provides electronic mail delivery The application protocols listed here are primarily user oriented. The other system−oriented applications services widely in use are: Domain name service DNS • Also called name service, to convert map host names assigned to the network devices into the appropriate IP addresses and vice versa Routing information protocol RIP • To exchange routing information Network file system NFS • To share files between various hosts on the network Network information service NIS • To centralize the administration over a group of hosts on the network Some applications require user interaction, like telnet or ftp, while others run hidden from users, like RIP, DNS, NFS, or NIS. Nevertheless, UNIX administrators must know a great deal about all of them. Figure 14.12 shows the hierarchy of TCPIP protocols in an imaginary system. The relationship between different layer protocols is presented. It is assumed that the system is connected to the Ethernet−type network. 336 Figure 14.12: The hierarchy of TCPIP protocols. The main purpose of this chapter is to get a basic idea about networking. Being familiar with the TCPIP protocol stack and basic layer functions is very instrumental in performing daily UNIX network administration. Our task will be significantly easier if we fully understand how things work in this amazing network environment known as the Internet. 337

Chapter 15: TCPIP Network

15.1 Data Delivery

Two basic steps must be completed to deliver data successfully between two Internet participants. First, it is necessary to transmit the data across the network to the appropriate host. Second, the data has to be transmitted within that host to the appropriate user or process. TCPIP uses three schemes to accomplish these tasks: Addressing 1. IP addresses uniquely identify each host on the entire internet; TCPIP relies on IP addressing to deliver data to the correct host on the network. Routing 2. The Internet consists of many interconnected networks; different networks are connected over routers gateways. Routing means to forward data to the correct network or subnetwork via an appropriate router gateway. Multiplexing 3. Protocol numbers and port numbers identify how to deliver data to the correct software module within the host.

15.1.1 IP Address Classes

The Internet protocol IP moves data between hosts in the form of datagrams. Each datagram is delivered to the host identified by a 32−bit IP address located in the Destination Address field in the datagram header. An IP address contains a network part and a host part, but the format of these parts is not uniformly determined; the number of address bits used to identify the network and the number used to identify the host vary according to the class of the address. The three address classes are class A, class B, and class C. By examining the first few bits of an address, IP software can quickly determine the addresss class and, therefore, its structure. Figure 15.1 illustrates how the address structure varies with an address class. It presents three addresss classes in three arbitrary IP address examples. The rules for address classes are: If the first address bit is 0, this is the address of a class A network; the next seven bits identify the network itself, and the remaining 24 bits identify the host in that network. There are fewer than 128 class A network addresses and 16 million hosts addresses available in each network a certain number of network addresses are reserved for special purposes. • If the first two bits are 10, this is the address of a class B network; the next 14 bits identify the network, and the remaining 16 bits identify the host in that network. There are slightly more than 16,000 class B network addresses and more than 64,000 hosts addresses available in each network. • If the first two bits are 11, this is the address of a class C network; the next 22 bits identify the network, and the last 8 bits identify the host in that network. There are more than 4 million class C network addresses with 256 hosts addresses available actually this number is lower, because the hosts address 0 is reserved to identify the network itself, and the address 255 is the network broadcast address. The C class addresses that start with the first three bits 111 are reserved for special purposes, which means 2 million class C network addresses are available for general use. • 338