AMWA-TV / nmos-testing

Testing tool for the AMWA NMOS Specifications
https://specs.amwa.tv/nmos-testing/
Apache License 2.0
38 stars 48 forks source link

Test suite IS0502, test_18 violates SDP RFC 8866 port parity rule #750

Open alabou opened 1 year ago

alabou commented 1 year ago

test_18 select a random dst_port as "dst_port = randint(5000, 5999)" without enforcing an even port number.

SDP's RFC 8866 state: "If noncontiguous ports are used or if they don't follow the parity rule of even RTP ports and odd RTCP ports, the "a=rtcp:" attribute MUST be used."

The SDP transport file template used by the test (video.sdp) is not using the "a=rtcp:" attribute.

The solution is to either have the "a=rtcp:" attribute or do dst_port = randint(5000, 5999) & 0xfffe

Note: There is another occurrence of this error in the function "node_sdp".

garethsb commented 1 year ago

Good spot (and that language has been there since RFC 4566)

garethsb commented 1 year ago

Hmm, it's not clear to me how one would use the a=rtcp: attribute, if the sender is not using RTCP? If you just want to use an odd port number for the RTP port, what are you supposed to do? That's not actually forbidden, is it? I think this is just another example of bad SDP specification language.

dst_port = randint(5000, 5999) & 0xfffe would mask that there's a problem with the spec language, but doesn't help explain what real IS-05 implementations that allow clients to set destination_port should do.

alabou commented 1 year ago

If the SDP specification language is not precise enough about the use of odd RTP port if RTCP is not used ... I would suggest the tests to be on the safe side an always use even port for RTP un less there is a real value in using odd RTP ports.