DCE 1.4 - UDP Broadcast

92 views
Skip to first unread message

Richard

unread,
Jan 12, 2015, 1:21:13 PM1/12/15
to ns-3-...@googlegroups.com
I'm trying to capture broadcast packets sent from my application using pcap. The files are always empty however my application reports the packet was sent successfully, it works natively too.

The routing tables and IP addresses all look OK inside the DCE node, shown below.

The broadcast is sent from each host to 10.1.1.255.

I've tried my simulation with iperf and the pcap is created as expected.

All the broadcast related discussion seems to point towards stock NS3 sockets, so I'm not sure where I am going wrong here, does anyone have a working example or a few pointers? 

I've attached the minimal version of my code and simulation, any help would be much appreciated.

Thanks in advance,

Richard


ip route show table main
 10.1.1.0/24 dev sim0  proto kernel  scope link  src 10.1.1.1

ip route show table local
 broadcast 127.255.255.255 dev lo  proto kernel  scope link  src 127.0.0.1
 broadcast
10.1.1.255 dev sim0  proto kernel  scope link  src 10.1.1.1
 broadcast
127.0.0.0 dev lo  proto kernel  scope link  src 127.0.0.1
 
local 10.1.1.1 dev sim0  proto kernel  scope host  src 10.1.1.1
 
local 127.0.0.1 dev lo  proto kernel  scope host  src 127.0.0.1
 broadcast
10.1.1.0 dev sim0  proto kernel  scope link  src 10.1.1.1
 
local 127.0.0.0/8 dev lo  proto kernel  scope host  src 127.0.0.1

ip addr show
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link
/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet
127.0.0.1/8 scope host lo
    inet6
::1/128 scope host
       valid_lft forever preferred_lft forever
 
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
    link
/sit 0.0.0.0 brd 0.0.0.0
 
3: ip6tnl0: <NOARP> mtu 1460 qdisc noop state DOWN
    link
/tunnel6 :: brd ::
 
4: sim0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link
/ether 00:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet
10.1.1.1/24 scope global sim0
    inet6 fe80
::200:ff:fe00:1/64 scope link tentative
       valid_lft forever preferred_lft forever

application output
 Sent: 20 Bytes to 10.1.1.255

dce-broadcast-test.cc
broadcast.c

Richard

unread,
Jan 13, 2015, 7:12:40 AM1/13/15
to ns-3-...@googlegroups.com
After playing around with the code a little more, it seems like the ns3 pcap is unable to capture a small amount of data. After increasing the total UDP payload sent from 20 bytes to ~2 Kilobytes, pcap works as expected. 

It's not pivotal that I can capture the broadcasts, but it would be great if anyone has any advice/explanation as to why this is the case, or if there is a fix?

Thanks, 

Richard

Hajime Tazaki

unread,
Jan 13, 2015, 10:59:10 AM1/13/15
to ns-3-...@googlegroups.com

I didn't spot the root cause of the issue, but when pcap
writer is used with DCE, the destructor of PcapWriter, which
calls fflush() to flush out pcap file, is not called.

the following patch is workaround for PointToPointNetDevice:
you may need to patch with a similar way to other NetDevice
(e.g., WiFiNetDevice).

https://gist.github.com/thehajime/f1878cdfc0d19bfa1c5d

-- Hajime

At Tue, 13 Jan 2015 04:12:40 -0800 (PST),
Richard wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; UTF-8 (7bit)>]
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [1.2 <text/html; UTF-8 (quoted-printable)>]
>

Richard Withnell

unread,
Jan 13, 2015, 1:43:25 PM1/13/15
to ns-3-...@googlegroups.com
After amending for the CsmaNetDevice, it works perfectly. 

Much appreciated, thanks Hajime. 

>

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/dmlmZ7a6t-4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages