Networking Forums

Networking Forums > Computer Networking > Linux Networking > Checksum of ip headers : is it changed when switching source and dest addresses ?

Reply
Thread Tools Display Modes

Checksum of ip headers : is it changed when switching source and dest addresses ?

 
 
markryde@gmail.com
Guest
Posts: n/a

 
      09-29-2006, 04:09 AM
Hello,

I am not familiar with the details of the checksum algorithm of ip
headers;
My question is this:

Suppose that I switch source and dest addresses in an IP header of an
IP packet - should the checksum of the ip header be changed ?
Or is the checksum algorithm indifferent to which is the IP src address
and
IP dest address in the ip header ?

Regards,
Mark

 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a

 
      09-29-2006, 07:25 AM

(E-Mail Removed) wrote:

> Suppose that I switch source and dest addresses in an IP header of an
> IP packet - should the checksum of the ip header be changed ?
> Or is the checksum algorithm indifferent to which is the IP src address
> and
> IP dest address in the ip header ?


What is the I here? Is this in a driver? In a user-space program?
Normally, the program that sends the actual packet will compute the
checksum, so you shouldn't need to change it no matter what it is and
whether it's right or not. Unless you're writing part of a network
stack, in which case you should definitely already know this stuff.

DS

 
Reply With Quote
 
David M
Guest
Posts: n/a

 
      09-29-2006, 10:35 AM
On Fri, 29 Sep 2006 00:25:47 -0700, David Schwartz rearranged some
electrons to form:

>
> (E-Mail Removed) wrote:
>
>> Suppose that I switch source and dest addresses in an IP header of an
>> IP packet - should the checksum of the ip header be changed ?
>> Or is the checksum algorithm indifferent to which is the IP src address
>> and
>> IP dest address in the ip header ?

>
> What is the I here? Is this in a driver? In a user-space program?
> Normally, the program that sends the actual packet will compute the
> checksum, so you shouldn't need to change it no matter what it is and
> whether it's right or not. Unless you're writing part of a network
> stack, in which case you should definitely already know this stuff.
>
> DS


Or trying to hide the source of the packet?

--
David M (dmacchiarolo)
http://home.triad.rr.com/redsled
T/S 53
sled351 Linux 2.4.18-14 has been up 1 day 18:35

 
Reply With Quote
 
markryde@gmail.com
Guest
Posts: n/a

 
      09-30-2006, 05:04 AM
David,
thnks!
> Is this in a driver? In a user-space program?


no, it is not a user-space program but a driver (kernel module). But I
am a newbie in
this and I am not sure wheter the checksum of the IP header is changed
when
src and dsr addresses are switched when we are talking about kernel
space.

Regards,
Mark





David Schwartz wrote:
> (E-Mail Removed) wrote:
>
> > Suppose that I switch source and dest addresses in an IP header of an
> > IP packet - should the checksum of the ip header be changed ?
> > Or is the checksum algorithm indifferent to which is the IP src address
> > and
> > IP dest address in the ip header ?

>
> What is the I here? Is this in a driver? In a user-space program?
> Normally, the program that sends the actual packet will compute the
> checksum, so you shouldn't need to change it no matter what it is and
> whether it's right or not. Unless you're writing part of a network
> stack, in which case you should definitely already know this stuff.
>
> DS


 
Reply With Quote
 
Christopher Layne
Guest
Posts: n/a

 
      10-02-2006, 08:26 AM
(E-Mail Removed) wrote:
> no, it is not a user-space program but a driver (kernel module). But I
> am a newbie in
> this and I am not sure wheter the checksum of the IP header is changed
> when
> src and dsr addresses are switched when we are talking about kernel
> space.


Bothered to look at any of the pre-existing kernel-space code out there, for
instance, ipt? Working within kernel land is not to be taken lightly. Sounds
like some form of rudimentary proxying or naive NAT-ing of some sort.

Boy that was hard, first hit in google for "tcp checksum":

http://www.netfor2.com/tcpsum.htm
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables port forwarding for specific source addresses ynotssor Linux Networking 22 08-30-2008 03:52 AM
1000 IP packets with different SOURCE&DESTINATION addresses generator/simulator song_winter@hotmail.com Linux Networking 6 07-17-2007 10:57 PM
iptables: allow multiple source addresses jqpx37 Linux Networking 7 10-04-2006 10:15 PM
Choosing the source IP if multiple addresses are bind to one inter circle Windows Networking 3 11-29-2005 06:13 PM
How to handle TCP checksum, if adapter support TCP checksum offloading? Rajesh Gupta Windows Networking 0 08-02-2004 11:20 PM



1 2 3 4 5 6 7 8 9 10 11