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

[BUG] SRTO_MSS = 1300 splits one message into two packets in TSBPD mode. #2589

Closed
maxsharabayko opened this issue Dec 22, 2022 · 4 comments · Fixed by #2591
Closed

[BUG] SRTO_MSS = 1300 splits one message into two packets in TSBPD mode. #2589

maxsharabayko opened this issue Dec 22, 2022 · 4 comments · Fixed by #2591
Assignees
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

maxsharabayko commented Dec 22, 2022

The default configuration in TSBPD mode is

  • SRTO_MSS = 1500;
  • SRTO_PAYLOADSIZE = 1316.

Trying to send a payload exceeding SRTO_PAYLOADSIZE leads to an error returned from srt_sendmsg2(..).
In the live configuration, it is expected that a message must fit into a single SRT data packet.

If SRTO_MSS < SRTO_PAYLOADSIZE, a message will be split into two packets.
For e.g. setting SRTO_MSS = 1300 and sending 1316 bytes long messages would produce two packets per message.

SRT v1.5.1 and prior.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Dec 22, 2022
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Dec 22, 2022
@maxsharabayko maxsharabayko self-assigned this Dec 22, 2022
@ethouris
Copy link
Collaborator

Does this happen even if a message is of a less size than 1300 bytes?

@jeandube
Copy link
Collaborator

AT some point in the evolution of SRT, the default MSS was changed from 1500 to 1360 (payload 1316 + headers), indirectly with the introduction of SRTO_PLAYLOADSIZE (default:1316). From memory, this broke some apps using RTP/SRT causing packet fragmentation and hard to diagnose problems. I suspect that at the time, returning an error in live mode was seen as a preferred behavior than fragmentation.

@ethouris
Copy link
Collaborator

Ah, so the problem was that with modified MSS, the PAYLOADSIZE option should be modified accordingly, that is, if the value of MSS-44 is less than the current payloadsize, it should be set to this value?

@jeandube
Copy link
Collaborator

I though they were synched but never tested the limits. I don't understand which problem SRTO_PAYLOADSIZE fixed. SRTO_MSS exists to prevent IP fragmentation on network's MTU and do it under SRT control (first/middle/last message packet flags). The actual defaults 1500 and 1316 work but are not optimal as 1500-1360 bytes per buffer are allocated but unused.

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 Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants