TCP/IP Network Administration Guide
검색에만이 책은
PDF로 이 문서 다운로드

TCP/IP Protocol Suite

2

This chapter introduces the Solaris implementation of the TCP/IP network protocol suite.
Protocol Layers and the OSI Modelpage 12
TCP/IP Protocol Architecture Modelpage 13
Standard TCP/IP Servicespage 17
Data Encapsulation and the TCP/IP Protocol Stackpage 20
The information is particularly geared to network administrators who are unfamiliar with the TCP/IP. (For an introduction to basic network concepts, see Chapter 1, "Overview of Network Administration.") If you are an experienced TCP/IP network administrator, consider moving on to chapters covering the tasks you want to perform.

Introducing the Internet Protocol Suite

This section presents an in-depth introduction to the protocols that compose TCP/IP. Although the information is purely conceptual, you should learn the names of the protocols and what each does. This is important because TCP/IP books explain tasks with the assumption that you understand the concepts introduced here.
TCP/IP is the commonly used nickname for the set of network protocols composing the Internet Protocol suite. Many texts use the term "Internet" interchangeably, when describing both the protocol suite and the global wide
area network. In this document, the term TCP/IP refers specifically to the Internet protocol suite; the term Internet refers to the wide area network and the bodies that govern it.
To interconnect your TCP/IP network with other networks, you must obtain a unique IP network number. At the time of this writing, IP network numbers are assigned by an organization known as the InterNIC.
If hosts on your network are going to participate in the Internet Domain Name Service (DNS), you must obtain and register a unique domain name. The InterNIC also handles the registration of domain names under certain top-level domains such as .COM (Commercial), .EDU (Education), and .GOV (Government). Chapter 3, "Planning Your Network," contains more information about the InterNIC. (For more information on DNS, refer to Name Services Administration Guide.)

Protocol Layers and the OSI Model

Most network protocol suites are structured as a series of layers, sometimes referred to collectively as a protocol stack. Each layer is designed for a specific purpose and exists on both the sending and receiving hosts. Each is designed so that a specific layer on one machine sends or receives exactly the same object sent or received by its peer process on another machine. These activities take place independently from what is going on in layers above or below the layer under consideration. In other words, each layer on a host acts independently of other layers on the same machine, and in concert with the same layer on other hosts.

OSI Reference Model

That most network protocol suites are viewed as structured in layers is a result of the Open Systems Interconnect (OSI) Reference Model designed by the International Standards Organization (ISO). The OSI model describes network activities as having a structure of seven layers, each of which has one or more protocols associated with it. The layers represent data transfer operations common to all types of data transfers among cooperating networks.
The protocol layers of the OSI Reference Model are traditionally listed from the top (Layer 7) to the bottom (Layer 1) up, as shown in Table 2-1 on page 13:
Table 2-1
Layer No.Layer NameDescription
7ApplicationConsists of standard communication services and applications that everyone can use.
6PresentationEnsures that information is delivered to the receiving machine in a form that it can understand.
5SessionManages the connections and terminations between cooperating computers.
4TransportManages the transfer of data and assures that received and transmitted data are identical.
3NetworkManages data addressing and delivery between
networks.
2Data LinkHandles the transfer of data across the network media.
1PhysicalDefines the characteristics of the network hardware.
The operations defined by the OSI model are purely conceptual and not unique to any particular network protocol suite. For example, the OSI network protocol suite implements all seven layers of the OSI Reference Model. TCP/IP uses some of OSI model layers and combines others. Other network protocols, such as SNA, add an eighth layer.

TCP/IP Protocol Architecture Model

The OSI model describes an idealized network communications protocol family. TCP/IP does not correspond to this model directly, as it either combines several OSI layers into a single layer, or does not use certain layers at all. Table 2-2 on page 14 shows the layers of the Solaris implementation of TCP/IP, listed from topmost layer (Application) to lowest (Physical Network).
.
Table 2-2
OSI Ref. Layer No.OSI Layer EquivalentTCP/IP LayerTCP/IP Protocol Examples
5,6,7Application,
Session,
Presentation
ApplicationNFS, NIS+, DNS, telnet, ftp, "r" commands, RIP,
RDISC, others
4Transport,TransportTCP, UDP
3NetworkInternetIP, ARP, ICMP
2Data LinkData LinkPPP, IEEE 802.2
1PhysicalPhysical NetworkEthernet (IEEE 802.3) Token Ring, RS-232, others
The table shows the TCP/IP protocol layers, their OSI Model equivalents, and examples of the protocols available at each level of the TCP/IP protocol stack. Each host involved in a communication transaction runs its own implementation of the protocol stack.

Physical Network Layer

The Physical Network layer specifies the characteristics of the hardware to be used for the network. For example, it specifies the physical characteristics of the communications media. The physical layer of TCP/IP describes hardware standards such as IEEE 802.3, the specification for Ethernet network media, and RS-232, the specification for standard pin connectors.

Data Link Layer

The Data Link layer identifies the network protocol type of the packet, in this case TCP/IP. It also provides error control and "framing." Examples of Data Link layer protocols are Ethernet IEEE 802.2 framing and Point-to-Point Protocol (PPP) framing.

Internet Layer

This layer, also known as the Network layer, accepts and delivers packets for the network. It includes the powerful Internet protocol (IP), the ARP protocol, and the ICMP protocol.
IP Protocol The IP protocol and its associated routing protocols are possibly the most significant of the entire TCP/IP suite. IP is responsible for:
  • IP addressing. The IP addressing conventions are part of the IP protocol. (Chapter 3, "Planning Your Network," describes IP addressing in complete detail.)
  • Host-to-host communications. IP determines the path a packet must take, based on the receiving host's IP address.
  • Packet formatting. IP assembles packets into units known as IP datagrams. Datagrams are fully described on page 22.
  • Fragmentation. If a packet is too large for transmission over the network media, IP on the sending host breaks the packet into smaller fragments. IP on the receiving host then reconstructs the fragments into the original packet.
ARP Protocol The Address Resolution Protocol (ARP) conceptually exists between the Data Link and Internet layers. ARP assists IP in directing datagrams to the appropriate receiving host by mapping Ethernet addresses (48 bits long) to known IP addresses (32 bits long).
ICMP Protocol Internet Control Message Protocol (ICMP) is the protocol responsible for detecting network error conditions and reporting on them. ICMP reports on:
  • Dropped packets (when packets are arriving too fast to be processed)
  • Connectivity failure (when a destination host can't be reached)
  • Redirection (which tells a sending host to use another router)
Chapter 6, "Troubleshooting TCP/IP," contains more information on the operating system commands that use ICMP for error detection.

Transport Layer

The TCP/IP Transport layer protocols ensure that packets arrive in sequence and without error, by swapping acknowledgments of data reception, and retransmitting lost packets. This type of communication is known as "end-to-end." Transport layer protocols at this level are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
TCP Protocol TCP enables applications to communication with each other as though connected by a physical circuit. TCP sends data in a form that appears to be transmitted in a character-by-character fashion, rather than as discreet packets. This transmission consists of a starting point, which opens the connection, the entire transmission in byte order, and an ending point, which closes the connection.
TCP attaches a header onto the transmitted data. This header contains a large number of parameters that help processes on the sending machine connect to peer processes on the receiving machine.
TCP makes an attempt to confirm that a packet has reached its destination by establishing an end-to-end connection between sending and receiving hosts. TCP is therefore considered a "reliable, connection-oriented" protocol.
UDP Protocol UDP, the other Transport layer protocol, provides datagram delivery service. It does not provide any means of verifying that connection was ever achieved between receiving and sending hosts. Because UDP eliminates the processes of establishing and verifying connections, applications that send small amounts of data use it rather than TCP. NFS is an example of an application that uses UDP for datagram delivery.

Application Layer

The Application layer defines standard Internet services and network applications that anyone can use. These services work with the Transport layer to send and receive data. There are many Applications layer protocols, some of which you probably already use. Some of the protocols include:
  • Standard TCP/IP services such as the ftp, tftp, and telnet commands
  • UNIX "r" commands, such as rlogin and rsh
  • Name services, such as NIS+ and Domain Name Service (DNS)
  • File services, such as NFS
  • RIP routing protocol
Standard TCP/IP Services telnet--The Telnet protocol enables terminals and terminal oriented processes to communicate on a network running TCP/IP. It is implemented as the program telnet (on local machines) and the daemon in.telnet (on remote machines). Telnet provides a user interface through which two hosts can communicate on a character-by-character or line-by-line basis. The application includes a set of commands that are fully documented in the telnet(1) man page.
ftp--The file transfer protocol (ftp) transfers files to and from a remote network. The protocol includes the ftp command (local machine) and the in.ftpd daemon (remote machine). ftp lets a user specify the name of the remote host and file transfer command options on the local host's command line. The in.ftpd daemon on the remote host then handles the requests from the local host. Unlike rcp, ftp works even when the remote computer is running a non-UNIX operating system. A user must log in to the remote computer to make an ftp connection unless it has been set up to allow anonymous ftp.
The ftp(1) man page describes all ftp command options, including those invoked through the command interpreter. The ftpd(1M) man page describes the services provided by the daemon in.ftpd.
tftp--The trivial file transfer protocol (tftp) provides functions similar to ftp, but it does not establish ftp's interactive connection. As a result, users cannot list the contents of a directory or change directories. This means that a user must know the full name of the file to be copied. The tftp(1) man page describes the tftp command set.
UNIX "r" Commands The UNIX "r" commands enable users to issue commands on their local machines that are actually carried out on the remote host that they specify. The r commands include:
  • rcp
  • rlogin
  • rsh
Instructions for using these commands are in the Solaris Advanced User's Guide and in the rcp (1), rlogin (1), and rsh (1) man pages.
Name Services Two name services are available from the Solaris implementation of TCP/IP: NIS+ and DNS.
NIS+
NIS+ provides centralized control over network administration services, such as mapping host names to IP and Ethernet addresses, verifying passwords, and so on. See Name Services Administration Guide for complete details.
Domain Name Service
The Domain Name Service (DNS) provides host names to the IP address service. It also serves as a database for mail administration. For a complete description of this service, see Name Services Administration Guide. See also the in.named(1M) man page.
File Services The NFS application layer protocol provides file services for the Solaris operating system. You'll find complete information about the NFS service in NFS Administration Guide.
Routing Protocols The Routing Information Protocol (RIP) and the Router Discovery Protocol (RDISC) are two routing protocols for TCP/IP networks. They are described in Chapter 5, "Configuring Routers."

How the TCP/IP Protocols Handle Data Communications

When a user issues a command that uses a TCP/IP application layer protocol, a chain of events is set in motion. The user's command or message passes through the TCP/IP protocol stack on the local machine, and then across the network media to the protocols on the recipient. The protocols at each layer on the sending host add information to the original data.
As the user's command makes its way through the protocol stack, protocols on each layer of the sending host also interact with their peers on the receiving host. Figure 2-1 shows this interaction.

그래픽

Figure 2-1

Data Encapsulation and the TCP/IP Protocol Stack

The packet is the basic unit of information transferred across a network, consisting, at minimum, of a header with the sending and receiving hosts' addresses, and a body with the data to be transferred. As the packet travels through the TCP/IP protocol stack, the protocols at each layer either add or remove fields from the basic header. When a protocol on the sending host adds data to the packet header, the process is called data encapsulation. Moreover, each layer has a different term for the altered packet, as shown in Figure 2-1 on page 19.
This section summarizes the life cycle of a packet from the time the user issues a command or sends a message to the time it is received by the appropriate application on the receiving host.

Application Layer--The User Initiates Communication

The packet's history begins when a user on one host sends a message or issues a command that must access a remote host. The application protocol associated with the command or message formats the packet so that it can be handled by the appropriate transport layer protocol, TCP or UDP.
Suppose the user issues an rlogin command to log in to the remote host, as shown in Figure 2-1. The rlogin command uses the TCP transport layer protocol. TCP expects to receive data in the form of a stream of bytes containing the information in the command. Therefore, rlogin sends this data as a TCP stream.
Not all application layer protocols use TCP, however. Suppose a user wants to mount a file system on a remote host, thus initiating the NFS application layer protocol. NFS uses the UDP transport layer protocol. Therefore, the packet containing the command must be formatted in a manner that UDP expects. This type of packet is referred to as a message.

Transport Layer --Data Encapsulation Begins

When the data arrives at the transport layer, the protocols at the layer start the process of data encapsulation. The end result depends on whether TCP or UDP has handled the information.
TCP Segmentation TCP is often called a "connection-oriented" protocol because it ensures the successful delivery of data to the receiving host. Figure 2-1 on page 19 shows how the TCP protocol receives the stream from the rlogin command. TCP divides the data received from the application layer into segments and attaches a header to each segment.
Segment headers contain sender and recipient ports, segment ordering information, and a data field known as a checksum. The TCP protocols on both hosts use the checksum data to determine whether data has transferred without error.
Establishing a TCP Connection In addition, TCP uses segments to determine whether the receiving host is ready to receive the data. When the sending TCP wants to establish connections, it sends a segment called a SYN to the peer TCP protocol running on the receiving host. The receiving TCP returns a segment called an ACK to acknowledge the successful receipt of the segment. The sending TCP sends another ACK segment and then proceeds to send the data. This exchange of control information is referred to as a three-way handshake.
UDP Packets UDP is a "connectionless" protocol. Unlike TCP, it does not check to make sure that data arrived at the receiving host. Instead, UDP takes the message received from the application layer and formats it into UDP packets. UDP attaches a header to each packet, which contains the sending and receiving host ports, a field with the length of the packet, and a checksum.
The sending UDP attempts to send the packet to its peer UDP process on the receiving host. The receiving UDP may send a response as an acknowledgment that it received the data. If the sending UDP doesn't get a response, it sends the packet again. UDP does not use the three-way handshake concept.

Internet Layer

As shown in Figure 2-1 on page 19, both TCP and UDP pass their segments and packets down to the Internet layer, where they are handled by the IP protocol. IP prepares them for delivery by formatting them into IP datagrams. Then IP determines the IP addresses for the datagrams, so they can effectively be delivered to the receiving host.
IP Datagrams IP attaches an IP header to the segment or packet's header in addition to the information added by TCP or UDP. Information in the IP header includes the IP addresses of the sending and receiving hosts, datagram length, and datagram sequence order. This is provided in case the datagram exceeds the allowable byte size for network packets and must be fragmented.

Data Link Layer--Framing Takes Place

Data link layer protocols such as PPP format the IP datagram into a frame. They attach a third header and a footer to "frame" the datagram. The frame header includes a cyclical redundancy check (CRC) field that checks for errors as the frame travels over the network media. Then the data link layer passes the frame to the physical layer.

Physical Network Layer--Preparing the Frame for Transmission

The physical network layer on the sending host receives the frames and converts the IP addresses into the hardware addresses appropriate to the network media. The physical network layer then sends the frame out over the network media.

How the Receiving Host Handles the Packet

When the packet arrives on the receiving host, it travels through the TCP/IP protocol stack in the reverse order from that which it took on the sender. Figure 2-1 on page 19 illustrates this path. Moreover, each protocol on the receiving host strips off header information attached to the packet by its peer on the sending host. Here is what happens.
  1. Physical Network Layer

    Receives the packet in its "frame" form. It converts the hardware addresses of the sender and recipient into IP addresses and then sends the frame to the data link layer.

  2. Data Link Layer

    Verifies that the CRC for the frame is correct and strips off the frame header and CRC. Finally, the data link protocol sends the frame to the Internet layer.

  3. Internet Layer

    Reads information in the header to identify the transmission and determine if it is a fragment. If the transmission was fragmented, IP reassembles the fragments into the original datagram. It then strips off the IP header and passes the datagram on to transport layer protocols

  4. Transport Layer (TCP and UDP)

    Reads the header to determine which application layer protocol must receive the data. Then TCP or UDP strips off its related header and sends the message or stream up to the receiving application.

  5. Application Layer

    Receives the message and performs the operation requested by the sending host.