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

Explain the term - carrier sense multiple access, What is use of Carrier se...

What is use of Carrier sense multiple access Carrier sense multiple access with collision detection (CSMA/CD) is a form of medium access control in which a station listens to

Data sharing - fundamentals of networks, Data Sharing One of the most ...

Data Sharing One of the most important uses of networking is to allow the sharing of data. Before networking was common an accounting employee who wanted to prepare a report f

Redhat, short note on redhat updation details? why redhat is popular?

short note on redhat updation details? why redhat is popular?

Network control protocols ncp, Network  Control  protocols ( NCP) Th...

Network  Control  protocols ( NCP) The first  ARPANET  networking protocols  was named  simply the network  control protocols in 1970,and  was created by  created by  network

Approach for client - server communication, Client Once the GUI applicat...

Client Once the GUI application is loaded, it will send a request (instance/object of Commands class) to server for a list of files from the server's shared directory.Client wil

Illustrate 802.11b HR DSSS, 802.11b HR DSSS a) High-rate DSSS using a ...

802.11b HR DSSS a) High-rate DSSS using a 2.4 GHz band b) Similar to DSSS excluding for encoding method c) Uses complementary code keying (CCK), encoding 4 or 8 bits to

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

Hardware sharing - fundamentals of networks , Hardware Sharing  ne...

Hardware Sharing  network  facilitate the  sharing  devices. For  example  instead of giving  each of 10 employees in  department  of the internet  on modern society is har

Which layers are network support layers, Which layers are network support l...

Which layers are network support layers? a. Physical Layer b. Data link Layer and c. Network Layers

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