Ip checksum, Computer Networking

Assignment Help:

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.


Related Discussions:- Ip checksum

Bridge - network layer and routing , Bridge A bridge  operation sin bo...

Bridge A bridge  operation sin both  physical  and data link  layer of OSI model. At physical  layer  it works  like  repeater as it regenerates the  signal  and performs  int

What is meant by middleware, Middleware is distributed software required to...

Middleware is distributed software required to support interaction among clients and servers. In short, it is the software that is in the middle of the Client/Server systems and it

What is multiplexing, What is Multiplexing? Multiplexing is the set of ...

What is Multiplexing? Multiplexing is the set of techniques that permits the simultaneous transmission of multiple signals across a single data link.

Explain hyper cube interconnection networks, Hyper Cube: A Hypercube inter...

Hyper Cube: A Hypercube interconnection network is an expansion of cube network. For n=3, Hypercube interconnection network may be described recursively in this manner:  For n

Wlan technology, Identify and briefly explain any four key requirements tha...

Identify and briefly explain any four key requirements that need to be examined when considering deploying a WLAN technology.

What are the key benefits of layered network, What are the key benefits of ...

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

Low frequency cut-off of the band-pass, Question Approximately what is ...

Question Approximately what is the low frequency cut-off of the band-pass filter shown in the figure?

Network layer - computer network, Network Layer The  internet  network...

Network Layer The  internet  network  layer is  responsible  for moving  network  layer  packets  known data grams  from one host to another. The internet transport  layer pro

Fault tree analysis, FAULT TREE ANALYSIS Reliability engineering, in a ...

FAULT TREE ANALYSIS Reliability engineering, in a nutshell is concerned with failures.   How failures occur, how often they occur, and how to minimize them are the basic proble

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd