Ip checksum, Computer Networking

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.

Posted Date: 3/15/2013 1:10:27 AM | Location : United States







Related Discussions:- Ip checksum, Assignment Help, Ask Question on Ip checksum, Get Answer, Expert's Help, Ip checksum Discussions

Write discussion on Ip checksum
Your posts are moderated
Related Questions
Q. Show the Error Correction by Hamming Code? Hamming Code is able to be applied to data units of any length and uses the relationship between data and redundancy bits For i

Illustrate the Bellman-Ford algorithm The Bellman-Ford algorithm uses only on information from its neighbours and knowledge of its link costs, to update it costs and paths. Dij

Difference among the communication and transmission? Transmission is a physical movement of information and concern issues as bit polarity, synchronization, clock etc. Commu

What are the disadvantages of Star Topology? The disadvantages are considered as follows: a. Needs more cable than most topologies. b. Moderately complex to install.

Illustrate the downside of groupware The downside of groupware is that they are very costly and with the increase in complexity or additional features, the cost increases propo

What is redirector? Redirector is software that intercepts file or prints I/O requests and changes them into network requests. This comes under presentation layer.

Data Distribution Data distribution directives tell the compiler how the program data is to be distributed between the memory areas associated with a set of processors. The log

Multistation Access Unit (MAU) Combines individual automatic switches May perhaps daisy chain to support more stations

I have an asignement regarding TCP tunning and optimization. Can you help?

Determine the Objectives of computer security Though computerisation helps a lot in proper organisation of experience, it also opens a Pandora's Box simultaneously. On one