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

WAN, what is a WAN

what is a WAN

What is an interrupt request, Question: a) Briefly describe the purpos...

Question: a) Briefly describe the purpose of Windows Powershell? b) Name three ways software can be installed on Linux? c) What is an interrupt request? d) As the

Analogue and digital, This assignment consists of both combinational logic ...

This assignment consists of both combinational logic circuit and analog counterpart to perform logical operations based on the given conditions. The first objective of this assignm

Developing prototypes - digital receipts, Increasingly it is the quality of...

Increasingly it is the quality of the interface of mobile phones that are giving competitors the edge.  Users not only make selections based on cost but also functionality and cert

Fixed version of rdt , Fixed version of rdt 2.0 rdt 2.1 The  rdt 2.1 s...

Fixed version of rdt 2.0 rdt 2.1 The  rdt 2.1 sender and receiver  FSM each now  have  twice  as many  states  as before. This is because  the protocols  state must  now refle

Computing the class of an address, Whenever it manage a packet, IP software...

Whenever it manage a packet, IP software requires to separate the receiver address into a suffix and prefix. Classful internet addresses are self-identifying because the class of t

How do you disable cdp on the whole router, By using this command Router(c...

By using this command Router(config)# no cdp run we can disable CDP on the entire Router

What is fcs, FCS= Frame Check Sequence CRC (Cyclic Redundancy Check) alg...

FCS= Frame Check Sequence CRC (Cyclic Redundancy Check) algorithm runs in switch that known as FCS (Frame Check Sequence)

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