Sei sulla pagina 1di 20

Types of HDLC Frame

I – Frame ( Information Frame )


S – Frame ( Supervisory Frame )
U – Frame ( Unnumbered Frame)
I-frame

I – Frames are used to carry user data & Control


information relating to user data (piggybacking).
The bits of the control unit are used as follows:
The first bit of the control field is 0, means an I-frame.
 Next 3-bits , called N(S) bits, defines the Sequence
Number of the frame (0 – 7).
 Next bit is P/F bit. It is a single bit. It is called Pool
or Final.
Pool means the frame is sent from primary station to
secondary( has receiver address ).
Final means the frame is sent from secondary station
to primary ( has sender address).
 Next 3 – bits, called N(R) –bits defines the value of
the Acknowledgement when piggybacking is used.
S-frame control field in HDLC ( Supervisory frame )

S – Frames are used to transport Control information of frames.


The bits of the control unit are used as follows:
 If first 2-bits are 10, means the frame is an S-frame.
 Next 2-bits is a code that defines 4 types of S-frames.
i) Code bits are 00: RR – Receiver Ready , it is RR S-frame.
ii) Code bits are 10: RNR – Receive Not Ready, RNR S- frame.
iii) Code bits are 01: REJ – Reject, REJ S-frame.
iV) Code bits are 11: SREJ – Selective Reject , SREJ S-frame.
The next bit in the control field is P/F. It is a single bit. It is
called Pool or Final. Pool means the frame is sent from primary
station to secondary ( has receiver address ).
Final means the frame is sent from secondary station to primary
(has sender address).
 Next 3-bits are N (R) –bits corresponds to ACK or NAK.
U-frame - control field in HDLC

U – Frames are used for session management and transfer control


information between the connected devices. It has an extra field
called management information field.
The bits of the control unit are used as follows:
• If first 2-bits are 11, means the frame is a U-frame.
• Next 5-bits are code bits separated by P/F. It generate 32 different
types of commands. First 2-bits are prefix & last 3-bits are suffix.

Some of the combinations are,


U-frame control command and response
Command/response Meaning
SNRM Set normal response mode
SNRME Set normal response mode (extended)
SABM Set asynchronous balanced mode
SABME Set asynchronous balanced mode (extended)
UP Unnumbered poll
UI Unnumbered information
UA Unnumbered acknowledgment
RD Request disconnect
DISC Disconnect
DM Disconnect mode
RIM Request information mode
SIM Set initialization mode
RSET Reset
XID Exchange ID
FRMR Frame reject
Piggybacking without Error

Figure shows an exchange using piggybacking where is no error. Station A transmit


an I-frame numbered 0 followed by another I-frame numbered 1. Station B
piggybacks its acknowledgment of both frames onto an I-frame of its own. Station
B’s first I-frame is also numbered 0 [N(S) field] and contains a 2 in its N(R) field,
acknowledging the receipt of A’s frames 1 and 0 and indicating that it expects frame
2 to arrive next. Station B transmits its second and third I-frames (numbered 1 and
2) before accepting further frames from station A. Its N(R) information, therefore,
has not changed: B frames 1 and 2 indicate that station B is still expecting A frame 2
to arrive next.
Piggybacking with Error

Suppose, frame 1 sent from station B to station A has an error.


Station A informs station B to resend frames 1 and 2 (the system is
using the Go-Back-N mechanism). Station A sends a reject
supervisory frame to announce the error in frame 1.
Data Transparency
The data bit pattern that can create problem during transmission is
called lack of data transparency.

The data field of the HDLC frame can carry text as well as
contextual information such as graphics, audio, video.

Some message types can create problems during transmission. If


the data field pattern matches with the bit sequence which is
reserved for flag field 01111110. Then, the receiver interprets that
sequence as the ending flag and resets for next frame. This

phenomenon is called lack of Data Transparency.


Bit Stuffing

 To over come the lack of data transparency, HDLC uses a process called
Bit Stuffing.

 Bit stuffing is the process of adding one extra 0 whenever there


are five consecutive 1s in the data. The receiver does not mistake
the data for a flag.

For Example

The sequence : 0111111110 becomes 0111110111000.

The extra 0 is inserted ( stuffed 0) regardless of sixth bit is


another 1. Its presence tells the receiver that the sequence is not
a flag. The receiver drops the stuffed 0 ( unstuff) from the data
and the original bit stream is restored.
Bit stuffing and Unstuffing
Problem – 1: Bit Stuff the following data
a) 0001111110111110011110011111001
b) 000111111111111111111111111111110011111001
Example
Draw the sender and receiver windows for a system using Go-Back-N
ARQ, given the following: i) Frame 0 is sent ;frame 0 is Ack, ii) frames
1&2 are sent; frames 1 & 2 are ack, iii) frames 345 are sent; frame 4 is
ack, timer for frame 5 expires, iv) frames 5,6 & 7 are sent; frames 4
through 7 are Ack.
Example
Ack 7 has been received by the sender in Go-Back –N
sliding window system. Now frames7, 0 , 1,2 &3 are
sent. For each of the following, discuss the
significance of a) an ACK 1 , b) an ACK 4, c) an ACK 3
Solution
a) Frames 7 and 0 received; next frame expected is
frame 1
b) Frames 7, 0, 1, 2, and 3 received; next frame
expected is frame 4
c) Frames 7, 0, 1, 2 received; the next frame expected
is frame 3
Example:
In HDLC, write a control field of the following frames. Low order bits have
been shown first.
i) I –frame, N(s) = 010, N ( R ) = 101 command with p bit equal to 0.
ii) S – frame, RNR, N(R) = 101 command with p bit equal to 1.
iii) U –frame, unnumbered ack, response with F-bit equal to 1.
Example:
A channel is operating at 4800 bps and the propagation delay is 20 ms.
What should be the minimum frame size for STOP – N – WAIT flow
control to get 50% line utilization efficiency.
Example:
If the frame size is 960 bits on a satellite channel operating at 960 kbps,
what is the maximum kink utilization for the following:
STOP – N – WAIT flow control mechanism, ii) Sliding window flow control
with window size 7, iii) Sliding window flow control with window size
127, iv) Sliding window flow control with window size 255. Assume that
the propagation delay is 270 ms.

Potrebbero piacerti anche