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
Question: (a) By making use of an example, explain the Cohen-Sutherland line clipping algorithm. (b) Compare and contrast between the CMY and RGB colour models. (c) Expla

Path  Overhead It is part  of SPE  and contain followings  information: Performance monitor of synchronous transport , signal , path , track ,parity ,checks,  and path  status.

Security Security  is the  protection of hardware software and data  from  unauthorized access. Restricted physical  access to computer password protection limiting  user priv

CSMA/CD - A Simple Definition A network station wishing to broadcast will first check the cable plant to make sure that no other station is currently transmit

State about the Bus Topology Comments 1 - Requires less cabling than a star network 2 - If there is a central cable problem entire netwo. rk goes down 3 - Less e

State how the different IP-QoS needs for controling traffic, data and voice applications can be supported in your technology choice from Q7. Describe the specific IP-QoS schemes -

Question 1 Define client and server. Explain the Client server model Question 2 What is a Mainframe System? Write down the features of Mainframe System Question 3

The following issues are decided by the system in the process of message passing: 1) Whether the communication link is established or not 2) Whether the receiver is ready to

Floating Point Representation in Memory 1. Describe the various ways of floating point representation in memory. What is the importance of normalizing the mantissa in this rep

IMPORTANT: The web server should be able to serve HTTP files only. You will not need to implement the directory listing and CGI-bin. Purpose The objective is to implement a H