Maximum packet size negotiation

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

    In version 2 of the SSH protocol family, the maximum packet size  
(MPS) negotiation is started when one of the parties (the client,  
typically) sends an SSH_MSG_CHANNEL_OPEN with its proposed MPS. Then the  
other party (the server) sends back an SSH_MSG_CHANNEL_OPEN_CONFIRMATION  
with its proposed MPS.

    Now if I understand it correctly this will all happen before the  
server knows what type of interaction the client intends to launch. It is  
true that one of the pieces of information included in the  
SSH_MSG_CHANNEL_OPEN is the channel type. But the client sets it to  
"session" for both interactive sessions and file transfer ones with SCP.  
Wheter this session will be interactive or otherwise is something to be  
found later on when the client sends an SSH_MSG_CHANNEL_REQUEST.  

    On this basis, it would seem to be impossible for the server to  
specify different MPSs, depending on whether the session will be  
interactive or otherwise. However, the SSH RFCs (4253, section 5.3)  
recommend negotiating smaller MPSs for interactive sessions.

    What am I missing? How can the server make such a decision?

Site Timeline