Desired behavior

When an application sends a packet to the global broadcast IP address, I would like that the packet be sent to the Ethernet global broadcast address (ff:ff:ff:ff:ff:ff), on all interfaces.

On Linux and probably other OSes as well this seems to work. Windows XP and Windows 7 exhibit different behaviors about this, and neither behaviour is desirable for my situation.

Windows XP behavior

The packet will be sent correctly to the first network interface (interface order is specified in "Network Connections/Advanced/Advanced Settings"). It will also be sent to the other interfaces.

Everything is right so far. Problem is, when sending to the other interfaces, the source address of the broadcast packet is the IP address of the first interface. For example, imagine this network configuration (order is important):

  • Adapter 1: IP address
  • Adapter 2: IP address
  • Adapter 3: IP address

Now if I send a broadcast packet, the following packets will be sent (with source and destination IP addresses):

  • On adapter 1: =>

  • On adapter 2: =>

  • On adapter 3: =>

    In practice, applications using broadcast packets won't work on any interfaces other than adapter 1. In my opinion, this is a blatant bug in the TCP/IP stack of Windows XP.

Windows 7 behavior

Modifying the network interface order doesn't seem to have any effect on Windows 7. Instead, broadcast seems to be controlled by the IP route table.

IPv4 Route Table
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
     10         On-link    286         On-link    286         On-link    286         On-link    306         On-link    306         On-link    306         On-link    266         On-link    266         On-link    266         On-link    306         On-link    266         On-link    286         On-link    306         On-link    266         On-link    286

See the routes? Yep, they control broadcast packets. In this situation, broadcast packets will be send via the because it has the lower metric... but not to the other interfaces.

You can change the interface through which global broadcast packets will be sent very easily (just add a persistent route with a low metric). But no matter how hard you try, broadcast packets will only be sent on only one interface, not all of them like I'd like it to do.


  • Windows 7 only sends broadcast packets to one interface. You can choose which one, but that's not the point here.
  • Windows XP sends broadcast packets to all interfaces, but it only sends them as expected to one interface, which in practice is equivalent to the Windows 7 behavior.

The goal

I want to change this global IP broadcast support in Windows (preferably Windows 7) once and for all. Of course the better way would be to have some kind of supported configuration change (registry hack or similar), but I'm open to all suggestions.

Any ideas?

  • What are you using to generate these broadcasts. I can't get my XP stack to do anything but directed broadcasts. i.e. in your case. Oct 7, 2009 at 12:42
  • Can you reference an RFC or other document that indicates the Correct Behavior you describe? While I agree it's desired behavior, to call it correct behavior should reference a spec that defines what is correct. Could it be that the specific routing implementation is left up to the provider (Microsoft in this case)? Oct 7, 2009 at 13:17
  • Scott Lundberg: many applications (especially games) will send global broadcast. You can generate some using netcat: "nc -v -u 5000" for example. Oct 7, 2009 at 13:26
  • Jason R. Coombs: indeed, maybe I had a poor choice of words. I should have used "desirable behavior". I don't think there is a RFC for this, but I may be wrong. Oct 7, 2009 at 13:29
  • Are you sending a TCP or UDP packet? According to this that matters social.msdn.microsoft.com/Forums/en/peertopeer/thread/….
    – Nissan Fan
    Oct 7, 2009 at 16:38

2 Answers 2


Not that I am in the business of defending Microsoft, but after reading through the following RFCs which attempt to define how broadcasts work, I don't think that Microsoft is necessarily violating any RFCs. IMO the problem should be fixed at the application level (i.e. directed broadcasts, not global) which will hit the appropriate routes in the routing table and only be sent from the correct interface for that IP network.

They both state that there is no standard defined for broadcasts. It also mentions in 919 that a specific physical interface should be selected for the broadcast. In the case of a multi-homed, multi-NIC machine generating the broadcast, I don't think that it's clearly stated what should happen. Broadcasts are never supposed to be passed by routers from one interface to the other, so is the Windows machine a router or not in this case?
If it is acting as a router, then any host responding to the broadcast with the incorrect IP address for that network (Adapters 2 and 3 in your example) should send the packet back to the ethernet address of Adapters 2 and 3 in response to Adapter 1's IP address and the Windows host should route it to the proper interface.
That sounds confusing... but can't think of a better way to phrase this

And finally, RFC 919 specifically says From RFC 919

Since we assume that the problem has already been solved at the data link layer, an IP host wishing to
send either a local broadcast or a directed broadcast need only
specify the appropriate destination address and send the datagram as
usual. Any sophisticated algorithms need only reside in gateways.

Reading that would suggest that the source IP address is irrelevant for a broadcast.

Since each application seems to handle broadcasts differently, I think that's where the responsibility resides. For example. nbtstat sends out directed broadcasts on multi-NICed machines, whereas games might use global broadcasts.
In short, the application should be fixed, not the OS in this case...

EDIT: Here is a link for the same circumstances, but on Linux. The linux kernel handles it by only sending one packet out the default interface (NIC A in this example). They recommend that the application enumerate the NICs and send a directed broadcast out each NIC. Link

  • 2
    In don't understand the relation between the paragraph you're quoting from RFC 919 and the source address. It seems obvious to me that it is always wrong to send an IP packet on an interface with the source address of another interface, regardless of the broadcast/unicast nature of the packet. I mean, you can't reasonably say "the source IP address is irrelevant for a broadcast", of course it is! How else are applications supposed to know who sent the broadcast? Oct 7, 2009 at 15:24
  • 1
    "It also mentions in 919 that a specific physical interface should be selected for the broadcast." Where? "The address denotes a broadcast on a local hardware network" (RFC919 7.)? In that case I respectfully disagree. We're discussing what to do with broadcasts at the host level, not at the network level. Besides, it is said just below that a host may "broadcast to all of its immediate neighbors by using". All its immediate neighbours. Not "all the neighbours on a specific network interface". Oct 7, 2009 at 15:32
  • 1
    "Applications don't care which interface sent the broadcast. They just need to respond to it." Huh... they need to send broadcasts too, not only respond to them. Consider the case of a LAN gameserver browser. It sends broadcast packets to discover game servers on the network. If the broadcast packets are not sent to all interfaces, the gameserver browser will not show game servers reachable through these interfaces. In other words, epic fail. Oct 7, 2009 at 16:52
  • 1
    "I am not sure, but I think that the OS is seeing request and saying that it needs to send that out on all interfaces (to find all immediate neighbors), but it was requested from a specific application, bound to a specific IP (might be default based on metric)." I agree. That doesn't mean it's the Right Thing To Do. In my opinion it completely violates the principle of least surprise from the point of view of the application developer, who just expects to have the packet sent to everyone on all interfaces. Oct 7, 2009 at 16:55
  • 4
    Not sure what you mean by duplicated. The RFCs specifically forbid forwarding of broadcast packets. There should only be one packet sent, which I think is the whole crux of our discussion. If the OS were to do as you say, it would actually have to generate 9 total packets (3 for each interface) because the IP layer would have to generate three packets with separate source IPs (one for each NIC at Layer 3) and then each NIC would have to send those out on the Ethernet (Layer 2). If there were routes between networks, then you get 3 responses back! Which one is right? Oct 7, 2009 at 18:41

Finally, I solved it programmatically. I wrote a tiny software called WinIPBroadcast which takes care of relaying the broadcast frames to all interfaces.

It works using an interesting fact: it is possible to receive locally generated global broadcast packets when listening on the loop back address ( WinIPBroadcast listens on the local address for all broadcast using RAW sockets, then for each broadcast packet, it relays it to all interfaces except the preferred one.

Update 06.12.2021: Updated Link for the community

  • As the windows stack is a fork of the BSD stack, I'm curious to know if BSD exhibits the same behaviour.
    – x0n
    Apr 22, 2011 at 14:20
  • Your software doesn't work. The program can't start becuase api-ms-win-core-rtlsupport-l1-2-0.dll is missing from your computer.. Good luck finding that .dll on Google.
    – Alex G
    Sep 12, 2017 at 3:42
  • @AlexG: that's weird, I thought I had fixed that problem through github.com/dechamps/WinIPBroadcast/commit/…. Are you sure you are running the last version (1.6)? Feel free to file a bug at github.com/dechamps/WinIPBroadcast/issues and I'll take a look. Sep 12, 2017 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.