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
VLAN ( Virtual Local Area Network) is a concept of creating distinct broadcast domains. It is a network which aims at partitioning the physical network. VLAN comprises all the attr

what is gateway?

What are called Fat clients and Fat servers? If the bulk of the application runs on the Client side, then it is Fat clients. It is used for decision support and personal softwa

When using access lists, it is important where those access lists are placed. Which Statement best defines access list placement Ans) Put standard access lists as near the desti

• This device creates one big collision domain and one large broadcast domain.

What is Explicit congestion signalling In general way, for explicit congestion avoidance, the network alerts end systems to growing congestion within the network and the end sy

What is Applets Little programs that can make the Web pages more aesthetically beautiful by means of animations, text, and graphics moving across the screen.



OSPF ( open Shortest Path First) Open shortest  path first  is a routing  protocols  developed for internet protocols networks by the  interior  gateway protocols working group