Hi Thomas,
thanks. I've filled a bugzilla entry: it seems a bug of DCE.
https://www.nsnam.org/bugzilla/show_bug.cgi?id=2035
-- Hajime
At Thu, 18 Dec 2014 13:29:19 -0800 (PST),
Thomas Burger wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; UTF-8 (7bit)>]
> Sorry, dce-tcp-simple.cc was the wrong attachment. Correct
> dce-udp-simple.cc is here.
>
>
>
> --
> 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 (7bit)>]
>
> [2 dce-udp-simple.cc <text/x-c++src; US-ASCII (7bit)>]
> #include "ns3/network-module.h"
> #include "ns3/core-module.h"
> #include "ns3/internet-module.h"
> #include "ns3/dce-module.h"
> #include "ns3/csma-module.h"
>
> using namespace ns3;
>
> int main (int argc, char *argv[])
> {
> CommandLine cmd;
> cmd.Parse (argc, argv);
>
> NodeContainer nodes;
> nodes.Create (1);
>
> NetDeviceContainer devices;
>
> CsmaHelper csma;
> csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps"));
> csma.SetChannelAttribute ("Delay", StringValue ("2ms"));
> devices = csma.Install (nodes);
>
> InternetStackHelper stack;
> stack.Install (nodes);
>
> Ipv4AddressHelper address;
> address.SetBase ("10.0.0.0", "255.255.255.0");
> Ipv4InterfaceContainer interfaces = address.Assign (devices);
>
> DceManagerHelper dceManager;
> dceManager.Install (nodes);
>
> DceApplicationHelper dce;
> ApplicationContainer apps;
>
> dce.SetStackSize (1 << 20);
>
> //Ignore UDP server
> //dce.SetBinary ("udp-server");
> //dce.ResetArguments ();
> //apps = dce.Install (nodes.Get (0));
> //apps.Start (Seconds (4.0));
>
> dce.SetBinary ("udp-client");
> dce.ResetArguments ();
> //dce.AddArgument ("127.0.0.1"); // works with write()
> //dce.AddArgument ("1.2.3.4"); // works with write(), -1 and EHOSTUNREACH
> dce.AddArgument ("10.0.0.123");// crashes with write() and send(), works with sendto()
> apps = dce.Install (nodes.Get (0));
> apps.Start (Seconds (4.5));
>
> Simulator::Stop (Seconds (1000100.0));
> Simulator::Run ();
> Simulator::Destroy ();
>
> return 0;
> }