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
Describe  the concept of broad cast and multi-cast?

LAN Topologies The term topology explains the geographic arrangement of networking devices. It explains the actual layout of the network hardware. Given the location of worksta

OSI= Open System Interconnection.

Question 1: a. What is xDSL and enumerate the benefit of such a technology? b. Name some of the typical applications of xDSL and the different types and standards of xDSL.

The bitonic sorting network needed log n number of stages for performing the task of sorting the list. The first n-1 stages of the circuit are able to sort two n/2 numbers and the

What is Uniform Resource Locator Address of location for accessing Web pages. Clicking on an icon or "hot text" is the most common means of accessing and using a URL. Typing

What is SAP? Series of interface points that permit other computers to interact with the other layers of network protocol stack is known as SAP.

What is a dedicated server? A network server designated to provide one particular service is known as dedicated server. For example if a computer is assigned for database servi

Explain how the lan model be developed The LAN model can be developed incrementally. If LAN is just a long cable. it cannot be brought down by single failure (if servers are re

Advantages and Disadvantage of Computer Networking Most of the benefits  of networking  can be  divided into  two  generic categories Connectivity and  sharing. Networks