5

My question has two parts.

First, why must an SSH server have at least a maximum packet size of 32678 bits? It seems a bit excessive for most uses of SSH, excluding file transfer. Is it common for SSH packets to be around this size, or is it meant specifically for file transfer?

Second, would it be ill-advised to ignore the standard, and support a lower maximum packet size? I am developing an SSH stack with very low RAM usage, and I simply cannot afford to support such a large packet size. Can I support, for instance, packets up to 4096, and make sure certain services such as file transfer aren't ever used?

Thanks

user2059810
  • 53
  • 1
  • 3
  • I can't say "why", but if it is in the standard, it is in the standard, and clients can do it whenever they want. Even if you search around in the code of all popular clients, and not a single one uses large packets except for file transfer, there are still unpopular and/or proprietary clients, that people use too. – deviantfan Jul 24 '17 at 18:15
  • Other than that, if you have the resources for an well-behaving TCP/IP stack, I can't really see how you could have a problem. ... Third, I already had lines of sh code that were longer than 4K. – deviantfan Jul 24 '17 at 18:16

1 Answers1

1

First, why must an SSH server have at least a maximum packet size of 32678 bits?

Because it is IETF standard (RFC 4253) and if you want to stay inter-operable with other applications using this standard, you should follow it. If you choose different lover value, sooner or later, you might encounter unexpected errors.

Saying other tools do not support such a large packet is not true. OpenSSH us using max packet size of 256 K.

Second, would it be ill-advised to ignore the standard, and support a lower maximum packet size?

Well ... you can try that. If the implementation is made in the way that there is a single constant which you can later change, you will implement it and see what happens for your clients and your use case. It always depends on what compatibility you are aiming. If you want support few clients you operate, it is probably ok, but if you aim for public service with unknown clients, it might be a bad idea.

Jakuje
  • 5,229
  • 16
  • 31