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
Unbound Transmission Media Unbound transmission media extend beyond the limiting confines of cabling. They give a good communication alternative for WANS. The lack of physical

Network Consultant, My name is Jason Long. I am the CEO of IL Corporation. IL is an investment firm that performs financial services to many organizations. We currently have a

In this part, we shall talk about about message passing libraries. In history, various message passing libraries have been available since the 1980s. These executions differed subs

Q. Define Name Space in domain name system? - All names assigned to machines on an internet - Must be unique; either flat or hierarchical - Flat name space - name is assi

ACK Received If an ACK is received by the  sender. The  SR sender marks  that packet  as having  been received by the receiver.

How can the use of NAT and PAT, be considered a security mechanism? Research the acronym(s) if it is not a part of your collection.

Q. What are the main categories based on which applications of computer network will be categorized? Ans: The main areas under which the applications for computer network will

Q. Explain Types of Redundancy Checks? Parity Check Simple Parity Check Two Dimensional Parity Check / Longitudinal Redundancy Check (LRC) CRC (Cyclic Redund

Q. Show a simplex Stop and Wait automatic repeat request? A simplex Stop and Wait ARQ - Normal Operation - Frame lost - Acknowledgement lost - Acknowledgement de

How Does Network Topology Affect The Cost And Network Performance, Computer Science.