bittorrent.org
bittorrent.org copied to clipboard
BEP 29: packets with unrecognized IDs
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,
- we receive
Fin(connection_id=1234)
packet. - We have never sent or received
Syn(connection_id=1234)
- What do we do with the packet?
- ignore it?
- send
Reset
packet back?
Thanks :)
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.
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.
as a separate note, you shouldn't send an RST back to an unrecognised RST packet.
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 :)