Professional Documents
Culture Documents
Mod4 Framing HDLC MAC PDF
Mod4 Framing HDLC MAC PDF
Mod4 Framing HDLC MAC PDF
Computer Networks
Module 4: Framing, HDLC, PPP and MAC
Data link layer packs bits in frames and one frame is distinguished from other.
Also, it separates a message from one source-destination pair from other
messages for other pair by adding sender and receiver address.
Framing
At physical layer, data transmission means moving bits in form of signals from
source to destination. So, physical layer provides bit synchronization to ensure
sender and receiver use same bit duration and timings.
Data link layer packs bits in frames and one frame is distinguished from other.
Also, it separates a message from one source-destination pair from other
messages for other pair by adding sender and receiver address.
Optimum size: Can’t be too large as error and flow control would be difficult. Too
small would result in a lot of overhead.
Types of framing
● Fixed-size
● Variable-size
Types of framing
● Fixed-size
There is no need of frame boundaries as the size is the delimiter. Example: ATM
WAN has fixed size frames called cells.
● Variable-size
Types of framing
● Fixed-size
There is no need of frame boundaries as the size is the delimiter. Example: ATM
WAN has fixed size frames called cells.
● Variable-size
1. Character-oriented protocols
2. Bit-oriented protocols
Character-oriented protocols
Data that is to be carried considered as a group of bits or character like 8 bit
character from a coding system like ASCII.
● Header
● Trailer
● Flag
Character-oriented protocols
Data that is to be carried considered as a group of bits or character like 8 bit
character from a coding system like ASCII.
Problem:???
Byte or character stuffing
Sender: Special byte is added to data stream of frame when data with flag pattern
is found. This extra byte is called escape character (ESC). It is a predefined bit
pattern.
Solution:
Byte or character stuffing
Sender: Special byte is added to data stream of frame when data with flag pattern
is found. This extra byte is called escape character (ESC). It is a predefined bit
pattern.
Byte stuffing is the process of adding 1 extra byte whenever there is a flag
or escape character in the text.
Byte or character stuffing
Byte or character stuffing
Bit-oriented protocols
Data is treated as sequence of bits which can represent text, audio, video by
upper layers.
We still need header and trailer as delimiters to separate frames. Most protocols
use special 8 bit pattern as flag 01111110.
Bit-oriented protocols
Data is treated as sequence of bits which can represent text, audio, video by
upper layers.
We still need header and trailer as delimiters to separate frames. Most protocols
use special 8 bit pattern as flag 01111110.
Flag can create same problem as we saw in byte-oriented protocols. If flag pattern
is repeated in data, how to inform the receiver it is not end of frame.
Bit-oriented protocols
Data is treated as sequence of bits which can represent text, audio, video by
upper layers.
We still need header and trailer as delimiters to separate frames. Most protocols
use special 8 bit pattern as flag 01111110.
Flag can create same problem as we saw in byte-oriented protocols. If flag pattern
is repeated in data, how to inform the receiver it is not end of frame ⇒ Bit stuffing
Bit stuffing
Stuffing single bit to prevent pattern from looking like a flag. In bit stuffing
whenever a 0 and 5 1s are encountered an extra 0 is added. This extra bit is
eventually removed by the receiver.
Note that extra bit is added after 011111 regardless of next bit to make it
conventional for receiver. This is because if we have 0111110, receiver would
interpret it as stuffed bit and remove it.
Bit stuffing
Stuffing single bit to prevent pattern from looking like a flag. In bit stuffing
whenever a 0 and 5 1s are encountered an extra 0 is added. This extra bit is
eventually removed by the receiver.
Note that extra bit is added after 011111 regardless of next bit to make it
conventional for receiver. This is because if we have 0111110, receiver would
interpret it as stuffed bit and remove it.
More theoretical but forms basis for practical protocols used in LANs like PPP,
Ethernet.
HDLC configuration and transfer modes
HDLC works in two modes:
● Information frame (I-frame): user data and control information about user data
like piggybacking.
● Supervisory frame (S-frame): control information
● Unnumbered frame (U-frame): System management like managing link itself,
session management
HDLC: Framing
HDLC: Frame content
Flag: synchronization pattern of 01111110.
Control:
It has a information field but that contains system management information and
not user data.
It has a information field but that contains system management information and
not user data.
Example: Internet users who connect their PC to ISP using dial up connections.
This is a byte oriented protocol and does not provide flow control. However, CRC
is used for error control.
PPP: Framing
Character or byte oriented.
Payload: User data or control information. Default size of maximum 1500 bytes but
can be changed by negotiation. Data field is byte stuffed to avoid flag-like pattern.
Byte stuffing - add ESC byte (01111101) whenever flag pattern appears in data.
PPP: Framing
Protocol: defines what is being carried in data field either user data or other
information.
Payload: User data or control information. Default size of maximum 1500 bytes but
can be changed by negotiation. Data field is byte stuffed to avoid flag-like pattern.
Byte stuffing - add ESC byte (01111101) whenever flag pattern appears in data.
Also, an ESC byte should be stuffed by another ESC byte.
Broadcast address:
FF:FF:FF:FF:FF:FF