What is Frame Check Sequence?
Last Updated :
24 Nov, 2021
Frame Check Sequence (FCS) refers to extra bits added to the frame for error detection. It is used for HDLC error detection. It is 2 byte or 4-byte field that is used to detect errors in the address field, control field, and information field of frames transmitted across the network. It is used to ensure the data frame is not corrupted by the transmission medium while sending it from sender to receiver.
HDLC Frame Format
Features:
- It is an error detection code present in HDLC frames.
- Its size varies from 2 bytes to 4 bytes.
- It is used in the communication protocol.
- It is only responsible for error detection and not error recovery.
- The type of FCS technique to be used depends on the protocol followed by the network.
Purpose:
Data frames often get corrupted while transmission through a communication medium. FCS bits are added to the frame prior to its transmission across the network. FCS code is again calculated at the destination site and compared with FCS bits of the frame, if FCS matches then the transmission is considered successful else frames are discarded. Hence, it is used for error detection.
FCS is only used for error detection and does not specify any detail about error recovery. Error recovery technique is entirely based on the transmission protocol. Following are the examples to demonstrate how different protocols respond to errors detected using FCS:
- Ethernet, data link layer protocol specifies that data frame should be discarded in case of error detection and does not take any action for error recovery. If the sender sends some message to the destination using ethernet protocol, the message is divided into data frames with FCS bits attached to each frame then these frames are transmitted over the medium. If any of the frames get corrupted while transmission then its FCS bits will be changed. At the destination, FCS is calculated and compared with FCS bits of each frame, and FCS of the corrupted frame will not match the calculated FCS and hence the frame will be discarded. Since ethernet does not specify any action to take like retransmission of corrupted frame in case of error detection hence data will be lost.
- TCP, transport layer protocol specifies that data frames should be discarded in case of error detection and retransmit corrupted frames and initiate error recovery. If the sender sends some message to the destination using TCP protocol, the message is divided into data frames with FCS bits attached to each frame then these frames are transmitted over the medium. If any of the frames get corrupted while transmission then its FCS bits will be changed. At destination FCS is calculated and compared with FCS bits of each frame and FCS of the corrupted frame will not match the calculated FCS and hence the frame will be discarded. TCP then initiates error recovery and retransmits the corrupted frames hence data will not be lost in this case.
Implementation:
The receiver computes the running sum of the entire frame with trailing FCS, then the result is compared with FCS bits of the frame, and if the result match then the transmission is considered successful else frame is discarded. Generally, MSB (most significant bit) of FCS is transmitted first but alternatively, FCS can be reversed to send LSB (least significant bit first).
Different techniques are used to calculate FCS codes for error detection. Following are some of the techniques that are used to detect errors in transmitted frames:
- Simple Parity Check: A parity bit is added to the frame for error detection. It is of two types- odd parity checking and even parity checking. In odd parity checking, the parity bit is set to 0 if data contains an odd number of 1s and set to 1 if data contains an even number of 1s. While in even parity checking, the parity bit is set to 1 if data contains an odd number of 1s and set to 0 if data contains an even number of 1s. Here, parity bits form the part of the frame as FCS code.
- Two-dimensional Parity Check: Parity bits are calculated for each row and each column and appended to the data frame. Calculation of parity bits for individual rows or columns is similar to a simple parity check. In this technique, the combination of the parity bits of all rows and columns forms the FCS code.
- Checksum: Data is divided into multiple segments and all the segments are added using 1s complement arithmetic and obtained sum is complemented to get the checksum. The checksum is sent along with other segments to the destination and at the receiver end sum of all the segments is calculated using 1's complement and then obtained sum is complemented. If the final result is zero then the transmission is considered successful else the frame is discarded. Sometimes, the checksum is considered as FCS code for the CRC error detection algorithm.
- Cyclic Redundancy Check (CRC): A sequence of redundant bits is added to the end of the data unit so that the resulting data is exactly divisible by a predetermined binary number. These bits are called cyclic redundancy check bits. At the receiver end, data is divided by that predetermined number and if the remainder comes out to be 0 then the frame is accepted else it is discarded. In this algorithm, cyclic redundancy bits are considered as FCS bits.
Working:
Data often gets corrupted while transmission hence frame check sequence is appended to the end of the frame while transmission. FCS is calculated by using any error detection techniques such as parity checking, checksum, etc. At the destination, FCS is again calculated by following the same technique that was used to generate FCS at the sender's site. Then the result is compared with FCS bits present in the data frame and if both of them are the same then the frame is accepted and transmission is considered successful else the frame is discarded assuming some error has occurred while transmission.
For example, suppose there are two devices within a network say A and B, and follows TCP protocol. A wants to send some data to B in such a way that corrupted frames are not accepted by B and communication is error-free. So, A divides the data of each frame in some segments of size m and calculates the checksum by summing up all the segments using 1's complement and appending it to the end of each frame, and then transmits the frame. Now, B will calculate the running sum of the frame along with FCS bits using 1's complement and if the sum comes out to be zero then the frame will be accepted by B else it will be discarded. Since the network is following TCP protocol A can retransmit the corrupted frames in case of failure detection. This way communication will be more efficient as no error will lead to inconsistency in communication.
Similar Reads
What is a Boot Sequence?
A boot sequence, also known as boot process or booting, refers to the sequence of steps that a computer system goes through when it is powered on or restarted. The purpose of the boot sequence is to initialize the hardware components, load the operating system into memory, and prepare the system for
5 min read
What is SPX (Sequenced Packet Exchange)?
Prerequisite: Introduction to Novell NetWare NetWare, developed by Novell is a NOS that expands to Network Operating systems. NOS is a special kind of operating system which helps the personal computers in a network (eg: computers connected in LAN) to share files and resources like printers. They ma
6 min read
What is System Integrity Check?
A system integrity check is a part of the system hardening process to confirm that we have taken all the necessary measures to prevent any unauthorized access to our systems and files. System integrity check verifies the integrity of different system components, such as operating systems, applicatio
6 min read
What is Minimum Ethernet Frame Size?
The minimum size of an Ethernet frame is 64 bytes. The Ethernet protocol is responsible for Network Interface Card (NIC) to Network Interface Card (NIC) communication of hosts on the same network. It is a protocol of the Layer 1 (Physical Layer) and Layer 2 (Datalink Layer) of the OSI Reference Mode
4 min read
What is Frame Flooding?
Frame Flooding is a procedure followed by a switch in which the switch forwards the Ethernet frame received by it to all the ports except the incoming port. Although the process seems identical to another procedure known as an Ethernet Broadcast, it is different in origin from a broadcast. Ethernet
2 min read
Sequences in LISP
In Lisp, the ordered set of elements is represented by sequences. All the functionality we use in sequences is applied on vectors and lists which are two of the subtypes of sequences. Creating a Sequence:The generic function for creating a Sequence in Lisp is: ;The generic function for creating a Se
7 min read
Frame of Reference
Frame of reference is a way to observe and measure objects' positions and movements. It acts like a coordinate system, helping us understand where things are and how they move. By using a frame of reference, we can describe motion accurately. It makes it clear if something is moving fast, slow, or a
6 min read
Packet Format Frame in Wireshark
Pre-requisites: Introduction to Wireshark After capturing some packets or after opening a previously saved captured file and analyzing them, sometimes we need to print the details of the captured packets. To print the packets, click on the "File" menu and then select the âPrintâ menu item. This will
2 min read
What is ARQ (Automatic Repeat Request)?
ARQ stands for Automatic Repeat Request also known as Automatic Repeat Query. ARQ is an error-control strategy used in a two-way communication system. It is a group of error-control protocols to achieve reliable data transmission over an unreliable source or service. These protocols reside in the Tr
7 min read
Basic Frame Structure of SDLC
Synchronous Data Link Control (SDLC) is generally linked layer protocol that is used with Systems Network Architecture (SNA) environment. SNA is proprietary networking architecture of IBM that is developed in 1974. SDLC also supports huge variety of typologies and different types of data links. Exam
3 min read