- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Character - Oriented Framing and Bit - Oriented Framing
Framing is a Data Link layer function whereby the packets from the Network Layer are encapsulated into frames. The data frames can be of fixed length or variable length. In variable - length framing, the size of each frame to be transmitted may be different. So, a pattern of bits is used as a delimiter to mark the end of one frame and the beginning of the next frame.
The two types of variable - sized framing are −
- Character-oriented framing
- Bit - oriented framing
Character - Oriented Framing
In character - oriented framing, data is transmitted as a sequence of bytes, from an 8-bit coding system like ASCII. The parts of a frame in a character - oriented framing are −
Frame Header − It contains the source and the destination addresses of the frame in form of bytes.
Payload field − It contains the message to be delivered. It is a variable sequence of data bytes.
Trailer − It contains the bytes for error detection and error correction.
Flags − Flags are the frame delimiters signalling the start and end of the frame. It is of 1- byte denoting a protocol - dependent special character.
Character - oriented protocols are suited for transmission of texts. The flag is chosen as a character that is not used for text encoding. However, if the protocol is used for transmitting multimedia messages, there are chances that the pattern of the flag byte is present in the message byte sequence. In order that the receiver does not consider the pattern as the end of the frame, byte stuffing mechanism is used. Here, a special byte called the escape character (ESC) is stuffed before every byte in the message with the same pattern as the flag byte. If the ESC sequence is found in the message byte, then another ESC byte is stuffed before it.
A problem with character - oriented framing is that it adds too much overhead on the message, thus increasing the total size of the frame. Another problem is that the coding system used in recent times have 16-bit or 32-bit characters that conflicts with the 8-bit encoding.
In bit-oriented framing, data is transmitted as a sequence of bits that can be interpreted in the upper layers both as text as well as multimedia data.
The parts of a frame in a character - oriented framing are −
Frame Header − It contains bits denoting the source and the destination addresses of the frame.
Payload field − It contains the message to be delivered. It is a variable sequence of bits.
Trailer − It contains the error detection and error correction bits.
Flags − Flags are a bit pattern that act as the frame delimiters signalling the start and end of the frame. It is generally of 8-bits and comprises of six or more consecutive 1s. Most protocols use the 8-bit pattern 01111110 as flag.
Bit - oriented protocols are suited for transmitting any sequence of bits. So there are chances that the pattern of the flag bits is present in the message. In order that the receiver does not consider this as end of frame, bit-stuffing mechanism is used. Whenever a 0 bit is followed by five consecutive 1 bits in the message, an extra 0 bit is stuffed at the end of the five 1s. When the receiver receives the message, it removes the stuffed 0s after each sequence of five 1s. The un-stuffed message is then sent to the upper layers.
- Related Articles
- Differentiate between block-oriented and character-oriented devices in UNIX
- Framing in Data Link Layer
- Difference between Row oriented and column oriented database
- What is Character Oriented Protocol in computer architecture?
- Object Oriented language v/s Procedure oriented programming language.
- Connection-Oriented Services
- Object-Oriented Databases
- Python Object-oriented and Functional Programming
- Object-oriented Data Model
- Differences between Procedural and Object Oriented Programming
- Distinguish between Connection-Oriented and Connectionless Service
- Object Oriented Programming in Python?
- Synchronous Connection-Oriented (SCO) Link
- Implementation of connection-oriented services
- What is Service-Oriented Architecture?