When a user issues a command that uses a TCP/IP application layer protocol, a chain of occasions is collection in motion. The user"s command or blog post passes through the TCP/IP protocol ridge on the local machine, and then throughout the network media to the protocols top top the recipient. The protocols in ~ eachlayer on the sending out host add information to the original data.

As the user"s command makes its method through the protocol stack, protocols on each layer that the sending out host also interact through their peers on the receiving host. The following number 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 straightforward unit of info transferred throughout a network, consisting, at a minimum, of a header v the sending and receiving hosts" addresses, and a body v the data to be transferred. Together the packet travels through the TCP/IP protocol stack, the protocols at every layer eitheradd or remove fields from the basic header. Once a protocol top top the sending hold adds data come the packet header, the procedure is referred to as data encapsulation. Moreover, each layer has a various term for the changed packet, as displayed in the adhering to figure.

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

This ar summarizes the life bike of a packet from the moment the user problems a command or sends a post to the moment it is got by the suitable application on the receiving host.

Application Layer--User Initiates Communication

The packet"s history begins when a user on one organize sends a post or concerns a command the must access a far host. The applications protocol associated with the command or message formats the packet so that it have the right to be tackled by the suitable transport class protocol, TCP or UDP.

Suppose the user issues an rlogin command to log in to the far host, as presented in figure 4-1. The rlogin command provides the TCP move layer protocol. TCP expects to receive data in the form of a stream of bytes comprise the informationin the command. Therefore, rlogin sends out this data together a TCP stream.

Not all applications layer protocols usage TCP, however. Mean a user desires to mount a file system ~ above a far host, for this reason initiating the NIS+ application layer protocol. NIS+ uses the UDP transport layer protocol. Therefore, the packet include the command have to be formatted in a manner the UDPexpects. This form of packet is described 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 an outcome depends on whether TCP or UDP has actually handled the information.

TCP Segmentation

TCP is often dubbed a "connection-oriented" protocol since it ensures the successful delivery of data to the receiving host. Number 4-1 shows just how the TCP protocol receive the stream from the rlogin command. TCP divides the data obtained from theapplication layer right into segments and also attaches a header to every segment.

Segment headers contain sender and also recipient ports, segment notified information, and a data ar known together a checksum. The TCP protocols on both hosts usage the checksum data to identify whether data has transferred there is no error.

See more: Choose The Word That Does Not Belong., Choose The Word That Doesn`T Belong

Establishing a TCP Connection

TCP uses segments to determine whether the receiving organize is ready to receive the data. Once the sending TCP desires to establish connections, it sends a segment referred to as a SYN come the peer TCP protocol to run on the receiving host. The receiving TCP returns a segment called an ACK to identify thesuccessful receipt of the segment. The sending TCP sends one more ACK segment, then proceeds come send the data. This exchange of regulate information is described as a three-way handshake.

UDP Packets

UDP is a "connectionless" protocol. Unlike TCP, it does not examine to make certain that data came down on the receiving host. Instead, UDP takes the blog post received indigenous the applications layer and formats it into UDP packets. UDP attaches a header to each packet, whichcontains the sending and also receiving organize ports, a field with the length of the packet, and also a checksum.

The sending UDP procedure attempts to send the packet to its peer UDP procedure on the receiving host. The applications layer determines whether the receiving UDP procedure acknowledges that the packet was received. UDP requires no an alert of receipt. UDP walk not use the three-way handshake.

Internet Layer

As shown in number 4-1, both TCP and UDP pass their segments and also packets down to the net layer, whereby they room handled by the IP protocol. IP prepares them for delivery by formatting them right into units dubbed IP datagrams. IP then determines the IP addresses for the datagrams,so they can be delivered effectively come the receiving host.

IP Datagrams

IP attaches one IP header to the segment or packet"s header in enhancement to the information added by TCP or UDP. Information in the IP header includes the IP addresses that the sending and receiving hosts, datagram length, and also datagram sequence order. This info is providedin case the datagram over the allowable byte size for network packets and must it is in fragmented.

Data-Link Layer--Framing take away Place

Data-link great protocols, such together PPP, layout the IP datagram into a frame. They connect a 3rd header and a footer come "frame" the datagram. The frame header has a cyclical redundancy check (CRC) ar that checks for errors as the frametravels over the network media. Climate the data-link layer passes the structure to the physics layer.

Physical Network Layer--Preparing the frame for Transmission

The physics network great on the sending host receives the frames and also converts the IP addresses right into the hardware addresses appropriate to the network media. The physics network class then sends out the structure out end the network media.

How the Receiving hold Handles the Packet

When the packet come on the receiving host, the travels with the TCP/IP protocol stack in the reverse order from that which it take it on the sender. Number 4-1 illustrates this path. Moreover, each protocol ~ above the receiving host strips turn off header information attached to thepacket by its peer on the sending host. Here is what happens:

TCP/IP inner Trace Support

TCP/IP offers internal trace support by logging TCP interaction when a link is terminated by one RST packet. Once an RST packet istransfer or received, info on as numerous as 10 packets, which to be transmitted or received instantly before on the connection, is logged through theconnection information.