-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Currently we open ports the traditional way, when a client sends a PASV, we bind & listen on the port and wait for the connection. This is fine but when the connection rates go up you can get some congestion issues, especially with a small range ports. It may also expensive to do these bind/listen/accept steps each time for an individual transfer. Additionally, ports that have been assigned to some random client can no longer be reused until the actual accepted connection comes in. So that also opens a possibility for an attack to open many ports in passive mode, and simply not connect to them.
A pooled listener mode would just listen on the passive port range continuously, and accept any inbound connections. The incoming connection is looked up in a table to see which session it's assigned to (if any). Assignment happens via PASV, when a PASV command is issued, the pooled listener would just look for a free port, but basically the full range of ports can be allocated for any individual client IP. Port stealing as a way of DoS would be impossible too.... since the attacker can reserve ports but these assignments are limited to his own IP address, leaving other client IPs unaffected.
So to put it short.. pooled listener mode should greatly reduce contention and allow for much higher i/o concurrency for heavily used ftp servers and/or servers that require limited port ranges.