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

Fix incorrect behavior in message mode when too small buffer supplied #2809

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b53a091
[FIX] Calculate correctly max payload size per UDP packet
Mar 1, 2023
a8b9104
Applied verification of the payload size fit. Added tests. Updated do…
Mar 3, 2023
56fdfdb
Withdrawn quotes for option names
Mar 3, 2023
d7f32d0
Fixed links in the socket option table
Mar 3, 2023
70de763
Fixed minimum MSS to 116. Fixed some other bux
Mar 6, 2023
2eb1159
Replaced rand_r with std c++ random
Mar 6, 2023
9f48d3c
Fixed usage of C++14 literals in the test (build failures)
Mar 6, 2023
edbb608
[MAINT] Upgraded CI: ubuntu to version 20.04
Mar 6, 2023
26a7be6
Fixed test logics (printing after closing)
Mar 6, 2023
3d387a2
Attempted fix for a deadlock in test, added some tracking
Mar 6, 2023
03717f3
Merge branch 'dev-upgrade-ci-ubuntu' into dev-fix-ipv6-payloadsize
Mar 6, 2023
3eef592
Added expect and tracking to close socket in ReuseAddr test (Travis p…
Mar 6, 2023
e2ab5f6
Used relaxed signaling for the sake of Travis
Mar 6, 2023
d081e50
Lock debug fix for tests
ethouris Mar 7, 2023
ba5f962
Added timeout for lock-CV to avoid Travis problem
ethouris Mar 7, 2023
320a79b
Attempted more debug for test ipv6 for Travis
ethouris Mar 7, 2023
1b3ccd7
More debug for Travis
ethouris Mar 7, 2023
90b13b1
Fixed test ipv6 to use promise-future for synchronization
Mar 7, 2023
bc4059c
Fixed filtering-out IPv6 tests for Travis
Mar 7, 2023
11574a0
Fixed wrong comment
Mar 9, 2023
fabb85f
Updated with upstream and fixed
Apr 28, 2023
7cc801f
Updated and fixed
Sep 8, 2023
7658145
Fixed a bug introduced during upstream merge
Sep 11, 2023
41a86bf
Fixed tests that should require IPv6 enabled
Sep 11, 2023
45809bd
Pre-refax of change-independent parts for 2677
Sep 18, 2023
c782bf7
Merge branch 'dev-fix-ipv6-payloadsize-prefax' into dev-fix-ipv6-payl…
Sep 18, 2023
848857b
Merge branch 'master' into dev-fix-ipv6-payloadsize
Sep 18, 2023
0c3abe0
A fix from code review
Sep 18, 2023
ce2a043
Apply SOME suggestions from the doc review (others pending)
ethouris Sep 19, 2023
ccfb0b6
Updated and fixed
Sep 19, 2023
422cbed
Merge branch 'master' into dev-fix-ipv6-payloadsize
Sep 19, 2023
fa40417
Some more explanatory comments to enforce checkin
Sep 19, 2023
5c2c876
Apply suggestions from doc review (still pending)
ethouris Sep 19, 2023
0403820
Update doc review (still pending)
ethouris Sep 19, 2023
e02d85a
Apply suggestions from doc review (complete)
ethouris Sep 19, 2023
6074f21
Added extra v6-to-v6 test to check correct payload size
Oct 2, 2023
43d1a9c
Merge branch 'dev-fix-ipv6-payloadsize' into dev-fix-messageapi-error
Oct 6, 2023
9c6e5b5
Added a test that demonstrates the bug
Oct 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from doc review (still pending)
Co-authored-by: stevomatthews <smatthews@haivision.com>
ethouris and stevomatthews authored Sep 19, 2023
commit 5c2c876b530a25b5c80f0d70306bea54d9416045
12 changes: 6 additions & 6 deletions docs/API/API-socket-options.md
Original file line number Diff line number Diff line change
@@ -927,17 +927,17 @@ The default value is 0x010000 (SRT v1.0.0).
Maximum Segment Size. This value represents the maximum size of a UDP packet
sent by the system. Therefore the value of `SRTO_MSS` must not exceed the
values of `SRTO_UDP_SNDBUF` or `SRTO_UDP_RCVBUF`. It is used for buffer
allocation and rate calculation using packet counter assuming fully filled
allocation and rate calculation using a packet counter that assumes fully filled
packets.

This value is a sum of:

* IP header (20 bytes for IPv4 or 32 bytes for IPv6)
* IP header (20 bytes for IPv4, or 32 bytes for IPv6)
* UDP header (8 bytes)
* SRT header (16 bytes)
* remaining space (as the maximum payload size available for a packet)

For the default 1500 the "remaining space" part is effectively 1456 for IPv4
For the default 1500 the "remaining space" is effectively 1456 for IPv4
and 1444 for IPv6.

Note that the IP version used here is not the domain of the underlying UDP
@@ -951,7 +951,7 @@ The IPv6 transmission case is assumed only if the peer's address is a true IPv6
(not IPv4 mapped). It is then not possible to determine the payload size limit
until the connection is established. SRT operations that must allocate any
resources according to this value prior to connecting will assume IPv4 transmission
because this way, in the worst case, they allocate more space than needed .
because this way, in the worst case, they allocate more space than needed.

This value can be set on both connection parties independently, but after
connection `SRTO_MSS` gets a negotiated value, which is the lesser
@@ -988,8 +988,8 @@ the peer is trusted (that is, you can be certain that you will never receive an
packet over the link used for the connection). You should also consider the limitations of
`SRTO_PAYLOADSIZE`.

In the file mode `SRTO_PAYLOADSIZE` has a special value 0 that means no limit
for one single packet sending, and therefore bigger portions of data are
In file mode `SRTO_PAYLOADSIZE` has a special value 0 that means no limit
for sending a single packet, and therefore bigger portions of data are
internally split into smaller portions, each one using the maximum available
"remaining space". The best value of `SRTO_MSS` for this case is then equal to
the current network device's MTU size. Setting a greater value is possible