Computer Networks · TEE · papers

Q4(b) · Internet checksum

2024-12-06 · AI-only Sem V variant

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

Q4(b). Find the 8-bit checksum of 10110001, 10101011, 00110101, 10100001. [5 marks]

Answer

Given

10110001, 10101011, 00110101, 10100001; word width = 8 bits.

To find

Sender checksum and receiver verification.

Formula and why

S=\operatorname{endAroundCarry}(\text{sum of words}),\qquad C=\operatorname{NOT}(S)LaTeX: S=\operatorname{endAroundCarry}(\text{sum of words}),\qquad C=\operatorname{NOT}(S)

One’s-complement addition returns an overflow carry to the least-significant end. Complement only after all words have been added.

Solution

Step 1. Add the words, folding each carry

WordDecimalRaw additionFolded additionRunning binary sum
10110001177177177 + carry 0 = 17710110001
1010101117134892 + carry 1 = 9301011101
0011010153146146 + carry 0 = 14610010010
1010000116130751 + carry 1 = 5200110100

Step 2. Complement every bit

Running sum = 00110100. Change every 0 to 1 and every 1 to 0: checksum = 11001011 (decimal 203).

Step 3. Receiver adds the data and checksum

52 + 203 = 255 = 11111111. All bits are 1; complement gives all zeros. Therefore this intact message passes the checksum check. A matching checksum detects no error; it does not prove that every possible corruption is absent.