When a user worries a command that uses a TCP/IP applications layer protocol, a chain of events is collection in motion. The user"s command or blog post passes through the TCP/IP protocol stack on the local machine, and then throughout the network media to the protocols top top the recipient. The protocols in ~ eachlayer top top the sending out host include information come the initial data.

As the user"s command provides its means through the protocol stack, protocols on each layer the the sending out host likewise interact v their peers on the receiving host. The following figure shows this interaction.

You are watching: What protocol makes a connection, checks whether the data is received, and resends it if it is not

Data Encapsulation and also the TCP/IP Protocol Stack

The packet is the basic unit of info transferred across a network, consisting, at a minimum, that a header v the sending and also receiving hosts" addresses, and a body with the data to be transferred. As the packet travels with the TCP/IP protocol stack, the protocols at every layer eitheradd or remove areas from the straightforward header. When a protocol ~ above the sending hold adds data to the packet header, the process is dubbed data encapsulation. Moreover, each layer has a different term because that the altered packet, as displayed in the complying with figure.

Figure 4-1 just how a Packet Travels v the TCP/IP Stack
*

This ar summarizes the life bicycle of a packet from the moment the user problems a command or sends a blog post to the time it is received by the proper application ~ above the receiving host.

Application Layer--User Initiates Communication

The packet"s history begins as soon as a user top top one host sends a post or concerns a command the must accessibility a far host. The application protocol connected with the command or message layouts the packet so the it deserve to be taken on by the suitable transport great protocol, TCP or UDP.

Suppose the user worries an rlogin command to log in to the remote host, as presented in figure 4-1. The rlogin command offers the TCP move layer protocol. TCP expects to receive data in the form of a currently of bytes containing the informationin the command. Therefore, rlogin sends this data together a TCP stream.

Not all application layer protocols use TCP, however. Suppose a user desires to mountain a paper system on a remote host, for this reason initiating the NIS+ application layer protocol. NIS+ offers the UDP transfer layer protocol. Therefore, the packet include the command have to be formatted in a manner that UDPexpects. This type of packet is described as a message.

Transport Layer--Data Encapsulation Begins

When the data come at the move layer, the protocols at the layer begin the process of data encapsulation. The end result depends on even if it is TCP or UDP has handled the information.

TCP Segmentation

TCP is often referred to as a "connection-oriented" protocol because it ensures the successful distribution of data to the receiving host. Number 4-1 shows just how the TCP protocol receive the stream indigenous the rlogin command. TCP divides the data received from theapplication layer into segments and attaches a header to every segment.

Segment headers save sender and also recipient ports, segment ordering information, and a data field known as a checksum. The TCP protocols on both hosts use the checksum data to identify whether data has transferred there is no error.

See more: The Minimum Amount Of Energy Needed For A Sensation To Occur Is Called

Establishing a TCP Connection

TCP offers segments to identify whether the receiving host is prepared to get the data. As soon as the sending out TCP wants to establish connections, it sends a segment referred to as a SYN come the peer TCP protocol running on the receiving host. The receiving TCP returns a segment referred to as an ACK to recognize thesuccessful receipt the the segment. The sending out TCP sends an additional ACK segment, climate proceeds come 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, the does not check to make certain that data arrived at the receiving host. Instead, UDP take away the blog post received from the applications layer and formats it into UDP packets. UDP attaches a header to every packet, whichcontains the sending and also receiving host ports, a ar with the size of the packet, and also a checksum.

The sending out UDP process attempts come send the packet to its peer UDP process on the receiving host. The applications layer determines whether the receiving UDP process acknowledges that the packet to be received. UDP needs no an alert of receipt. UDP walk not usage the three-way handshake.

Internet Layer

As presented in figure 4-1, both TCP and UDP happen their segments and also packets down to the net layer, wherein they space handled through the IP protocol. IP prepares lock for delivery by formatting them into units dubbed IP datagrams. IP then determines the IP addresses for the datagrams,so they deserve to be yielded effectively 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. Details in the IP header contains the IP addresses of the sending and receiving hosts, datagram length, and also datagram sequence order. This info is providedin instance the datagram exceeds the allowable byte dimension for network packets and must be fragmented.

Data-Link Layer--Framing takes Place

Data-link great protocols, such as PPP, format the IP datagram right into a frame. They connect a 3rd header and also a footer to "frame" the datagram. The frame header consists of a cyclical redundancy check (CRC) ar that checks because that errors as the frametravels end the network media. Then the data-link layer overcome the structure to the physics layer.

Physical Network Layer--Preparing the frame for Transmission

The physical network great on the sending hold receives the frames and also converts the IP addresses right into the hardware addresses ideal to the network media. The physical network layer then sends out the framework out over the network media.

How the Receiving organize Handles the Packet

When the packet arrives on the receiving host, the travels v the TCP/IP protocol ridge in the reverse order from the which it took on the sender. Number 4-1 illustrates this path. Moreover, each protocol top top the receiving organize strips turn off header details attached come thepacket by its peer on the sending host. Right here is what happens:

TCP/IP interior Trace Support

TCP/IP gives internal trace assistance by logging TCP communication when a connection is terminated by one RST packet. When an RST packet is sent or received, information on as many as 10 packets, which to be transmitted or received automatically before on the connection, is logged v theconnection information.