473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Multicast socket

Is there something special I need to do to send data to a multicast IP and
have it go across a router? Router is a Win2000 Server connecting 2
networks via RRAS PPTP. The routing appears to be working because I can
ping the multicast address and get responses from the server on the other
network. I didn't think ping would work like that but as long as I have the
server process running I can ping the multicast IP and get a response. The
problem is my client app's packets do not appear to be reaching my server.
Is there something special I need to do to the client socket? I tried
SetSocketOption and adding it to the multicast group but that didn't help
either. It could be rras but ping worked. The SendTo executed without
error and sent the data out.

Thanks,
jim
Nov 16 '05 #1
7 7670
Hi Jim,

Based on my understanding, your Server application can not receive the
Client's data.

I think you should first determine if the problem is due to your router. To
determine this, you may test your CS application on 2 machines which there
is no router between them.

Also, you may use the Network Monitor with your router, your server
machine, your client machine to analysis which network segment lost the
sending data.

For more information about how to do multicast, please refer to:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemnetsocketsmulticastoptionclasstopic.asp

The below article teaches you how to use UDP client to listen for UDP
datagrams broadcast to the multicast address:
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconusingudpservices.asp

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #2
I'm going to try and run it on the other network. I think it might be the
routing as well, but pings to the multicast address work and route.

I started a cs multicast server on this network and it connected fine, but
the listener was actually running in the same process so I'm not sure if
that was a valid enough test.

Thanks again,
jim

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:ir**************@cpmsftngxa06.phx.gbl...
Hi Jim,

Based on my understanding, your Server application can not receive the
Client's data.

I think you should first determine if the problem is due to your router. To determine this, you may test your CS application on 2 machines which there
is no router between them.

Also, you may use the Network Monitor with your router, your server
machine, your client machine to analysis which network segment lost the
sending data.

For more information about how to do multicast, please refer to:
http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemnetsocketsmulticastoptionclasstopic.asp

The below article teaches you how to use UDP client to listen for UDP
datagrams broadcast to the multicast address:
http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconusingudpservices.asp

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #3
Hi Jim,

Thanks for your feedback.

Yes, because your ping works well, I think your network should be well. But
because your CS program does not work well, the datagram must be lost in
certain network section.

You may use Network Monitor tool to find which section you lost the
datagram. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #4
FYI. The reason the packet never reached the other machine was not a
routing issue. The default TTL for a multicast packet is 1. This keeps the
packets on the current subnet because they will be dropped by the router.
The following function fixed the problem. Settting the MulticastTimeToLive
is neccessary for multicast packets to travel across subnets.

lSocket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, 5);

I still have another issue but will ask it in a separate post.

jim

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:Dy**************@cpmsftngxa06.phx.gbl...
Hi Jim,

Thanks for your feedback.

Yes, because your ping works well, I think your network should be well. But because your CS program does not work well, the datagram must be lost in
certain network section.

You may use Network Monitor tool to find which section you lost the
datagram. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #5
Hi Jim,

Thanks very much for your feedback!

I am so glad you find the cause yourself, you should be proud of yourself.

Also, thanks for sharing your answer with the community!

For your another issue, is it titled "How do I cancel a BeginReceiveFrom" ?
I have replied you in that issue, please follow up there. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #6
My pleasure. MS might want to mention the multicast ttl in the multicast
section or maybe even set it int he example code. It's just another couple
lines of code and it might bring it to the attention of a programmer while
looking at the example.

Thanks,
jim

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:R3**************@cpmsftngxa10.phx.gbl...
Hi Jim,

Thanks very much for your feedback!

I am so glad you find the cause yourself, you should be proud of yourself.

Also, thanks for sharing your answer with the community!

For your another issue, is it titled "How do I cancel a BeginReceiveFrom" ? I have replied you in that issue, please follow up there. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #7
Hi Jim,

Thanks very much for your feedback.

Actually, the lack mention of TTL setting for multicasting in MSDN is
because this is a need of IP Multicasting with multi-routers, it is related
to the RFC specification.

Please refer to this article:
"IP Multicasting in C#"
http://www.codeproject.com/csharp/multicast.asp

In the article, the author refers a RFC:
http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc1112.html

Which has 3 recommandations:
1. Join a multicast group
2. Leave a multicast group
3. Set the TTL of a multicast group

Also, the author mentioned:
"Sets the time to live for the socket - this is very important in defining
scope for the multicast data. Setting a value of 1 will mean the multicast
data will not leave the local network, setting it to anything above this
will allow the multicast data to pass through several routers, with each
router decrementing the TTL by 1. Getting the TTL value right is important
for bandwidth considerations."

So, I think the RFC specification has pointed out this, MSDN
SetSocketOption method is a general way to set a lot of Socket options, it
will refer such detail things.

Hope my reply makes sense to you.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: nazgulero | last post by:
Hello all, I am fairly new to C++, and I am trying to write a client/server API for multicast. I have come across the script below, but for some reason, the server does not get any of the...
1
by: Alfred B. Thordarson | last post by:
Hi All. I have this weird problem that on my devlepment machine (Windows XP) I don't receive MultiCast messages that I send from my machine. This means that my two processes can't communicate...
6
by: PHLICS_Admin | last post by:
Hi All, There are two network cards in one computer (named A) , and there is one network card in another computer(named B). On computer A: one network card is used to connect to internet, and...
2
by: Terry | last post by:
I've got a strange problem receiving multicast packets in a C# application. What's strange is that it works *sometimes* but not always. I create a socket, call bind(), set the multicast socket...
5
by: Nuno Magalhaes | last post by:
I'm trying to set a multicast server but I get "Invalid argument" when setting multicast options. Below is the code that gives me problems more precisely in SetSocketOption with the AddMembership...
0
by: Nuno Magalhaes | last post by:
The MSDN says that I have to bind the socket on a local address to use ReceiveFrom function. How can I bind the socket on a multicast address in order to get the multicast data. Say that I want to...
0
by: Nuno Magalhaes | last post by:
The MSDN says that I have to bind the socket on a local address to use ReceiveFrom function. How can I bind the socket on a multicast address in order to get the multicast data. Say that I want to...
7
by: pietro.cerutti | last post by:
Hi guys, I have a daemon running on Debian and listening for multicast packets sent to 224.0.0.251:5353 (ZeroConf Multicast DNS queries). The server is plugged into a VLAN trunk with eth0 and...
1
by: Jayme.Pechan | last post by:
I was working on a multicast client and ran into a possible problem. Here is the code... udpClient = new UdpClient(4000); udpClient.JoinMulticastGroup(IPAddress.Parse("224.1.1.1"));...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.