How do I send TCP packets with packETH?

0

I want to send packets to 127.0.0.1:11311 with packETH. However, there are some problems I cannot solve.

Here's some screenshots: (click to zoom in)

enter image description here

enter image description here


  1. In IPv4 data ("Header length")

    Header length of the packets I want to send is 20. However the "Header length" only accepts a one digit number. How can I solve this kind of problem?

  2. The packets I want to send didn't specify "TOS"(In IPv4 data) & "urgent pointer"(In TCP data)

    Are these two arguments important when sending TCP packets?

  3. In IPv4 data ("options 0x")

    The TCP data options of the packets I want to send is 0x12. However it kept showing an error message:

    Wrong length of tcp options field(length mod 8 must be 0)

    0x12 mod 8 should be zero, I also tried 0x08, 0x00...etc but the error message didn't change.

    I have no idea why this happens, is it relevant to "Header length"?

Po-Jen Lai

Posted 2012-04-21T18:20:28.193

Reputation: 103

The error tells you that the options field must be multiple of 8's. In most cases the TCP packet is 20 bytes with no options field. – 0xab3d – 2012-04-21T18:25:36.357

Answers

0

  1. The IPv4 header length field is interpreted as multiples of 4 octets. IPv4 headers are almost always 20 octets long, so this field's value is almost always 5.

  2. Nope, the TOS/DiffServ bits and urgent pointer are usually not important.

  3. This field is looking for a value, not a length. When you entered 0x12 or 0x08 or 0x00 thinking you were entering a length, you were actually just entering a single octet value. 1 mod 8 != 0. I'm guessing the packet you were trying to mimic had a 12-octet TCP Timestamp value in there. Also note that the TCP Timestamp option needs to be aligned on a 4-byte boundary from...the start of the TCP headers, if I recall correctly..., so you might need to put some one-octet 0x00 "Nop"/No-op TCP options in there as well, depending on how things align.

Spiff

Posted 2012-04-21T18:20:28.193

Reputation: 84 656