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

State the characteristics of thinnet, Thinnet Characteristics Short...

Thinnet Characteristics Shorter range (185 meters) as well as smaller capacity Bus topology LAN Connectors and cables include: thin coaxial cable, NICs and BNC-T

What are firewalls, What are firewalls? Firewalls serve to protect an i...

What are firewalls? Firewalls serve to protect an internal network from external attacks. These external threats can be hackers who need to steal data or computer viruses that

Error correcting code - hamming code, Error Correcting Code - Hamming Code:...

Error Correcting Code - Hamming Code: Hamming code is the one of the error-correcting code named after its inventor. Because of the simplicity of the hamming code, it can dete

Describe the importance of backups, Question: (a) Describe the importa...

Question: (a) Describe the importance of backups and the use of antivirus software. (b) With the help of an example/ illustration, explain the term encryption and explain

Define router. explain its type, Question 1 Define Router. Explain its typ...

Question 1 Define Router. Explain its type Question 2 List and discuss the different concepts of EIGRP Question 3 Explain the concept of autonomous system Autonomo

State about the communications network, State about the communications netw...

State about the communications network 1) The communications network may only accept blocks of data up to a specific size.   (2) Error control might be more effective with a

What is the mesh network, A network in which there is multiple network link...

A network in which there is multiple network links among computers to provide multiple paths for data to travel.

Overview of the transport layer protocols, Overview of the Transport  Laye...

Overview of the Transport  Layer Protocols Transport layer  can be  available  more than  protocols  to the  network  applications. For  example the network  applications. For

What are the disadvantages of star topology, What are the disadvantages of ...

What are the disadvantages of Star Topology? The disadvantages are considered as follows: a. Needs more cable than most topologies. b. Moderately complex to install.

Advantages of configuring virtual local area network, Many benefits of conf...

Many benefits of configuring VLAN as listed below: • Performance Enhancements: It reduces heavy load on the network by permitting operations at lower latencies by using VLAN t

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