chiark / gitweb /
New peer option `-mobile': follow rapid IP address and port changes.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 27 Jun 2011 02:26:00 +0000 (03:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 Mar 2012 15:54:35 +0000 (15:54 +0000)
commit6411163d48434575eaf49463e056e971a2fba16a
tree5462206f06f780bff9a4d34c38e7ff62bd822bcc
parent8743c77697568c88131c3c39a0b1e002e1fa09a0
New peer option `-mobile': follow rapid IP address and port changes.

Mobile devices on 3G networks can change apparent IP address and port
numbers rapidly.  If any peer has the `-mobile' flag (PSF_MOBILE) set,
and a MSG_PACKET message arrives from an unexpected source, see if any
of the `-mobile' peers can decrypt it: if so, update the peer's address
rather than rejecting the packet.

This is inefficient because it involves a linear search of the peer
list.  If this turns out to be a problem, we can make some protocol
changes (e.g., inserting a peer hint into the packet) later.

Note that an adversary can deny service by capturing legitimate packets
from a mobile source and sending them on with a different address.  The
peer will assume that the target's address has changed.  But to make
this work effectively, the adversary's packet has to reach the target
before (or instead of) the legitimate one, or else the bogus packet will
be rejected for having a duplicate sequence number.  The next packet
received unmodified from the source will switch the target's idea of the
source's address back again anyway.  An adversary who can consistently
prevent packets from being delivered can trivially deny service anyway,
so this isn't actually much of a concern.
mon/tripemon.in
peerdb/peers.in.5.in
py/tripe.py.in
server/admin.c
server/peer.c
server/tripe-admin.5.in
server/tripe.h
svc/connect.8.in
svc/connect.in