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

Show the tcp/ip and osi similarities, Q. Show the TCP/IP and OSI Similariti...

Q. Show the TCP/IP and OSI Similarities? TCP/IP and OSI Similarities - Both have Layers - Both have Application Layers - Have Comparable Transport and Network Layer

Explain about gigabit ethernet, Gigabit Ethernet Data rate of 1000 ...

Gigabit Ethernet Data rate of 1000 Mbps or else 1 Gbps Typically implemented as full-duplex with no CSMA/CD 1000Base-X utilizes long-wave optical fiber (1000Base-

Dns - server attacks, DNS - Server Attacks It’s not so easy to list al...

DNS - Server Attacks It’s not so easy to list all the associated attacks as they are evolving way so fast. As any error of flaw is identified, a patch is released in response

command saves the configuration stored in ram to nvram, Which command save...

Which command saves the configuration stored in RAM to NVRAM Ans) copy running-config startup-config is the command which saves the configuration stored in RAM to NVRAM

Why routine security audits are essential, Why Routine security audits are ...

Why Routine security audits are essential It is essential that regular security audits are conducted to find out physically which computer is connected and permits access to

Describe the datawarehouse and data mining, Question 1: ‘There is an ov...

Question 1: ‘There is an overwhelming imperative for organisations to analyse every bit of information they can extract from their huge data warehouses for competitive advant

State the reason for intranet system breaks down, State the reason for Intr...

State the reason for Intranet system breaks down Care must be taken to ensure that proper spare parts are available even after about five years of commissioning. In addition t

Program annotation packages, A fairly renowned approach in this area is Ope...

A fairly renowned approach in this area is OpenMP, a recently developed industry standard for shared memory programming on architectures with uniform memory access characteristics.

Configure the logical topology - configure router1, Configure Router1. ...

Configure Router1. From Host1, connect to the console of Router 1 and establish a console session. Directions for creating a console connection using HyperTerminal are in Appen

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