Stranger
Stranger

Reputation: 862

Networks - Bit Stuffing

I have this question about networking regarding bit stuffing. I am slightly confused about the answer provided. Please help me understand it.

QUestion: When bit stuffing is used, is it possible for the loss, insertion, or modification of a single bit to cause an error not detected by the checksum? If not, why not? If so, how? Does the check sum length play a role here?

Answer: It is possible. If data is 01111110 -> 011111010 if the second 0 is lost due to transmission error, 01111110 will received, which can be interpreted as end of frame. The bits before the end of the frame will then be interpreted as the checksum. If the checksum is 4 bits, there is 1 chance in 24 that these random bits will be interpreted as a valid checksum. The longer the checksum, the less likely that this mistake will happen

I did not understand the bolded part. What does it mean that there is 1 in 24 chance that it will be interpreted as a valid checksum? I will be happy if someone could clarify it for me please.

Upvotes: 2

Views: 2804

Answers (2)

juicy
juicy

Reputation: 31

Sorry for the necro response but I have the answer to this in case anyone stumbles upon this question when doing their homework :D

The "1 in 24" answer you provided is wrong. A checksum of length 4 actually has a 1 in 16 (2^4) chance of being valid. Such an event is clearly less likely with increasing checksum length as increasing the length of the checksum by one decreases the likelihood by half.

Upvotes: 3

Srdjan Grubor
Srdjan Grubor

Reputation: 2675

Short checksums will only help identify faulty transmission with a small number of bits wrong. For example:

-1 checksum bit + byte of data will detect correctly one bit wrong in the data but two bits wrong may cause checksum to be evaluates as correct.

-2 checksum bits (depending on the implementation) + byte of data can identify 2 faulty bits in any location of data.

-Once you reach 4 bits of checksum per byte (1/2 ratio) you can even correct the wrong bits in both checksum and the data (RAID arrays use this)

Upvotes: 0

Related Questions