An interactive demonstration of how data is divided and transmitted across networks using different framing techniques.
Framing is the process of dividing a stream of data into manageable units called frames. It allows the receiver to identify where each frame begins and ends, ensuring accurate data transmission across networks.
Why do we need it? Without framing, data would be a continuous stream of bits with no clear boundaries, making it impossible to detect errors or retransmit lost data.
Data is divided into frames of equal size. If the last frame is smaller than the fixed size, it is padded with extra bits or bytes.
Example: If frame size is 3 and data is "HELLOWORLD", frames would be: HEL | LOW | ORL | D (padded)
Used when frames are variable-sized. Special FLAG characters mark the beginning and end of frames. If FLAG or ESC characters appear in the data, an ESC character is inserted before them.
Example: If FLAG=F, ESC=E, and data is "AFEBFCD", stuffed data becomes: F | A | EF | EE | B | EF | C | D | F
Used in bit-oriented protocols. A special bit pattern (usually 01111110) marks frame boundaries. If five consecutive 1s appear in data, a 0 is automatically inserted after them.
Example: If data is "011111011", after stuffing: "0111110011" (a 0 is inserted after five 1s)
| Method | Frame Size | Overhead | Best For |
|---|---|---|---|
| Fixed-Size | Fixed | Low (padding only) | Consistent data streams |
| Byte Stuffing | Variable | Medium (ESC characters) | Character-oriented protocols |
| Bit Stuffing | Variable | Low (few inserted bits) | Bit-oriented protocols |