<chapter id="ipov-1"><title>Solaris TCPIP Protocol Suite (Overview)</title><highlights><para>This chapter introduces the Solaris implementation of the TCP/IP network
protocol suite. The information is intended for system and network administrators
who are unfamiliar with basic TCP/IP concepts. The remaining parts of this
book assume that you are familiar with these concepts.</para><para>This chapter contains the following information:</para><itemizedlist><listitem><para><olink targetptr="ipov-6" remap="internal">Introducing the TCP/IP Protocol Suite</olink></para>
</listitem><listitem><para><olink targetptr="ipov-29" remap="internal">How the TCP/IP Protocols Handle
Data Communications</olink></para>
</listitem><listitem><para><olink targetptr="ipov-43" remap="internal">Finding Out More About TCP/IP and the
Internet</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="ipov-6"><title>Introducing the TCP/IP Protocol Suite</title><para>This section presents an in-depth introduction to the protocols
that are included in TCP/IP. Although the information is conceptual, you should
learn the names of the protocols. You should also learn what each protocol
does.  </para><para>&ldquo;TCP/IP&rdquo; is the acronym that is commonly used for the set
of network protocols that compose the <emphasis>Internet Protocol suite</emphasis>.
Many texts use the term &ldquo;Internet&rdquo; to describe both the protocol
suite and the global wide area network. In this book, &ldquo;TCP/IP&rdquo;
refers specifically to the Internet protocol suite. &ldquo;Internet&rdquo;
refers to the wide area network and the bodies that govern the Internet.</para><para>To interconnect your TCP/IP network with other networks, you must
obtain a unique IP address for your network. At the time of this writing,
you obtain this address from an Internet service provider (ISP).</para><para>If hosts on your network are to participate in the Internet Domain
Name System (DNS), you must obtain and register a unique domain name. The
InterNIC coordinates the registration of domain names through a group of worldwide
registries. For more information on DNS, refer to <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>. </para><sect2 id="ipov-7"><title>Protocol Layers and the Open Systems Interconnection
Model</title><para>Most network protocol suites are structured as a series of layers,
sometimes collectively referred to as a <emphasis>protocol stack</emphasis>.
Each layer is designed for a specific purpose. Each layer exists on both the
sending and receiving systems. A specific layer on one system sends or receives
exactly the same object that another system's <emphasis>peer process</emphasis> sends
or receives. These activities occur independently from activities in layers
above or below the layer under consideration. In essence, each layer on a
system acts independently of other layers on the same system. Each layer acts
in parallel with the same layer on other systems.</para><sect3 id="ipov-8"><title>OSI Reference Model</title><para>Most network protocol suites are structured in layers. The International
Organization for Standardization (ISO) designed the Open Systems Interconnection
(OSI) Reference Model that uses structured layers. The OSI model describes
a structure with seven layers for network activities. One or more protocols
is associated with each layer. The layers represent data transfer operations
that are common to all types of data transfers among cooperating networks. </para><para>The OSI model lists the protocol layers  from the top (layer 7) to the
bottom (layer 1). The following table shows the model.</para><table frame="topbot" id="ipov-tbl-9"><title>Open Systems Interconnection
Reference Model</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="72*"/><colspec colname="column2" colwidth="72*"/><colspec colname="column3" colwidth="252*"/><thead><row rowsep="1"><entry><para>Layer No.</para>
</entry><entry><para>Layer Name</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>7</para>
</entry><entry><para>Application </para>
</entry><entry><para>Consists of standard communication services and applications that everyone
can use.</para>
</entry>
</row><row><entry><para>6</para>
</entry><entry><para>Presentation </para>
</entry><entry><para>Ensures that information is delivered to the receiving system in a form
that the system can understand.</para>
</entry>
</row><row><entry><para>5</para>
</entry><entry><para>Session </para>
</entry><entry><para>Manages the connections and terminations between cooperating systems.</para>
</entry>
</row><row><entry><para>4</para>
</entry><entry><para>Transport </para>
</entry><entry><para>Manages the transfer of data. Also assures that the received data are
identical to the transmitted data.</para>
</entry>
</row><row><entry><para>3</para>
</entry><entry><para>Network </para>
</entry><entry><para>Manages data addressing and delivery between networks.</para>
</entry>
</row><row><entry><para>2</para>
</entry><entry><para>Data link </para>
</entry><entry><para>Handles the transfer of data across the network media.</para>
</entry>
</row><row><entry><para>1</para>
</entry><entry><para>Physical </para>
</entry><entry><para>Defines the characteristics of the network hardware.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The OSI model defines conceptual operations that are not unique
to any particular network protocol suite. For example, the OSI network protocol
suite implements all seven layers of the OSI model. TCP/IP uses some of OSI
model layers. TCP/IP also combines other layers. Other network protocols,
such as SNA, add an eighth layer. </para>
</sect3>
</sect2><sect2 id="ipov-10"><title>TCP/IP Protocol Architecture Model</title><para>The OSI model describes idealized network communications with
a family of protocols. TCP/IP does not directly correspond to this model.
TCP/IP either combines several OSI layers into a single layer, or does not
use certain layers at all. The following table shows the layers of the Solaris
implementation of TCP/IP. The table lists the layers from the topmost layer
(application) to the bottommost layer (physical network). </para><table frame="topbot" id="ipov-tbl-11"><title>TCP/IP Protocol Stack</title><tgroup cols="4" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="2*"/><colspec colnum="2" colname="column2" colwidth="2.5*"/><colspec colnum="3" colname="column3" colwidth="2.5*"/><colspec colnum="4" colname="column4" colwidth="7*"/><thead><row rowsep="1"><entry><para>OSI Ref. Layer No.</para>
</entry><entry><para>OSI Layer Equivalent</para>
</entry><entry><para>TCP/IP Layer</para>
</entry><entry><para>TCP/IP Protocol Examples</para>
</entry>
</row>
</thead><tbody><row><entry><para>5,6,7</para>
</entry><entry><para>Application, session, presentation</para>
</entry><entry><para>Application </para>
</entry><entry><para>NFS, NIS, DNS, LDAP, <command>telnet</command>, <command>ftp</command>, <command>rlogin</command>, <command>rsh</command>, <command>rcp</command>, RIP, RDISC,
SNMP, and others</para>
</entry>
</row><row><entry><para>4</para>
</entry><entry><para>Transport </para>
</entry><entry><para>Transport </para>
</entry><entry><para>TCP, UDP, SCTP</para>
</entry>
</row><row><entry><para>3</para>
</entry><entry><para>Network</para>
</entry><entry><para>Internet </para>
</entry><entry><para>IPv4, IPv6, ARP, ICMP</para>
</entry>
</row><row><entry><para>2</para>
</entry><entry><para>Data link</para>
</entry><entry><para>Data link </para>
</entry><entry><para>PPP, IEEE 802.2</para>
</entry>
</row><row><entry><para>1</para>
</entry><entry><para>Physical</para>
</entry><entry><para>Physical network </para>
</entry><entry><para>Ethernet (IEEE 802.3), Token Ring, RS-232, FDDI, and others </para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The table shows the TCP/IP protocol layers and the OSI model equivalents.
Also shown are examples of the protocols that are available at each level
of the TCP/IP protocol stack. Each system that is involved in a communication
transaction runs a unique implementation of the protocol stack. </para><sect3 id="ipov-13"><title>Physical Network Layer</title><para>The <emphasis>physical network layer</emphasis> specifies the
characteristics of the hardware to be used for the network. For example, physical
network layer 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. </para>
</sect3><sect3 id="ipov-14"><title>Data-Link Layer</title><para>The <emphasis>data-link layer</emphasis> identifies the network
protocol type of the packet, in this instance TCP/IP. The data-link layer
also provides error control and &ldquo;framing.&rdquo; Examples of data-link
layer protocols are Ethernet IEEE 802.2 framing and Point-to-Point Protocol
(PPP) framing. </para>
</sect3><sect3 id="ipov-15"><title>Internet Layer</title><para>The Internet layer, also known as the <emphasis>network layer</emphasis> or <emphasis>IP layer</emphasis>, accepts and delivers packets for the network. This layer
includes the powerful Internet Protocol (IP), the Address Resolution Protocol
(ARP), and the Internet Control Message Protocol (ICMP). </para><sect4 id="ipov-16"><title>IP Protocol</title><para>The IP protocol and its associated routing protocols are possibly
the most significant of the entire TCP/IP suite. IP is responsible for the
following: </para><itemizedlist><listitem><para><emphasis role="strong">IP addressing</emphasis> &ndash; The IP
addressing conventions are part of the IP protocol. <olink targetptr="ipplan-5" remap="internal">Designing
an IPv4 Addressing Scheme</olink> introduces IPv4 addressing and <olink targetptr="ipv6-overview-10" remap="internal">IPv6 Addressing Overview</olink> introduces IPv6
addressing. </para>
</listitem>
</itemizedlist><itemizedlist><listitem><para><emphasis role="strong">Host-to-host communications</emphasis> &ndash;
IP determines the path a packet must take, based on the receiving system's
IP address. </para>
</listitem>
</itemizedlist><itemizedlist><listitem><para><emphasis role="strong">Packet formatting</emphasis> &ndash; IP
assembles packets into units that are known as <emphasis>datagrams</emphasis>.
Datagrams are fully described in <olink targetptr="ipov-38" remap="internal">Internet Layer:
Where Packets Are Prepared for Delivery</olink>. </para>
</listitem>
</itemizedlist><itemizedlist><listitem><para><emphasis role="strong">Fragmentation</emphasis> &ndash; If a
packet is too large for transmission over the network media, IP on the sending
system breaks the packet into smaller fragments. IP on the receiving system
then reconstructs the fragments into the original packet. </para>
</listitem>
</itemizedlist><para>The Solaris OS supports both IPv4 and IPv6 addressing formats, which
are described in this book. To avoid confusion when addressing the Internet
Protocol, one of the following conventions is used:</para><itemizedlist><listitem><para>When the term &ldquo;IP&rdquo; is used in a description, the
description applies to both IPv4 and IPv6.</para>
</listitem><listitem><para>When the term &ldquo;IPv4&rdquo; is used in a description,
the description applies only to IPv4.</para>
</listitem><listitem><para>When the term &ldquo;IPv6&rdquo; is used in a description,
the description applies only to IPv6.</para>
</listitem>
</itemizedlist>
</sect4><sect4 id="ipov-17"><title>ARP Protocol</title><para>The Address Resolution Protocol (ARP) conceptually exists between
the data-link and Internet layers. ARP assists IP in directing datagrams to
the appropriate receiving system by mapping Ethernet addresses (48 bits long)
to known IP addresses (32 bits long). </para>
</sect4><sect4 id="ipov-18"><title>ICMP Protocol</title><para>The Internet Control Message Protocol (ICMP) detects and reports
network error conditions. ICMP reports on the following: </para><itemizedlist><listitem><para><emphasis role="strong">Dropped packets</emphasis> &ndash; Packets
that arrive too fast to be processed </para>
</listitem><listitem><para><emphasis role="strong">Connectivity failure</emphasis> &ndash;
A destination system cannot be reached</para>
</listitem><listitem><para><emphasis role="strong">Redirection</emphasis> &ndash; Redirecting
a sending system to use another router </para>
</listitem>
</itemizedlist><para><olink targetptr="ipv6-admintasks-1" remap="internal">Chapter&nbsp;8, Administering a
TCP/IP Network (Tasks)</olink> contains more information on the Solaris OS
commands that use ICMP for error detection.</para>
</sect4>
</sect3><sect3 id="ipov-19"><title>Transport Layer</title><para>The TCP/IP <emphasis>transport layer</emphasis> ensures 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 <emphasis>end-to-end</emphasis>. Transport layer protocols at this
level are Transmission Control Protocol (TCP), User Datagram Protocol (UDP),
and Stream Control Transmission Protocol (SCTP). TCP and SCTP provide reliable,
end-to-end service. UDP provides unreliable datagram service.</para><sect4 id="ipov-20"><title>TCP Protocol</title><para>TCP enables applications to communicate with each other as though
they were 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 discrete
packets. This transmission consists of the following:</para><itemizedlist><listitem><para>Starting point, which opens the connection</para>
</listitem><listitem><para>Entire transmission in byte order</para>
</listitem><listitem><para>Ending point, which closes the connection.</para>
</listitem>
</itemizedlist><para>TCP attaches a header onto the transmitted data. This header contains
many parameters that help processes on the sending system connect to peer
processes on the receiving system.</para><para>TCP confirms that a packet has reached its destination by establishing
an end-to-end connection between sending and receiving hosts. TCP is therefore
considered a &ldquo;reliable, connection-oriented&rdquo; protocol.</para>
</sect4><sect4 id="ermih"><title>SCTP Protocol</title><para>SCTP is a reliable, connection-oriented transport layer protocol
that provides the same services to applications that are available from TCP.
Moreover, SCTP can support connections between systems that have more than
one address, or <emphasis>multihomed</emphasis>. The SCTP connection between
sending and receiving system is called an <emphasis>association</emphasis>.
Data in the association is organized in chunks. Because SCTP supports multihoming,
certain applications, particularly applications used by the telecommunications
industry, need to run over SCTP, rather than TCP. </para>
</sect4><sect4 id="ipov-21"><title>UDP Protocol</title><para>UDP provides datagram delivery service. UDP does not verify connections
between receiving and sending hosts. Because UDP eliminates the processes
of establishing and verifying connections, applications that send small amounts
of data use UDP. </para>
</sect4>
</sect3><sect3 id="ipov-22"><title>Application Layer</title><para>The <emphasis>application layer</emphasis> defines standard Internet
services and network applications that anyone can use. These services work
with the transport layer to send and receive data. Many application layer
protocols exist.  The following list shows examples of application layer protocols: </para><itemizedlist><listitem><para>Standard TCP/IP services such as the <filename>ftp</filename>, <filename>tftp</filename>, and <command>telnet</command> commands</para>
</listitem><listitem><para>UNIX &ldquo;r&rdquo; commands, such as <command>rlogin</command> and <command>rsh</command></para>
</listitem><listitem><para>Name services, such as NIS and the domain name system (DNS)</para>
</listitem><listitem><para>Directory services (LDAP)</para>
</listitem><listitem><para>File services, such as the NFS service</para>
</listitem><listitem><para>Simple Network Management Protocol (SNMP), which enables network
management</para>
</listitem><listitem><para>Router Discovery Server protocol (RDISC) and Routing Information
Protocol (RIP) routing protocols </para>
</listitem>
</itemizedlist><sect4 id="ipov-23"><title>Standard TCP/IP Services</title><itemizedlist><listitem><para><emphasis role="strong">FTP and Anonymous FTP</emphasis> &ndash;
The File Transfer Protocol (FTP) transfers files to and from a remote network.
The protocol includes the <command>ftp</command> command and the <command>in.ftpd</command> daemon. FTP enables a user to specify the name of the remote host
and file transfer command options on the local host's command line. The <command>in.ftpd</command> daemon on the remote host then handles the requests from
the local host. Unlike <filename>rcp</filename>, <command>ftp</command> works
even when the remote computer does not run a UNIX based operating system.
A user must log in to the remote system to make an <command>ftp</command> connection,
unless the remote system has been configured to allow anonymous FTP. </para><para>You can obtain an enormous amount of material from <emphasis>anonymous
FTP servers</emphasis> that are connected to the Internet.  Universities and
other institutions set up these servers to offer software, research papers,
and other information to the public domain. When you log in to this type of
server, you use the login name <command>anonymous</command>, hence the term &ldquo;anonymous
FTP server.&rdquo; </para><para>Using anonymous FTP and setting up anonymous
FTP servers is outside the scope of this manual. However, many books, such
as <emphasis>The Whole Internet User's Guide &amp; Catalog</emphasis>, discuss
anonymous FTP in detail. Instructions for using FTP are in <olink targetdoc="sysadv4" remap="external"><citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>. The <olink targetdoc="refman1" targetptr="ftp-1" remap="external"><citerefentry><refentrytitle>ftp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page describes all <command>ftp</command> command options that are invoked
through the command interpreter. The <olink targetdoc="refman1m" targetptr="ftpd-1m" remap="external"><citerefentry><refentrytitle>ftpd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page describes the services that are
provided by the <command>in.ftpd</command> daemon.</para>
</listitem>
</itemizedlist><itemizedlist><listitem><para><emphasis role="strong">Telnet</emphasis> &ndash; The Telnet protocol
enables terminals and terminal-oriented processes to communicate on a network
that runs TCP/IP. This protocol is implemented as the <command>telnet</command> program
on local systems and the <command>in.telnetd</command> daemon on remote machines.
Telnet provides a user interface through which two hosts can communicate on
a character-by-character or line-by-line basis. Telnet includes a set of commands
that are fully documented in the <olink targetdoc="refman1" targetptr="telnet-1" remap="external"><citerefentry><refentrytitle>telnet</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page. </para>
</listitem>
</itemizedlist><itemizedlist><listitem><para><emphasis role="strong">TFTP</emphasis> &ndash; The Trivial File
Transfer Protocol (<command>tftp</command>) provides functions that are similar
to <filename>ftp</filename>, but the protocol does not establish <filename>ftp</filename>'s
interactive connection. As a result, users cannot list the contents of a directory
or change directories. A user must know the full name of the file to be copied.
The <olink targetdoc="refman" targetptr="tftp-1" remap="external"><citerefentry><refentrytitle>tftp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>man page describes
the <command>tftp</command> command set. </para>
</listitem>
</itemizedlist>
</sect4><sect4 id="ipov-24"><title>UNIX &ldquo;r&rdquo; Commands</title><para>The UNIX &ldquo;r&rdquo; commands enable users to issue commands
on their local machines that run on the remote host. These commands include
the following:</para><itemizedlist><listitem><para><command>rcp</command> </para>
</listitem><listitem><para><command>rlogin</command> </para>
</listitem><listitem><para><command>rsh</command> </para>
</listitem>
</itemizedlist><para>Instructions for using these commands are in the <olink targetdoc="refman1" targetptr="rcp-1" remap="external"><citerefentry><refentrytitle>rcp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>, <olink targetdoc="refman1" targetptr="rlogin-1" remap="external"><citerefentry><refentrytitle>rlogin</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>,
and <olink targetdoc="refman1" targetptr="rsh-1" remap="external"><citerefentry><refentrytitle>rsh</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages.</para>
</sect4><sect4 id="ipov-25"><title>Name Services</title><para>The Solaris OS provides the following name services:</para><itemizedlist><listitem><para><emphasis role="strong">DNS</emphasis> &ndash; The domain name
system (DNS) is the name service provided by the Internet for TCP/IP networks.
DNS provides host names to the IP address service. DNS also serves as a database
for mail administration. For a complete description of this service, see <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>. See also
the <olink targetdoc="refman3b" targetptr="resolver-3resolv" remap="external"><citerefentry><refentrytitle>resolver</refentrytitle><manvolnum>3RESOLV</manvolnum></citerefentry></olink> man page.</para>
</listitem><listitem><para><filename>/etc</filename> <emphasis role="strong">files</emphasis> &ndash;
The original host-based UNIX name system was developed for standalone UNIX
machines and then adapted for network use. Many old UNIX operating systems
and computers still use this system, but it is not well suited for large complex
networks.</para>
</listitem><listitem><para><emphasis role="strong">NIS</emphasis> &ndash; Network Information
Service (NIS) was developed independently of DNS and has a slightly different
focus. Whereas DNS focuses on making communication simpler by using machine
names instead of numerical IP addresses, NIS focuses on making network administration
more manageable by providing centralized control over a variety of network
information. NIS stores information about machine names and addresses, users,
the network itself, and network services. NIS name space information is stored
in NIS maps. For more information on NIS Architecture and NIS Administration,
see <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</sect4><sect4 id="ipov-2"><title>Directory Service</title><para>The Solaris OS supports LDAP (Lightweight Directory Access Protocol)
in conjunction with the Sun Open Net Environment (Sun ONE) Directory Server,
as well as other LDAP directory servers. The distinction between a name service
and a directory service is in the differing extent of functionality. A directory
service provides the same functionality of a naming service, but provides
additional functionalities as well. See <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</sect4><sect4 id="ipov-26"><title>File Services</title><para>The NFS application layer protocol provides file services for
the Solaris OS. You can find complete information about the NFS service in <olink targetdoc="sysadv4" remap="external"><citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>. </para>
</sect4><sect4 id="ipov-27"><title>Network Administration</title><para>The Simple Network Management Protocol (SNMP) enables you to view
the layout of your network and the status of key machines. SNMP also enables
you to obtain complex network statistics from software that is based on a
graphical user interface (GUI). Many companies offer network management packages
that implement SNMP. </para>
</sect4><sect4 id="ipov-28"><title>Routing Protocols</title><para>The Routing Information Protocol (RIP) and the Router Discovery
Server Protocol (RDISC) are two routing protocols for TCP/IP networks. They
are described in <olink targetptr="ipref-13" remap="internal">Routing Protocols in the Solaris
OS</olink>. </para>
</sect4>
</sect3>
</sect2>
</sect1><sect1 id="ipov-29"><title>How the TCP/IP Protocols Handle Data Communications</title><para>When a user issues a command that uses a TCP/IP application layer
protocol, a series of events is initiated. The user's command or message passes
through the TCP/IP protocol stack on the local system. Then, the command or
message passes across the network media to the protocols on the remote system.
The protocols at each layer on the sending host add information to the original
data. </para><para>Protocols on each layer of the sending host also interact with their
peers on the receiving host. <olink targetptr="ipov-fig-30" remap="internal">Figure 1&ndash;1</olink> shows
this interaction.</para><sect2 id="ipov-32"><title>Data Encapsulation and the TCP/IP Protocol Stack</title><para>The packet is the basic unit of information that is transferred
across a network. The basic packet consists of a header with the sending and
receiving systems' addresses, and a body, or <emphasis>payload</emphasis>,
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 system adds data to the packet
header, the process is called <emphasis>data encapsulation</emphasis>. Moreover,
each layer has a different term for the altered packet, as shown in the following
figure. </para><figure id="ipov-fig-30"><title>How a Packet Travels Through the TCP/IP Stack</title><mediaobject><imageobject><imagedata entityref="fig88.epsi"/>
</imageobject><textobject><simpara>Diagram shows how a packet travels through the TCP/IP
stack from the sending host to the receiving host.</simpara>
</textobject>
</mediaobject>
</figure><para>This section summarizes the life cycle of a packet. The life cycle
starts when you issue a command or send a message. The life cycle finishes
when the appropriate application on the receiving system receives the packet. </para><sect3 id="ipov-33"><title>Application Layer: Where a Communication Originates</title><para>The packet's history begins when a user on one system sends a
message or issues a command that must access a remote system. The application
protocol formats the packet so that the appropriate transport layer protocol,
TCP or UDP, can handle the packet. </para><para>Suppose the user issues an <command>rlogin</command> command to
log in to the remote system, as shown in <olink targetptr="ipov-fig-30" remap="internal">Figure
1&ndash;1</olink>. The <command>rlogin</command> command uses the TCP transport
layer protocol. TCP expects to receive data in the form of a stream of bytes
that contain the information in the command. Therefore, <command>rlogin</command> sends
this data as a TCP stream. </para>
</sect3><sect3 id="ipov-34"><title>Transport Layer: Where Data Encapsulation Begins</title><para>When the data arrives at the transport layer, the protocols at
the layer start the process of data encapsulation. The transport layer encapsulates
the application data into transport protocol data units. </para><para>The transport layer protocol creates a virtual flow of data between
the sending and receiving application, differentiated by the transport port
number.  The port number identifies a <emphasis>port</emphasis>, a dedicated
location in memory for receiving or sending data. In addition, the transport
protocol layer might provide other services, such as reliable, in order data
delivery. The end result depends on whether TCP, SCTP, or UDP handles the
information.</para><sect4 id="ipov-35"><title>TCP Segmentation</title><para>TCP is often called a &ldquo;connection-oriented&rdquo; protocol
because TCP ensures the successful delivery of data to the receiving host. <olink targetptr="ipov-fig-30" remap="internal">Figure 1&ndash;1</olink> shows how the TCP protocol
receives the stream from the <command>rlogin</command> command. TCP then divides
the data that is received from the application layer into segments and attaches
a header to each segment. </para><para>Segment headers contain sending and receiving ports, segment ordering
information, and a data field that is known as a <emphasis>checksum</emphasis>.
The TCP protocols on both hosts use the checksum data to determine if the
data transfers without error.</para>
</sect4><sect4 id="ipov-36"><title>Establishing a TCP Connection</title><para>TCP uses segments to determine whether the receiving system is
ready to receive the data. When the sending TCP wants to establish connections,
TCP sends a segment that is called a <emphasis>SYN</emphasis> to the TCP protocol
on the receiving host. The receiving TCP returns a segment that is called
an <emphasis>ACK</emphasis> to acknowledge the successful receipt of the segment.
The sending TCP sends another ACK segment, then proceeds to send the data.
This exchange of control information is referred to as a <emphasis>three-way
handshake</emphasis>. </para>
</sect4><sect4 id="ipov-37"><title>UDP Packets</title><para>UDP is a &ldquo;connectionless&rdquo; protocol. Unlike TCP, UDP
does not check that data arrived at the receiving host. Instead, UDP formats
the message that is received from the application layer into <emphasis>UDP
packets</emphasis>. UDP attaches a header to each packet. The header contains
the sending and receiving ports, a field with the length of the packet, and
a checksum. </para><para>The sending UDP process attempts to send the packet to its peer
UDP process on the receiving host. The application layer determines whether
the receiving UDP process acknowledges the reception of the packet. UDP requires
no notification of receipt. UDP does not use the three-way handshake. </para>
</sect4>
</sect3><sect3 id="ipov-38"><title>Internet Layer: Where Packets Are Prepared for
Delivery</title><para>The transport protocols TCP, UDP, and SCTP pass their segments
and packets down to the Internet layer, where the IP protocol handles the
segments and packets. IP prepares them for delivery by formatting them into
units called <emphasis>IP datagrams</emphasis>. IP then determines the IP
addresses for the datagrams, so that they can be delivered effectively to
the receiving host. </para><sect4 id="ipov-39"><title>IP Datagrams</title><para>IP attaches an <emphasis>IP header</emphasis> to the segment or
packet's header, in addition to the information that is added by TCP or UDP.
Information in the IP header includes the IP addresses of the sending and
receiving hosts, the datagram length, and the datagram sequence order. This
information is provided if the datagram exceeds the allowable byte size for
network packets and must be fragmented. </para>
</sect4>
</sect3><sect3 id="ipov-40"><title>Data-Link Layer: Where Framing Takes Place</title><para>Data-link layer protocols, such as PPP, format the IP datagram
into a <emphasis>frame</emphasis>. These protocols attach a third header and
a footer to &ldquo;frame&rdquo; the datagram. The frame header includes a <emphasis>cyclic redundancy check</emphasis> (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. </para>
</sect3><sect3 id="ipov-41"><title>Physical Network Layer: Where Frames Are Sent and
Received</title><para>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. </para>
</sect3><sect3 id="ipov-42"><title>How the Receiving Host Handles the Packet</title><para>When the packet arrives on the receiving host, the packet travels
through the TCP/IP protocol stack in the reverse order from which it was sent. <olink targetptr="ipov-fig-30" remap="internal">Figure 1&ndash;1</olink> illustrates this path. Moreover,
each protocol on the receiving host strips off header information that is
attached to the packet by its peer on the sending host. The following process
occurs:</para><orderedlist><listitem><para>The physical network layer receives the packet in its frame form.
The physical network layer computes the CRC of the packet, then sends the
frame to the data link layer.</para>
</listitem><listitem><para>The data-link layer verifies that the CRC for the frame is correct
and strips off the frame header and the CRC. Finally, the data-link protocol
sends the frame to the Internet layer.</para>
</listitem><listitem><para>The Internet layer reads information in the header to identify
the transmission. Then, the Internet layer determines if the packet is a fragment.
If the transmission is fragmented, IP reassembles the fragments into the original
datagram. IP then strips off the IP header and passes the datagram on to transport
layer protocols.</para>
</listitem><listitem><para>The transport layer (TCP, SCTP, and UDP) reads the header to determine
which application layer protocol must receive the data. Then, TCP, SCTP, or
UDP strips off its related header. TCP, SCTP, or UDP sends the message or
stream to the receiving application.</para>
</listitem><listitem><para>The application layer receives the message. The application layer
then performs the operation that the sending host requested.</para>
</listitem>
</orderedlist>
</sect3>
</sect2><sect2 id="ipov-100"><title>TCP/IP Internal Trace Support</title><para>TCP/IP provides internal trace support by logging TCP communication
when an RST packet terminates a connection. When an RST packet is transmitted
or received, information on as many as 10 packets, which were just transmitted,
is logged with the connection information.</para>
</sect2>
</sect1><sect1 id="ipov-43"><title>Finding Out More About TCP/IP and the Internet</title><para>Information about TCP/IP and the Internet is widely available.
If you require specific information that is not covered in this text, you
can probably find what you need in the sources cited next. </para><sect2 id="ipov-44"><title>Computer Books About TCP/IP</title><para>Many trade books about TCP/IP and the Internet are available from
your local library or computer bookstore. The following two books are  considered
the classic texts on TCP/IP:</para><itemizedlist><listitem><para>Craig Hunt. <emphasis>TCP/IP Network Administration</emphasis>  &ndash;
This book contains some theory and much practical information for managing
a heterogeneous TCP/IP network.</para>
</listitem><listitem><para>W. Richard Stevens. <emphasis>TCP/IP Illustrated, Volume I</emphasis>  &ndash;
This book is an in-depth explanation of the TCP/IP protocols. This book is
ideal for network administrators who require a technical background in TCP/IP
and for network programmers.</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="ewavk"><title>TCP/IP and Networking Related Web Sites</title><para>The Internet has a wealth of web sites and user groups that are devoted
to TCP/IP protocols and their administration. Many manufacturers, including
Sun Microsystems, offer web-based resources for general TCP/IP information.
The following are helpful web resources for TCP/IP information and general
system administration information.</para><informaltable frame="topbot" pgwide="100"><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="65.07*"/><colspec colwidth="34.93*"/><thead><row rowsep="1"><entry><para>Web Site</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><ulink url="http://www.ietf.org/home.html" type="text_url">The Internet
Engineering Task Force (IETF) web site</ulink></para>
</entry><entry><para>The IETF is the body responsible for the architecture and governance
of the Internet. The IETF web site contains information about the various
activities of this organization. The site also includes links to the major
publications of the IETF. </para>
</entry>
</row><row><entry><para><ulink url="http://www.sun.com/bigadmin" type="text_url">Sun Microsystem's
BigAdmin Portal</ulink></para>
</entry><entry><para>BigAdmin provides information for administering Sun computers. The site
offers FAQs, resources, discussions, links to documentation, and other materials
that pertain to Solaris OS administration, including networking.</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2><sect2 id="ipov-45"><title>Requests for Comments and Internet Drafts</title><para>The Internet Engineering Task Force (IETF) working groups publish standards
documents that are known as <emphasis>Requests for Comments</emphasis> (RFCs).
Standards that are under development are published in <emphasis>Internet Drafts</emphasis>.
The Internet Architecture Board (IAB) must approve all RFCs before they are
placed in the public domain. Typically RFCs and Internet drafts are directed
to developers and other highly technical readers. However, a number of RFCs
that deal with TCP/IP topics contain valuable information for system administrators.
These RFCs are cited in various places throughout this book.</para><para>Generally, For Your Information (FYI) documents appear as a subset
of the RFCs. FYIs contain information that does not deal with Internet standards.
FYIs contain Internet information of a more general nature. For example, FYI
documents include a bibliography that list introductory TCP/IP books and papers.
FYI documents provide an exhaustive compendium of Internet-related software
tools. Finally, FYI documents include a glossary of Internet and general networking
terms. </para><para>You will find references to relevant RFCs throughout this guide
and other books in the Solaris System Administrator Collection.</para>
</sect2>
</sect1>
</chapter>