Maximum packet size

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
    In version 2 of the SSH protocol, how is the value of the maximum
packet size M in an SSH_MSG_CHANNEL_OPEN packet to be understood? I see
two possibilities:

    1) M is the maximum value admissible for the packet length field
in a packet; maximum value as far as the party who has sent the
SSH_MSG_CHANNEL_OPEN packet is concerned.

    2) M is the value in the packet length field, plus the length of
that field (always 4), plus the length of the MAC field. That is, M is
the total length of the data actually exchanged when a packet is sent/

    The standard (RFC 4254, section 5.1) seems to support option
number 2, albeit the language is sufficiently vague to allow for option 1
as well.

Re: Maximum packet size

Quoted text here. Click to load it

Neither.  It's the maximum amount of channel data in a packet.  i.e.,
it's the maximum value for the length field of the string embedded in an
well-worded here, but the giveaway is in section 5.2:

   The maximum amount of data allowed is determined by the maximum
   packet size for the channel, and the current window size, whichever
   is smaller.

Since the window size must (to be meaningful) only cover channel data,
to make this comparison meaningful the maximum packet size must also.

More pragmatically, this is what PuTTY and OpenSSH do.

Ben Harris

Re: Maximum packet size

On Mon, 05 Nov 2007 23:23:22 +0000, Ben Harris wrote:

Quoted text here. Click to load it

    Thanks. I just wonder why the standard is so vague here?

Site Timeline