Solved

Adding checksum on packets

Posted on 2008-10-10
3
608 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now