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

Session layer standards, Session layer protocols consists of NFS, SQL, RPC,...

Session layer protocols consists of NFS, SQL, RPC, Appletalk Session Protocol (ASP), XWindows, and NetBEUI.

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

Define the term - proxy servers, Define the term - Proxy servers These ...

Define the term - Proxy servers These types of firewalls have been further classified into two types: application level gateways and circuit level gateways. The application

Types of ends in wan, There are two types of ends in WAN (1)DTE (DATA TE...

There are two types of ends in WAN (1)DTE (DATA TERMINAL EQUIPMENT) (2)DCE(DATA COMMUNICATION EQUIPMENT)

Odd-even merging circuit, Let us firstly illustrate the idea of merging two...

Let us firstly illustrate the idea of merging two sorted sequences using a odd-even merging circuit. The functioning of a merging circuit is as follows: 1)   Let there be two so

What is tcp/ip, What is TCP/IP TCP/IP is short for Transmission Control...

What is TCP/IP TCP/IP is short for Transmission Control Protocol / Internet Protocol. This is a set of protocol layers that is intended to make data exchange possible on dissim

Rip routes entering and leaving the router, Recognize the command that will...

Recognize the command that will show the RIP routes entering and leaving the router? Ans) Route# debug ip rip

Ip, what is dce

what is dce

Layer responsible for putting 1s and 0s into a logical group, Name the laye...

Name the layer responsible for putting 1s and 0s into a logical group? Ans) Frames are broken down into 1s and 0s and placed onto the physical medium by the Data Lin layer.

Shortest path - network layer and routing , Shortest path  The  dijkst...

Shortest path  The  dijkstra algorithms  four steps to discover what it called  the shortest path  tree . a.The algorithm  beings  to build  the tree identifying  its root.

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