Solved

Adding checksum on packets

Posted on 2008-10-10
3
610 Views
Last Modified: 2013-11-09
When a packet is sent to IP  from TCP and gets handed over to the NIC, checksum is added for delivery confirmation. I am very familiar with checksums as a means of transmission control.
 
It sounds like it is NOT IP which adds the checksum, but firmware on the NIC card. But it wasn't absolutley clear to me that it was the case.
 
Is it IP that adds the checksum or the NIC card?
0
Comment
3 Comments
 
LVL 8

Expert Comment

by:Thejaka
ID: 22692770
Different checksums may be used on different structures (i.e. packet formats) at different layers/protocols.

The IP (IPv4) header checksum protects only the IPv4 header, while the TCP, ICMP, and UDP checksums provide end-to-end error detection for both the transport header (including network and transport layer information) and the transport payload data.
http://www.erg.abdn.ac.uk/users/gorry/course/inet-pages/ip-cksum.html

Even for TCP, the IPv4 pseudo header checksum is different from IPv6 checksum:
http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Fields_used_to_compute_the_checksum

Additional info:
http://www.vijaymukhi.com/vmis/ip.htm
http://www.vijaymukhi.com/vmis/tcp.htm
0
 
LVL 13

Expert Comment

by:Xyptilon2
ID: 22693689
The checksum is added in layer 4 of the OSI model, the transport layer when talking about the TCP protocol. (not all transport protocols support reliable transmissions with checksums), the checksum is added on layer 4. However, depending on the NIC card it can be added by both the hardware of the software. I believe it is called checksum offloading.

{quote}
Check the value of `flags' in the output of `ifconfig' on the interface you're interested in. If you see `CKO', the hardware is doing TCP/IP checksum calculation; if not, the software stack is.


0
 
LVL 50

Accepted Solution

by:
Don Johnston earned 500 total points
ID: 22693747
There are checksums (or error detection values) added to the traffic at various points while the data is moving down the OSI model.

One of the first places could be the application.

After that layer 4 (tcp or udp) adds a checksum.

http://www.fatpipe.org/~mjb/Drawings/TCP-Header.pdf
http://www.fatpipe.org/~mjb/Drawings/UDP-Header.pdf

With TCP, if the segment is determined to be bad, this can cause a retransmit. But with UDP, the receiving device simply discards the bad segment.

At layer 3, the only part that gets a checksum is the header. Bad data can't be detected.

http://www.fatpipe.org/~mjb/Drawings/IP-Header.pdf

At layer 2, the checksum (cyclic redundancy check) is for the entire frame, just like TCP and UDP. This checksum is created at the NIC.

Unless you're using 802.3 or 802.3 SNAP frames (with LLC type2), no retransmit will ocurr if a bad frame is received. The bad frame is discarded.

http://folk.uio.no/od/tcp-ip-intro/subsection3_2_3.html

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
error log using ftp 7 41
maybe no no httpd.conf 6 49
writing a post to a file that is on same folder and same webserver 5 32
Decrypt string by php 7 34
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question