The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
directory checksum error jagan_kalluri UNIX for Dummies Questions & Answers 2 10-16-2008 08:11 AM
checksum jn5519 SCO 3 07-05-2007 07:32 PM
Directory is Same but Checksum is different JustinPyfrom Filesystems, Disks and Memory 3 01-30-2007 07:54 AM
Checksum Key Files adamevans AIX 1 01-22-2007 11:19 PM
Checksum question jigarlakhani Shell Programming and Scripting 1 12-05-2005 10:31 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-28-2008
Registered User
 

Join Date: May 2008
Posts: 8
Disabling IP Checksum Calculation

Hello Friends,
I'm constructing the IP Packets by using the RAW Sockets. If I give any value for VER/TTL/Protocol the packet is being transmitted with that particular values.
But in case of IP Checksum, I'm always getting the correct checksum value irrespective of the value I give.
Can anyone please let me know, who is filling the correct checksum and how to disable it??

Thanks in Advance.

Regards,
Aamir
Reply With Quote
Forum Sponsor
  #2  
Old 05-28-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
Disabling that functions is a feature of most ethernet cards, it's called "TCP checksum offload". Under Linux you have to execute : "ethtool -K eth0 rx off tx off" - replace eth0 if different name is used, and consult the man pages for "ethtool"
Reply With Quote
  #3  
Old 05-28-2008
andryk's Avatar
Registered User
 

Join Date: Sep 2003
Posts: 448
Quote:
Originally Posted by aamirglb View Post
Hello Friends,
I'm constructing the IP Packets by using the RAW Sockets. If I give any value for VER/TTL/Protocol the packet is being transmitted with that particular values.
But in case of IP Checksum, I'm always getting the correct checksum value irrespective of the value I give.
Can anyone please let me know, who is filling the correct checksum and how to disable it??

Thanks in Advance.

Regards,
Aamir
LOL, its the kernel obviously , what option did ya use after opening the socket ???
AFAIK, if you include the ip header (which you did) then the kernel will compute that checksum for you if checksum field is 0 otherwise your packet will be sent using that value... So your problem seems a bit weird to me too
Reply With Quote
  #4  
Old 05-28-2008
Registered User
 

Join Date: May 2008
Posts: 8
Hello,
I'm getting the following error when running "ethtool -K eth0 rx off tx off"
Cannot set device rx csum settings: Operation not supported.

Thanks in Advance.

Regards,
Aamir
Reply With Quote
  #5  
Old 05-29-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
Like I said, this option is available only for certain NICs, it may be the case that you network card doesn't support it. I'm not aware of any other option.
Reply With Quote
  #6  
Old 05-29-2008
Registered User
 

Join Date: May 2008
Posts: 8
Hello Friends,
I was able to do it by using PF_PACKET option and form the entire packet (ie ethernet+ip+udp).
What ever checksum i give for ip is not getting modified now.

Thanks a lot for your help.

Regards,
Aamir
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0