Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Source Specific Multicast Not Supported (?) #332

Closed
GScharfofMars opened this issue Feb 22, 2018 · 7 comments
Closed

Source Specific Multicast Not Supported (?) #332

GScharfofMars opened this issue Feb 22, 2018 · 7 comments
Assignees
Labels
flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: docs Improvements or fixes to documentation
Milestone

Comments

@GScharfofMars
Copy link

System info

Operating System: Ubuntu 16.04 LTS
Shaka Packager Version: v2.0.0-1d6a2de-release

Issue and steps to reproduce the problem

The following is an address redacted snippet from a test script. The redacted address streams have been shown to exist and be accessible to the host via other programs such as vlc and multicat.

Packager Command:
STREAM_SRC=XX.XX.XX.XX
INTERFACE=YY.YY.YY.YY
STREAM_ADDR=ZZ.ZZ.ZZ.ZZ
STREAM_PORT=PPPPP

./shaka-packager --v=1
in=upd://${STREAM_ADDR}:${STREAM_PORT}?source=${STREAM_SRC}?interface=${INTERFACE}?reuse=1,stream=audio,init_segment=audio_init.mp4,segment_template='audio_$Number$.m4s',playlist_name=audio.m3u8,hls_group_id=audio,hls_name=ENGLISH
in=upd://${STREAM_ADDR}:${STREAM_PORT}?source=${STREAM_SRC}?interface=${INTERFACE}?reuse=1,stream=video,init_segment=h264_init.mp4,segment_template='h264_$Number$.m4s',playlist_name=h264_.m3u8
--hls_master_playlist_output h264_master.m3u8

The result is:
./testPackager.sh
[0222/181854:INFO:demuxer.cc(89)] Demuxer::Run() on file 'upd://REDACTED?source=REDACTED?interface=REDACTED?reuse=1'.
[0222/181854:INFO:demuxer.cc(161)] Initialize Demuxer for file 'upd://REDACTED?source=REDACTED?interface=REDACTED?reuse=1'.
[0222/181854:VERBOSE1:status.cc(72)] 5 (FILE_FAILURE): Cannot open file for reading upd://REDACTED?source=REDACTED?interface=REDACTED?reuse=1
[0222/181854:ERROR:packager_main.cc(470)] Packaging Error: 5 (FILE_FAILURE): Cannot open file for reading upd://REDACTED?source=REDACTED?interface=REDACTED?reuse=1

https://google.github.io/shaka-packager/html/tutorials/live.html indicates that "source" is an optional clause for the upd "file" option.

Additional Info:
Inspection of source code (udp_options.cc) did not reveal any evidence that the "source" clause of the input spec is parsed or stored in the UdpOptions object instance, nor does the method used to join the IGMP group in udp_file.cc appear to be consistent with the method of joining an SSM group.

@kqyang
Copy link
Contributor

kqyang commented Feb 22, 2018

@GScharfofMars For UDP options, source and interface mean the same thing. Either one can be used to specify the UDP multi-cast interface address. What do you put in source and interface options respectively? And what is the option you fed to vlc?

Also, the separator between different options is &. Sorry for not mentioning it in the document. I'll update the document to reflect that.

So the UDP file name should be something like:

upd://${STREAM_ADDR}:${STREAM_PORT}?source=${STREAM_SRC}&reuse=1

Please try and let us know if it works.

@kqyang kqyang added the type: docs Improvements or fixes to documentation label Feb 22, 2018
@GScharfofMars
Copy link
Author

@kqyang

First, thanks for jumping in. I appreciate the support.

Source=interface surprises me a little.
I did try using & (escaped to & for bash) as the separator, to no effect.

Our environment is configured to use IGMP V3 Source Specific Multicast. VLC style mrls are in the generalized form of

udp://ipV4addressOfStreamSource@ipv4MulticastStreamAddress:port multicat also has an extension, /interface=ipV4AddressOfEth0 , and so with shaka-packager I was using interface=ipv4AddressofEth0 and source=ipV4AddressOfStreamSource.

Using vlc/multicat, I can observe IGMP message traffic with tcpdump. If the streamSourceAddress is specified, additional records indicating such are put into the IGMP join message, and the switch responds by sending the stream. If the streamSourceAddress is omitted, an IGMP message is sent without those records, and the switch declines to send the stream.

Summary, using tcpdump -vvv decode, REDACTIONS-IN-CAPS:

Success:
igmp v3 report, 2 group record(s) [gaddr MULTICAST-ADDRESS-OF-STREAM allow { ADDRESS-OF-STREAM-SOURCE }] [gaddr MULTICAST-ADDRESS-OF-STREAM to_in { ADDRESS-OF-STREAM-SOURCE}]

Failure:
igmp v3 report, 1 group record(s) [gaddr MULTICAST-ADDRESS-OF-STREAM to_ex { }]

Using shaka-packager, I see no IGMP messages sent of any flavor, under any combination of udp file names, including upd://addressOfSource@MulticastAddressOfStream:Port, nor do I see any way to supply the addressOfSource so as to propitiate the switch.

@kqyang
Copy link
Contributor

kqyang commented Feb 23, 2018

@GScharfofMars Emm.. It seems that I had a misunderstanding of the meaning of source and interface. I thought they were the same. Do you have any documentation on UDP multicast explaining these addresses?

So we are not handling source correctly. We'd love contributions if you know how to fix it. Here is the code setting up the socket: https://github.com/google/shaka-packager/blob/master/packager/file/udp_file.cc#L171.

@kqyang kqyang added type: bug Something isn't working correctly flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this labels Feb 23, 2018
@GScharfofMars
Copy link
Author

The reference I see coming up on the Web all the time is UNIX Network Programming, Second Edition, by W. Richard Stevens (Prentice Hall, 1998). Chapter 19 on "Multicasting".

I thought I had a copy on my shelf, but I'm not seeing it since the last time I cleaned my office. :(

My curiosity motivates me to try my hand at fixing it, but I won't be able to engage until later next week.

@kqyang
Copy link
Contributor

kqyang commented Feb 23, 2018

Great. I'll assign it to you and add it to v2.1.0 milestone (which is targeted in the end of March). Let us know if anything changes. Thanks for your help.

@kqyang kqyang added this to the 2.1.0 milestone Feb 23, 2018
@fatpelt
Copy link
Contributor

fatpelt commented Mar 2, 2018

@GScharfofMars if you can't get to it let me know. i have a working prototype

@GScharfofMars
Copy link
Author

I've been sidetracked at work, and haven't even cracked open the lid on this. If you have something that works, by all means, I cede the coding stick to you. Thanks.

@kqyang kqyang closed this as completed in 6a8d2aa Mar 6, 2018
shaka-bot pushed a commit that referenced this issue Mar 17, 2018
Issue #332.

Change-Id: I3a2b1e1e0525eaba5bb657ce0481d96ceafb4e89
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label May 5, 2018
@shaka-project shaka-project locked and limited conversation to collaborators May 5, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: docs Improvements or fixes to documentation
Projects
None yet
Development

No branches or pull requests

4 participants