IETF-SSH archive

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

Re: What's "maximum packet size"?



Jacob Nevins <jacobn+secsh%chiark.greenend.org.uk@localhost> writes:

> I believe that this (maximum length of channel data) is the correct
> interpretation. (FWIW, it's what both PuTTY and OpenSSH used, last time
> I looked.)

That's my recollection too (I haven't checked the archives, though).

> The relationship with the transport layer is discussed in the next
> paragraphs, but again it's not entirely unambiguous.

If we accept that "maximum packet size" in the connection layer should
be interpreted in the context of that layer (i.e. it's the size of the
payload in CHANNEL_DATA / CHANNEL_EXTENDED_DATA), I don't think the
relationship is terribly difficult.

For receiving:

  When you advertise a maximum packet size for a new channel, that means
  you are prepared to receive channel packets up to that size. And it's
  your responsibility to ensure that your transport layer implementation
  is comfortable with the corresponding transport-layer packets, which
  may well be larger than the 32768/35000 limits.

For sending:

  When the other side has advertized a large maximum packet size for a
  channel, feel free to generate packets of that size, even if it
  makes the transport packets larger than the 32768/35000 limit. And
  if your transport implementation is unwilling to generate packets of
  that size, just clamp down the advertised value you receive from the
  other end.

If you want to honor the 32768 octet limit on the transport layer, to
get the largest possible "maximum packet size" for a channel, you have
to subtract the CHANNEL_EXTENDED_DATA overhead, which is 13 octets
IIRC.

For simplicity, and to have a little margin, my implementation
restricts the maximum packet size in the connection layer to 32768 -
100.

Regards,
/Niels





Home | Main Index | Thread Index | Old Index