The document discusses the Data Link Layer's function of framing, which involves dividing data into manageable chunks for error detection. It outlines various framing methods, including fixed and variable size frames, as well as techniques like character and bit stuffing. Additionally, it covers specific protocols such as HDLC, BISYNC, PPP, and DDCMP, highlighting their frame structures and error handling mechanisms.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
7 views32 pages
Data Link Layer - Framig
The document discusses the Data Link Layer's function of framing, which involves dividing data into manageable chunks for error detection. It outlines various framing methods, including fixed and variable size frames, as well as techniques like character and bit stuffing. Additionally, it covers specific protocols such as HDLC, BISYNC, PPP, and DDCMP, highlighting their frame structures and error handling mechanisms.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32
Data Link Layer
Framing • Framing is a function of the data link layer.
• The advantage of using frames is that data is
divided into recoverable chunks that can easily be checked for corruption. Problems in Framing • Detecting start of the frame Station detects frames by looking out for a special sequence of bits that marks the beginning of the frame i.e. SFD (Starting Frame Delimiter) Problems in Framing • How does the station detect a frame? Every station listens to link for SFD pattern through a sequential circuit. If SFD is detected, sequential circuit alerts station. Station checks destination address to accept or reject frame. Problems in Framing • Detecting end of frame When to stop reading the frame. Types of framing 1. Fixed size – The frame is of fixed size no need to provide boundaries to the frame (length of the frame :delimiter ) Drawback: It suffers from internal fragmentation if the data size is less than the frame size Solution: Padding Types of framing 2. Variable size – need to define the end of the frame as well as the beginning of the next frame.
This can be done in two ways:
• Length field – indicate the length of the frame.
Used in Ethernet(802.3). The problem with this is that sometimes the length field might get corrupted. • End Delimiter (ED) – indicate the end of the frame. Used in Token Ring The problem with this is that ED can occur in the data Framing Approaches There are mainly three types of framing approaches: • Bit-Oriented Framing • Byte-Oriented Framing • Clock Based Framing Methods of Framing 1. Character Count 2. Flag Byte with Character Stuffing 3. Starting and Ending Flags, with Bit Stuffing 4. Encoding Violations Character Count rarely used required to count total number of characters that are present in frame. This is be done by using field in header. Character count method ensures data link layer at the receiver or destination about total number of characters that follow, and about where the frame end. Character Count There is disadvantage also of using this method i.e., if anyhow character count is disturbed or distorted by an error occurring during transmission, then destination or receiver might lose synchronization. The destination or receiver might also be not able to locate or identify beginning of next frame. Character Count Character Stuffing • also known as byte stuffing or character- oriented framing • In byte stuffing, special byte that is basically known as ESC (Escape Character) added to data section of the data stream or frame • when there is message or character that has same pattern as that of flag byte. But receiver removes this ESC and keeps data part that causes some problems or issues Character Stuffing Bit Stuffing
Bit stuffing is the insertion of non information
bits into data. Note that stuffed bits should not be confused with overhead bits. Overhead bits are non-data bits that are necessary for transmission (usually as part of headers, checksums etc.). Example in upcoming slide Bit-Oriented Framing • frames as a collection of bits. • The data is transmitted as a sequence of bits that can be interpreted as text and multimedia data in the upper layer. Bit-Oriented Framing • Consider the frame to be sent and received by the devices. • The 8 bits added at the start and end of the frame in this protocol are 01111110 • Frame 011111100101000111111001111110 Bit-Oriented Framing 011111100101000111111001111110 ie. 011111100101000111111001111110 In Bit Stuffing, stuff a pattern of bits of arbitrary length in the message to differentiate from the delimiter. Bit-Oriented Framing • whenever the sender device finds the frame consisting of five consecutive 1’s, it will stuff a ‘0’ bit. 0111111001010001111101001111110. When the receiving device receives this frame and encounters a ‘0’ after five consecutive bits, it will remove it to maintain the original frame. • High-Level Data Link Control (HDLC) is a data link layer protocol. Byte-Oriented Approach • frames as a collection of bytes(8 bits), also known as a character (Character Oriented Approach) There are three Byte-Oriented Protocols: 1. Binary Synchronous Communication Protocol (BISYNC) 2. Digital Data Communication Message Protocol (DDCMP) 3. Point-to-Point Protocol(PPP). HDLC High-Level Data Link Control (HDLC) a bit - oriented protocol each frame contains up to six fields. The fields of a HDLC frame are − • Flag − It is an 8-bit sequence that marks the beginning and the end of the frame. The bit pattern of the flag is 01111110. • Address − It contains the address of the receiver. If the frame is sent by the primary station, it contains the address(es) of the secondary station(s). If it is sent by the secondary station, it contains the address of the primary station. The address field may be from 1 byte to several bytes. High-Level Data Link Control (HDLC) • Control − It is 1 or 2 bytes containing flow and error control information. • Payload − This carries the data from the network layer. Its length may vary from one network to another. • FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC (cyclic redundancy code) Types of HDLC Frames • There are three types of HDLC frames. The type of frame is determined by the control field of the frame. 1.I-Frame 2.S-Frame 3.U-Frame • I-frame − Information frames carry user data from the network layer. include flow and error control information The first bit of control field of I-frame is 0. • S-frame − Supervisory frames do not contain information field. used for flow and error The first two bits of control field of S-frame is 10. • U-frame − Un-numbered frames are used for miscellaneous functions, like link management. It may contain an information field, if required. The first two bits of control field of U-frame is 11. Binary Synchronous Communication Protocol (BISYNC)
• Also known as Basic Mode Protocol
• It is a sentinel approach. • frame format Binary Synchronous Communication Protocol (BISYNC)
SYN: Special starting character,
SOH: Start of the Header, STX: Start of the text, ETX: End of the text. The STX and ETX guard the data part of the portion. To avoid the framing error problem, Byte Stuffing is used. This is used when the frames consist of characters. A byte is stuffed in the message to differentiate from the delimiter. Point-to-Point Protocol(PPP) • It is a wide area network protocol that runs over internet links. • mainly used in broadband communication that deals with high speed and heavy loads. • The frame format Point-to-Point Protocol(PPP) The bit pattern for the flag is 01111110. The address field is set to 11111111 in case of broadcast. The control value is set to a constant value of 11000000. The protocol consists of 1 or 2 bytes that define the type of data in the payload section. The maximum length of this field is 1500 bytes. The checksum field is used for error detection. if the flag bits appear in the payload part, the situation is overcome using character/byte stuffing. Digital Data Communication Message Protocol (DDCMP)
• A new count field is introduced in this
protocol. • The frame format Digital Data Communication Message Protocol (DDCMP)
• if transmission error corrupts the count field,
then the end of the frame will not be detected by the receiver correctly. Clock Based Framing • mainly used for Optical Networks such as SONET. • In this approach, a series of repetitive pulses maintain a constant bit rate and keep the digital bits aligned in the data stream.