Find the answer to your Linux question:
Results 1 to 2 of 2
I want to write a program to generate udp checksum to validate my progra, I need some real data. I send a udp packet from one machine to another machine, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2012
    Posts
    85

    UDP checksum inconsistency between sender and receiver


    I want to write a program to generate udp checksum
    to validate my progra, I need some real data.
    I send a udp packet from one machine to another machine, the packet can be correctly received by the udp server.
    I captured the packet using tcp dump on both machines

    from the udp client machine, the udp packet and pseudo IPV4 header bytes are(HEX format):
    Code:
     
        pseudo header
        src dst ip:        8a60c948 8a60c96d
        proto_num len: 0011 0016
    
        UDP header:    83d87d000016 a79e 
              data:         49276d206e6f 742068657265210a
    on the udp server machine(receiver):
    Code:
       
        pseudo header
        src dst ip:              8a60c948 8a60c96d
        proto_num and len: 0011 0016
     
        UDP header:          83d87d000016 c2c5 
              data:               49276d206e6f 742068657265210a
    the checksum should be calculated over

    8a60c9488a60c96d0011001683d87d000016000049276d206e 6f742068657265210a

    where the checksum field is replaced by 0x0000

    but we see that the checksum is changed from 0xa79e on the client to 0xc2c5 on the server side. why this change happens? and which is the correct udp header checksum?
    thanks!

  2. #2
    Just Joined!
    Join Date
    Sep 2003
    Posts
    17
    Have you tried sending different UDP packets to see what happens? Maybe you can detect a pattern.

    From the wikipedia page for UDP, the checksum is optional. So it's possible that one or both of the machines you're using is not actually calculating a checksum, and is instead just putting junk in the checksum field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •