An acknowledgment ACK for short is a small control frame that a protocol sends back to its peer saying that it has received an earlier frame. By control frame we mean a header without any data, although a protocol can piggyback an ACK on a data frame it just happens to be sending in the opposite direction.
The receipt of an acknowledgment indicates to the sender of the original frame that its frame was successfully delivered. If the sender does not receive an acknowledgment after a reasonable amount of time, then it retransmits the original frame. This action of waiting a reasonable amount of time is called a timeout.
The general strategy of using acknowledgments and timeouts to implement reliable delivery is sometimes called automatic repeat request abbreviated ARQ.
The simplest ARQ scheme is the stop-and-wait algorithm. The idea of stop-and-wait is straightforward: After transmitting one frame, the sender waits for an acknowledgment before transmitting the next frame. If the acknowledgment does not arrive after a certain period of time, the sender times out and retransmits the original frame. Figure Timeline showing four different scenarios for the stop-and-wait algorithm. Figure 34 illustrates timelines for four different scenarios that result from this basic algorithm.
The sending side is represented on the left, the receiving side is depicted on the right, and time flows from top to bottom. Figure 34 a shows the situation in which the ACK is received before the timer expires; b and c show the situation in which the original frame and the ACK, respectively, are lost; and d shows the situation in which the timeout fires too soon. The packet timelines shown in this section are examples of a frequently used tool in teaching, explaining, and designing protocols.
They are useful because they capture visually the behavior over time of a distributed system—something that can be quite hard to analyze. When designing a protocol, you often have to be prepared for the unexpected—a system crashes, a message gets lost, or something that you expected to happen quickly turns out to take a long time. These sorts of diagrams can often help us understand what might go wrong in such cases and thus help a protocol designer be prepared for every eventuality.
There is one important subtlety in the stop-and-wait algorithm. Suppose the sender sends a frame and the receiver acknowledges it, but the acknowledgment is either lost or delayed in arriving. This situation is illustrated in timelines c and d of Figure In both cases, the sender times out and retransmits the original frame, but the receiver will think that it is the next frame, since it correctly received and acknowledged the first frame. This has the potential to cause duplicate copies of a frame to be delivered.
To address this problem, the header for a stop-and-wait protocol usually includes a 1-bit sequence number—that is, the sequence number can take on the values 0 and 1—and the sequence numbers used for each frame alternate, as illustrated in Figure Thus, when the sender retransmits frame 0, the receiver can determine that it is seeing a second copy of frame 0 rather than the first copy of frame 1 and therefore can ignore it the receiver still acknowledges it, in case the first ACK was lost.
Timeline for stop-and-wait with 1-bit sequence number. Consider, for example, a 1. Since the sender can send only one frame per RTT, and assuming a frame size of 1 KB, this implies a maximum sending rate of. We would like to be able to send this much data without waiting for the first acknowledgment.
The principle at work here is often referred to as keeping the pipe full. The algorithms presented in the following two subsections do exactly this. We would like the sender to be ready to transmit the ninth frame at pretty much the same moment that the ACK for the first frame arrives. The algorithm that allows us to do this is called sliding window , and an illustrative timeline is given in Figure Timeline for the sliding window algorithm.
The sliding window algorithm works as follows. First, the sender assigns a sequence number , denoted SeqNum , to each frame. The sender maintains three variables: The send window size , denoted SWS , gives the upper bound on the number of outstanding unacknowledged frames that the sender can transmit; LAR denotes the sequence number of the last acknowledgment received ; and LFS denotes the sequence number of the last frame sent.
The sender also maintains the following invariant:. This situation is illustrated in Figure Sliding window on sender. When an acknowledgment arrives, the sender moves LAR to the right, thereby allowing the sender to transmit another frame. Also, the sender associates a timer with each frame it transmits, and it retransmits the frame should the timer expire before an ACK is received.
Notice that the sender has to be willing to buffer up to SWS frames since it must be prepared to retransmit them until they are acknowledged. The receiver maintains the following three variables: The receive window size , denoted RWS , gives the upper bound on the number of out-of-order frames that the receiver is willing to accept; LAF denotes the sequence number of the largest acceptable frame ; and LFR denotes the sequence number of the last frame received.
The receiver also maintains the following invariant:. Sliding window on receiver. When a frame with sequence number SeqNum arrives, the receiver takes the following action. Now the receiver needs to decide whether or not to send an ACK. Let SeqNumToAck denote the largest sequence number not yet acknowledged, such that all frames with sequence numbers less than or equal to SeqNumToAck have been received.
The receiver acknowledges the receipt of SeqNumToAck , even if higher numbered packets have been received. This acknowledgment is said to be cumulative. However, no ACK needs to be sent since frame 6 has yet to arrive. Server Fault is a question and answer site for system and network administrators.
It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I have a question about the reliability of network layers, I think in the network layers there is a redundancy, my question is why both link-level and end-end reliability need?
End-to-end is required because not ALL network layers are particularly reliable, and only the end systems know how much reliability is really required. Also, if there is more than one lossy link, only the end systems know which packets really need retransmitted or corrected for and end-to-end reliability therefore minimises the extra work to compensate for loss.
And finally, all means for not losing packets take time. If every hop on a long path goes for near-perfect reliability, the overall latency will be enormous. When a link-layer protocol provides reliable delivery, it guarantees to move each network layer data-gram across the link without any error. A link-layer reliability is often used for links that are prone to high error rates such as wireless etc. Ok, so you have a server.. And you want pretty good availability and redundancy, so you connect it with one NIC to a single switch.
This allows one NIC to fail, still leaving you with connectivity. Depending on the bonding mode of the NIC. Better still would be to connect 2 NICs to different switches. Now you can lose a single NIC and a single switch. For greater redundancy you need to look at how the network gets beyond the LAN. WAN redundancy provided by more than one diverse route.
By diverse I mean the traffic takes a different route entirely out to the internet. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 9 years, 8 months ago.
Active 7 years, 7 months ago. Viewed 6k times. There is a quote I forgot from which network book I copied long time ago. We know that TCP is a Transport layer protocol, not a link layer protocol. Improve this question.
Martin Prikryl Tim Tim 1. Add a comment. Active Oldest Votes. Improve this answer. Kyle Jones Kyle Jones 6, 2 2 gold badges 20 20 silver badges 31 31 bronze badges. BatchyX BatchyX 2, 14 14 silver badges 12 12 bronze badges. TCP is designed to work on the presumption that individual links are expected to be relatively reliable.
It is not designed to deal with links or nodes that drop packets for reasons other than congestion. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
0コメント