Bug 2195 - Udp[Trace]Client can't send packets to broadcast address
Udp[Trace]Client can't send packets to broadcast address
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P5 enhancement
Assigned To: George Riley
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-18 16:52 UTC by Tommaso Pecorella
Modified: 2015-10-19 17:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2015-10-18 16:52:04 UTC
UdpClient and UdpTraceClient sockets are missing a call to SetAllowBroadcast(true).

The net result is that they refuse to send packets to broadcast addresses, causing users puzzling (see https://groups.google.com/forum/#!topic/ns-3-users/uV_CdAZbT-I).

The proposed change is: add a SertAllowBroadcast (true) to the two apps. There's no real reason to prevent the use of a broadcast address in sending UDP packets. it can have a sense in UdpEcho[Client, Server] because the server will echo to the client, but even there it is debatable.

Note: UDP sockets refuse to send packets to broadcast addresses by default.
Comment 1 Tom Henderson 2015-10-18 23:02:07 UTC
+1; moving to patch pending since patch proposed the report
Comment 2 Tommaso Pecorella 2015-10-19 16:13:57 UTC
changeset 11693	49602a02bf68

I changed UdpEchoClient as well for the records, as it could be interesting to allow a broadcast Echo (though it will most probably cause a collision).