471,319 Members | 3,299 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Multicast Question

I'm streaming quicktime H264 movies to 224.1.2.3:554. Why, in my
MulticastReceiver class of another application, have I have to bind my
socket locally on the same remote port (554) in order to receive the
multicast packets (with the primitive receive)? Why can't I bind to
another port and still receive the packets? Below is the source code
I'm using to initialize the receiver.

---------------------------------
public MulticastReceiver(string remoteIPAddress,int remotePort)
{
//Create multicast receiver socket
socket=new
Socket(AddressFamily.InterNetwork,SocketType.Dgram ,ProtocolType.Udp);
IPEndPoint ep=new IPEndPoint(IPAddress.Any,remotePort);
socket.Bind(ep);
IPAddress ip=IPAddress.Parse(remoteIPAddress);
socket.SetSocketOption(SocketOptionLevel.IP,Socket OptionName.AddMembership,new
MulticastOption(ip,IPAddress.Any));
}

Jan 25 '06 #1
7 4757
Nuno Magalhaes wrote:
I'm streaming quicktime H264 movies to 224.1.2.3:554. Why, in my
MulticastReceiver class of another application, have I have to bind my
socket locally on the same remote port (554) in order to receive the
multicast packets (with the primitive receive)? Why can't I bind to
another port and still receive the packets? Below is the source code
I'm using to initialize the receiver.


The point of specifying the port is to effectively say what you're
interested in. There may be any number of applications spitting packets
at your IP address. If all ports saw all packets, you'd see all the
packets from all of those applications.

Jon

Jan 25 '06 #2
But it's not at my IP address it's from 10.154.0.104:6000 to
224.1.2.3:554.
From another application on another computer, I can only receive the

224.1.2.3 multicast packets if I'm bind to the local port 554 on the
local IP address. That leaves no room for multiple instances of
applications running on the same machine capture the multicast packets.

Jan 25 '06 #3
I'm not saying that one port should see all packets. It's a multicast
packet.
It's impossible for two applications on the same machine receive
packets from the endpoint 224.1.2.3:554 since they need to
simultaneously bind the socket on local machine port 554.

Jan 25 '06 #4
Nuno Magalhaes wrote:
I'm not saying that one port should see all packets. It's a multicast
packet.
It's impossible for two applications on the same machine receive
packets from the endpoint 224.1.2.3:554 since they need to
simultaneously bind the socket on local machine port 554.


Okay, I see what you're saying. I'll see what I can find out.

Jon

Jan 25 '06 #5
I've tested my NetworkEmulator application (that works like a router)
and the only way to work is this:

1) RTPServer(H264) broadcasting to 224.1.2.3:554 (local port 6000)
2) NetworkEmulator from 224.1.2.3:554 to 224.1.2.4:555 (local port
6002)
3) NetworkEmulator from 224.1.2.4:555 to 224.1.2.5:556 (local port
6001)
4) NetworkEmulator from 224.1.2.5:556 to 224.1.2.6:557 (local port
6003)

Checked ethereal all on the same machine and there were entries to all
this addresses/ports (almost 120 packets/s). We have to use always
different addresses and ports and each pair address/port can only be
used once by an application simultaneously running on the same machine.

With the limitation that the Receiver function can only be bound to
port 554, 555 or 556 in this example in order to receive those packets.

Jan 25 '06 #6
Nuno Magalhaes wrote:
I've tested my NetworkEmulator application (that works like a router)
and the only way to work is this:
<snip>
With the limitation that the Receiver function can only be bound to
port 554, 555 or 556 in this example in order to receive those packets.


Right. So does that mean you don't need me to do any more digging?

Jon

Jan 25 '06 #7
Not for now :-)

Jan 25 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by PHLICS_Admin | last post: by
1 post views Thread by PHLICS_Admin | last post: by
reply views Thread by PHLICS_Admin | last post: by
7 posts views Thread by Jim H | last post: by
2 posts views Thread by Naveen Mukkelli | last post: by
5 posts views Thread by GVN | last post: by
7 posts views Thread by pietro.cerutti | last post: by
reply views Thread by zig158 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.