Bug 2195

Summary: Udp[Trace]Client can't send packets to broadcast address
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: applicationsAssignee: George Riley <riley>
Status: RESOLVED FIXED    
Severity: enhancement CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

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).