can message frame data link layer components and functions

Jun 19, 2025 Leave a message

1. Overview of the CAN protocol


1.1 Origin and development of the CAN protocol


CAN protocol was firstly proposed by German Bosch Company in 1983, aiming to solve the communication problems in automobile electronic system. With the development of technology, CAN protocol is gradually widely used in industrial control, medical equipment, smart home and other fields.


1.2 Characteristics of CAN protocol


CAN protocol has the following characteristics:

 

  • Multi-master control: CAN protocol supports multiple nodes to communicate at the same time, which improves the real-time and reliability of the system.
  • Broadcast communication: CAN protocol adopts broadcast method for communication, all nodes can receive the sent data.
  • Non-destructive Arbitration: When two or more nodes send data at the same time, the CAN protocol ensures the correct transmission of data through an arbitration mechanism.
  • Error Detection and Handling: The CAN protocol has error detection and handling functions, which can detect and handle errors in the communication process in time.

 

2. Components of CAN message frame


CAN message frame is the most basic data transmission unit in CAN protocol, and its components are as follows:


2.1 Frame start bit


The frame start bit is the first bit of the message frame and is used to identify the start of the message frame.

 

2.2 Arbitration Field

 

The arbitration field is used to prioritize the data to be sent. In the CAN protocol, the length of the arbitration field is 11 or 29 bits, corresponding to standard and extended frames, respectively. The smaller the value of the arbitration field, the higher the priority.

 

2.3 Control Field

 

The control field consists of the Remote Transmission Request (RTR) bit and the Identifier Extension (IDE) bit.The RTR bit is used to identify whether the data frame is a remote frame or a data frame, and the IDE bit is used to identify whether the frame is a standard frame or an extended frame.

 

2.4 Data Field

 

The data field is used to store the actual data transmitted. The length of the data field is 0-8 bytes for standard frames and 0-64 bytes for extended frames.

 

2.5 Check Field

 

The checksum field consists of the cyclic redundancy check (CRC) and the CRC delimiter, which is used to detect whether there is an error in the data during transmission, and the CRC delimiter, which identifies the end of the CRC checksum.

 

2.6 Answer Field

 

The answer field consists of an answer slot and an answer definer. The answer slot is used to receive an answer from a node and the answer definer identifies the end of the answer field.

 

2.7 End-of-Frame Bit

 

The end-of-frame bit is the last bit of a message frame and is used to identify the end of the message frame.

 

3. Functions of the Data Link Layer


The data link layer is the second layer in the OSI reference model, which is mainly responsible for the reliable transmission of data on top of the physical layer. The functions of the data link layer include:


3.1 Frame Synchronization


Frame synchronization is one of the basic functions of the data link layer, which is used to ensure that transmitting and receiving nodes are able to correctly identify the beginning and end of an information frame.


3.2 Error Control


Error control is another important function of the data link layer, including error detection and error correction.The CAN protocol uses cyclic redundancy check (CRC) for error detection to ensure data integrity.


3.3 Flow Control


Flow control is used to prevent a transmitting node from sending data too quickly for a receiving node to process. The data link layer ensures reliable data transmission by controlling the rate at which data is sent.


3.4 Access Control


Access control is another key function of the data link layer that is used to coordinate communication between multiple nodes. In the CAN protocol, access control is realized through a non-destructive arbitration mechanism to ensure the correct transmission of data.
 

4. Application of CAN message frames in the data link layer


4.1 Frame synchronization


In CAN message frames, the frame start bit and the frame end bit are used to achieve frame synchronization. The transmitting node identifies the start of the message frame by sending the frame start bit, and the receiving node synchronizes the frame by detecting the frame start bit.


4.2 Error Control


The CRC of the checksum field is used for error control in the CAN message frame. The transmitting node generates a CRC based on the data and appends it to the data field before sending the data. After receiving the data, the receiving node recalculates the CRC checksum and compares it with the received CRC checksum to detect any error in the data.


4.3 Flow Control


In CAN protocol, flow control is mainly realized through arbitration mechanism. When two or more nodes send data at the same time, the CAN protocol determines the priority through the arbitration mechanism to ensure the reliable transmission of data.


4.4 Access Control


In the CAN protocol, access control is mainly realized through the non-destructive arbitration mechanism. When two or more nodes send data at the same time, the CAN protocol determines the priority of the sent data by comparing the value of the arbitration field. The node with higher priority can continue to send data, while the node with lower priority needs to wait until the higher priority node finishes sending data.

Send Inquiry

whatsapp

Phone

E-mail

Inquiry