scapy icon indicating copy to clipboard operation
scapy copied to clipboard

DRAFT: Add support for MPTCP

Open RuiCunhaM opened this issue 4 years ago • 3 comments

Checklist:

  • [x] If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • [ ] I squashed commits belonging together
  • [ ] I added unit tests or explained why they are not relevant
  • [ ] I executed the regression tests for Python2 and Python3 (using tox or, cd test && ./run_tests_py2, cd test && ./run_tests_py3)
  • [x] If the PR is still not finished, please create a Draft Pull Request

fixes #3333

RuiCunhaM avatar Aug 15 '21 16:08 RuiCunhaM

Hi & thanks for the PR ! (sorry for the delay) A few comments:

  • you can re-implement your MPTCP dissection module by creating a Scapy packet layer. This will be much faster and will already support building (+ it's much closer to the "scapy spirit")
  • you can probably implement that directly into scapy/layers/inet.py

Supporting this extension would be a nice feature ! Thanks for your interest on that

gpotter2 avatar Aug 31 '21 21:08 gpotter2

Hi! Thank you for your answer! I think I understand what you're suggesting, once I have the time again I'll give it a try.

RuiCunhaM avatar Sep 01 '21 18:09 RuiCunhaM

@gpotter2 Sorry for tagging you but I finally had the time to get back to this, and I must confess that I'm now confused by what you suggested before.

I can't quite figure out how I'm supposed to use a Scapy packet layer in the current options parsing of the TCP. I know that at some point there was something like a TcpOption class that could be extended, but now, with the current format, using structs directly when parsing and encoding options I don't understand how this would fit. Should I call directly decode/encode methods from the Packet class or something similar?

I'm sorry if this is something trivial that I'm missing, but if you could elaborate a bit more on how a Packet layer can be used directly with the current logic I would appreciate it.

Thanks in advance.

RuiCunhaM avatar Nov 22 '21 16:11 RuiCunhaM

@RuiCunhaM Do you have an example pcap handy?

stryngs avatar Dec 06 '22 08:12 stryngs

Hello @stryngs. I believe the ones in the tcpdump tests cover most of the options in the protocol.

RuiCunhaM avatar Dec 06 '22 18:12 RuiCunhaM

Hello,

Just in case you need more MPTCP (mostly v1) traces, feel free to look at: https://github.com/multipath-tcp/packetdrill/files/7958963/traces.tar.gz (from https://github.com/multipath-tcp/packetdrill/pull/76)

matttbe avatar Dec 07 '22 11:12 matttbe

Closing for inactivity.

gpotter2 avatar Feb 03 '24 15:02 gpotter2