How to make UDP broadcast more robust against packet loss

My task is to stream the same HD video ~ 4-5Mbps to many clients (~50) on one network. The easiest way is to use RTSP over TCP, and have a couple of servers serve all the clients with individual unicasts. That will take a lot of bandwidth on the server, so I want to use broadcast. However, the only way I know, is to use UDP broadcast. That works fine up until I get packet losses. It works fine on a local network (tree of switches), but if the traffic goes through an ISP's L2 access (trunks), I get losses.

I'm thinking of making the VLC server send a double broadcast (two different ports), and in some way receive the double broadcast on the clients and have them gather the double stream into one and pipe this to local VLC to display the video. When using double streams, one of the streams can loose a packet, and hopefully the other stream did not loose it.
That is : VLC server -> double UDP broadcast -> client -> merge double stream into single stream -> VLC Client

I need suggestions for network software that runs on Windows, to do this. Or suggestions for better ways to do this.
lefodnesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
UDP is a send and forget technology.  and double streaming doubles the send/receive bandwidth requirements.
0
Don JohnstonInstructorCommented:
I think you'll be better off trying to use QOS.  Assuming you have control over the network hardware.
0
lefodnesAuthor Commented:
Yes. It doubles the bandwidth. I could triple the bandwidth, if it helped. It is better than having 50x bandwidth.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

giltjrCommented:
I'm not sure, but does VLC support multicast?  Since all endpoints are on the same network (I am assuming L3 network) this would allow a single packet to be sent to multiple destinations, while allowing for TCP resend in case of a packet is lost.
0
lefodnesAuthor Commented:
Yes? Maybe? where can I read about tcp multicast? I thought there was only udp multicast, and I did not understand the difference between broadcast and multicast, other than multicast uses multicast addresses.
0
giltjrCommented:
Think of multicast as a directed broadcast.  It's a single stream that is sent to a specific MAC address/IP address that can have multiple hosts listening on.    Not everybody is listening, so not everybody gets it.

In a switched environment if the switch support IGMP snooping, then the switch will only forward the traffic to the ports that have hosts that have registered to get the traffic.  So if you have 48 port switch and only 5 hosts have registered, then the switch will forward the traffic to the ports those 5 hosts are on.

Typically all hosts are on the same L2 network, but you can  route multicast within your own network.
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
to many clients (~50) on one network
It works fine on a local network (tree of switches), but if the traffic goes through an ISP's L2 access (trunks), I get losses.
I'm confused, you mention first one network, and then you are talking about more than one network. Did you just mean that "separately" you've tested over local networks and then over wider networks?

Anyway, I'm not sure how flexible VLC server is but can it be setup to broadcast UDP for any clients on the local network, and then have directed TCP to any clients over the trunk. If there are a number of clients that are accessed over the same trunk, perhaps VLC has some way where you can send the one stream over the trunk, and then re-broadcast at that end to local UDP clients? Just some ideas.
0
giltjrCommented:
I was assuming that he has a link that allows him to bridge L2 between sites so that both sites are on the same L3 network.
0
lefodnesAuthor Commented:
I'm sorry not being clear on this. I did this last year in one network, same ip range, one tree of switches, no trunks, at one site. Now, I have two sites, but it is actually only one network still. The ISP delivers port to port L2 accesses, bridging between the networks. All packets should still be forwarded, but still, I get losses. I should probably split them into two different ip ranges 192.168.80/23 and 192.168.82/24, and route between them
0
giltjrCommented:
Ah. for normal traffic it would be better to split.  That way broadcasts don't have to go over the WAN link.

If you you split into two IP subnets and want to do the multicast you will need to look into multicast routing
0
lefodnesAuthor Commented:
I would be happy to get a hint on how a host does "subscribe" to a multicast address, as in giltjr's example. I have tried this, but the switches always do a broadcast when I send RTP video to a multicast address.
0
giltjrCommented:
Do your switches support IGMP snooping and is it enabled?

Depending on your setup, the traffic will be a broadcast, but it will be a "limited" broadcast.  

Using the diagram below say COMPUTER#1 wants to play the video and points to the multicast IP address that the VLC server is using and that is the ONLY computer that wants to watch the video.  The traffic will go out as a broadcast from SWITCH#1 to SWITCH#2 and then to the port that COMPUTER#1 is on.  However the, assuming your switches support IGMP and it is enabled, the traffic should NOT go to the port that COMPUTER#3 is on, nor should it go to SWITCH#3.


VLC Server <---> SWITCH#1 <---> SWITCH #2 <---> COMPUTER#1
                                      /\                               /\
                                      |                                 |
                                     \/                                \/
                            SWITCH#3                COMPUTER#3
                                      /\
                                      |
                                     \/
                           COMPUTER#2
0
giltjrCommented:
I was re-checking and I could swear that VLC supported TCP multicast, but looking at its features it does not seem to list it.  I would look some more.
0
lefodnesAuthor Commented:
Thank you giltjr for your information!.
First, I have read more about the multicasting, and from what I read, there is no such thing as TCP on multicast. If there was, how is the SYN and FIN messaging going on..?

My switches support IGMP Snooping, and I had turned it on. As you (giltjr) wrote earlier, the switch should send to only those that have registered. But how do they register? I got it all as broadcast, and I could turn off sending unregistered multicast. If I did that for each port, the packets were not forwarded.

From this link, I read that there must be a router sending some IGMP query, and the listening host should reply to them with an IGMP report, thus telling the switches in between that they are having a multicast being set up. I tried searching for multicast packets with Wireshark, but got no interesting packets. Actually, I shouldn't be having to have a router in my network, but since I do have it, I should check if it could send IGMP queries, then?
My router is a Sonicwall NSA 240, and the switches are Cisco SG200-18

My question would be : Is it normal procedure on a host, that if an application starts listening on a UDP port on a multicast address, should the network adapter automatically create IGMP reports for that multicast address (and port)? Do normal Windows hosts understand IGMP?

Thanks for bearing with me on this one!
0
David Johnson, CD, MVPOwnerCommented:
why don't you just set up a proper media server, it is a free add-on for IIS
0
Don JohnstonInstructorCommented:
First, I have read more about the multicasting, and from what I read, there is no such thing as TCP on multicast.

You are correct.  In this case (streaming), multicast simply can't be TCP.  Because TCP has reliable delivery, this would disrupt the content since a retransmitted packet would arrive out of sequence.  And, as you point out, one station requesting a retransmit would impact all other receivers.

the switch should send to only those that have registered. But how do they register?
Hosts send IGMP Join messages once the multicast receiving application is started. When the switch receives the join message, the multicast traffic (for that particular address) is forwarded out that port (assuming the multicast traffic is already flowing).

I got it all as broadcast, and I could turn off sending unregistered multicast.
Are you saying that you received the stream as a broadcast???

From this link, I read that there must be a router sending some IGMP query and the listening host should reply to them with an IGMP report, thus telling the switches in between that they are having a multicast being set up.
That explanation of multicast and IGMP is presented in a rather convoluted way. The setup occurs when a host sends an IGMP join message. The switch sees that and records the multicast group address and port number to the address table.  The join message also makes it's way to the router which opens up the flow.  When other hosts send join messages for the same flow, the switch adds those ports to the address table entry for the multicast address and flow is sent out that port too. Periodically, the router will send a IGMP query to verify that there are still receivers. As long as one device responds, the flow continues.  If there are no replies, the flow is stopped.  

My question would be : Is it normal procedure on a host, that if an application starts listening on a UDP port on a multicast address, should the network adapter automatically create IGMP reports for that multicast address (and port)? Do normal Windows hosts understand IGMP?
Yes.  Loading a multicast app on a host and specifying the address will generate an IGMP Join (AKA Membership Report) message.  Every current OS on the market supports IGMP.

I think this is a much better (quick) explanation of IGMP.

HTH
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lefodnesAuthor Commented:
Thanks to all for helping. I have opened up both VLC listening on an UDP port, registered for a multicast address. I have also made a small application that opens up a UDP socket with multicast, but for no applications I see any IGMP packets on the network other than the ones other applications are generating. I have confirmed that the UDP socket is listening, using the "netstat"-command in Windows. I would believe that the IGMP Join is a broadcast message. It was not seen by Wireshark locally from the PC and it was not seen by the packet diagnostic in Sonicwall FW.
The filters should be correct, since I can capture other IGMP messages.
Grading the solution to C, because I never got a better way of securing UDP data. Loss of data would still be a problem to multicast.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Networking

From novice to tech pro — start learning today.