UdpAnySourceMulticastClient in real Wp7 device - windows-phone-7.1

I am discovering the desktops within same wifi network, I am using the UDP multicasting
using UdpAnySourceMulticastClient.
Everything is working fine in emulator(means discovering desktops), But its not working in the real device(HTC RADAR).
Note: I referred the Peer Communication in WP7
Is this UDP Multicasting is supported in Wp7 Device?
Updated: I Changed the Mulitcast IpAddress 224.0.0.1 to 224.0.1.11 its working fine in device also. if anybody got cause please explain it..

I think it's because you used a reserved multicast-address:
"GROUP_ADDRESS: A multicast group is defined by a multicast group address, which is an IP address that must be in the range from 224.0.0.0 to 239.255.255.255. Multicast addresses in the range from 224.0.0.0 to 224.0.0.255 inclusive are “well-known” reserved multicast addresses. For example, 224.0.0.0 is the Base address, 224.0.0.1 is the multicast group address that represents all systems on the same physical network, and 224.0.0.2 represents all routers on the same physical network."
(see: http://goo.gl/Nu3IJ)

Related

Multicast not working at Windows 10 PC. How to Enable multicast at Local LAN at Windows 10

I can multicast at 224.0.0.1 and my all others local LAN PCs can listen the stream.
But when I multicast at other multicast IP like: 224.0.0.130, no LAN PCs can listen that. Though I can get at wireshark in source PC.
There are several reasons not to work multicast in windows 10. I have solved it by following 2 steps:
Interface Metric: From network settings, go to advance option and uncheck Automatic metric and set Interface matric a number. Lower the prior.
Change C# code:
By default, multicast send data to loopback interface. Hence need to specify which interface you want to use, means which ip you want use to send the multicast stream (ie. At which network you want to send multicast).
Here’s a sample C# code:
m_Socket.SetSocketOption(
SocketOptionLevel.IP,
SocketOptionName.MulticastInterface,
IPAddress.Parse("192.168.0.104").GetAddressBytes()
);
M_Socket is the socket to send the stream and “192.168.0.104” is the interface ip at which network I want to send the stream.
By following above, Now I can send multicast successfully.

Multicast data cannot be received by programs

Connection Schema
As given above, we connected two computers with one ethernet cable. Then using different programs we tried to sent data using as unicast,broadcast and multicast. However, we could not achieve to sent data as multicast. I mean, we can capture the data using wireshark, however both vlc,ffplay could not achieve to receive data.
We disabled firewalls of computers.
We achieved to send unicast and broadcast.
Wireshark can capture multicast data and there are not any checksum issues.
We use 239.5.5.5 as multicast address.
We checked ttl of packets.
We used different computers, but we get same result.
We forgot to turn off other interfaces in the computer including wifi and virtual machine interfaces. After turning off other interfaces, we are able to get multicast stream from Ethernet interface.

How to send UDP packets to a MAC address from an Android app?

Is there a way to send UDP packets to a network MAC address?
Neither DatagramSocket nor DatagramPacket seems to have a mechanism of doing this.
Because of the layered network stack, the first response is that you cannot send a UDP message to a MAC address. My statement means that you don't have any means of setting a MAC address in a UDP datagram field. You can send a UDP datagram to an IP address and port. This IP address can be unicast, multicast, or broadcast.
If you intend to send a UDP datagram to a specific MAC address, you need to implement a more complex solution (DHCP is an example of a more complex solution). There are different strategies you can apply:
If you just need to send a datagram to a MAC address without having received any datagram from that NIC, and knowing that MAC address, first you will need to send a layer 2 frame to that MAC address (a layer 2 protocol allows you to set a MAC address). You can implement a protocol listening to that MAC address frames and being able to send a response back providing you the corresponding IP address. RARP is a protocol that lets you get an IP given the MAC address
You can implement your protocol that uses a multicast group. From your PC you send a multicast message containing the MAC address you are targeting. All nodes (applications in nodes) subscribed to that multicast group receive that message. The one with the targeted MAC address can respond. Once it responds, you have its IP address and can send a unicast UDP datagram.
The short answer is no. The networking stack is set up for the hardware address to be addressable in the OS's media layer with only a defined interface with the transport layer exposed to the application. You would need to tap into the low-level OS. It looks like you are trying to make this call within Java and it's highly unlikely that you will be able to accomplish this.

Getting IP addresses of the PC's available on wifi network in android

I am able to establish connection between android and PC via Wi-fi. But this is done by hard coding the the IP address of the PC (server) in the android program. But I wanted to get IP addresses of the PC's available on the Wi-fi network programmatically. So please let me know how to scan for PC's on the network and get their respective IP address.
can you not multicast a UDP packet on the network which the server listens for and responds to with a packet containing the ip address of the server in order to set up the connection?
You should be able to find help on that topic, with some options here here and here

How bonjour works on IOS?

I created an application using bonjour and I am able to send files from one device to another. But the question is: I am not able to discover the devices on the LAN without running both the applications on the device. Do I need to run the application using bonjour to get it detected using bonjour.
Yes you do. Running the application registers the appropriate entries into the iOS multicast DNS service. Once you shut the app down I expect it removes itself from the multicast DNS registry (which it is correct to do, because it is no longer available), so you can't find it from other devices.
EDIT: (Very roughly) Bonjour is multicast DNS. The Bonjour service runs a multicast DNS server. When your application starts up it communicates with the local multicast DNS server and creates a number of entries that identify the service it is making available, the ports it is available on and other relevant attributes. It also registers itself as interested in learning about any other network device that is running the service.
The local multicast DNS server makes announcements that signal to any one else listening on the network that a new service is available. Your app (on a different machine) is notified by the Bonjour service that another client has appeared, and that is more or less how the magic is done. Longer multicast DNS writeups are all around: Google is your friend.

Resources