IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: questions about the window size



Thomas Anderson <zelnaga%gmail.com@localhost> writes:

> Section 5.2 of RFC4254 says:
>
>    The maximum amount of data allowed is determined by the maximum
>    packet size for the channel, and the current window size, whichever
>    is smaller.  The window size is decremented by the amount of data
>    sent.  Both parties MAY ignore all extra data sent after the allowed
>    window is empty.
>
> This is the data transfer packet:
>
> byte SSH_MSG_CHANNEL_DATA
> uint32 recipient channel
> string data
>
> Since string's are defined by RFC4251 as being "stored as a uint32
> containing its length (number of bytes that follow) and zero (= empty
> string) or more bytes that are the value of the string" it's unclear
> weather or not the uint32 length field contributes to the total or not. Any
> ideas?

In this context, it should be the amount of channel data, not including
the size of the string length field or any other ssh protocol headers.
(Unlike the somewhat related global maximum on SSH packet size).

> It is also unclear from this RFC whether or not
> SSH_MSG_CHANNEL_EXTENDED_DATA should be decrementing from the window size
> or not.

DATA and EXTENDED_DATA should be handled in the same way for flow
control. So yes, you should decrement the appropriate window size when
sending or receiving EXTENDED_DATA.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.



Home | Main Index | Thread Index | Old Index