Session Negotiation

17 views
Skip to first unread message

Noah Voogd

unread,
Mar 31, 2021, 9:58:49 AM3/31/21
to Saros Development
Hi there,

I'm trying to figure what happens during a session negotiation in Saros.

There are some lovely comments in the code that do a great job explaining the interactions that must take place between host and client in order to add the client to a session.

However, one of the steps described there does not appear to take place.
When I look at the traffic between host and client, the 'SNCMP' (Session Negotiation Completed) stanza is never sent. 
Somehow the client is added to the session successfully anyways. How is that possible?

I ask because I'm trying to connect to a Saros session with a NodeJS application.
Everything seems to work well, the host recognizes the 'fake' client, but after connecting and sending the 'COES' (Connection Established) stanza back to the host I don't know what to do next.
The host displays the following at this point: "Establishing connection and performing final initialization...".
According to the code I should send a 'SNCMP' stanza next, but when I do, nothing happens.

As mentioned above, when a legitimate Saros client gets added to a session, there is no trace of a 'SNCMP' stanza. But it somehow still works.

What magic takes place that convinces the host to accept the client into the session?

Any and all help would be greatly appreciated!
Noah

Noah Voogd

unread,
Apr 16, 2021, 4:03:26 AM4/16/21
to Saros Development
Okay, so I've figured out what's happening.

During a session negotiation the client and host set up a bytestream connection between local proxies using the SOCKS 5-protocol.
I didn't realize this before because it's an entirely different connection to where the initial communication takes place and I has somehow assumed that the negotiation 'handshake' would be completed on the connection where it started.
However, the SNCMP stanza is sent via this bytestream connection once the host and client's proxies are connected.
This is actually where most of the data transfer takes place.

The current version of Saros (16.0.1 on Eclipse) also offers the option to switch to communication via In-Band Bytestreams, in which case the communication would happen via IBB stanzas.

Thought I'd answer my own question in case anyone runs into the same problem in the future.

Op woensdag 31 maart 2021 om 15:58:49 UTC+2 schreef Noah Voogd:
Reply all
Reply to author
Forward
0 new messages