LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-14-2007, 05:36 AM   #1
mshenbagaraj
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
Unhappy TCP checksum error


Hi
i was hooking the packet at the NET_IP_LOCAL_OUT or NET_IP_POST_ROUTING and added my AH header to that packet in between IP and TCP headers .....
i reduced the MSS to 1450(by default it is 1500)..because i was adding my AH header after all the packet formation was done i.e)befor hook the packet formation was done......
Also i calculated the check sum in that hook and replaced with that TCP checksum...
when i send lesser than 1500bytes of data..i was able to receive the packets at the receiver...
i was analysing the packet headers in receiver using
Ethereal Analyser........

But when i was tried to send more than 1500 bytes of data for example 5000bytes..i was able to receive the first ACK packet carries first 1500 bytes of data ..for that packet the check sum also showing corrct in ethereal.....but for the next ACK packet which carries next 1500 bytes ethereal is showing check sum error in TCP header...
similar thing is happenig for the proceeding ACK packets (next 1500 bytes of data)and PUSH packets(carries the remaining data)....

i am using Linux kernel 2.6.16.10 version........
i am not sure the problem is at the sending side or receiving side...because at the sending side the device driver may change the Checksum...i am not sure the full functioning of device driver...
Please help me on this issue....
I am waiting for the reply...

Thanks & regards
Shenbagaraj.M
 
Old 05-14-2007, 03:13 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
If the first packet has right checksum and the second one not, I'd assume you're calculating checksum for incorrect data block or you're not including the AH header.

I understand the IP checksum is correct. It would mean it's either AH or TCP header. Look into that fragment carefully, it's probably something very simple. Also, if you have a debugging console where you can print something, write checksums after calculating it for one header after another (depending on the function you use; which should in fact calculate it all correctly if you give it correct packet boundaries). It should show something.
 
Old 05-15-2007, 04:52 AM   #3
mshenbagaraj
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
thanks for the reply.....-
do i need to include AH header in calculating checksum..if so then what are the fields i need to include from that Ah header....
please reply ...
 
Old 05-16-2007, 02:43 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You don't include AH in TCP checksum, that's quite important.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tcp checksum incorrect x1228 Programming 1 09-11-2006 03:53 AM
TCP header checksum live_dont_exist Programming 16 04-13-2005 12:45 PM
checksum error, sorry i_want_help Linux - Software 1 03-30-2004 03:42 PM
anyone can help me with the TCP checksum? vaaub Programming 1 02-10-2004 01:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration