Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding checksum on packets

Posted on 2008-10-10
3
Medium Priority
?
618 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 2000 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

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

618 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