0% found this document useful (0 votes)
126 views

Layer 2 Framing HDLC (High-Level Data Linl Control) : Giuseppe Bianchi

This document discusses Layer 2 framing using HDLC (High-level Data Link Control). HDLC is a common Layer 2 protocol that provides framing, error detection, and flow control. It delineates frames using flags and implements bit stuffing to prevent long runs of identical bits and ensure reliable transmission. The core components of an HDLC frame are addressed, including the flag, address, control, information, and frame check sequence fields. The document also describes different types of HDLC frames and their uses for information transfer, supervision, and unnumbered management frames.

Uploaded by

hassan_m2222
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views

Layer 2 Framing HDLC (High-Level Data Linl Control) : Giuseppe Bianchi

This document discusses Layer 2 framing using HDLC (High-level Data Link Control). HDLC is a common Layer 2 protocol that provides framing, error detection, and flow control. It delineates frames using flags and implements bit stuffing to prevent long runs of identical bits and ensure reliable transmission. The core components of an HDLC frame are addressed, including the flag, address, control, information, and frame check sequence fields. The document also describes different types of HDLC frames and their uses for information transfer, supervision, and unnumbered management frames.

Uploaded by

hassan_m2222
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Layer 2 Framing

HDLC (High-level Data Linl Control)

Giuseppe Bianchi

HDLC
Typical Layer 2 protocol Services: Framing Error detection and frame retransmission Flow control Most of current line-based L2 protocols are derived from HDLC PPP (dial-up, ADSL, ) LAP-D (ISDN) LAP-B (X.25)
Giuseppe Bianchi

Why framing?
transmitted received frames frames FRAMES = structured information & control fields Framing

0111110101

PHY

= bit/byte streams

0110110111

PHY:

- bit oriented - byte oriented Giuseppe Bianchi

1000101010111010101010111 10001000-01011000-11110110

HDLC Frame Format


Flag 1 byte Address Control 1-n bytes 1-2 bytes Information (variable) FCS 2-4 bytes Flag 1 byte

Each frame starts & ends with reserved flag: 0111.1110 = 0x7e Just one flag required between consecutive frames
flag HDLC frame flag HDLC frame

Two consecutive flags = empty frame


Just ignore
flag HDLC frame Giuseppe Bianchi flag flag HDLC frame

The need for stuffing


Flag 0111.1110 FRAME 0100.0100..0000.0000..0111.1000..0111.1110..0101.1110..0100.0000 Flag 0111.1110

0111.1110..0100.0100..0000.0000..0111.1000..0111.1110..0101.1110..0100.0000..0111.1110

Flag FRAME Flag 0111.1110 0100.0100..0000.0000..0111.1000 0111.1110

FRAME 0101.1110..0100.0000

Flag 0111.1110

Giuseppe Bianchi

Bit stuffing
HDLC Frame delineated by flag character 01111110 Six consecutive 1s Bit stuffing: prevent occurrence of more than five 1s! Transmitter inserts extra 0 after each consecutive five 1s inside the frame Receiver checks for five consecutive 1s
if next bit = 0, it is removed if next two bits are 10, then flag is detected If next two bits are 11, then frame has errors

Giuseppe Bianchi

Bit stuffing example


EXAMPLE: send

Data to be sent:

0110111111111100 0111111001101111101111100001111110
EXAMPLE: receive

After stuffing and framing

Data received After destuffing and deframing

01111110000111011111011111011001111110

*000111011111-11111-110*

Giuseppe Bianchi

Byte stuffing
Byte-oriented channels? Same stiffing idea, but stuffing via control escape octes: Send (reserved byte) as (control escape octet) + (reserved byte)XOR(0010.0000) Extra XOR (bit 5 complemented) for improved robustness Control escape octet 0111.1101 = 0x7d of course NOW this is a reserved byte, too!

11 3F 7E 02 7D 10

Receiver detects control escape And removes it restoring original byte as part of the frame (e.g. not as flag)

11 3F 7D 5E 02 7D 5D 10
See RFC 1662 for bit-stuffing over bit synchronous links (versus byte-oriented links) Giuseppe Bianchi

HDLC Frame Content


Flag 1 byte Address Control 1-n bytes 1-2 bytes Information (variable) FCS 2-4 bytes Flag 1 byte

Address: Receiving (secondary) station Or Transmitting (secondary) station in case of response 1111.1111 = broadcast address Control Frame type and transmission control information FCS CRC16 or CRC32 for error detection Size of fields decided during link set-up/initialization procedure
Giuseppe Bianchi

Control field
Three types of frames I = Information frame
0

S = Supervisory frame
1 0

U = Unnumbered frame
1 1

Giuseppe Bianchi

Information Frame
8 bit case

0
0

N(S)

P/F

N(R)
P/F

16 bit case

N(S)

N(R)

N(S) # of currently transmitted frame N(R) # of next frame expected to be received i.e., ACK of all frames until N(R)-1 P/F bit For polling operation
Giuseppe Bianchi

Supervisory Frame
8 bit case

1 0

P/F

N(R)
P/F

16 bit case

1 0

0 0 0 0

N(R)

Control frame used to manage ACK and flow control S=RR (Receive Ready)
Carries cumulative ACK up to N(R)-1

S=RNR (Receive Not Ready)


Blocks sender (flow control), carries cumulative ACK as well

S=REJ (Reject)
Negative ACK for frame # N(R), for Go-Back-N case

S=SREJ (Selective Reject)


Negative ACK for frame # N(R), for Sel. Repeat case Extension: OTHER frame # to be retransmitted may be included in the frame information field
Giuseppe Bianchi

Unnumbered Frame
1 1 M
P/F

Frames used for datalink management Initialization, Setup/release, Reset, Management and notification of malfunctions and issues Several control messages See details and examples in book Different datalink scenarios Asynchronous Balanced Mode (ABM) LAP-B
Two full-duplex stations

Normal Response Mode (NRM)


Unbalanced (half-duplex) operation: primary station can only access link, secondary station is slave

Asynchronous Response Mode (ARM)


Like NRM, but secondary station may further initiate an unsolicited transmission

Giuseppe Bianchi

You might also like