Last modified 2/6/95.
Datalink protocols assume that the connected nodes have some way to transfer frames of data from one to the other, and that the receiver can detect errors when they occur in a frame. These topics were considered in earlier pages.
Here we consider the problem of managing the shared link between two or more nodes. First we consider possible configurations, then we consider protocols used to assure delivery of error-free frames in correct order.
A link may be
The directionality and temporal constraints on use of the medium are captured by the notion of duplexity.
Which node is eligible to transmit and when is the subject of line discipline. This is our main topic at the link and medium access layer, since this is where the protocols come into play.
There is no distinguished station to control the access to the shared medium, so stations must function in a distributed manner.
A primary station directs the secondary station(s), and usually all communication between secondaries must go through the primary. The primary uses polling to determine whether a secondary has data to send, and select to determine whether a secondary is ready to receive data.
The primary sends a SEL to the secondary station it wants to send data. The selected station either ACKs if it can receive the data or NAKs if it can't. If it can, the primary sends it the data and it ACKs the frame if it was good.
The primary sends a SEL and the data frame without waiting for the secondary to ACK the SEL first. If the secondary was ready, it ACKs as usual if the frame was good. Otherwise, it NAKs the frame (if it was not ready or if the frame was damaged).
The primary polls a secondary station by sending it a POLL frame. If the secondary has data, it responds with a data frame else it NAKs the POLL. The primary ACKs the data frame if it was received correctly, or NAKs it otherwise.
The primary polls each station individually, waiting for a NAK or data from each one before polling the next. The POLL for the next station can be pipelined following the ACK for the current one on multidrop lines.
The primary polls the farthest station first. Each secondary station, when it receives a poll, sends data if it has any, then polls the next nearest station. The nearest station polls the primary, which informs it that all the stations have been polled. The primary then ACKs all the data frames it received, and starts the next poll. This is most useful in half-duplex environments, since the cost of changing the direction of the line is paid only twice per cycle (the minimum possible) rather than twice per station. The line must be multidrop, of course. Pipelining accounts for the gain here.
A hybrid scheme may use a primary station to set up communication resources for a pair (or a set) of secondaries, using one method to allow a secondary to request a reservation and then using reservation techniques for the secondaries to carry out their conversation. These are used in some LANs and especially in satellite networks.
The data link protocol must provide for
The sender sends frames one after the other, without waiting for any ACKs. There is no way to recover from lost or damaged frames.
The sender sends a frame, then waits for the receiver to ACK or NAK. The protocol hangs if a data frame, an ACK or a NAK is lost.
The sender transmits numbered frames to the receiver, puts the frame on the retransmission queue, starts a timer, and waits for an ACK or a NAK. If none is received before the timer expires, then the frame on the retransmission queue is retransmitted. The receiver can distinguish between new frames and retransmitted duplicates by the sequence number. Without numbered ACKs, however, the sender can misinterpret an ACK and fail to retransmit a lost or damaged packet.
Sliding window alone allows for multiple outstanding unacknowledged packets, so that the protocol performance can be improved. With automatic retransmit request (ARQ), it handles errors well. The receiver may be able to adjust the sender's window size for flow control.
The sender has a maximum send window size, N, that is used to define the greatest difference (modulo max_seq_#) between the lowest numbered unacknowledged frame (min) and the highest numbered frame that can be sent (max). The sender keeps track of these two quantities, plus the next sequence number to use for a new data frame, i. If i > max the the sender has to wait until max is incremented to send frame i. The sender increments both max and min (modulo max_seq_#) when an ACK for min is received. The receiver also has a window, the receive window, that defines the frames it will accept. At first, the rmin = i, and rmax-rmin is the receive window size. Whenever a frame is received, the receiver acknowledges it (whether or not it is accepted). If the sequence number of the received frame j is such that rmin <= j <= rmax, and it has not already been received, then the receiver buffers it. If j = rmin, then the receiver increments both rmax and rmin (modulo max_seq_#) and passes the frame to the next higher layer. If frame j+1 was already received and buffered, then it too is passed on and the receive window shifted. This continues until frame rmin is not in a recieve buffer.
A one-bit sequence number is used, with the ACK naming the next sequence number it expects.
The receiver typically uses cumulative ACKs, naming the next sequence number it expects. NAKs only expedite retransmission. The receiver need only have one buffer, provided it can always transfer frames to the host.
The SR (selective reject/report/retransmit) ARQ requires the receiver to have as many buffers as the sender, and to buffer frames received out of order, provided they are in the receive window. Cumulative ACKs will not inform the sender of frames correctly received out of order until the missing frame is received, so explicit ACKs are often used. NAKs are very useful with this protocol.
An important parameter to consider is the number of frames that can be in transit from the sender to the receiver a one time, a.
where D = distance (meters), V = propagation velocity (m/s), L = frame size (bits), and R = data rate (bps).
U_p = 1.
U_p = 1/(1 + 2a)
U_p = min{1, N/(1+2a)}, where N = send window size.
As N increases, so does U_p up to a point (when N = 1_2a).
There is little point to having a receive window larger than the send window, and the sum of the maximum send and receive windows must not exceed the total number of sequence numbers available.
Like PAR, but it has sequence numbers on the ACKs.
(ACK max, no NAK)
(ACK or NAK each frame)
To estimate the effect of errors, the decrease in utilization due to retransmission of damaged frames must be considered. If P = frame error rate = Prob(frame is damaged), then the expected number of transmissions per success, assuming that an error only causes one frame to be retransmitted, is:
The error rate, hence the expected number of retransmissions, increases as the frame length increases, which causes U_e to decrease. On the other hand, U_f improves as the frame length increases, since more data is packed into a frame with a fixed amount of overhead. Likewise, increasing L will decrease a, so the protocol utilization rate may also improve. Balancing these conflicting trends to obtain the best net overall utilization is an optimization problem. A parametrized formula for the overall utilization taking all these factors into account may be differentiated with respect to L, and when this derivative is set to zero and the equation solved, a local extremum will be found. By checking the utilization at this value of L as well as the limit as L -> oo, the global optimum value of L may be found, as a function of bit error rate, framing overhead, and protocol.