Please help me with link failure in DCE Linux kernel

410 views
Skip to first unread message

Michal Travnicek

unread,
Apr 15, 2013, 4:37:25 PM4/15/13
to ns-3-...@googlegroups.com
Hello all,

could you please help me with a problem i`m facing at the moment. I`m trying to simulate UDP traffic from one end of the network to the other end. When I use Ipv4::SetDown on the interface on the node that is in the way of traffic, I would expect the routing protocol to automatically redirect traffic through alternative path. But in my simulation when I use Ipv4::SetDown the simulation ends with SIGSEGV error. Whole simulation takes 100 s, link down is set at 60 s and when I run the simulation, it tracks traffic to PCAP untill 60 s and then it shows SIGSEGV error. So I think there must be something wrong with routing.

Please help me i`m getting desparate about this problem. My code is bellow, even with basic model of network.
I`m using Ubuntu 12.04, i simulate also normal ns-3 and also ns-3 DCE Quagga with Linux kernel and everything works fine. Link failure in ns-3 and ns-3 DCE Quagga runs fine as well.

Thanks in advance,
Michal Travnicek

//
//      n2-------
//    /         |
//   /          |
// n0    ns3----n4-----n5
//   \    /             |
//    \  /              |
//     n1----------------                            
// 


#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/dce-module.h"

using namespace ns3;

static std::string Ipv4AddressToString (Ipv4Address ad)
{
  std::ostringstream oss;
  ad.Print (oss);
  return oss.str ();
}

NS_LOG_COMPONENT_DEFINE ("DceNavrh");


int
main (int argc, char *argv[])
{

 
  CommandLine cmd;
  cmd.Parse (argc, argv);
 
  NodeContainer c;

 

  c.Create (6);    
  NodeContainer n0n2 = NodeContainer (c.Get (0), c.Get (2));
  NodeContainer n0n1 = NodeContainer (c.Get (0), c.Get (1));
  NodeContainer n2n4 = NodeContainer (c.Get (2), c.Get (4));
  NodeContainer n1n3 = NodeContainer (c.Get (1), c.Get (3));
  NodeContainer n3n4 = NodeContainer (c.Get (3), c.Get (4));
  NodeContainer n1n5 = NodeContainer (c.Get (1), c.Get (5));
  NodeContainer n4n5 = NodeContainer (c.Get (4), c.Get (5));


  DceManagerHelper dceManager;
 

  dceManager.SetNetworkStack ("ns3::LinuxSocketFdFactory", "Library",  StringValue ("liblinux.so"));
  LinuxStackHelper stack;
  stack.Install (c);

 
  PointToPointHelper p2p;
  p2p.SetDeviceAttribute ("DataRate", StringValue ("768kbps")); //768kbsp
  p2p.SetChannelAttribute ("Delay", StringValue ("0ms"));

  NetDeviceContainer d0d2 = p2p.Install (n0n2);
  NetDeviceContainer d0d1 = p2p.Install (n0n1);
  NetDeviceContainer d2d4 = p2p.Install (n2n4);
  NetDeviceContainer d1d3 = p2p.Install (n1n3);
  NetDeviceContainer d3d4 = p2p.Install (n3n4);
  NetDeviceContainer d1d5 = p2p.Install (n1n5);
  NetDeviceContainer d4d5 = p2p.Install (n4n5);

 
  Ipv4AddressHelper ipv4;

  ipv4.SetBase ("10.0.20.0", "255.255.255.0");
  Ipv4InterfaceContainer i0i2 = ipv4.Assign (d0d2);

  ipv4.SetBase ("10.0.10.0", "255.255.255.0");
  Ipv4InterfaceContainer i0i1 = ipv4.Assign (d0d1); 

  ipv4.SetBase ("10.20.40.0", "255.255.255.0");
  Ipv4InterfaceContainer i2i4 = ipv4.Assign (d2d4);

  ipv4.SetBase ("10.10.30.0", "255.255.255.0");
  Ipv4InterfaceContainer i1i3 = ipv4.Assign (d1d3);

  ipv4.SetBase ("10.30.40.0", "255.255.255.0");
  Ipv4InterfaceContainer i3i4 = ipv4.Assign (d3d4);

  ipv4.SetBase ("10.10.50.0", "255.255.255.0");
  Ipv4InterfaceContainer i1i5 = ipv4.Assign (d1d5);

  ipv4.SetBase ("10.40.50.0", "255.255.255.0");
  Ipv4InterfaceContainer i4i5 = ipv4.Assign (d4d5);

  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

  dceManager.Install (c);

  DceApplicationHelper process;
  ApplicationContainer apps;
 

  std::ostringstream oss;

  process.SetBinary ("udp-perf");
  process.AddArgument ("--duration=100");
  process.AddArgument (oss.str ().c_str ());
  oss.clear ();
  apps = process.Install (c.Get(0));
  apps.Start (Seconds (1.0));

  process.SetBinary ("udp-perf");
  process.ResetArguments ();
  process.AddArgument ("--pktsize=1024");
  process.AddArgument (oss.str ().c_str ());
  oss.clear ();
  process.AddArgument ("--port=9");
  process.AddArgument (oss.str ().c_str ());
  oss.clear ();
  process.AddArgument ("--client");
  process.AddArgument (oss.str ().c_str ());
  oss.clear ();
  oss.str ("");
  oss << "--host=" << Ipv4AddressToString ("10.0.10.1");
  process.AddArgument (oss.str ().c_str ());
  oss.clear ();
  oss.str ("");
  process.AddArgument ("--duration=100");
  apps = process.Install (c.Get(5));
  apps.Start (Seconds (1.0));


  p2p.EnablePcapAll ("merenidce/uzel");

     
  Ptr<Node> n1 = c.Get (1);
  Ptr<Ipv4> ipv43 = n1->GetObject<Ipv4> ();


 
 // The first ifIndex is 0 for loopback, then the first p2p is numbered 1,

  // then the next p2p is numbered 2

  uint32_t ifIndex3 = 3; // interface 2 on node 1 connecting node 1 with node 5

 Simulator::Schedule (Seconds (60.0),&Ipv4::SetDown,ipv43, ifIndex3);
  
  Simulator::Stop (Seconds (100.0));
  Simulator::Run ();
  Simulator::Destroy ();
 
  return 0;
 
}

Hajime Tazaki

unread,
Apr 17, 2013, 3:11:59 AM4/17/13
to ns-3-...@googlegroups.com

Hi,

I looked at your script.

The reason of SEGV is the ifindex specified for link down
(SetDown).

If I changed the following line from 3 to 2, SEGV was
disappeared.

uint32_t ifIndex3 = 3; // interface 2 on node 1 connecting node 1 with node 5

The interface index in ns-3 was started from 0 as you
guessed, but loopback interface is not correctly counted IF
you used DCE linux.

I'm going to find a solution of this issue, but for a
workaround, you can specify the different ifindex for your
simulation.



-- Hajime

At Mon, 15 Apr 2013 13:37:25 -0700 (PDT),
Michal Travnicek wrote:
>
> [1 <text/plain; ISO-8859-1 (7bit)>]

Michal Travnicek

unread,
Apr 17, 2013, 2:55:27 PM4/17/13
to ns-3-...@googlegroups.com
Hello Hajime,

thanks a lot for your answer. I tried to change interface number but it didn`t help. Well, it doesn`t show SIGSEGV error now, but the simulation runs and no link failure occurs. So it runs like normal simulation with no failure. I also tried to set down some other interfaces on different nodes, but the result was the same.

It`s important for me to know if there is some mistake in my code or if the failure event doesn`t run well in ns-3 DCE Linux. It`s for my Master Thesis so i would need some confirmation about this if its possible please. Because if there is something that i`m doing wrong i need to fix it. :)

I would really appreciate your help,

Thanks so much in advance,
Michal Travnicek


Dne středa, 17. dubna 2013 9:11:59 UTC+2 Hajime napsal(a):

Hajime Tazaki

unread,
Apr 20, 2013, 9:53:44 AM4/20/13
to ns-3-...@googlegroups.com

Hi,

currently, DCE requires additional call after
Ipv4GlobalRoutingHelper::PopulateRoutingTables () due to
lack of enough implementation of routing table
manipulation. so first, you can add the following call after
Ipv4GlobalRoutingHelper::PopulateRoutingTables.

LinuxStackHelper::PopulateRoutingTables ();

next, DCE currently doesn't implement netdevice state,
though SetDown method is available. The method is simply set
an internal state but nobody look at that state so, all the
traffic pass to the network device even if the SetDown is
called. and routing daemons/protocols are not interact with
this state either.

it would be nice to support such a feature for DCE, but I
can't tell when it would be.

-- Hajime

At Wed, 17 Apr 2013 11:55:27 -0700 (PDT),
Michal Travnicek wrote:
>
> [1 <text/plain; UTF-8 (quoted-printable)>]
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> [2 <text/html; UTF-8 (quoted-printable)>]
>

Jonay Rodríguez Báez

unread,
Nov 7, 2016, 7:55:17 AM11/7/16
to ns-3-users
Hi, 

I know that this is an old post but currently, I have the same problem. Is SetDown available in DCE ?. 

I'm using NS3 version 2.6 and  DCE (version 1.9)  with BGP. After few seconds, if I try to set down a node, I receive a SIGSEGV exception. Any help is welcome.

Thanks.

Matt Anonyme

unread,
Nov 7, 2016, 10:08:57 AM11/7/16
to ns-3-users
I am afraid you might need to implement it yourself or hack around the problem sry

Jonay Rodríguez Báez

unread,
Nov 8, 2016, 3:27:32 AM11/8/16
to ns-3-users
Hi Matt,
Thanks for your quick response. Finally, I have decided to try other solution. Using Config::Set to increase the links delay, I can 'down' a BGP node and force the rooting remap.

Regards
Reply all
Reply to author
Forward
0 new messages