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 eachlayer 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. 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 the TCP/IP Protocol Stack
The packet is the basic unit of information transferred across a network, consisting, at a 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 eitheradd 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 the following figure.
Figure 4-1 How a Packet Travels Through the TCP/IP Stack

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–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 4-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 informationin 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 NIS+ application layer protocol. NIS+ uses the UDP transport layer protocol. Therefore, the packet containing the command must be formatted in a manner that UDPexpects. This type of packet is referred to as a message.
See more: 5 Dollars In Euros (Eur) – 5 Usd To Eur Exchange Rate
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 4-1 shows how the TCP protocol receives the stream from the rlogin command. TCP divides the data received from theapplication 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.
See more: Fetty Wap Illuminati Picture, Check Out This Insane Conspiracy Theory
Establishing a TCP Connection
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 thesuccessful 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 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, whichcontains the sending and receiving host ports, a field with the length of the packet, and a checksum.
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 that the packet was received. UDP requires no notification of receipt. UDP does not use the three-way handshake.
Internet Layer
As shown in Figure 4-1, 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 units called IP datagrams. IP then determines the IP addresses for the datagrams,so they can be delivered 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. Information in the IP header includes the IP addresses of the sending and receiving hosts, datagram length, and datagram sequence order. This information is providedin 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 frametravels 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 4-1 illustrates this path. Moreover, each protocol on the receiving host strips off header information attached to thepacket by its peer on the sending host. Here is what happens:
TCP/IP Internal Trace Support
TCP/IP provides internal trace support by logging TCP communication when a connection is terminated by an RST packet. When an RST packet is transmitted or received, information on as many as 10 packets, which were transmitted or received immediately before on that connection, is logged with theconnection information.