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

Process server, Using a process server (such as inetd or xinetd) to listen ...

Using a process server (such as inetd or xinetd) to listen on a set of well-popular ports and start one another server.  I said that it had much to do with overhead.  Say you set u

Tech ed, can you help me convert binary into decimals?

can you help me convert binary into decimals?

Show the traffic profiles, Q. Show the Traffic profiles? Constant-...

Q. Show the Traffic profiles? Constant-bit-rate traffic - ADR=PDR No MBS Variable-bit-rate traffic ADR != PDR Small MBS Bursty traffic

Round trip time and time out - transport layer, Round Trip Time (RTT) and T...

Round Trip Time (RTT) and Time Out The  size and  the complexity  of computer  networks  have grown  in past years. To achieve  an efficient  and reliable transmission  some

Introduction of dns - domain name server, Introduction of DNS While di...

Introduction of DNS While discussing about the Internet, one things comes automatically in the n=mind and hence it is directly or indirectly depended on DNS. The DNS which sta

Program for two library methods with thread , #include void subdomain(...

#include void subdomain(float x[ ], int istart, int ipoints) { int i; for (i = 0; i x[istart+i] = 123.456; } void sub(float x[ 10000], int npoints) {

How network gateway is different from routers, Gateway A device linked...

Gateway A device linked to multiple physical TCP/IP networks capable of routing or delivering IP packets among them. Router It's a layer 3 device that connects 2 diss

Filtering incoming frames, FILTERING INCOMING FRAMES: An analyzer may ...

FILTERING INCOMING FRAMES: An analyzer may be configured to process and filter frames. It may count frames of a specific size or type. It may also shows only frames from or to

Shared memory programming, We know that all processors share a common memor...

We know that all processors share a common memory in shared memory model. Every processor, however, can be assigned a different part of the program stored in the memory to implemen

Describe the different steps in distributed problem solving, QUESTION (...

QUESTION (a) Four important benefits of Multi-Agent Systems are modularity, efficiency, reliability and flexibility. Briefly explain these benefits (b) Agents work together

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