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 is client/server, What is client/server? Client/server is a type o...

What is client/server? Client/server is a type of network wherein one or more computers act as servers. Servers give a centralized repository of resources like printers and fil

Give the solutions to the threats, Give the solutions to the threats In...

Give the solutions to the threats In order to implement solutions to the threats, it is advisable that the company should maintain proper password protected hardware. Wherever

operational amplifier and peak detector circuit, Question The operatio...

Question The operational amplifier in the peak detector circuit shown in the figure below is powered from plus and minus 15 V. If Vout is at 1V and Vin is at 0.5V, at approxima

Error detection-general, Q. Error Detection-General? Sender transmi...

Q. Error Detection-General? Sender transmits every data unit twice Receiver performs bit-by-bit comparison between those two versions of data. Any mismatch would

Explain the acknowledged connectionless service, Explain the Acknowledged c...

Explain the Acknowledged connectionless service This is a cross between the previous two services. It provides that datagrams are to be acknowledged, but no prior logical conne

Use of coaxial cable, Has a central core conductor covered in an insulating...

Has a central core conductor covered in an insulating sheath encased in an outer conductor of metal foil  RG numbers indicate physical specs such as thickness and type of insula

Explain the different signal propagation behaviours, Question : (a) Lis...

Question : (a) List down and explain the different signal propagation behaviours that radio waves exhibit. (b) Explain the term Delay Spread with reference to signal propaga

What is remote procedure call, What is Remote Procedure Call (RPC)? RPC...

What is Remote Procedure Call (RPC)? RPC hides the intricacies of the network by using the ordinary process call mechanism familiar to every programmer. A client process calls

What is frequency borrowing, What is Frequency borrowing In the simples...

What is Frequency borrowing In the simplest case, frequencies are taken from adjacent cells by congested cells. The frequencies can also be assigned to cells dynamically.

Analogue and digital, This assignment consists of both combinational logic ...

This assignment consists of both combinational logic circuit and analog counterpart to perform logical operations based on the given conditions. The first objective of this assignm

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