Skip to content
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

[FR] Change Packet Timestamping in non-live Configuration #2581

Open
maxsharabayko opened this issue Dec 13, 2022 · 6 comments
Open

[FR] Change Packet Timestamping in non-live Configuration #2581

maxsharabayko opened this issue Dec 13, 2022 · 6 comments
Labels
[core] Area: Changes in SRT library core Epic Type: Enhancement Indicates new feature requests
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

As of now in the live configuration of SRT the timestamp field of a data packet reflects the time the payload was submitted to SRT for sending or the source time for the payload provided by the app.

In other configurations (essentially when TSBPD is disabled), the timestamp field of a data packet reflects the time the packet is being sent over a UDP socket. It also means each retransmitted packet has a different value of the timestamp field.
The latter conflicts with the AEAD mode. The timestamp field is included in the associated data. A packet is expected to be encrypted only once, while the timestamp field will change if a packet is retransmitted.

TSBPD off, AES-GCM on configuration is forbidden by #2573. Hence only live configuration is allowed to use AEAD.

However, there is not much sense in preserving the existing timestamping behavior.
In the non-live configuration, the timestamp field is not used by the receiver. Could be used to estimate transmission delays though.

However, having a unified logic regardless of the configuration makes a lot more sense. It simplifies the code, simplifies the protocol, and allows using AEAD in non-live configurations.

@maxsharabayko maxsharabayko added Type: Enhancement Indicates new feature requests [core] Area: Changes in SRT library core Epic labels Dec 13, 2022
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Dec 13, 2022
@ethouris
Copy link
Collaborator

Note also that transmission delays could be still estimated the same way, just retransmitted packets should not be used for this. It is possible to discard them thanks to the existence of the R flag.

@maxsharabayko
Copy link
Collaborator Author

Not that accurate, because the time between packet submission to the sender buffer of SRT, and actual sending would be unknown. Furthermore, the source time may be supplied by the app.

@ethouris
Copy link
Collaborator

Then the only use of it could be by the application. There might be also an alternative way of flattening the jitter by having TSBPD off, but it will be application's work to deliver packets to the splitter at the right time ("zero latency").

@maxsharabayko
Copy link
Collaborator Author

Right, this would allow #2460.

@teshrim
Copy link

teshrim commented Jul 26, 2023

However, having a unified logic regardless of the configuration makes a lot more sense. It simplifies the code, simplifies the protocol, and allows using AEAD in non-live configurations.

Might this cause folks to simply use AES-CTR for both live and non-live configurations, to avoid the headache/hassle of conditional encryption logic?

@maxsharabayko
Copy link
Collaborator Author

@teshrim

Might this cause folks to simply use AES-CTR for both live and non-live configurations, to avoid the headache/hassle of conditional encryption logic?

Depends on the security requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Epic Type: Enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

3 participants