Maximum packet size - SSH

This is a discussion on Maximum packet size - SSH ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Maximum packet size

  1. Maximum packet size

    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/
    received.

    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.


  2. Re: Maximum packet size

    In article ,
    K. Jennings wrote:
    > 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/
    >received.


    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
    SSH_MSG_CHANNEL_DATA or SSH_MSG_CHANNEL_EXTENDED_DATA. The RFC is not
    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

  3. Re: Maximum packet size

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

    > In article , K. Jennings
    > wrote:
    >> 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/
    >>received.

    >
    > 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
    > SSH_MSG_CHANNEL_DATA or SSH_MSG_CHANNEL_EXTENDED_DATA. The RFC is not
    > 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.


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


+ Reply to Thread