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
Explain about the Middleware support All the connectivity interface related tools come under the category of middleware. Middleware provides the link for data exchange between

DNS ID hacking The Dns use ID system in order to keep track of each every request and replies. In order to spoof the DNS’s response, the hacker needs to do ID Hacking. In orde

There are two dominant forms of building distributed systems: client-server systems, i.e. systems in which one machine acts as a server and act as clients; and peer-to-peer systems

10Base2 - Thinnet Cable diameter is about 0.64 cm (RG-58) More flexible as well as easier to handle and install than Thicknet "2" represents a maximum segment len

Repeaters - Operate only in physical layer - Connects two segments of the same LAN - Both segments must be of the same protocol - Only forwards frames; does not filter

Skype is a web-based service which offers cheap and free phone calls. Explain step by step (in terms of networking technology) what really happens from the point when you initiate

How receiver detects error The frame is 10011101. The generator is 1001. The message after appending the three zeros is 10011101000. The reminder on dividing 10011101000 by 100

What are the key benefits of layered network? Main advantages of layered network are given below: a) Complex systems can be split into understandable subsystems. b) Any f

can u send me a hacking software of face book for free

Application Layer The  application layer is where  network  applications and their  application layer protocols  reside. The internet application layer includes many protocols