Calculating UDP Checksum - HOW?

Henderieckx Filip Filip.Henderieckx at siemens.atea.be
Fri Jul 19 18:45:52 EDT 2002


Addendum : Some output results

Original Packet
Pre: 139.10.136.58.5000 > 139.10.138.2.5000: udp 152
  45b000ac 9f5f0000 801171e0 8b0a883a 8b0a8a02 13881388
  00982359 80034242 02f58500 cc13ea62 d61f6b5e 11a4f037
  6b62b2fc a6d06cd6 46409c6c 9065acb1 d60ecccf 90db0ecc
  97d65d84 a611a2b0 c53b3132 e4dcb0f5 7a5734d2 68cf971a
  32c5f4e4 8f3aea62 9535d65d 7c65d1e4 90af6369 b4aa7f4f
  cf8479a9 23668de9 a16c0d54 6710daec 8d24d8d6 dd6ca612
  cfed1626 ab57a669 2d5aa316 eb6668f0 d49a09b4 29cecfb3
  32f37ae4

IP Destination Address rewritten (via STORE)
Stored: 139.10.136.58.5000 > 139.10.136.59.5000: udp 152
  45b000ac 9f5f0000 801171e0 8b0a883a 8b0a883b 13881388
  00982359 80034242 02f58500 cc13ea62 d61f6b5e 11a4f037
  6b62b2fc a6d06cd6 46409c6c 9065acb1 d60ecccf 90db0ecc
  97d65d84 a611a2b0 c53b3132 e4dcb0f5 7a5734d2 68cf971a
  32c5f4e4 8f3aea62 9535d65d 7c65d1e4 90af6369 b4aa7f4f
  cf8479a9 23668de9 a16c0d54 6710daec 8d24d8d6 dd6ca612
  cfed1626 ab57a669 2d5aa316 eb6668f0 d49a09b4 29cecfb3
  32f37ae4

IP Checksum recalculated (via SetIPChecksum)
IPChecksummed: 139.10.136.58.5000 > 139.10.136.59.5000: udp 152
  45b000ac 9f5f0000 801173a7 8b0a883a 8b0a883b 13881388
  00982359 80034242 02f58500 cc13ea62 d61f6b5e 11a4f037
  6b62b2fc a6d06cd6 46409c6c 9065acb1 d60ecccf 90db0ecc
  97d65d84 a611a2b0 c53b3132 e4dcb0f5 7a5734d2 68cf971a
  32c5f4e4 8f3aea62 9535d65d 7c65d1e4 90af6369 b4aa7f4f
  cf8479a9 23668de9 a16c0d54 6710daec 8d24d8d6 dd6ca612
  cfed1626 ab57a669 2d5aa316 eb6668f0 d49a09b4 29cecfb3
  32f37ae4

Trial to recalculate UDP Checksum (via SetTCPChecksum (???))
but some bytes of underlying protocol destroyed (CC13 -> CDDA)
But after this operation the UDP Checksum is correct !!!???
But my packet is destroyed !!!  :-(
TCPChecksummed: 139.10.136.58.5000 > 139.10.136.59.5000: udp 152
  45b000ac 9f5f0000 801173a7 8b0a883a 8b0a883b 13881388
  00982359 80034242 02f58500 cddaea62 d61f6b5e 11a4f037
  6b62b2fc a6d06cd6 46409c6c 9065acb1 d60ecccf 90db0ecc
  97d65d84 a611a2b0 c53b3132 e4dcb0f5 7a5734d2 68cf971a
  32c5f4e4 8f3aea62 9535d65d 7c65d1e4 90af6369 b4aa7f4f
  cf8479a9 23668de9 a16c0d54 6710daec 8d24d8d6 dd6ca612
  cfed1626 ab57a669 2d5aa316 eb6668f0 d49a09b4 29cecfb3
  32f37ae4

IP Rewrite Element used (IP & UDP Checksum changed, Source IP Address
changed)
Post: 139.10.138.2.5000 > 139.10.136.59.5000: udp 152
  45b000ac 9f5f0000 801171df 8b0a8a02 8b0a883b 13881388
  00982191 80034242 02f58500 cddaea62 d61f6b5e 11a4f037
  6b62b2fc a6d06cd6 46409c6c 9065acb1 d60ecccf 90db0ecc
  97d65d84 a611a2b0 c53b3132 e4dcb0f5 7a5734d2 68cf971a
  32c5f4e4 8f3aea62 9535d65d 7c65d1e4 90af6369 b4aa7f4f
  cf8479a9 23668de9 a16c0d54 6710daec 8d24d8d6 dd6ca612
  cfed1626 ab57a669 2d5aa316 eb6668f0 d49a09b4 29cecfb3
  32f37ae4



>  -----Original Message-----
> From: 	Henderieckx Filip  
> Sent:	Friday, July 19, 2002 5:39 PM
> To:	'click at pdos.lcs.mit.edu'
> Subject:	Calculating UDP Checksum - HOW?
> 
> Hi,
> 
> I have following situation :
> 
> CLICK Configuration (partly) :
> 
> -> StoreIPAddress(16) : This element overwrites the Destination IP Address
> -> SetIPChecksum() : This element recalculates the IP Checksum
> 
> But : in case of a UDP packet, it appears that also the UDP Checksum has
> to be recalculated.
> 
> How can I do this?
> 
> I tried the SetTCPChecksum() Element (don't know in fact whether this is
> the correct way to do but I didn't found an SetUDPChecksum element) and
> this Element changes the packet so that the UDP checksum is correct but it
> doesn't change the UDP checksum field. It changes 2 bytes in an underlying
> protocol (e.g. RTP which is under UDP) thereby destroying the correct
> working of this protocol???
> Is this an error in the SetTCPChecksum Element?
> 
> How can this be explained? Or do you have knowledge about other Elements I
> should use to have a correct UDP Checksum
> 
> Note : the IPREWRITER Element seems to automatically update the UDP
> Checksum...
> 
> thanks in advance for your answer,
> 
> kind regards,
> 
> Filip Henderieckx
> 
> 




More information about the click mailing list