0

I'm writing a service using UDP, but I can't manage to reply to the client.

When sending to the client via the DHCP-assigned IP (192.168.1.143) Wireshark shows no sent packets. The server receives and Wireshark shows any packet sent by the client (broadcasted).

If I send to a random, unassigned IP Wireshark doesn't show it. I thought the NIC would happily send it, since there is a router in the way - shouldn't Wireshark show it, even though it cannot possibly be received by a remote endpoint?

If I send to either the router IP or another (specific, there is only one other) computer, the packet is shown in Wireshark.

I am running Windows 7, the firewall is turned off using the control panel.

Does the fact that wireshark doesn't show these packets mean that they aren't sent? What reason could there be for showing packets to one IP, but not another, on the same subnet?

Max
  • 101
  • 2
  • When you say "there is a router in the way", you mean that the destination IP address is not inside the sending machine's subnet? – David Schwartz Dec 17 '12 at 08:13
  • No, all devices are in the same subnet, 192.168.1.x, but the router does DHCP for all devices. – Max Dec 17 '12 at 12:07

1 Answers1

1

The NIC cannot happily send a packet to an unassigned IP address in the same subnet, since it would have no idea what hardware address to send it to. Since the address is in the same subnet, the router is not in the way. Routers route between subnets.

Update 1: I see you're thinking that the machine is "wired directly to the router", but this is confusing terminology. Your "router" has a built-in switch in addition to a router. This machine is in fact connected to the router's switch, as is the actual part of the router that routes.

Update 2: It seems wired devices cannot communicate with wireless devices on your LAN at all, since wired devices are not getting ARP replies from wireless devices. The next step in troubleshooting is to make sure wired and wireless machines are connected to the same router and that you don't have some other device in-between them.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
  • But there is only a wired connection to the router? So the local NIC on my host computer would send the packet to the router, which would drop it, but it would still be sent from my local computer? Am I completely wrong? The issue is though that I can send to one existing device (Windows 7 PC using a wired connection) and not another (Android 4.1 device using wireless). The packets don't arrive and wireshark shows no outbound packets. – Max Dec 17 '12 at 12:21
  • You're completely wrong. Whatever argument you're using to conclude that you should send the traffic to something other than the machine directly would equally well apply to packets you were trying to send to the router. And clearly those are sent directly. (Both the router and this other machine are devices whose IP address are inside this machine's subnet, and thus should be sent directly. That's what the subnet mask is for -- to tell a machine which addresses it can reach directly.) – David Schwartz Dec 17 '12 at 12:24
  • Well, I'm addressing it directly to the devices (192.168.1.2 and 192.168.1.143, respectively). One of them shows outbound packets in Wireshark, the other does not. Both devices actually exist, but one is wireless and the other is wired. The silly thing with sending to no endpoint (say 192.168.1.50) was just because I thought Wireshark would show me the outbound packet (addressed to 192.168.1.50) but sent through the router. But that might be completely stupid :p – Max Dec 17 '12 at 12:31
  • Okay, not sending packets to a local IP that does not exist is expected, there's no way to know what hardware address to send them to, so they can't be put on the wire. So is your actual issue packets not being sent wireless machines? Presumably, it's for the same reason -- the machine is not getting the wireless machine's hardware address. You can check by running `arp -a` from a command prompt (after trying to send). – David Schwartz Dec 17 '12 at 12:34
  • I'm using python sockets, and `sendto` is returning the amount of bytes sent, which is 20. It does tell me that whichever address I send to though. `arp -a` indeed doesn't show the `192.168.1.143` address, but I know it is connected by DHCP (I can receive packets from it). Do you know what could cause this? – Max Dec 17 '12 at 12:46
  • Can you `ping` these IP addresses? – David Schwartz Dec 17 '12 at 12:48
  • No, not from my current local host at least. "Destination host unreachable". My router shows this in "Available LAN hosts" though: `unknown 192.168.1.143 1C:B0:94:D5:DC:A0 Dynamic Wireless` I guess the MAC address is what my local host is lacking? – Max Dec 17 '12 at 12:52
  • So your actual problem is that your wired and wireless machines can't communicate with each other. Are you sure they're connected to the same router? Can they all reach the Internet? – David Schwartz Dec 17 '12 at 13:08
  • I just tested; other wireless devices can be reached fine. All devices are shown correctly in the LAN hosts entry in the router interface though. So it's a single device, that is shown as an available host in the router, that can't be reached (isn't listed in the ARP table in any of my windows machines). Could the problem be with the router or the device? I don't know how the ARP table is populated... – Max Dec 17 '12 at 13:18
  • It could be either. One way to check is to monitor the network at the device and see if it's receiving ARP queries. – David Schwartz Dec 17 '12 at 13:29
  • Hi, I thought you might want to know how it worked out: Rebooted the router (not a cheapo one either, cisco small business) and I could ping it. I feel both stupid and cheated, because I didn't just start with restarting every device, and because it´s still necessary 2012. – Max Dec 18 '12 at 04:49