I have tried to collect most of the questions related to CAN Protocol which can ask by your Interviewer. You must have gone through my CAN protocol tutorial before starting this Q&A.
CAN Stands for Controller Area Network patented by Robert Bosch in
1986 to replace conventional wiring used between ECUs for data sharing between ECUs in
It is an asynchronous serial communication protocol. it allows up to 1 Mbps bit rate for a 40m wire length. The most popular bit rate is 500 kbps for 100m length. For more detail
CAN Protocol Basically used on Physical layer(11898-2), Data link layer
(11898-3) , and the transport layer(15765-2).
The physical layer standard is used for bit encoding with NRZ line code and the data link layer is used for error detection, handling, and Message receiving/transmission while transport layer protocol 15765-2 is used for data packet handling if the data length is greater than 8 bytes (<4096 bytes).
CAN protocol allows only 8-byte data in CAN Frame. More than 8-byte data will be fragmented in the 8-byte frame as per 15765-2 standard at the transport layer. For more detail go through this article.
CAN protocol is very enriched in features which motivate one should use it for data communication-
Apart from these, the CAN protocol has other powerful features. It offers the in-built features in the CAN controller like synchronization of nodes, Frame Integrity check through CRC mechanism etc. because of all these features offered at the h/w level, lots of software coding overhead is reduced. for detail about the features list please go through this article
Basically, two types of communication exist –
Synchronous Communication – Each bit of data drives syncs with a clock signal and the master drives the clock signal means the master can only initiate data communication.
Asynchronous communication – Data transmission is not synced with any external clock signal. it may be transmitted intermittently. In the case of CAN, a bit transmission
CAN Network architecture is like the below image :
As shown in the above figure CAN network is basically made of Node and CAN Bus. Node has basically three components :
ISO mapped the CAN protocol specification with the OSI model according to the above architecture. CAN protocol basically works on three OSI layers: The physical layer, Data Link Layer and Transport layer. Go through this article for detail.
CAN Protocol used two-wire twisted pair cables for CAN Bus architecture to reduce cross-talk and EMI. Please go through this article for detail.
In a Bus topology, a terminator register is used whether in CAN or Ethernet or somewhere else to absorb the signal at the end to avoid reflection. The terminator register must be equal to the impedance generated by the signal(V/I).In CAN usually, 100-120 ohm resistance is used at the end of the differential cable.
NRZ encoding uses to change Controller’s digital signal to the BUS level. Go through the article for more detail.
High-Speed CAN and Low-Speed CAN(Fault Tolerant CAN) is basically two architecture for Node arrangement at the CAN network on the physical layer.ISO codified this architecture in 11898-2(High-Speed CAN) and 11898-3 (Low-Speed CAN). It basically differs in speed and voltage level. Go through this article for detail.
Originally Bosch released CAN specification CAN 2.0 for passenger Vehicles which explains 11- bit identifier frame architecture but later on it was divided into CAN 2.0(A) which is named as the standard CAN to be used in passenger cars dealing with 11-bit Identifiers. At the same time, the other is CAN2.0(B) which is known as extended CAN be used in heavy vehicles like Buses and Trucks it deals with a 29-bit Identifier. So the basic difference in both standards is in the message Identifier field. For detailed frame architecture, Go through this article.
As you have seen in the CAN frame format in the above question only the Arbitration field in the extended frame format only differs from the standard CAN means extended CAN architecture is designed in such a way that standard and extended CAN coexist on the same network. In extended frame format, the IDE bit distinguishes between the standard and extended CAN.
IDE bit is dominant(1) for the Standard frame and recessive for the extended frame. so the standard frame will win arbitration if both have the same 1st identifier field(11-bit).
CSMA stands for Carrier Sense Multiple Access. This concept is used in transmission media access. if multiple ECUs are connected by sharing the same transmission medium to transfer its data then there is the possibility of collision and data corruption if multiple nodes start transmission same time.CSMA introduce two concepts CSMA/CA and CSMA/CD to avoid this situation.
CSMA/CA is carrier sense multiple access /collision avoidance. It is applicable before starts of transmission. The node having CSMA/CA enabled feature first checks the transmission medium status before starting transmission and if BUS is idle(which means not is use) then it will start transmission otherwise it will wait for the bus to be idle. In CAN this feature is introduced by the Arbitration concept. Look at this article for arbitration
CSMA/CD is Carrier Sense Multiple Access/Collision Detection. It is applicable when the data transmission starts. A Node with CSMA/CD-enabled feature detects the collision and stops further data transmission. It will initiate data re-transmission. In CAN this feature is successfully implemented through Bit Monitoring feature of the Transmitter node. Click for detail on the bit monitoring Concept.
There are four types of frames exist-Data Frame to carry Data, a Remote Frame for requesting data from another node, an Error Frame for acknowledging transmission/reception errors, and a last one is overload frame used for wait time requests if the node is busy. Go through from this article for detail.
The data frame will win the arbitration because the arbitration field contains Identifier+RTR. Here identifier is the same but RTR is dominant in the case of the Data Frame while recessive in the case of the remote frame.CAN bus works on wired and logic so 1&0=0. So the final value on the CAN bus will be dominant(0). So Ecu which sends the data frame(RTR=0) will get the same value as that it transmitted while ECU which sent the remote frame will not get the same value and consider that bus is busy and stop further transmission and wait for the bus to be idle and another ECU will continue its data frame transmission
There are 5 types of error that exist in CAN- Bit error, Stuff error, CRC error, Ack Error, and Form Error. Some of the errors are detected by transmitters like Bit errors and ACK errors and some by the receiver like Stuff errors, CRC errors, and Form Errors. Go through this article to know all about error detection.
These states are basically parts of error confinement. Go through this article for detail about these states of a node.
Bit time is the time required to carry a bit on the CAN bus. it is calculated in time quanta, the smallest unit of the bit time. Go through the detail about bit time and its calculation.