bittorrent.org icon indicating copy to clipboard operation
bittorrent.org copied to clipboard

BEP 29: packets with unrecognized IDs

Open povilasb opened this issue 6 years ago • 4 comments

http://www.bittorrent.org/beps/bep_0029.html doesn't specify how one should handle packets whose connection ID is not known for us. For example,

  1. we receive Fin(connection_id=1234) packet.
  2. We have never sent or received Syn(connection_id=1234)
  3. What do we do with the packet?
  • ignore it?
  • send Reset packet back?

Thanks :)

povilasb avatar May 04 '18 09:05 povilasb

In theory a reset packet should be sent in response to a packet with an unknown connection ID, but libtorrent at least ignores such packets. I assume this was done to avoid amplification attacks.

ssiloti avatar May 04 '18 17:05 ssiloti

RST packets should be small, so there shouldn't be any amplification as long as you verify that you're responding to something that has the minimum plausible packet size and rate-limit them. Sure, there's reflections, but those are unavoidable and you get them with TCP or properly-crafted requests too.

the8472 avatar May 05 '18 16:05 the8472

as a separate note, you shouldn't send an RST back to an unrecognised RST packet.

arvidn avatar May 20 '18 18:05 arvidn

Okey dokes, thanks guys, before closing this issue I'll try to do a PR for BEP 29 that specifies this behavior when I'm done with my work on uTP - that might take about 2 weeks though :)

povilasb avatar May 21 '18 05:05 povilasb