Multicast/unicast
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Multicast/unicast

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    2

    Multicast/unicast

    We are connected to a server that sends udp multicast packets. Whenever a gap is detected we are supposed to send a "PacketRequest" to the server to get the missing packets. The server then sends the missing packets back to us with unicast to the same socket that we get the multicast packets on.

    The problem we have is that, if we have several applications on the same machine connected to the same multicast group and port, they will get the same source address. This means that the unicast data that the server is sending back to us, is sent to one of the applications, but it might not be the one that requested the data. Do anyone know how we should set up our socket in order for this to work?

    code looks like this:
    Code:
            boost::asio::ip::udp::endpoint endpoint(interface, port);
            m_socket.open(endpoint.protocol());
            m_socket.set_option(boost::asio::ip::udp::socket::reuse_address(true));
            m_socket.bind(endpoint);
            m_socket.set_option(boost::asio::ip::multicast::join_group(host));

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,845

    Re: Multicast/unicast

    Have the server resend packets on the same multicast ?

    If you missed a packet, it's not unreasonable to assume others missed the same packet as well.
    If the server is unicasting to you, it can't simultaneously be multicasting to everyone, so it's not going to slow down the server per se.
    This does make some assumptions about how the network multicast segments are organized of course, there may be reasons why unicast is really necessary.

  3. #3
    Join Date
    Nov 2013
    Posts
    2

    Re: Multicast/unicast

    Quote Originally Posted by OReubens View Post
    Have the server resend packets on the same multicast ?

    If you missed a packet, it's not unreasonable to assume others missed the same packet as well.
    If the server is unicasting to you, it can't simultaneously be multicasting to everyone, so it's not going to slow down the server per se.
    This does make some assumptions about how the network multicast segments are organized of course, there may be reasons why unicast is really necessary.
    Hi OReubens

    I am not sure what you mean. The server is sending unicast because it does not want to send duplicate packets to everyone (multicast). Instead it only sends the unicast data to those clients that have made a Request for missing packets (gaps). I think we will solve this issue by requiring one NIC per application. This means that the clients will have different source addresses.

  4. #4
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,845

    Re: Multicast/unicast

    I did in fact mean... send the packet again to everyone over multicast.

    This isn't an uncommon approach in multicast scenario's that have retransmission needs. The advantage is that if 2 or more clients need the same packet sent again, the server only needs to send each failed packed again once.

    The disadvantage is that clients that did not have reception errors will get additional "clutter". Depending on the actual network topology.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center