LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2007, 03:57 AM   #1
icortazar3
LQ Newbie
 
Registered: Dec 2007
Location: Madrid
Distribution: Debian mostly
Posts: 2

Rep: Reputation: 0
Unhappy UDP checksum


I am writing a Kernel Module (will become GPL when ended) to backup VANETS using Cellular Data Network (UMTS)

I'm using Netfilter hooks: The idea seems simple you put an OUTPUT hook and if the dest address is in a list of adrresses to be backuped, you change the dest address
Of course you have to recalculate
IP checksum: ip_send_ceck()
Route: ip_route_me_harder()
TCP/UDP checksums these are build using a fake header with ip addresses and ports. After changing an address you haye to call
ip_nat_cheat_check()

The problem is when my hook is called UDP checksum isnīt in place yet, I donīt know where it is calculated (I know that because I always get the same check value but my datagrams have an increasing order field)

Could any one help me?
 
Old 12-19-2007, 03:13 AM   #2
icortazar3
LQ Newbie
 
Registered: Dec 2007
Location: Madrid
Distribution: Debian mostly
Posts: 2

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by icortazar3 View Post
I am writing a Kernel Module (will become GPL when ended) to backup VANETS using Cellular Data Network (UMTS)

I'm using Netfilter hooks: The idea seems simple you put an OUTPUT hook and if the dest address is in a list of adrresses to be backuped, you change the dest address
Of course you have to recalculate
IP checksum: ip_send_ceck()
Route: ip_route_me_harder()
TCP/UDP checksums these are build using a fake header with ip addresses and ports. After changing an address you haye to call
ip_nat_cheat_check()

The problem is when my hook is called UDP checksum isnīt in place yet, I donīt know where it is calculated (I know that because I always get the same check value but my datagrams have an increasing order field)

Could any one help me?

I think I have resolved the problem.

It was related with TOE (Tcp offload engine) and you donīt really need to disable it. The only thing you have to do if you're going to mangle a packet is:
if(skb->ip_summed == CHECKSUM_HW)
skb_checksum_help(skb, 0);
Being skb a pointer to the "socket buffer" of the packet. This call will complete the checksum calculation.
Of course after mangling you have to call ip_send_check() , ip_route_me_harder() and ip_nat_cheat_check()

Cheers
 
  


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
Network boot returns "UDP Checksum Error" iainr Linux - Networking 1 08-06-2009 02:58 PM
uknown url type udp when using a udp tracker fakie_flip Linux - Software 1 08-03-2006 06:03 AM
UDP: Short Packets: and UDP bad checksum: entries in dmesg minutes2memories Linux - Networking 2 02-26-2006 08:28 PM
RFC 868 udp 37 time-udp gpl SUSE / openSUSE 2 03-31-2005 11:07 AM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:58 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration