Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Channels on SSH-2
- James H. Newman
June 12, 2007, 4:03 pm
rate this thread
when the client wishes to open a channel it sends a SSH_MSG_CHANNEL_OPEN
message, containing a sender channel field, which is an integer to
identify that channel.
The server is supposed to reply with
SSH_MSG_CHANNEL_OPEN_CONFIRMATION, which contains two channel
identifiers: recipient and sender. Here is where the confusion begins.
The standard (RFC 4254, section 5.1) says
"The 'recipient channel' is the channel number given in the
original open request, and 'sender channel' is the channel number
allocated by the other side."
This would seem to imply that 'recipient channel' is here whatever was in
the sender channel field of the matching SSH_MSG_CHANNEL_OPEN message
sent by the client. I would have thought that 'sender channel' must be
whatever channel identifier the server has assigned to this channel -
which may, or may not, be the same as that assigned by the client.
Is this the correct interpretation? What is making me doubt is
that the quotation above seems to imply that 'recipient channel' and
'sender channel' are one of the same - which is of course silly (why
would we need to call them 'recipient' and 'sender' if they are the same?)
Re: Channels on SSH-2
Yes. `Recipient' and `sender' here denote the recipient and sender
of _each individual SSH message_. So whenever I send you a message
about some channel, the sender field indicates my reference number
for the channel (because I'm the one sending _this particular
message_), and the recipient field indicates your reference number
(because you're the one receiving this message). When you reply to
me, you are the sender and I am the recipient, so the two roles are
swapped round and so are the reference numbers.
Have you got confused between `sender' and `server' here, perhaps?
The advantage of doing it this way is that the channel management
code can be shared between an SSH client and an SSH server without
having to flip round the meanings of the fields based on some sort
of state bit. Whether I'm a client or a server, I always put my own
reference number in the sender field of outgoing messages, and
expect to find my own reference number in the recipient field of
Simon Tatham "A defensive weapon is one with my finger on the
- » protocol question - issue with exit-status inside unfinished data stream?
- — Newest thread in » Secure Shell Forum