Ip checksum, Computer Networking

Assignment Help:

This code properly implements the IP checksum function on a 32-bit machine: unsigned short cksum(unsigned short *buf, int count)
{
unsigned long sum = 0;
while (count--) {
sum += *buf++;
if (sum & 0xFFFF0000) {
sum &= 0xFFFF;
sum++;
}
}
return ~(sum & 0xFFFF);
}
The if statement performs "wraparound" if the sum over?ows 16 bits. That is, it takes the 1 that over?owed into the 17th bit and adds it to the lower 16 bits of the sum.

Here's how to compute and check the checksum. The sender should perform these actions:

1. Completely ?ll in the IP header, with zero in the checksum ?eld.

2. Compute the checksum and store it in the checksum ?eld.

The receiver should perform these actions:

1. Copy the checksum ?eld's value into a variable.

2. Zero the IP header's checksum ?eld.

3. Compute the checksum over the IP header.

4. Compare the computed checksum value with the value in the variable.


Related Discussions:- Ip checksum

What are some drawbacks of implementing a ring topology, What are some draw...

What are some drawbacks of implementing a ring topology? In case one workstation on the network varies a malfunction, it can bring down the whole network. Another drawback is t

State the fundamental principles of 3gpp security, Question : a) What ...

Question : a) What does association refer to in IEEE 802.11? b) State the fundamental principles of 3GPP security. c) Explain the term "binding" in Mobile IPv6 d)

Data communications and networks, A magazine publisher based in Nairobi has...

A magazine publisher based in Nairobi has branch in Kisumu, and one in Mombasa. The company has kept in touch by telephone and courier service. Each office is networked. The networ

Define the terms unicasting and multiccasting, Define the terms Unicasting,...

Define the terms Unicasting, Multiccasting and Broadcasting? If the message is sent from a source to a one destination node, it is called Unicasting. If the message is sent

How xor operations can implement key stream attacks, Question: a) In a...

Question: a) In a wireless network where WEP is enforced as security mechanism, what procedure would the network manager adopt for changing WEP default keys. b) Using Pla

Explain about error detection, Q. Explain about Error Detection? Data c...

Q. Explain about Error Detection? Data can be corrupted during transmission because of accidents, Storms, sudden increase in electricity and voltage / decrease in signal power

Determine sonet devices, Sonet Devices STS Mux or DMux either multiplex...

Sonet Devices STS Mux or DMux either multiplexes signals from multiple sources into an STS or demultiplexes an STS into different destination signals. Regenerator is a repea

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd