![]() More importantly, the buffer dynamically grows to the proper size by polling the proc entry for the TCP connection's buffer size (basically poking a hole between layers 3 and 4). ![]() HPN-SSH directly addresses the SSH buffer problem by having a maximum buffer size of around 16MB. So when using SFTP you have to make sure that the TCP receive buffer, the SSH receive buffer, and the SFTP receive buffer are all of sufficient size (without being too large or you can have over buffering problems in interactive sessions). The size of this receive buffer is datagram size * maximum outstanding messages (both of which may be set on the command line). So you end up with what you might as well think of as yet another receive buffer. The outstanding messages may be up to a specific datagram size. Each message may be a command, a result of a command, or bulk data flow. SFTP uses a concept of outstanding messages. This is complicated by the fact that SFTP adds another layer of flow control onto of the TCP and SSH flow controls. Why does this matter? If the receive buffer size is less than the bandwidth delay product (BDP) then you will never be able to fully fill the pipe regardless of how fast your system is. Most modern OSes have a buffer that can grow (using auto-tuning receive buffers) up to an effective size of 4MB. Stock OpenSSH has a maximum receive buffer size of 2MB but this really ends up being closer to ~1.2MB. The end results is that the effective size of the receive buffer is the minimum of the receive buffers of the two sliding windows. The means that you have the SSH sliding window riding on top of the TCP sliding window. The most common implementation basically reimplements sliding windows. This means that SSHv2 has to implement its own flow control algorithm. ![]() As such, the SSH channels are essentially unaware of the underlying flow control algorithm used by TCP. First off, it's important to keep in mind that SSHv2 is a multiplexed protocol - multiple channels over a single TCP connection. I'd like to start with a couple of background items. I'm the author of HPN-SSH and I was asked by a commenter here to weigh in.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |