4 Framing Notesl4 - 103314
4 Framing Notesl4 - 103314
FRAMING TECHNIQUE
LECTURE No.4
INTRODUCTION
The Data Link Layer is the second layer in the OSI model, above the Physical
Layer, which ensures that the error free data is transferred between the
adjacent nodes in the network. It breaks the datagram passed down by
above layers and converts them into frames ready for transfer. The function
of Data Link layer is to provide
Framing
Flow Control
Error control
Performing addressing
Access control
Since the physical layer accepts and transmits a stream of bits without any
regard to meaning or structure, it is up to the data link layer to create and
recognize frame boundaries. This can be accomplished by attaching special
bit patterns to the beginning and end of the frame. If these bit patterns can
accidentally occur in data, special care must be taken to make sure these
patterns are not incorrectly interpreted as frame delimiters. The four framing
methods that are widely used are
Character count
Starting and ending characters, with character stuffing
Bit stuffing
Physical layer coding violations
Character Count
This 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. The disadvantage is that if the count is distorted by a transmission
error, the destination will lose synchronization and will be unable to locate
the start of the next frame. So, this method is rarely used.
In this second method, each frame starts with the ASCII character sequence
DLE STX and ends with the sequence DLE ETX.(where DLE is Data Link
Escape, STX is Start of TeXt and ETX is End of TeXt.) This method overcomes
the drawbacks of the character count method. If the destination ever loses
synchronization, it only has to look for DLE STX and DLE ETX characters. If
however, binary data is being transmitted then there exists a possibility of
the characters DLE STX and DLE ETX occurring in the data. Since this can
interfere with the framing, a technique called character stuffing is used.
The sender's data link layer inserts an ASCII DLE character just before the
DLE character in the data. The receiver's data link layer removes this DLE
before this data is given to the network layer.
Bit stuffing
The third method allows data frames to contain an arbitrary number of bits
and allows character codes with an arbitrary number of bits per character. At
the start and end of each frame is a flag byte consisting of the special bit
pattern. Whenever the sender's data link layer encounters five consecutive
1s in the data, it automatically stuffs a zero bit into the outgoing bit stream.
This technique is called bit stuffing. When the receiver sees five consecutive
1s in the incoming data stream, followed by a zero bit, it automatically
destuffs the 0 bit. The boundary between two frames can be determined by
locating the flag pattern.
The final framing method is physical layer coding violations and is applicable
to networks in which the encoding on the physical medium contains some
redundancy. In such cases normally, a 1 bit is a high-low pair and a 0 bit is a
low-high pair. The combinations of low-low and high-high which are not used
for data may be used for marking frame boundaries.