1
\$\begingroup\$

This Link says a that :Use of sequence numbers fixes the duplicate error.

When can duplicate message end up at a receiver?

If a node detects an error, it sends out an error flag and when all the other receiving nodes detect the error, they too send out error flags and destroy the received message. The transmitter then resends the message again.

Im not aware of the possibilities of a duplicate messages being received...

Plz Help as i must decide if sequence number must be used or not in my messages.

Thanks

\$\endgroup\$
1
\$\begingroup\$

The presentation you linked to talks about a situation where a receiver accepts a message, but a transmitter recognizes the same message as incorrectly transmitted. Currently I don't understand exactly how that would happen, but I guess a receiver could use data from a frame where the ACK bit does not get set for any reason, which causes the transmitter to resend the frame.

IMO the exact reason why this can or would happen is irrelevant, but instead you have to think about the kind of data that you are transmitting: if you periodically send e.g. the current value of a sensor reading over the bus a retransmission will not be a bad thing. If on the other hand your message contains a small chunk of a larger data block then resending that part will cause the larger block to be corrupt. This is the reason why protocols like CCP or XCP contain a message counter.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ "a transmitter recognizes the same message as incorrectly transmitted" I suppose this could be caused by noise on the Rx line, between the CAN transceiver and the MCU? Those signals are not differential, and plain TTL levels. So given a poor PCB design, it is quite possible you could get problems with them, especially at higher baud rates. \$\endgroup\$ – Lundin Mar 9 '16 at 8:00
  • \$\begingroup\$ The truth is, if your CAN nodes receive messages inconsistently, the whole system is broken. Message counters won't help, you'll have to fix the bus if you want it to work. The reason why XCP has a message counter is because it supports unreliable transmission media such as Ethernet. \$\endgroup\$ – Dmitry Grigoryev Mar 9 '16 at 8:54
  • \$\begingroup\$ @0x6d64- Yes il be sending data in packets(big block in small chunks). \$\endgroup\$ – AlphaGoku Mar 10 '16 at 10:53
  • \$\begingroup\$ @Lundin- Ur situation seems possible. A transmitter sends a message, the receivers receive the msg with no errors but the ACK flag at the transmitter end doesnt become dominant and stays recessive due to noise/failure of the RX pin between the Tranceiver and MCU. This will cause the transmitter to resend the message & increase transmit error counter(upto 127 before going to error passive). But when the transmitter sends out an error flag(when in error active), wont the receivers destroy the received message? \$\endgroup\$ – AlphaGoku Mar 11 '16 at 4:27
  • \$\begingroup\$ @0x6d64- Yes il be sending huge data fragmented into smaller packets. \$\endgroup\$ – AlphaGoku Mar 11 '16 at 4:27
0
\$\begingroup\$

Possibility 1:

The point of time at which a message is taken to be valid, is different for the transmitter and the receivers of the message. The transmitter checks all bits until the end of END OF FRAME field. Receivers consider a message valid if there is no error until the last but one bit of END OF FRAME. The value of the last bit of END OF FRAME is treated as dont care, (a dominant value does not lead to a FORM ERROR). This difference in the interpretation of a valid transmission/reception of a message can give rise to inconsistent message omissions/duplicates. If a transmitter detects that the last bit is a dominant instead of a recessive,it will resend. The receiver has no clue that this is a duplicate message because it did not consider the previous message as an error.

Reference for the answer

Overload frame conditions

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ But now that the transmitter knows that its an error, does it retransmit the message with no error flag? Or does it send an error flag and then retransmit? If it sends an error flag and then retransmits, when the receivers detect an error flag sent by the transmitter, wont they destroy the previously received messages??? So again, duplicate messages wont be received at the nodes.. Still confused about the answer i posted as the link does not talk about this scenario i have mentioned. Plz help \$\endgroup\$ – AlphaGoku Mar 14 '16 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.