I'd like to get feedback from my friends and colleagues about multicast support on their phones, so I wrote a simple app for testing multicast. The Multicast Test Tool continually monitors the network for Multicast DNS mDNS packets while the app is running in the foreground, and presents the contents of these packets to the user. The app also allows the user to perform simple mDNS queries on the local network. Mac and Linux machines will respond to this discovery query. Windows machines will also respond if you are running iTunes and have checked "Share my library on my local network" in the preferences.
If you think your network may not have any of these devices which support mDNS service discovery, you can run the attached perl script to transmit a gratuitous mDNS packet. My home network is always buzzing with mDNS traffic, so on my multicast-capable virtual machine I see lots of activity without performing any queries.
If you see any activity at all, it means that your phone supports multicast. If you see no activity, then your phone likely does not support multicast.
I'm David Simmons, a software engineer specializing in low-level system software such as device drivers, network protocols, graphics, and video.
It only takes a minute to sign up. I have scripts that run IP multicast tests; however, my scripts are failing on a particular linux machine. To check whether the compiled and running kernel subscribes to any multicast group, I would use netstat -g.
I see that eth0 interface on my host thinks its subscribed Also alternatively, if I ping the group or the network and then all the known multicast enabled host networks are returned to me, I would say multicast is working on the host.
Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 8 years, 4 months ago. Active 2 years, 4 months ago. Viewed k times. Mike Pennington Mike Pennington 2, 4 4 gold badges 26 26 silver badges 38 38 bronze badges.
Active Oldest Votes. It seems the most kernels post v1 do support multicast by default. Mike Pennington 2, 4 4 gold badges 26 26 silver badges 38 38 bronze badges. Nikhil Mulley Nikhil Mulley 7, 24 24 silver badges 48 48 bronze badges. But how do you determine, if the router that box is connected to supports multicast?
Use network service discovery
Multicasting -- the sender sends a single datagram from its unicast address to the multicast group address and intermediary routers take care of making copies and sending them to all receivers that have joined the corresponding multicast group. If Yes, router needs to support the multicasting then. Router that supports PIM, usually enabled, and multicast group -- Ify,router network does support multicasting.Network service discovery NSD gives your app access to services that other devices provide on a local network.
Adding NSD to your app allows your users to identify other devices on the local network that support the services your app requests. This is useful for a variety of peer-to-peer applications such as file sharing or multi-player gaming. This lesson shows you how to build an application that can broadcast its name and connection information to the local network and scan for information from other applications doing the same.
Finally, this lesson shows you how to connect to the same application running on another device. Note: This step is optional. If you don't care about broadcasting your app's services over the local network, you can skip forward to the next section, Discover Services on the Network. To register your service on the local network, first create a NsdServiceInfo object. This object provides the information that other devices on the network use when they're deciding whether to connect to your service.
This code snippet sets the service name to "NsdChat". The service name is the instance name: it is the visible name to other devices on the network. The name is visible to any device on the network that is using NSD to look for local services.
How to watch IPTV (online TV) on Android and iPhone
Keep in mind that the name must be unique for any service on the network, and Android automatically handles conflict resolution. If two devices on the network both have the NsdChat application installed, one of them changes the service name automatically, to something like "NsdChat 1 ".
The second parameter sets the service type, specifies which protocol and transport layer the application uses. You can download the list from the IANA list of service names and port numbers. If you intend to use a new service type, you should reserve it by filling out the IANA Ports and Service registration form. When setting the port for your service, avoid hardcoding it as this conflicts with other applications.
Subscribe to RSS
For instance, assuming that your application always uses port puts it in potential conflict with other installed applications that use the same port. Instead, use the device's next available port.Account Options Sign in. Top charts. New releases.Cisco Multicast Routing for CCNA, CCNP, and CCIE Candidates
Multicast Tester Mitch Talmadge Tools. Add to Wishlist. Multicast Tester is used for testing Multicast packets on your network. There are a couple possible reasons for this: 1.
Your code may be the problem. Your router's firewall may block Multicast packets. Some devices inherently block all Multicast connections. In this case you may neither receive nor send packets. This is a device problem, not an app problem. It cannot be circumvented in any way, even with root. The only solution would be to install another ROM which does not block Multicast connections. I cannot bind to a certain address or port. Typically you will see this error if you try to bind to a port less thanas these ports are restricted for the operating system's use only.
This is the case on most operating systems, even on desktops. Try using a port larger than if you are not already, or try another IP address.
I'm seeing characters in Hexadecimal that shouldn't be there. This is more than likely a bug in your code, not mine. However, my contact page is open if you are pretty sure that I am the one with the bug. Reviews Review Policy. This can be achieved manually with the Clear Console button. If you have any suggestions or concerns, please send me an email! View details. Flag as inappropriate.
Visit website. See more. Innova Electronics Corporation.But what if we need to do the same on Android mobile? Again, multicast may help us here, and we may use the same C MulticastUdpClient class explained in the previous post. I will create small tester application, like I did for Windows. The application will have one activity which will provide an input fields to enter multicast IP and port, and 2 buttons to start UDP client and to send sample message. Thank you for your sample code on UDP for android, very appreciated!
Can you please publish it as well. Hello Vincent, yes, I am sorry, really the function is missing. GetHostEntry Dns. GetHostName ; foreach var ip in host. I m from India. Wooww really… That would be super helpful… Awaiting Like Liked by 1 person.
You are commenting using your WordPress. You are commenting using your Google account. You are commenting using your Twitter account. You are commenting using your Facebook account. Notify me of new comments via email. Notify me of new posts via email. Note that mobile multicast will work only inside the local network over WiFi. App; using Android. Content; using Android. Runtime; using Android. Views; using Android. Widget; using Android.
OS; using System. Net; using WpfApplication1; using System. Sockets; using System.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Skip to content. Permalink Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up. Branch: master. Find file Copy path. Cannot retrieve contributors at this time. Raw Blame History. IOException ; import java. DatagramPacket ; import java. InetAddress ; import java.
MulticastSocket ; import java. ArrayList ; import java. List ; import xlwireless. XLWirelessUtility ; import xlwireless. XLWirelessLog ; import android. Context ; import android. WifiInfo ; import android. WifiManager ; import android. MulticastLock ; import android. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. IOException. DatagramPacket. InetAddress.
I write a server which sends a message to a android client. Until yet the client should only log the received message. I noticed that no multicast packet are received on my device.
I've tested the code with 2 different devices. The Nexus4 and the Nexus7 both running the latest Android. Also, you may want to play with the Advanced settings in the WiFi menu on your phone, both Wi-Fi optimizations and Keep Wi-Fi on during sleep may impact your ability to do multicasts. Learn more. Android can not receive multicast packet Ask Question. Asked 6 years, 3 months ago.
Active 4 years, 4 months ago. Viewed 9k times. Could anybody help me? Patrick Pichler.
Patrick Pichler Patrick Pichler 41 1 1 silver badge 4 4 bronze badges. In your sample I believe you're missing some code for DatagramPacket creation and handling.
I also would like to state for a fact that Android can do mulitcast reception; I've tested it on the Nexus7 and other devices. Have you managed to resolve it yet?
What network interface do you use?