Lesson 1 - ATM Concepts

advertisement
Chapter 3a
The Data Link Layer Protocols
1. Introduction
2. DLL Design.
a. Network Layer Services.
b. Error Control
c. Flow Control
3. Elementary Data Link Protocols a. Stop-and-Wait Protocol
b. A Simplex protocol for a
Noisy Channel; Time-out
c. Sliding-Window Protocols
d. Sliding-window Flow Control
e. A One-Bit Sliding-Window
f. A Protocol Using-Go-Back- N
4. High-Level Data Link Control
g. Selective Reject
a. HDLC Operation
5. DLL in the Internet
b. HDLC Protocol
a. PPP-The point-to-point Protocol
(T. 183-229; 234-246)
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
2
1. Introduction
In this chapter we will consider the design principle for layer 2- DLL. We will
consider communication between two adjacent machines (connected by pointto-point communication channel, and the bits are delivered in the same order
in which they are sent) at the DLL.
Our discussion so far has concerned sending signals over a transmission
link. For effective digital data communications, much more is needed to
control and manage the exchange. To achieve the necessary control, a layer
of logic is added above the physical interfacing. This logic is referred to as
data link control, or data link control protocol. The layer that provides the
data link control is called Data Link Layer (DLL). When a data link
control protocol is used, the transmission medium between systems is
referred to as a data link.
To see the need for DLL, we list some of the requirements and objectives for
effective data communication between two directly connected transmittingreceiving stations:

Frame synchronization. Data are sent in blocks called frames. The
beginning and end of each frame must be recognized.

Error control. Any bit errors introduced by the transmission system
must be corrected.

Flow control. The sending station must not send frames at a rate
faster then the receiving station can absorb them.

Addressing. On a multipoint line, such as a LAN, the identity of the
two stations involved in a transmission must be specified.

Link management. The initiation, maintenance, and termination of a
data exchange requires a fair amount of coordination and cooperation among
stations.
Procedures for the management are satisfied by the DLL. Data Link
Protocols used for the communication must take circuit errors, data rate, and
time delay factors into consideration.
2. DLL Design.
Functions of the DLL are:
1.
Providing service interface to the network layer.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
3
2.
Dealing with transmission errors
3.
Regulating the flow of data (slow receivers will not overloaded by fast
senders).
For solution of these functions, the DLL takes the packets from the network
layer and encapsulates them into frames for transmission. Each frame
contains a frame header, payload field for holding the packets, and a frame
trailer, see Figure 1.
Sending machine
Packet
Header Payload fild Trailer
Receiving machine
Frame
Packet
Header Payload field Trailer
Figure 1. “Packet” and “Frame” relationship
Frame management is basic task of the DLL. In some cases, functions of
error control and flow control are allocated in transport or other upper layer
protocols and not in the DLL, but principles are pretty much the same. In the
DLL they often show up in their simplest and purest forms, making this a
good place to consider them in this chapter.
a. Network Layer Services.
The function of the DLL is to provide services to the network layer. The
principal service is transferring data from the network layer on the source
machine to the layer on the destination machine. Actual path of the data
transfer process follows layers 3-2-1 on the sender machine and 1-2-3 on the
destination machine, but it is easier to think that two DLL processes data
transfer using a data link protocol. The actual services can vary from system
to system. Three reasonable possibilities that are commonly provided are:
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
1.
2.
3.
4
Unacknowledged connectionless service.
Acknowledged connectionless service.
Acknowledged connection-oriented service.
Let us consider each of them.
1. Unacknowledged connectionless service consists of having the source
machine send independent frames to the destination machine without having
the destination machine acknowledged them. No logical connection is
established beforehand or released afterward. If a frame is lost due to noise
on the line, no attempt is made to detect the loss or recover from it in the
DLL. This class of service is appropriate when the error rate is very low so
that recovery task is left for solution to higher layers. It is also appropriate
for real-time traffic, such as voice, in which late data are worse than bad
data. Most LANs use unacknowledged connectionless service in the DLL.
2. Acknowledged connectionless service is more reliable. When this service
is offered, there are still no logical connections used, but each frame sent is
individually acknowledged. In this way, the sender knows whether a frame
has arrived correctly. If it has not arrived within a specific time interval, it
can be sent again. This service is useful over unreliable channels, such as
wireless system. The trouble with this strategy is that, frames usually have a
strict maximum length imposed by the hardware and network layer packets
do not. If the average packet is broken up into frames, and let say, 20% of all
frames are lost, it may take a very long time for the packet to get through. If
individual frames are acknowledged and retransmitted, entire packets get
through much faster. On reliable channels, such as fiber, the overhead of a
heavyweight data link protocol may be unnecessary, but on wireless
channels, with their unreliability, it is well worth the cost.
3. Acknowledged connection-oriented service requires established
connection between source and destination machines before any data are
transferred. Any frame sent over the connection is numbered, and the DLL
guarantees that each frame sent is indeed received, and are received in the
same order. With connectionless service, in contrast, it is possible that a lost
acknowledgement causes a packet to be sent several times and thus received
several times. When connection-oriented service is used, transfers go
through three distinct phases:
a. the connection is established and counters needed to keep track of
which frames have been received and which ones have not.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
5
b. One or more frames are transmitted.
c. Connection is released, freeing up the variables, buffers and other
resources used to maintain the connection.
A typical example is a WAN subnet consisting of routers connected by pointto-point leased telephone lines. When a frame arrives at a router, the
hardware checks it for errors, and then passes the frame to the DLL
software (which might be embedded in a chip on the network interface
board). The DLL software checks to see if it is the frame expected, and if so,
gives the packet (contained the payload field) to the routing software. The
routing software then chooses the appropriate outgoing line and passes the
packet back down to the DLL software, which then transmits it. The flow
over two routers is shown in Figure 2.
The routing code frequently wants the job done right. It does not want to be
bothered too often with packets that got lost on the way. It is up to the DLL
protocol, shown in the dotted rectangle, to make unreliable communication
lines look perfect or, at least, fairly good.
To provide service to the network layer, the DLL must use the service
provided to it by the physical layer. What the physical layer does is accept a
raw of a bit stream and attempt to deliver it to the destination. This bit
stream is not guaranteed to be error free. The numbers of bits received may
be less than, equal to, or more than that the number of bits transmitted, and
they may have different values. It is up to the DLL to detect and, if
necessary, correct errors. The usual approach is for the DLL to break the bit
stream up into discrete frames and compute the checksum for each frame.
Method of bit stream breaking into frames, checksum algorithm, the
checksum recompilation and error control methods are widely considered in
literature, so we will not consider in this note, but recommend readers to
observe the methods.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
6
Router
DLL
process
Routing
process
2
2
Frames
here
3
2
Packets
here
2
3
Data link
protocol
Transmission
line to a router
Figure 2. The flow over two routers
b. Error Control
Error control refers to mechanisms to detect and correct errors that occur in
the transmission of frames. We will use the model, which covers the typical
case. As before, data are sent as a sequence of frames, frames arrive in the
same order in which they are sent; and each transmitted frame suffers an
arbitrary and variable amount of delay before reception. In addition, we
disclose the possibility of two types of errors:
 Lost frame
 Damaged frame
The usual way to ensure reliable delivery is to provide the sender with some
feedback about what is happening at the other end of the line. Typically, the
protocol calls for the receiver to send back special control frames carrying
positive or negative acknowledgment about the incoming frames. If the
sender receives a positive ACK about a frame, it knows the frame has
arrived safely. On the other hand, a negative ACK means that something has
gone wrong, and the frame must be transmitted again.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
7
The most common techniques for error control are based on some or all of
the following ingredients:
 Error detection.
 Positive Acknowledgment.
 Retransmission after time-out.
 Negative acknowledgment and retransmission
When the sender transmits a frame, it generally also starts a timer. The timer
is set to expire after an interval long enough for the frame to reach the
destination, be processed there, and have the ACK propagate back to the
sender. Normally, the frame will be correctly received and the ACK will get
back before the timer runs out, in which case the timer will be cancelled.
However, if either the frame or the ACK is lost, the timer will go off,
alerting the sender to a potential problem. The solution is to just transmit the
frame again. However, when frames may be transmitted multiple times is a
danger that the receiver will accept the same frame two or more times and
passé it to the network layer more than once. To prevent this from
happening, it is generally necessary to assign sequence numbers to outgoing
frames, so that the receiver can distinguish retransmissions from originals.
Collectively, these mechanisms are all referred to as Automatic Report
Request (ARQ); the effect of ARQ is to turn an unreliable data link into a
reliable one. Three versions Of ARQ have been standardized:
 Stop-and-wait ARQ
 Go-back-N ARQ
 Selective-reject ARQ
All of these forms are based on the use of the flow control technique; we
examine each of them in turn.
c. Flow Control
Another important design issue that occurs in the DLL (and higher layers as
well) is what to do with a sender that systematically wants to transmit frames
less than the receiver can accept them. This situation can occur when the
sender is running on a fast computer and the receiver is running a slow
machine. The sender keeps pumping the frames out at a high rate until the
receiver is completely overloaded. Even if the transmission is error free, at a
certain point the receiver will simply be unable to handle the frames as they
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
8
arrive and will start to lose some. Clearly, something has to be done to
prevent this situation.
Two approaches are commonly used: 1. Feedback-based flow control, the
receiver sends back information to the sender giving it permission to send
more data or at least telling the sender how the receiver is doing. 2. Ratebased flow control, the protocol has a built-in mechanism that limits the
rate at which senders may transmit data, without using feedback from the
receiver. Since rate-based schemes are never used in the DLL we will look
at feedback-based flow control schemes.
Various feedback-based flow control schemes are known, but most of them
use the same basic principle. The protocol contains well-defined rules about
when a sender may transmit the next frame. These rules often prohibit
frames from being sent the receiver has granted permission. For example,
when connection is set up, the receiver might say: “You may send me n
frames now, but after they have been sent, do not send any more until I have
told you to continue”.
3. Elementary Data Link Protocols
Let us consider DLL three protocols with increasing complexity. Before we
look at protocols let us make some assumptions underlying the model of
communication. Let us assume that:
1). DLL and Network layer are independent processes that communicate by
passing messages back and forth trough the physical layer. In many cases,
the physical and DLL processes will be running on a processor inside a
special network I/0 chip and the network layer code will be running on the
main CPU. However, other implementations are also possible (e.g., three
processes inside a single I/O chip, or the physical and DLL as procedures
called by the network layer process). In any event, training the three layers
as separate processes makes the discussion conceptually cleaner and also
serves to emphasize the independence of the layers.
2). Machine A wants to send a long stream of data to machine B, using a
reliable, connection-oriented service. Latter, we will consider the case where
B also wants to send data to A simultaneously. A is assumed to have an
infinite supply of data ready to send and never has to wait for data to be
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
9
produced, when A’s DLL asks for data, the network layer is always able to
comply immediately.
3). Machines do not crash. That is, these protocols deal with communication
errors, but not the problems caused by computers crashing and rebooting.
As far as the DLL is concerned, the packet passed across the interface to it
from the network layer is pure data, whose every bit is to be delivered to the
destination’s network layer. The fact that the destination’s network layer
may interpret part of the packet as a header is of no concern to the DLL.
When the DLL accepts a packet, it encapsulates the packet in a frame by
adding a data link header and trailer to it see Figure 1. Thus, a frame consists
of an embedded packet, some control information (in the header), and a
checksum (in the trailer). The frame is then transmitted to the DLL on the
other machine. We will assume that there exists suitable library procedures
to_physical_layer to send a frame and from_physical_layer to receive a
frame. The transmitting hardware computes and appends the checksum (thus
creating the trailer), so that the DLL software need not worry about it.
Initially, the receiver has nothing to do. It just is waiting for something to
happen by procedure call wait_for event(&event). This procedure only
returns when something has happened (a frame has arrived). Upon return,
the variable event tells what happened. The set of possible events differs for
the various protocols to be described and will be defined separately for each
protocol. (In realistic situation, the DLL will not wait for event, but will
receive an interrupt, which will cause it to stop whatever it was doing and go
handle the incoming frame).
When a frame arrives at the receiver, the hardware computes the checksum.
If the checksum is incorrect (i.e. there was transmission error), the DLL is so
informed (event=cksum_error). If the inbound frame arrived undamaged,
the DLL is also informed (event=frame_arrived) so that it can acquire the
frame for inspection using from_physical_layer. As soon as the receiving
DLL has acquired an undamaged frame, it checks the control information in
the header, and if everything is all right, passes the packet portion to the
network layer. Under no circumstances is a frame header ever given to a
network layer.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
10
There is good reason why the network layer must never be given any part of
the frame header: to keep the network and data link protocols completely
separate. As long as the network layer knows nothing at all about the data
link protocol or the frame format, these things can be changed without
requiring changes to the network layer’s software. Providing an interface
between network layer and DLL greatly simplifies the software design
because communication protocols in different layers can evolve
independently.
More general solution is to have the receiver provide feedback to the sender.
After having passed a packet to its network layer, the receiver sends a little
frame back to the sender which gives the sender permission to transmit the
next frame. After having sent a frame, the sender is required by the protocol
to wait its time until the little (acknowledgment) arrives. Using feedback
from the receiver to let the sender know when it may send more data.
Protocols in which the sender sends one frame and then waits for
acknowledgment before proceeding are called stop-and-wait protocol.
a. Stop-and Wait Protocol
The main problem we have to deal with here is how to prevent the sender
from flooding the receiver with data faster than the receiver is able to
process them. If receiver requires a time Δt to execute from_physical_layer
plus to_network_layer, the sender must transmit at an average rate less than
one frame per time Δt. Moreover, if we assume that no automatic buffering
and queuing are done within the receiver’s hardware, the sender must never
transmit a new frames until the old one has been accepted.
Two sorts of errors could occur: First, the frame that arrives at the
destination could be damaged, the receiver detects this by using error
detection technique and discards the frame. To account this possibility, the
source station is equipped with a timer. After a frame is transmitted, the
source station waits for an acknowledgment. If no acknowledgment is
received by the time the timer expires, then the same frame is sent again. It
is noticeable that, this method requires that the transmitter maintain a copy
of a frame until an acknowledgment is received for the frame. The second
sort of error is a damaged acknowledgment. Consider the following
situation: Station A sends a frame. The frame is received correctly by station
B, which responds with an acknowledgment. The ACK is damaged in transit
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
11
and is not recognized by A, which will therefore time-out and resend the
same frame. This duplicate frame arrives and is accepted by B, which has
therefore accepted two copies of the frame as if they were separate. To avoid
this problem, frames are alternately labeled with 0 or 1, and positive ACKs
are of the form ACK0 and ACK1. In keeping with the sliding-window
convention, an ACK0 acknowledges receipt of a frame numbered 1 and
indicates that the receiver is ready for a frame numbered 0.
The simplest form of flow control, known as stop-and wait flow control,
works as follows. A source entity transmits a frame. After reception, the
destination entity indicates its willingness to accept another frame by
sending back an acknowledgment to the frame just received. The source
must wait until it receives the acknowledgment before sending the next
frame. The destination can thus stop the flow of data by simply withholding
acknowledgment. Protocols in which the sender sends one frame and then
waits for an acknowledgment before proceeding are called stop-and-wait.
Consequently, the communication channel between the two DLL needs to be
capable of bidirectional information transfer. However, this protocol
entails a strict alternation of flow: first the sender sends a frame, then the
receiver sends a frame (acknowledgment), then the sender sends another
frame, then the receiver sends another one, and so on. Half duplex physical
channel would suffice here.
The principal advantage of stop-and-wait ARQ is its simplicity. Its principal
disadvantage is that stop-and-wait is an inefficient mechanism. The slidingwindow flow control technique can be adapted to provide more efficient line
use, it is sometimes referred to as continuous ARQ.
This procedure works fine and, indeed, can hardly be improved upon when a
massage is sent in a few large frames. However, it is often the case that a
source will break up a large block of data into smaller blocks and transmit
the data in many frames. This is done for the following reasons:

The buffer size of the receiver may be limited.

The larger the transmission, the more likely that there will be an error,
necessitating retransmission of the entire frame. With smaller frames, error
are detected sooner, and a smaller amount of data needs to be retransmitted.

On a shared medium, such as a LAN, it is usually desirable not to
permit one station to occupy the medium for an extended period, as this
causes long delay at the other sending stations.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
12
With the use of multiple frames for a single massage, the stop-and-wait
procedure may be inadequate. The essence of the problem in that only one
frame at a time can be in transmits. In situation where the bit length of the
link is greater than the frame length, serious inefficiencies result: this
illustrated in Figure 3. The transmission time (the time it takes for a station
to transmit a frame) is normalized to one, and the propagation delay (the
time it takes for a bit to travel from sender to receiver) is inspected as the
variable α. In other words, when α is less than 1, the propagation time is less
than the transmission time. In this case, the frame is sufficiently long that the
first bits of the frame have arrived at the destination before the source has
completed the transmission of the frame. When α is greater than 1, the
propagation time is grater than transmission tome.
In this case, the sender completes transmission of the entire frame before the
leading bits of the frame arrive at the receiver. Put another way, longer
values of α are reliable with higher data rates and /or longer distances
between stations. Both parts of Figure 3 (a and b) consist of a sequence of
snapshots of the transmission process over time. In both cases, the first four
snapshots show the process of transmitting a frame containing data, and the
last the last snapshot shows the return of a small acknowledgment frame.
Not that for α>1, the line is always underutilized, and, even for α<1, the line
is inefficiently utilized. In essence, for very high data rates, or for very long
t0
T
R
t0
T
R
t0+1
T
R
t0+α
T
R
t0+α
T
R
t0+1
T
R
t0+1+α
T
R
t0+1+α
T
R
t0+1+2α
T
R
t0+1+2α
T
R
(a) α>1 (underutilized)
(b) α<1 (inefficiently utilized)
Figure 3. Stop-and-wait link utilization (transmission time=1; propagation
delay,
L
  ).
V
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
13
distances between sender and receiver, stop-and-wait flow control provides
inefficient line utilization. The sliding-window flow control technique can
be adapted to provide more efficient line use, in this context, it is sometimes
referred to as continuous automatic report request (ARQ).
b. A Simplex protocol for a Noisy Channel; Time-out
Now let us consider the normal situation of communication channel, where
data are transmitted in one direction only (simplex channel), that makes
error. Frames may be either damaged or lost completely. However, we
assume that if a frame is damaged in transmit, the receiver hardware will
detect this when it computes the checksum. If the frame is damaged in such
a way that the checksum is nevertheless correct, an unlikely occurrence this
protocol (and all other protocols) can fail (i.e., deliver an incorrect packet to
the network layer). At first glance it might seem that a variation of stop-andwait protocol would work: adding a timer. The sender could send a frame,
but the receiver would only send an acknowledgment frame if the data were
correctly received. If a damaged frame arrived at the receiver, it would be
discarded. After a while the sender would time out and sends the frame
again. This process would be repeated until the frame finally arrives intact.
The above scheme has a fatal flow in it. To see what might go wrong let us
consider that the DLL task is process to provide error-free, transparent
communication between network layer processes. The network layer on
machine A gives a series on packets to its DLL, which must ensure that an
identical series of packets are delivered to the network layer on machine B
by its DLL. In particular, the network layer on machine B has no way of
knowing that a packet has been lost or duplicated, so the DLL must
guarantee that no combination of transmission errors, however unlikely, can
cause a duplicate packet to be delivered to a network layer.
Consider the following protocol scenario:
1. The network layer on A gives packet 1 to its DLL. The packet is correctly
received at B and passed to the network layer on B. B sends an
acknowledgment frame back to A.
2. The acknowledgment frame gets lost completely. It just never arrives at
all.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
14
3. The DLL on A eventually times out. Not having received an
acknowledgment, it (incorrectly) assumes that its data frame was lost or
damaged and sends the frame containing packet 1 again.
4. The duplicate frame also arrives at the DLL on B perfectly and is
randomly passed to the network layer there. If A is sending a file to B, part
of the file will be duplicated (i.e., the copy of the file made by B will be
incorrect and the error will not have been detected). In other words, the
protocol will fail.
What is needed is some way for the receiver to be able to distinguish a frame
that it is seeing for the first time from a retransmission. The obvious way to
achieve this is to have the sender put a sequence number in the header of
each frame it sends. Then the receiver can check the sequence number of
each arriving frame to see if it is a new frame or a duplicate to be detected.
Since a small frame header is desirable, the question arises: What is the
minimum number of bits needed for the sequence number? If frame m is lost
or damaged, the receiver will not acknowledge it, so the sender will keep
trying to send it. Once it has been correctly received, the receiver will send
an acknowledgment to the sender. It is here that the potential trouble crops
up. Depending upon whether the acknowledgment frame gets back to the
sender correctly or not, the sender may try to send m or m+1.
The event that triggers the sender to start sending frame m+2 is the arrival of
acknowledgment for frame m+1. But this implies that m has been correctly
received and furthermore that acknowledgment has also been correctly
received by the sender (otherwise, the sender would not have begun with
m+1, let alone m+2). As a consequence, the only ambiguity is between a
frame and its immediate predecessor or successor, not between the
predecessor and successor themselves.
A 1-bit sequence number (0 or 1) is therefore sufficient. At each instant of
time, the receiver expects a particular sequence number next. Any arriving
frame containing the wrong sequence number is rejected as a duplicate.
When a frame containing the correct sequence number arrives, it is accepted
and passed to the network layer. Then the expected sequence number is
incremented modulo 2 (i.e., 0 becomes 1 and 1 becomes 0).
Protocol, in which the sender waits for a positive acknowledgment before
advancing to the next data item are often called PAR (Positive
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
15
Acknowledgment with Retransmission) or ARQ (Automatic Repeat
request).
The simplex protocol for noisy channel differs from its predecessors in that
both sender and receiver have a variable whose value is remembered while
the DLL is in the wait state. The sender remembers the sequence number of
the next frame to send. After transmitting a frame, the sender starts the time
running. If it was already running, it will be reset to allow another full timer
interval. The time interval should be chosen to allow enough time for the
frame to get to the receiver, for the receiver to process it in the worst case,
and for the acknowledgement frame to propagate back to the sender. Only
when that time interval has elapsed is it safe to assume that either the
transmitted frame or its acknowledgement has been lost, and to send a
duplicate. If the timeout interval is set too short, the sender will transmit
unnecessary frames.
After transmitting a frame and starting the timer, the sender waits for
something exciting to happen. Only three possibility exist: an
acknowledgment frame arrives undamaged, a damaged acknowledgment
frame staggers in, or the timer expires. If a valid acknowledgment comes in,
the sender fetches the next packet from its network layer and puts it in the
buffer, overwriting the previous packet. It also advances the sequence
number. If a damaged frame arrives or no frame at all arrives, neither the
buffer nor the sequence number is changed so that a duplicate can be sent.
When a valid frame arrives at the receiver, its sequence number is checked
to see if it is a duplicate. If not, it is accepted, passed to the network layer,
and an acknowledgment is generated. Duplicated and damaged frames are
not passed to the network layer.
c. Sliding-Window Protocols
In practical situation data transmission is duplex. One way of achieving fullduplex data transmission is to have two separate communicating channels
and use each one for simplex data traffic. If this is done, we have two
separate physical circuits, each with a “forward” channel (for data) and a
“reverse” channel (for acknowledgments). In both cases the bandwidth of
the reverse channel is almost entirely wasted. So, better idea is to use the
same circuit for data in both directions. In this model the data frame from A
to B are intermixed with the acknowledgment frames from B to A. By
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
16
looking at the kind field in the header of an incoming frame, the receiver can
tell whether the frame is data or acknowledgment.
In the essence of the problem described in stop-and wait protocol is that only
one frame at a time can be in transmit. In situation where the bit length of
the link is greater than the frame length (α>1), serious inefficiencies result.
Efficiency can be improved by allowing multiple frames to be in transmit at
the same time.
Let us examine how this might work for two stations. A and B, connected
via a full-duplex link. Station B allocates buffer space for n frames. Thus, B
can accept n frames, and A is allowed to send n frames without waiting for
any acknowledgments. To keep track of which frames have been
acknowledged, each is labeled with a sequence number. B acknowledges a
frame by sending an acknowledgment that includes the sequence number of
the next frame expected. This acknowledgment also completely announces
that B is prepared to receive the next n frames, beginning with the sequence
number specified. This scheme can also be used to acknowledge multiple
frames. For example, B could receive frames 2, 3, and 4, but withhold
acknowledgment until frame 4 has arrived: by then returning an
acknowledgment with sequence number 5, B acknowledges frames 2, 3, and
4 at one time. A maintains a list of sequence numbers that it is allowed to
send, and B maintains list of sequence numbers that is prepared to receive.
Each of these lists can be thought of as a window of frames. The operation
is referred to as sliding-window flow control.
Several additional comments needed to be made. Because the sequence
number to be used occupies a field in the frame, it is clearly bounded size.
For example, for a 3-bit field, the sequence number can range from 0 to 7.
Accordingly, frames are numbered modulo 8, that is, after sequence number
7, the next number is 0. In general, for a k-bit field the range of sequence
k
k
numbers is 0 through 2  1 , and frames are numbered modulo 2 ; with
this in mind, Figure 4 is a useful way of depicting the sliding-window
process. It assumes the use of 3-bit sequence number, so that frames are
numbered from 0 to 7, and then the same numbers are reused for subsequent
frames. The shaded rectangle indicates that the sender may transmit 7
frames, beginning with frame 6. Each time a frame is sent, the shaded
window shrinks; each time acknowledgment is received, the shaded window
grows.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
17
Window of frames that
Frames already received May be transmitted
0
1
2
3
4
5
6
7
0
1
2
3
4
Last frame Window shrinks
Frame
Sequence transmitted from trailing edge
as frames are sent
number
5
6
7
0
1
2
3
4
Window expands from
leading edge as received
acknowledgment
(a) Transmitter’s perspective
Frames already received
0
1
2
3
4
Last frame
acknowledged
5
Window of frames that
May be accepted
6
7
0
1
2
3
Window shrinks
from trailing edge
As frames are received
4
5
6
7
0
1
2
3
4
Window expands from
leading edge as sent
acknowledgment
(b) Receiver’s perspective
Figure 4. Sliding-window depiction
The actual window size need not be the maximum possible size for a given
sequence number. For example, using a 3-bit sequence number, a window
size of 4 should be configured for the stations using the sliding-window flow
control protocol.
d. Sliding-window flow control
Example of sliding-window flow control is shown in Figure 5. The example
assumes a 3-bit sequence number field and a maximum window size of
seven frames. Initially, A and B have windows including that A may
transmit seven frames, beginning with frame 0 (F0). After transmitting three
frames (F0, F1, F2) without acknowledgment, A has shrink its window to
four frames. The window indicates that A may transmit four frames,
beginning with frame number 3. B then transmits an RR3 (receive-ready
frame 3), which means: “I have received all frames up frame 2 and am ready
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
Source system A
Destination system B
0 1 2 3 4 5 6 7 0 1 2 3
F0
F1
F2
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
RR3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
18
F3
F4
F5
F6
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
RR7
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
Figure 5. Example of a sliding-window protocol
to receive frame number 3, in fact, I am prepared to receive seven frames,
beginning with frame number 3”. With this acknowledgment, A is back up
to permission to transmit seven frames, still beginning with frame 3. A
proceeds to transmit frames 3, 4, 5, and 6. B returns an RR7, which
acknowledges all of these frames and permit A to send 7 frames, beginning
with frame 7.
Most protocols also allow a ststion to completely cut off the flow frames
from the other side by sending a Recive_not-ready (RNR) massage, which
acknowledges former frames but forbids transfer of future frames. Thus,
RNR 5 means: “ I have received all frames up though number 4 but am
unable to accept any more.” At some subsequent point, the station must send
a normal acknowledgment to reopen the window.
We have discussed transmission in one direction only. If two stations
exchange, each needs to maintain two windows, one for transmit and one for
receive, and each side needs to send the data and acknowledgment to the
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
19
other. To provide efficient support for this requirement, a future known as
piggybacking, it is typically the technique of temporarily delaying outgoing
ACKs so that they can be hocked onto the next outgoing data frame. Each
data frame includes a field that holds the sequence number of that frame plus
a field that holds the sequence number used for acknowledgment. Thus, if a
station has data to send and an acknowledgment to send, it sends both
together in one frame, thereby saving communication capacity.
Of course, if a station has an acknowledgment but no data to send, it sends a
separate acknowledgment frame. If a station has data to send but no new
acknowledgment to send, it must repeat the last acknowledgment that it sent,
this is because the data frame includes a field for the acknowledgment
number, and some value must be put into the field. When a station receives a
duplicate acknowledgment, it simply ignores it.
Protocol with window size of 1 uses stop-and-wait since the sender transmits
a frame and waits for its acknowledgment before sending the next one.
Under normal circumstances, one of the two DLL goes first and transmits
the first frame. In other words, only one of the DLL programs should contain
the procedure calls outside the main loop. In the event that both DLL start
of simultaneously, unusual situation arises. The starting machine fetches the
first packet from its network layer, builds a frame from it, and sends it.
When this frame arrives, the receiving DLL checks to see if it is a duplicate,
just as in protocol 3 (see T.). If the frame is the one expected, it is passed, it
is passed to the network layer and the receiver’s window is slide up.
It should be clear from the discussion that sliding-window flow control is
potentially much more efficient than stop-and-wait flow control. The reason
is that, with sliding-window flow control, the transmission link is treated as
pipeline that may be filled with frames in transit. In contrast, with stop-andwait flow control, only one frame may be in the pipe at a time.
e. A One-Bit Sliding Window
Before talking the general case, let us first examine a sliding window
protocol with a maximum window size 1. Such a protocol uses stop-andwait since the sender transmits a frame and waits for its acknowledgment
before sending the next one.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
20
Like the others, it starts out by defining some variables. Next_frame_to_send
tells which frame the sender is trying to send. Similarly, frame_expected
tells which frame the receiver is expecting. In both cases, 0 and 1 are the
only possibilities.
The acknowledgment field contains the number of the last frame received
without error. If this number agrees with the sequence number of the frame
the sender is trying to send, the sender knows it is done with the frame
stored in buffer and can fetch the next packet from its network layer. If the
sequence number disagrees, it must continue trying to send the same frame.
Whenever a frame is received, a frame is also sent back.
Now let us examine protocol 4 (protocol numbering in the note and T. may
not matches to each other) to see how flexible it is to pathological scenarios.
Assume that computer A is trying to send its frame 0 to computer B and that
B is trying to send its frame 0 to A. Suppose that A sends a frame to B, but
A’s time-out interval is a little too short. Consequently, A may time out
repeatedly, sending a series of identical frames, all with seq=0 and ack=1.
When the first valid frame arrives at computer B, it will be accepted and
frame_accepted will be set to 1. All the subsequent frames will be rejected
because B is now expecting frames with sequence number 1, not 0.
Furthermore, since all the duplicates have ack=1 and B is still waiting for an
acknowledgment of 0, B will not fetch a new packet from its network layer.
After every rejected duplicate comes in, B sends A frame containing seq=0
and ack=0. Eventually, one of these arrives correctly at A, causing A to
begin sending the next packet. No combination of lost frames or followed
time-outs can cause the protocol to deliver duplicate packets to either
network layer, to skip a packet, or to deadlock.
However, a unusual situation arises if both sides simultaneously send an
initial packet. This synchronization difficulty is illustrated by Figure 6. In
part (a), the normal operation of the protocol is shown. In (b) the peculiarity
is illustrated. If B waits for A’s first frame before sending one of its own, the
sequence is as shown in (a), and every frame is accepted. However, if A and
B simultaneously initiate communication, their first frames cross, and the
DLLs then get into situation (b). In (a) each frame arrival brings a new
packet for the network layer, there are no duplicates. In (b) half of the
frames contain duplicates, even though there are no transmission errors.
Similar situation can occur as a result of followed time-outs, even when one
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
21
side clearly starts first. In fact, if multiple premature timeouts occur, frames
may be sent three or more times.
A sends (0,1,A0)
B gets (0,1,A0)*
B sends (0,0,B0)
A gets (0,0,B0)*
A sends (1,0,A1)
B gets (1,0,A1)*
B sends (1,1,B1)
A gets (1,1,B1)*
A sends (0,1,A2)
B gets (0,1,A2)*
B sends (0,0,B2)
A gets (0,0,B2)*
A sends (1,0,A3)
B gets (1,0,A3)*
B sends (1,1,B3)
a
A sends (0,1,A0)
B sends (0,1,B0)
B gets (0,1,A0)*
B sends (0,0,B0)
A gets (0,1,B0)*
A sends (0,0,A0)
B gets (0,0,A0)
B sends (1,0,B1)
A gets (0,0,B0)
A sends (1,0,A1)
B gets (1,0,A1)*
B sends (1,1,B1)
A gets (1,0,B1)*
A sends (1,1,A1)
b
B gets (1,1,A1)
B sends (0,1,B2)
Figure 6. Two scenario for protocol 4. (a) Normal case. (b) Abnormal case.
The notation is (seq, ack, packet number). An asterisk indicates where a
network layer accepts a packet.
f. A Protocol Using Go Back N
For frame transmitting and receiving of an acknowledgment the long roundtrip time can play important role for the efficiency of the bandwidth
utilization. As an example, consider a 59-kbps satellite channel with a 500msec round-trip propagation delay. Let us imagine trying to use protocol 4
to send 1000-bit frames via the satellite. At t=0 the sender starts sending the
first frame. At t=20 msec the frame has been completely sent. Not until
t=270 msec has the frame fully arrived at the receiver. And not until t=520
msec has the acknowledgment arrived back at the sender, under the best of
circumstances (no waiting in the receiver and a short acknowledgment
frame). This means that the sender was blocked during 500/520 or 96% of
the time. In other words, only 4 % of the available bandwidth was used.
Clearly, the combinations of a long transmit time, high bandwidth, and short
frame length is disastrous in terms of efficiency.
The problem described above can be viewed as a consequence of the rule
requiring a sender to wait for acknowledgment before sending another
frame. If we relax those restrictions, much better efficiency can be achieved.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
22
Basically, the solution lies in allowing the sender to transmit up to w frames
before blocking, instead of just 1. With an appropriate choice of w the sender
will be able to continuously transmit frames for a time equal to the roundtrip transmit time without filling up the window. In the example above, w
should be at least 26. The sender begins sending frame 0 as before. By the
time it has finished sending 26 frames, at t=520, the acknowledgment for
frame 0 will have just arrived. Thereafter, acknowledgments arrive every 20
msec, so the sender always gets permission to continue just when it needs it.
At all times, 25 or 26 unacknowledged frames are exceptional. Put in other
terms, the sender’s maximum window size is 26.
The need for a large window on the sending side occurs whenever the
product of bandwidth x round-trip-delay is large. If the bandwidth is high,
even for a moderate delay, the sender will exhaust its window quickly unless
it has a large window. The product of these two factors basically tells what
the capacity of the pipe is, and the sender needs the ability to fill it without
stopping in order to operate at peak efficiency.
This technique is known as pipelining. If the channel capacity is b bits/sec,
the frame size l bits, and the round-trip propagation time R sec, the time
required to transmit a single frame is l/b sec. After the last bit of data frame
has been sent, there is a delay of R/2 before that bit arrives at the receiver
and another delay of at least R/2 for acknowledgment to come back, for a
total delay of R.
In stop-and-wait the line is busy for l/b and idle for R, giving
Line utilization = l / (l+bR)
If l<bR, the efficiency will be less than 50%. Since there is always a nonzero
delay for the acknowledgment to propagate back, pipelining can be used to
keep the line busy during this interval, but if the interval is small, the
additional complexity is not worth the trouble.
Pipelining frames over an unreliable communication channel raises some
serious issues; what happens if a frame in the middle of long streams is
damaged or lost? - Large number of subsequent frames will arrive at the
receiver before the sender even finds out that anything is wrong. When a
damaged frame arrives at the receiver, it obviously should be discarded, but
what should the receiver do with all the correct frames following it?
(Remember that the receiving DLL is obligated to hand packets to the
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
23
network layer in sequence). In Figure 7 we see the effect of pipelining on
error recovery. We will now examine it in some detail.
Time interval
0
1
2
3
0
0
a
4
5
1
2
0
0
b
3
Error
E
8
2
3
4
5
4
E
D
D D
D
D
D
2
5
4
2
1
5
6
1
2
7
8
5
6
6
7
9
7
8
3
3
7
4
4
5
5
Time
Frames discarded by DLL
N2
3
6
2
1
1
1
7
1
Error
0
6
10
11
12
13
0
8
9
9
10
10
11
11
12
13
0
Frames buffered by DLL
Data flow
Ack flow
Figure 7. Pipelining and error recovery. Effect of an error when:
(a) receiver’s window size is 1 and (b) receiver’s window size is large.
Two basic approaches are available for dealing with errors in the presence of
pipelining. One way, called go back N, is for the receiver simply to throw
away all subsequent frames, sending no ACKs for the discarded frames. This
strategy corresponds to a receive window of size 1. In other words, the DLL
refuses to accept any frame except the next one it must give to the network
layer. If the sender’s window fills up before the timer runs out, the pipeline
will begin to empty. Eventually, the sender will time out and retransmit all
unacknowledged frames in order, starting with the damaged or lost one. This
approach can waste a lot of bandwidth if the error rate is high.
In Figure 7 a. we see go back N for the case in which the receiver’s window
is large. Frames 0 and 1 are correctly received and acknowledged. Frame 2,
however, is damaged or lost. The sender, unaware of this problem, continues
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
24
to send frames until the timer for frame 2 expires. Then it backs up to frame
2 and starts all over with it sending 2,3,4, etc. all over again.
The other general strategy for handling errors when frames are pipelined is
called selective repeat. When it is used, a bad frame that is received is
discarded, but good frames received after they are buffered. When the sender
times out, only the oldest unacknowledged frame is retransmitted. If that
frame arrives correctly, the receiver can deliver to the network layer, in
sequence, all the frames it has buffered. Selective repeat is often combined
with having the receiver send a negative acknowledgment (NAK) when
it detects an error, for example, when it receives a checksum error or a frame
out of sequence. NAK stimulate retransmission before the corresponding
timer expires and thus improve performance.
In Figure 7 b. frames 0 and 1 are again correctly received and acknowledged
and frame 2 is lost. When frame 3 arrives at the receiver, the DLL there
notices that is has missed a frame, so it sends back a NAK for 2 but buffers
3. When frames 4 and 5 arrive, they, too, are buffered by the DLL instead of
being passed to the network layer. Eventually, the NAK gets back to the
sender, which immediately resends frame 2. When that arrives, the DLL
now has 2,3,4, and 5 and can pass all of them to the network layer in the
correct order. It can also acknowledge all frames up to and including 5, as
shown in the Figure. If the NAK should get lost, eventually the sender will
time out for frame 2 and send it (and only it) of its own accord, but that may
be quite a while later. In effect, the NAK speeds up the retransmission of
one specific frame.
Selective repeat corresponds to a receiver window larger than 1. Any frame
within the window may be accepted and buffered until all the previous ones
have been passed to the network layer. This approach can require large
amount of DLL memory if the window is large.
These two alternative approaches are trade-offs between bandwidth and
DLL buffer space. Depending on which resource is scarcer, one or the other
can be used.
How timers are implemented is illustrated in Figure 8. Assume that the clock
ticks once every 100 msec. Initially, the real time is 10:00:00.0; three
timeouts are pending, at 10:00:00.5, 10:00:01.3, and 10:00:01.9. Every time
the hardware clock ticks, the real time is updated and the tick counter at the
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
25
head of the list is decremented. When the tick counter becomes zero, a
timeout is caused and the node is removed from the list, se Figure 8 b.
Although this organization requires the list to be scanned when start_timer
or stop_timer is called, it does not require much work per tick.
10:00:00.0
Real
time
5
8
1
10:00:00.5
2
6
3
8
2
6
3
Pointer to next timeout
Frame being timed
Ticks to go
(a)
(b)
Figure 8 simulation of multiple timers in software
g. Negative ACK - Selective Reject
With selective reject ARQ, the only frames retransmitted are those that
receive a negative ACK, in this case called SREJ, or that time-out. This
would appear to be more efficient than go-back-N, because it minimizes the
amount of retransmission. On the other hand, the receiver must maintain a
buffer large enough to save post-SREJ frame in error is retransmitted, and it
must contain logic for reinserting that frame in the proper sequence. The
transmitter, too, requires more complex logic to be able to send a frame out
of sequence. Because of such complications, selective-reject ARQ is much
less used than go-back-N ARQ.
The window size limitation is more restrictive for selective-reject than for
go-back-N. Consider the case of a 3-bit sequence number size for selectivereject. Allow a window size of seven, and consider the following scenario:
 1. Station A sends frames 0 through 6 to station B.
 2. Station B receives all seven frames and cumulatively acknowledges
with RR7.
 3. Because of a noise, the RR7 is lost.
 4. A times-out and retransmits frame 0.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
26
 5. B has already advanced its receive window to accept frames 7, 0, 1,
2, 3, 4, and 5. Thus, it assumes that frame 7 has been lost and that this
is a new frame 0, which it accepts.
The problem with the foregoing scenario is that there is an overlap between
the sending and receiving window. To overcome the problem, the maximum
window size should be no more than half the range of of sequence numbers.
In the scenario above, if only four unacknowledged frames may be
outstanding, no confusion can result. In general, for a k-bit sequence number
field, with provides a sequence number range of 2 k , the maximum window
size is limited to 2 k 1 .
8. High-Level Data Link Control
a. HDLC Operation
High-Level Data Link Control (HDLC) is one of the most common Data
Link Layer protocols used in wide-area networking. HDLC and its subsets
(Synchronous Data Link Control (SDLC) and Link Access Procedure
for D Channel (LAPD) provide the mechanism for moving information
across a physical link. Different modifications of these protocols made by
ANSI and CCITT were called Advanced Data Communication Control
Procedure (ADCCP) and LAP (Link Access Procedure). These protocols
are based on the same principles and all are bit oriented, and all use bit
stuffing for data transparency. All bit-oriented protocols use frame structure
shown in Figure 9.
Primary station--Sends commands and accepts responses (referred to as the
"master" node). This configuration is often seen in IBM hosts. A primary
station is further described as a polling environment.
Secondary station--Accepts commands and sends responses (referred to as
the "slave" node). This configuration appears in secondary stations
communicating over remote lines to an IBM mainframe primary station.
Combined station--Sends or accepts commands and responses. This type of
link station is found in balanced configurations where communication is on a
peer-to-peer basis.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
27
b. HDLC Data Link Protocol
The HDLC Frame Format Diagram shows the fields in an HDLC frame.
These frames are used to communicate across a given physical link between
two communicating devices, similar to an Ethernet frame over a 10BaseT
segment.
Flag
Address
8 Bits
8/16 Bits 8/16 Bits
01111110
Control
Data
Variable Length
256 or 512 bytes
CRC
Flag
8/16 Bits 8 Bits
01111110
Figure 9. HDLC Frame Format
The fields in an HDLC frame include:
Flag (1 byte [octet])--The Flag field is used for synchronization of the bit
stream. Each frame starts off with this flag, which is a hexadecimal 7E. Only
the flag byte will have 6 bits set in a row. If a character that has 6 or more
consecutive bits needs to be transmitted, a technique called "zero bit
insertion," or "bit stuffing," is used to ensure the data character is not
mistaken for a flag character. This 0 bit is stripped off at the receiver before
forwarding the frame to the higher layers. The protocol replaces the fifth
consecutive 1 with a 0, changing the character's form.
Address (1 or 2 bytes)--The Address field contains the address of the
secondary station and is primarily important for lines with multiple
terminals. For point-to-point lines, it is sometimes used to distinguish
commands from responses.
Control (1 or 2 bytes)--The Control field denotes the type of frame
(supervisory or information), and contains counters to keep track of
transmitted and received frames for acknowledgment and flow control. The
Control field format is as follows:




Frame ID (1 or 2 bits).
0--Information transfer (I) frame (data transfer between stations).
10--Supervisory (S) frame (polling, data ACK, and control).
11--Unnumbered (U) frame (polling, testing, station initialization, and
control).
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a



28
Supervisory, unnumbered, or send sequence number (NS) (2 or 3
bits)--Varies by the frame type in length and purpose.
Poll/final (P/F) (1 bit)--Indicates poll from primary station or final
frame from secondary.
Receive sequence number (NR) (3 bits)--Used by information and
supervisory frames to acknowledge the number of successfully
received frames. For unnumbered frames, this is a portion of the
Unnumbered Modifier Function that determines the unnumbered
frame's purpose.
Information ("I" field) (variable)--The Information field contains the data,
if any. For most HDLC stations, this field is usually no larger than 256 or
512 bytes, although there are some implementations that transmit larger
frames. The HDLC trailer includes:
Cycling Redundancy Check (CRC) (2 bytes)--The CRC field contains a
checksum to ensure data integrity.
Flag (1 byte)--The Flag field is used to signal the end of a frame, and
possibly the start of the next frame. This character takes the form of
hexadecimal 7E, similar to the flag byte. On idle point-to-point, lines, flag
sequences are transmitted continuously. The minimum frame contains three
fields and totals 32 bits, excluding the flags on either end.
There are three kinds of frames: Information, Supervisory, and
Unnumbered. These frames have different control field, see Figure 10.
Bits
1
3
1
3
(a)
0
Seq
P/F
Next
(b)
1
0
Type
P/F
Next
(c)
1
1
Type
P/F
Modifier
Figure 10. Control field of (a) an Information frame, (b) a Supervisory
frame, (c) an unnumbered frame.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
29
The protocol uses a sliding window, with 3-bit sequence number. Up to
seven unacknowledged frames may be outstanding at any instant. The Seq.
field in Figure 10 is the frame sequence number. The next field is a
piggybacked ACK. For ACK is used the number of the first frame not yet
received (i,e., the next frame expected). The choice of using the last frame
received or the next frame expected is arbitrary;
The P/F bit stands for Poll/Final. It is used when a computer is polling a
group of terminals. When used as P, the computer is inviting the terminal to
send data. All the frames sent by the terminal, except the final one, have the
P/F bit set to P. The final one is set to F.
In some of the protocols. The P/F bit is used to force the other machine to
send a Supervisory frame immediately rather than waiting for reverse traffic
onto which to piggyback the window information, The bit also has some
minor uses in connection with the Unnumbered frame.
The various kinds of Supervisory frames by the Type field. Type 0 is an
ACK frame (RECEIVE READY) used to indicate the next frame expected.
This frame is used when there is no reverse traffic to use for piggybacking.
Different types of frames use different ACKs:
Type 1 is negative ACK frame (called REJECT). It is used to indicate that a
transmission error has been detected;
Type 2 is RECEIVE NOT READY. It acknowledges all frames up to but
not including next, just as RECEIVE READY does, but it tells the sender to
stop sending. REVEIVE NOT READY is intended to signal certain
temporary problems with the receiver, such as a shortage of buffers, and not
as an alternative of the sliding window control. When the condition has been
repaired, the receiver sends a RECEIVE READY, REJECT, or certain
control frames.
Type 3 is the SELECTIVE REJECT. It calls for retransmission of only the
frame specified. In this sense it is most useful when the sender’s window
size is half the sequence space size, or less.
The third class of frame is the unnumbered frame. It is sometimes used for
control purposes but can also carry data when unreliable connectionless
service is called for. The various bit-oriented protocols differ considerably
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
30
here, in contrast with the other two kinds, where they are nearly identical.
Five bits are available to indicate the frame type, but not all 32 possibilities
are used.
All the protocols provide a command, DISConnect, that allows a machine to
announce that it is going down. They also have a command that allows a
machine that has just come back on-line to announce its presence and force
all the sequence number back to zero. This command is called SNRM (Set
Normal Response Mode). It is an unbalanced (i.e., asymmetric) mode in
which one end of the line is the master and the another the slave. To make
the protocol more suitable when the two partners are equals, HDLC and
LAPB have an additional command, SABM (Set Asynchronous Balanced
Mode), which resets the line and declares both parties to be equals.
A third command provided by all the protocols is FRMR (FRaMe Reject),
used to indicate that a frame with a correct checksum but impossible
semantics arrived. Example of impossible semantics are a type 3
Supervisory frame in LAPB, a frame shorter than 32 bits, an illegal control
frame, and ACK of a frame that was outside the window, etc. FRMR frames
contain a 24-bit data field telling what was wrong with the frame. The data
include the control field of the bad frame, the window parameters, and a
collection of bits used to signal specific errors.
Control frames can be lost or damaged, just like data frames, so they must be
acknowledged too. A special control frame, called UA (Unnumbered ACK),
is provided for this purpose. Since only one control frame may be
outstanding, there is never any ambiguity about which control frame is being
acknowledged.
The remaining control frames deal with initialization, polling, and status
reporting. There is also a control frame that may contain arbitrary
information, UI (Unnumbered Information). These data are not passed to the
network layer, but are for receiving DLL itself.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
31
5. Data Link Layer in the Internet
The Internet consists of individual machines (hosts and routers) and the
communication infrastructure that connects them. Within a single building,
LANs are widely used for interconnection, but most of the wide area
infrastructure is built up from point-to-point leased lines. Here we will
examine the data link protocols used on point-to-point lines in the Internet.
In practice, point-to-point communication is primarily used in two situations.
First, thousands of organizations have one or more LANs, each with some
number of hosts (personal computers, user workstations, servers, and so on)
along with a router (or a bridge, which is functionally similar). Often, the
routers are interconnected by a backbone LAN. Typically, all connections to
the outside world go through one or two routers that have point-to-point
leased lines to distant routers. It is these routers and their leased lines that
make up the communication subnets on which the Internet is built.
The second situation in which point-to-point lines play a major role in the
Internet is the millions of individuals who have home connections to the
Internet, using modems and dial-up telephone lines. Usually, what happens
is that the user’s home PC calls up an Internet server’s router and then acts
like a full blown Internet hosts. This method of operation is no different
from having a leased line between the PC and router, except that the
connection is terminated when the user ends the session. A home PC calling
an Internet service provider is illustrated in Figure 11. The modem is shown
external to the computer to emphasize its role, but modern computers have
internal modems.
For both the router-router leased line connection and the dial-up host-router
connection, some point-to-point data line control is required on the line for
framing, error control, and the other data link layer functions. The one used
in the Internet is called PPP.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
Internet provider’s office
User’s home
Dial-up
Telephone
line
PC
Client process
Using TCP/IP
32
modem
TCP/IP
Connection
Using PPP
modems
Router
Routing
process
Figure 11. A home personal computer acting as an Internet host
a. PPP-The Point-to-point Protocol
The Internet needs a point-to-point protocol for a variety of purposes,
including router-to-router traffic and home user-to-ISP traffic. PPP handles:
1.error detection,
2. supports multiple protocols,
3. allows IP addresses to be negotiated at connection time,
4. permits authentication, and has many other features.
PPP provides three features:
1. A framing method that clearly delineates the end of one frame and the
start of the next one. The frame format also handles error detection
2. A link control protocol for bringing lines up, testing them, negotiating
options, and bringing them down again gracefully when they are no
longer needed, This protocol is called LCP (Link Control Protocol).
It supports synchronous and asynchronous circuits and byte-oriented
and bit-oriented encodings.
3. A way to negotiate network-layer options in a way that is independent
of the network layer protocol to be used. The method chosen is to
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
33
have a different NCP (Network Control Protocol) for each network
layer supported.
To see how these pieces fit together, let us consider the typical scenario of a
home user calling up an Internet service provider to make a home PC a
temporary Internet host. The PC first calls the provider’s router via a
modem. After the router’s modem has answered the phone and established a
physical connection, the PC sends the router a series of LCP packets in the
payload field of one or more PPP frames. These packets and their responses
select the PPP parameters to be used.
Once the parameters have been agreed upon, a series of NCP packets are
sent to configure the network layer. Typically, the PC wants to run a TCP/IP
protocol stack, so it needs an IP address. There are not enough IP addresses
to go around, so normally each Internet provider gets a block of them and
then dynamically assigns one to each newly attached PC for the duration of
its login session. If a provider owns n IP addresses, it can have up to n
machines logged in simultaneously, but its total costumer base may be many
times that. The NCP for IP assigns the IP address.
At this point is new an Internet host and can send and receive IP packets,
just as hardwired host can. When the user is finished, NCP tears down the
network layer connection and frees up the IP address. Then LCP shuts down
the DLL connection. Finally, the computer tells the modem to hang up the
phone, releasing the physical layer connection.
The PPP frame format was chosen to closely reassemble the HDLC frame
format, since there was no reason to reinvent the wheel. The major
difference between PPP and HDLC is that PPP is byte oriented rather than
bit oriented. In particular, PPP uses byte stuffing on dial-up modem lines,
so all frames are an integral number of bytes. It is not possible to send a
frame consisting of 30.25 bytes, as it is with HDLC. Not only can PPP
frames be sent over dial-up telephone lines, but they can also be sent over
SONET or true bit-oriented HDLC lines (e.g., router-router connections)
The PPP frame format is shown in Figure 12.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
34
Bytes
1
Flag
01111110
1
1
1 or 2
variable
Address
Control Protocol Payload
11111111 00000011
2 or 4
Checksum
1
Flag
01111110
Figure 12. The PPP full frame format for unnumbered mode operation
All PPP frames begin with the standard HDLC flag byte, which is byte
stuffed if it occurs within the payload field. Address field is always set to the
binary value 11111111 to indicate that all stations are to accept the frame.
Using this value avoids the issue of having to assign data link addresses.
In the Control field, the default value of which is 00000011. This indicates
an unnumbered frame. In other words, PPP does not provide reliable
transmission using sequence numbers ACKs as the default. In noisy
environments, such as wireless networks, reliable transmission using
numbered mode can be used.
Since the Address and Control fields are always constant in the default
configuration, LCP provides the necessary mechanism for the two parties to
negotiate an option to just omit them altogether and save 2 bytes per frame.
The fourth PPP field is the Protocol field. Its job is to tell what kind of
packet is in the Payload field. Codes are defined for LCP, NCP, IP, IPX,
AppleTalk, and other protocols. Protocols starting with a 0 bit are network
layer protocols such as IP, IPX, OSI CLANP, XNS. Those starting with a 1
bit are used to negotiate other protocols. These include LCP and a different
NCP for each network layer protocol supported. The default size of the
protocol field is 2 bytes, but it can be negotiated down to 1 byte using LCP.
The Payload field is variable length, up to some negotiated maximum. If the
length is not negotiated using LCP during line setup, a default length of
1500 bytes is used. Padding may follow the payload if needed be.
Prof. M. Gerla & R. Dzhanidze. Class 117. Chapter 3a
35
In summary, PPP is a multiprotocol framing mechanism suitable for use
over modems, HDLC bit-serial lines, SONET, and other physical layers. It
supports error detection, option negotiating, header compression, and,
optionally, reliable transmission using an HDLC-type frame format.
The task of the DLL is to convert the raw bit stream offered by the physical
layer into a stream of frames for use by the network layer. Various framing
methods are used, including character count, byte stuffing, and bit stuffing.
Data link protocols can provide error control to retransmit damaged or lost
frames. To prevent a fast sender from overrunning a slow receiver, the data
link protocol also provide flow control. The sliding window mechanism is
widely used to integrate error control and flow control in a convenient way.
Sliding window protocols can be categorized by the size of the sender’s
window and the size of the receiver’s window. When both are equal to 1, the
protocol is stop-and-wait. When the sender’s window is greater than 1, for
example, to prevent the sender from blocking on a circuit with a long
propagation delay, the receiver can be programmed either to discard all
frames other than the next one in sequence or to buffer out-of-order frames
until they are needed.
We examined a series of protocols. Protocol l is designed for an error-free
environment in which the receiver can handle any flow sent to it. Protocol 2
still assumes an error-free environment but introduces flow control.
Protocol 3 handles error by introducing sequence numbers and using the
stop-and-wait algorithm. Protocol 4 allows bidirectional communication and
introduces the concept of piggybacking. Protocol 5 uses a sliding window
protocol with go-back-N. Finally, protocol 6 uses selective repeat and
negative ACK.
Many networks use one of the bit-oriented protocols-SDLC, HDLC,
ADCCP or LAPB-at the DLL. All of these protocols use flag bytes to
delimit frames, and bit stuffing to prevent flag bytes from occurring in the
data. All of them also use a sliding window for flow control. The Internet
uses PPP as the primary data link protocol over point-to-point lines.
Download