Lecture 6 - DLL Framing
Lecture 6 - DLL Framing
OVERVIEW OF DLL
Specific responsibilities of the data link layer include
• framing,
• addressing,
• flow control,
• error control,
• media access control.
2
FRAMING
The data link layer needs to pack the received data into
frames, so that each frame is distinguishable from
another.
Types of Framing
Fixed-Size Framing
Variable-Size Framing
Variable Length Framing
10
FRAMING – CHARACTER COUNT
The first framing method uses a field in the header to specify
the number of characters in the frame. When the data link layer
at the destination sees the character count, it knows how many
characters follow and hence where the end of the frame is.
11
The trouble with this algorithm is that the count can be garbled by a
transmission error.
FRAMING – BIT STUFFING
This technique allows data frames to contain an arbitrary number of bits and
allows character codes with an arbitrary number of bits per character. It works
like this. Each frame begins and ends with a special bit pattern, 01111110 (in
fact, a flag byte).
Whenever the sender's data link layer encounters five consecutive 1s in
the data, it automatically stuffs a 0 bit into the outgoing bit stream.
This bit stuffing is analogous to byte stuffing, in which an escape byte is
stuffed into the outgoing character stream before a flag byte in the data. When
the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically destuffs (i.e., deletes) the 0 bit
15
Byte stuffing and unstuffing
17
Flag byte with Byte Stuffing
14
Data: 01101111110
Data: 01101111110