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] Payload size rules are tied to IPv4 only #2663

Open
ethouris opened this issue Feb 14, 2023 · 0 comments · May be fixed by #2677
Open

[BUG] Payload size rules are tied to IPv4 only #2663

ethouris opened this issue Feb 14, 2023 · 0 comments · May be fixed by #2677
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@ethouris
Copy link
Collaborator

The internal rules to calculate the maximum payload size for the SRT packet are largely based on the size of 28, which is 8 bytes for UDP header and 20 bytes for the IPv4 header (as mentioned in #2662). This calculation doesn't apply to IPv6, however.

Affected are:

  • The SRT_LIVE_MAX_PLSIZE constant in srt.h header
  • The CUDT::m_iMaxSRTPayloadSize field, which is used also to calculate the allocation size for the packet's payload

Potential problem: Sending a file over IPv6, which is the case when the maximum SRT payload size is used, may set an oversize to an MTU because it is assumed that the maximum UDP payload is 1492, while for IPv6 it's 1460 for the standard 1500 MTU. The live mode is unaffected only because it has the 1316 payload size, which fits in both IPv4 and IPv6 frames.

Potential solution: The CUDT::open() function is called everywhere in conditions where the expected (although not always already allocated) socket family is already known. This family identifier must be passed to it, and then down to CUDT::clearData so that the correct maximum payload size depending on the IP version is defined.

@ethouris ethouris added the Type: Bug Indicates an unexpected problem or unintended behavior label Feb 14, 2023
@ethouris ethouris added this to the v1.6.0 milestone Feb 14, 2023
@maxsharabayko maxsharabayko added the [core] Area: Changes in SRT library core label Sep 18, 2023
@maxsharabayko maxsharabayko modified the milestones: v1.5.4, v1.6.0 May 27, 2024
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.

2 participants