tracepkt icon indicating copy to clipboard operation
tracepkt copied to clipboard

TCP packet support

Open PaulFurtado opened this issue 5 years ago • 0 comments

How challenging do you think it would be to add TCP support? I'm diving into the code myself and looking at potential gotchas so I'm wondering what you think as well.

Currently, it filters using icmpid, which is a great trick, but that wouldn't work for TCP. For TCP, it may be possible using a FWMARK, however, those are lost when the routing across network namespaces. Instead, I'm guessing I'd need to possibly:

  1. Create a TCP socket on the python side
  2. Bind the source port before sending any packets
  3. Connect
  4. Track every time iptables modified the source/dest IPs

Alternatively, I guess I could track the TCP sequence numbers rather than the source/dest which might be more reliable.

What do you think?

PaulFurtado avatar Jun 14 '19 04:06 PaulFurtado