π€ What is Framing? (Basic Idea)
When data is sent over a network, it does not travel as one big message.
π Instead:
Data is broken into smaller pieces
Each piece is packed into a frame
These frames are sent one by one
π This process is called Framing.
π§ Simple Definition
π Framing is the process of dividing data into manageable units called frames and adding control information to ensure correct delivery.
π§ Why Framing is Needed
Imagine sending a huge book π through courier:
β Sending it as one piece is risky
β Sending it chapter by chapter is safer
π Similarly, in networking:
Large data β broken into frames
Easier to transmit
Easier to detect errors
Easier to retransmit if lost
π§± Where Does Framing Occur?
Framing is performed by the Data Link Layer
It works between two directly connected devices
π Example:
Computer β Switch
Switch β Router
π¦ What is a Frame?
A Frame is a data packet at the Data Link Layer.
π It contains:
Actual data
Control information
Address information
Error-checking information
π§© Basic Structure of a Frame


A typical frame contains:
1οΈβ£ Header
2οΈβ£ Data (Payload)
3οΈβ£ Trailer
πΉ1. Frame Header
Contains:
π·οΈ Source MAC Address
π·οΈ Destination MAC Address
Control information
π Helps identify who sent the data and who should receive it.
πΉ 2. Data (Payload)
Actual information being sent
Comes from the Network Layer
π This is the main content.
πΉ 3. Frame Trailer
Contains:
β Error detection bits (CRC)
π Helps check whether data was damaged during transmission.
π Key Responsibilities of Framing
Framing helps in:
π¦ Dividing data into frames
π·οΈ Adding physical (MAC) addresses
β Detecting transmission errors
π Synchronizing sender and receiver
π§ Types of Framing Techniques
There are four main framing methods:
1οΈβ£ Character Count Framing
2οΈβ£ Byte Stuffing
3οΈβ£ Bit Stuffing
4οΈβ£ Physical Layer Coding Violations
Weβll explain each one by one π
π’ 1. Character Count Framing
π§ How It Works
Header contains number of characters
Receiver reads that many characters
π Example:
Header says 10 bytes, receiver reads next 10 bytes as frame.
β Problem
If count is corrupted β entire frame lost
π Rarely used today.
π‘ 2. Byte Stuffing


π§ How It Works
Special byte marks:
Start of frame
End of frame
If same byte appears in data β extra byte added (stuffed)
π§ Example
Flag byte:
01111110If appears in data β extra escape byte added
β Advantage
Reliable
Easy to implement
β Disadvantage
Increases frame size
π’ 3. Bit Stuffing

π§ How It Works
Frame marked by special bit pattern
If data has 5 consecutive 1s, a 0 is inserted
π Receiver removes the extra 0.
π§ Example
Data: 111110
Stuffed: 1111100
β Advantages
Efficient
Used in modern protocols
β Disadvantages
Slight processing overhead
π Used in HDLC protocol
β‘ 4. Physical Layer Coding Violations
π§ How It Works
Uses special signal patterns
These patterns never occur in normal data
π Used to mark:
Start of frame
End of frame
β Limitation
Depends on physical layer encoding
Not universally applicable
π§ Framing vs Packet vs Segment (Common Confusion)
Layer | Data Unit |
|---|---|
Application | Data |
Transport | Segment |
Network | Packet |
Data Link | Frame |
Physical | Bits |
π Remember this table β very important
β Advantages of Framing
Improves reliability
Enables error detection
Helps synchronization
Efficient data transmission
β One-Line Summary
πΉ Framing is the Data Link Layer process of dividing data into frames and adding control information for reliable communication.