Solved

Adding checksum on packets

Posted on 2008-10-10
3
615 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

719 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