HDLC Protocols
HDLC Protocols
HDLC Protocols
3 PROTOCOLS
Now let us see how the data link layer can combine framing, flow control, and error control
to achieve the delivery of data from one node to another.
Analysis
Here two events can occur:
a request from the network layer or
an arrival notification from the physical layer.
The responses to these events must alternate. In other words, after a frame is sent, the algorithm must
ignore another network layer request until that frame is acknowledged.
Efficiency
The Stop-and-Wait ARQ discussed in the previous section is very inefficient if our channel
is thick and long. By thick, we mean that our channel has a large bandwidth; by long,
we mean the round-trip delay is long. The product of these two is called the
bandwidthdelay product
In other words, we need to let more than one frame be outstanding to keep the channel busy
while the sender is waiting for acknowledgment. In this section, we discuss one protocol that
can achieve this goal; in the next section, we discuss a second.
In this protocol we can send several frames before receiving acknowledgments.
we keep a copy of these frames until the acknowledgments arrive.
Sequence Numbers
Frames from a sending station are numbered sequentially.
we need to set a limit. If the header of the frame allows m bits for the sequence number, the
sequence numbers range from 0 to 2m 1. For example, if m is 4, the only sequence
numbers are 0 through 15 inclusive. However, we can repeat the sequence.
So the sequence numbers are
Sliding Window
In this protocol (and the next), the sliding window is an abstract concept that defines the
range of sequence numbers that is the concern of the sender and receiver. In other words,
the sender and receiver need to deal with only part of the possible sequence numbers. The
range which is the concern of the sender is called the send sliding window; the range that
is the concern of the receiver is called the receive sliding window.
The send window is an imaginary box covering the sequence numbers of the data
frames which can be in transit.
Acknowledgment
The receiver sends a positive acknowledgment if a frame has arrived safe and sound
and in order. If a frame is damaged or is received out of order, the receiver is silent (send
any frame).
This, in turn, causes the sender to go back and resend all frames, beginning with the one
with the expired timer.
HDLC
High-level Data Link Control (HDLC) is a bit-oriented protocol for communication
over point-to-point and multipoint links. It implements the ARQ mechanisms we discussed
in this chapter.
Frames
HDLC defines three types of frames:
1. information frames (I-frames),
2. supervisory frames (S-frames), and
3. unnumbered frames (U-frames).
Each type of frame serves as an envelope for the transmission of a different type of
message.
I-frames are used to transport user data and control information relating to user data
(piggybacking).
S-frames are used only to transport control information.
U-frames are reserved for system management. Information carried by U-frames is intended
for managing the link itself.
Frame Format
Each frame in HDLC may contain up to six fields, as shown in Figure 11.27: a beginning
flag field, an address field, a control field, an information field, a frame check
sequence (FCS) field, and an ending flag field.
In multiple-frame transmissions, the ending flag of one frame can serve as the beginning flag
of the next frame.
Fields
Let us now discuss the fields and their use in different frame types.
Flag field. Is an 8-bit sequence that identifies both the beginning and the end of a
frame and serves as a synchronization pattern for the receiver.
Address field. The second field of an HDLC frame contains the address of the
secondary station. If a primary station created the frame, it contains a to address. If
a secondary creates the frame, it contains a from address.
Control field. The control field is a 1- or 2-byte segment of the frame used for
flow and error control.
Information field. users data from the network layer or management information. Its
length can vary from one network to another.
FCS field. The frame check sequence (FCS) is the HDLC error detection field. It
can contain either a 2- or 4-byte ITU-T CRC.
Control Field
The control field determines the
1. type of frame and
2. defines its functionality.
Usage
I frame
1) To carry user data
from the network layer.
2) They can include
flow and error control
information
(piggybacking).
S Frame
Supervisory frames are
used for flow and error
control whenever
piggybacking is either
impossible or
inappropriate.
S-frames do not
have information fields.
Bit
Description:
1st Bit
Type: specifies control
frame
Bit
Description:
Next 3 Bits
N(S),
define the sequence
number of the frame.
Bit
Description:
Last 3 Bits
N(R), correspond to the
acknowledgment
number when
piggybacking is used
U Frame
Unnumbered frames
are used to exchange
session management
and control
information
between connected
devices
U-frames contain an
information field,
but one used for system
management
information, not user
data
Poll or final
On the other hand, to keep PPP simple, several services are missing:
1. PPP does not provide flow control. A sender can send several frames one after
another with no concern about overwhelming the receiver.
2. PPP has a very simple mechanism for error control. A CRC field is used to detect
errors. If the frame is corrupted, it is silently discarded; the upper-layer protocol
needs to take care of the problem. Lack of error control and sequence numbering
may cause a packet to be received out of order.
3. PPP does not provide a sophisticated addressing mechanism to handle frames in a
multipoint configuration.
Framing
PPP is a byte-oriented protocol. Framing is done according to the discussion of byteoriented
protocols at the beginning of this chapter.
Protocol. The protocol field defines what is being carried in the data field: either
user data or other information. We discuss this field in detail shortly. This field is
by default 2 bytes long, but the two parties can agree to use only 1 byte.
Transition Phases
A PPP connection goes through phases which can be shown in a transition phase
diagram (see Figure 11.33).
Dead. In the dead phase the link is not being used. There is no active carrier (at
the physical layer) and the line is quiet.
Establish. When one of the nodes starts the communication, the connection goes
into this phase. In this phase, options are negotiated between the two parties. If the
negotiation is successful, the system goes to the authentication phase (if authentication is
required) or directly to the networking phase.
Authenticate. The authentication phase is optional; the two nodes may decide,
during the establishment phase, not to skip this phase. However, if they decide to
proceed with authentication, they send several authentication packets, discussed
later. If the result is successful, the connection goes to the networking phase; otherwise,
it goes to the termination phase.
Network. In the network phase, negotiation for the network layer protocols takes
place. PPP specifies that two nodes establish a network layer agreement before data at
the network layer can be exchanged. The reason is that PPP supports multiple protocols
at the network layer. If a node is running multiple protocols simultaneously at the
network layer, the receiving node needs to know which protocol will receive the data.
Open. In the open phase, data transfer takes place. When a connection reaches
this phase, the exchange of data packets can be started. The connection remains in
this phase until one of the endpoints wants to terminate the connection.
Multiplexing
Although PPP is a data link layer protocol, PPP uses another set of other protocols to
1. establish the link, (LCP)
2. authenticate the parties involved (AP), and
3. carry the network layer data. (NCP)
Three sets of protocols are defined to make PPP powerful:
Multilink PPP
PPP was originally designed for a single-channel point-to-point physical link. The availability
of multiple channels in a single point-to-point link motivated the development of
Multilink PPP.
In this case, a logical PPP frame is divided into several actual PPP frames.
A segment of the logical frame is carried in the payload of an actual PPP frame,
as shown in Figure 11.40. To show that the actual PPP frame is carrying a fragment of a
logical PPP frame, the protocol field is set to 0x003d. This new development adds
complexity.
For example, a sequence number needs to be added to the actual PPP frame to
show a fragments position in the logical frame.