-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added and updated handshake description #351
Conversation
I went through the entire document and made significant changes to hopefully improve readability. Note that there are several questions, indicated by ???, that will have to be resolved before final release of this document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/handshake.md
Outdated
0 1 2 3 | ||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
|1| Message Type | Message Extended Type | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the bar should be directly under the "6", not the "7".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and the less significant digit bar should be also better aligned.
docs/handshake.md
Outdated
The **Extension Flags** subfield in the `Type` field in a conclusion handshake | ||
message contains one of these flags: | ||
|
||
- `HS_EXT_HSREQ`: defines SRT characteristic data; always present | ||
- `HS_EXT_KMREQ`: if using encryption, defines encryption block | ||
- `HS_EXT_CONFIG`: informs about having extra configuration data attached | ||
|
||
The extension block has the following structure: | ||
The above schema shows the HSv5 packet structure that can be split into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above schema shows the HSv5 packet structure, which can be split into
docs/handshake.md
Outdated
3. The KMREQ extension | ||
|
||
Note that extensions are added only in certain situations (as described | ||
above with the handshake process), so sometimes there are no extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above), so sometimes there are no extensions
docs/handshake.md
Outdated
Note that extensions are added only in certain situations (as described | ||
above with the handshake process), so sometimes there are no extensions | ||
at all. When extensions are added, the HSREQ extension is always present. | ||
The KMREQ extension is added only if the encryption is requested (the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The KMREQ extension is added only if encryption is requested (the
docs/handshake.md
Outdated
above with the handshake process), so sometimes there are no extensions | ||
at all. When extensions are added, the HSREQ extension is always present. | ||
The KMREQ extension is added only if the encryption is requested (the | ||
passphrase is set by `SRTO_PASSPHRASE` socket option). There might be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passphrase is set by the SRTO_PASSPHRASE
socket option). There might also be
docs/handshake.md
Outdated
at all. When extensions are added, the HSREQ extension is always present. | ||
The KMREQ extension is added only if the encryption is requested (the | ||
passphrase is set by `SRTO_PASSPHRASE` socket option). There might be | ||
also other extensions following. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant is that the other extensions may appear after HSREQ and KMREQ, not just that they can be present.
docs/handshake.md
Outdated
when the payload was retransmitted. | ||
2. **Retransmission** flag (1 bit). Controlled by `SRT_OPT_REXMITFLG`, this flag | ||
is 0 when a packet is sent the first time, and 1 when it is retransmitted (i.e. | ||
requested in a loss report). When the incoming packet is belated (one with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested in a loss report). When the incoming packet is late (has a
docs/handshake.md
Outdated
is 0 when a packet is sent the first time, and 1 when it is retransmitted (i.e. | ||
requested in a loss report). When the incoming packet is belated (one with a | ||
sequence number older than the newest received so far), this flag allows the | ||
Receiver to distinguish between a retransmitted packet and reordered packet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Receiver to distinguish between a retransmitted packet and a reordered packet.
docs/handshake.md
Outdated
sequence number older than the newest received so far), this flag allows the | ||
Receiver to distinguish between a retransmitted packet and reordered packet. | ||
This is used by the "reorder tolerance" feature described in the API | ||
documentation under "SRTO_LOSSMAXTTL"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation under "SRTO_LOSSMAXTTL".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it also to:
documentation under SRTO_LOSSMAXTTL
socket option.
docs/handshake.md
Outdated
- If both have declared encryption, but have set different passwords, | ||
the Responder will send a KMRSP block with `SRT_KM_S_BADSECRET` value. | ||
the Responder will send a `KMRSP` block with an `SRT_KM_S_BADSECRET` value. | ||
The transmission in both direction will be "scrambled" (encrypted and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transmission in both directions will be "scrambled" (encrypted and
docs/handshake.md
Outdated
direction (forward KMX) is updated. HSv4 relies only on these messages, so | ||
there's no difference between initial and refreshed KM exchange. In HSv5 the | ||
initial KM exchange is done within the handshake in both directions, and then | ||
the key refresh process is started by the sender and it updates the key for one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the key refresh process is started by the Sender and it updates the key for one
docs/handshake.md
Outdated
which the socket was bound. If the cookies are identical (for any reason), the | ||
connection will not be made until new, unique cookies are generated (after a | ||
delay of up to one minute). In the case of an application "connecting to itself", | ||
the cookies will always be identical, and so the connection will never be made). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous closed parenthesis.
between connected parties) over this connection, it may switch to the `Connected` | ||
state just as if it had received a `URQ_AGREEMENT` message. | ||
|
||
4. If the the Initiator is already switched to the `Connected` state it will not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the twice
|
||
1. The Handshake data part (up to "Peer IP Address" field) | ||
2. The HSREQ extension | ||
3. The KMREQ extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to mark somehow this breakdown on the schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/handshake.md
Outdated
Declares the `SRTO_TLPKTDROP` flag of the party. This is important | ||
because both parties must cooperate in this process. In HSv5, if both | ||
directions are TSBPD, both use this setting. This flag must always be | ||
set in live mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not true that this flag must be always set in live mode, although this is default and most recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change last sentence (lines 1181-1182) to:
"While it is not always necessary to set this flag to live mode, it is the default and most recommended setting."
docs/handshake.md
Outdated
|
||
- If the Initiator declares encryption, but the Responder does not, then | ||
the Responder responds with `SRT_KM_S_NOSECRET` status. This means | ||
that the Responder will not be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid confusion here, I'd say it explicitly that it's a string that a Caller can pass to a Listener (it's actually passed from an Initiator to a Responder in general, but in Rendezvous connections this feature doesn't make sense)
.
I'm kinda confused. The comments show text that is completely irrelevant to the cited document parts. Is this document now considered fixed? |
No description provided.