Routing problem in DCE quagga ospf

318 views
Skip to first unread message

1989c...@gmail.com

unread,
May 13, 2014, 10:40:30 PM5/13/14
to ns-3-...@googlegroups.com
Hi,
I'm using dce-quagga ospf as routing protocols in my simulation. I have built a simple topology but the ospf routing doesn't work correctly. Could anyone offer a help? Really appreciate it.

The topology and IP address assigning are as follows:
     
  10.0.0.1     10.0.0.2  10.0.0.3    10.0.0.4  10.0.0.5     10.0.0.6        
 n0--------------------------n1--------------------------n2---------------------------n3
All these four nodes are running dce-quagga ospfd.

I bind an UDP client in n0 and an UDP-echo-server in n3, and several packets are sent by n0 to n3.
During the simulation, all the packets from n0 can reach n3 correctly. However, the echo packets generated by n3 can't reach n0. All the echo packets just bounced on the link between n2 and n3 till the TTL=0.
It seems that n2 didn't set up the right routing table, so it sent these echo packets(dest to 10.0.0.1) back to n3.

I have checked all the ospf LSAs as follows:
1.Between n0 and n1, LSAs are only generated by n1 and indicate that there is a stub link which ID is 10.0.0.0
2.Between n1 and n2, LSAs are only generated by n1 and indicate that there are two stub lins which ID are both 10.0.0.0
3.Between n2 and n3, LSAs are generated both by n2 and n3. LSAs generated by n2 indicate that there is a stub link (ID=10.0.0.0) and a transit link (ID=10.0.0.6); LSAs generated by n3 indicate that there is a transit link (ID=10.0.0.6).

I don't quite understand whether those LSAs work correctly. If not, what kind of LSAs should be generated and what's wrong with my script? Hope you can help me with that. Really appreciate that!

Guo Chen



My script are as follows
===============================================================================
#include "ns3/network-module.h"
#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/dce-module.h"
#include "ns3/quagga-helper.h"
#include "ns3/point-to-point-helper.h"
#include "ns3/applications-module.h"

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("DceQuaggaOspfd");

// Parameters
uint32_t nNodes = 3;
uint32_t stopTime = 600;
std::string netStack = "ns3";


int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.AddValue ("nNodes", "Number of Router nodes", nNodes);
cmd.AddValue ("stopTime", "Time to stop(seconds)", stopTime);
cmd.AddValue ("netStack", "What network stack", netStack);
cmd.Parse (argc,argv);

//
//  Step 1
//  Node Basic Configuration
//
NodeContainer nodes;
nodes.Create (nNodes);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer *devices;
devices=new NetDeviceContainer[nNodes-1];
for(int i=0;i<nNodes-1;i++)
{
devices[i]=pointToPoint.Install (nodes.Get(i),nodes.Get(i+1));
}
DceManagerHelper processManager;
Ipv4AddressHelper ipv4AddrHelper;

// Internet stack install
InternetStackHelper stack;    
Ipv4DceRoutingHelper ipv4RoutingHelper;
stack.SetRoutingHelper (ipv4RoutingHelper);
stack.Install (nodes);

ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.0");
Ipv4InterfaceContainer *interfaces;
interfaces=new Ipv4InterfaceContainer[nNodes-1];
for(int i=0;i<nNodes-1;i++)
{
interfaces[i]=ipv4AddrHelper.Assign (devices[i]);
}

processManager.Install (nodes);

QuaggaHelper quagga;
quagga.EnableOspf (nodes, "10.0.0.0/16");
quagga.EnableOspfDebug (nodes);
quagga.EnableZebraDebug (nodes);
quagga.Install (nodes);

uint16_t port = 9;  // well-known echo port number
UdpEchoServerHelper server (port);
ApplicationContainer apps = server.Install (nodes.Get (nNodes-1));
apps.Start (Seconds (101));
apps.Stop (Seconds (110));
 
//
// Create a UdpEchoClient application to send UDP datagrams from node zero to
// node one.
//
Address serverAddress;
serverAddress = Address(interfaces[nNodes-2].GetAddress (1));
//std::cout<<"hello"<<std::endl;
uint32_t packetSize = 1024;
uint32_t maxPacketCount = 10;
Time interPacketInterval = Seconds (1.);
UdpEchoClientHelper client (serverAddress, port);
client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
client.SetAttribute ("Interval", TimeValue (interPacketInterval));
client.SetAttribute ("PacketSize", UintegerValue (packetSize));
apps = client.Install (nodes.Get (0));
apps.Start (Seconds (102));
apps.Stop (Seconds (110));
 

pointToPoint.EnablePcapAll ("dce-quagga-ospfd",false);
//
// Step 9
// Now It's ready to GO!
//
if (stopTime != 0)
{
Simulator::Stop (Seconds (stopTime));
}
Simulator::Run ();
Simulator::Destroy ();

return 0;
}



1989c...@gmail.com

unread,
May 13, 2014, 10:56:49 PM5/13/14
to ns-3-...@googlegroups.com
All the packet traces are attached here.

在 2014年5月14日星期三UTC+8上午10时40分30秒,1989c...@gmail.com写道:
dce-quagga-ospfd-0-0.pcap
dce-quagga-ospfd-1-0.pcap
dce-quagga-ospfd-1-1.pcap
dce-quagga-ospfd-2-0.pcap
dce-quagga-ospfd-2-1.pcap
dce-quagga-ospfd-3-0.pcap

1989c...@gmail.com

unread,
May 15, 2014, 8:48:02 PM5/15/14
to ns-3-...@googlegroups.com
Can anybody help me? Thanks very much!

Tommaso Pecorella

unread,
May 16, 2014, 2:44:03 PM5/16/14
to ns-3-...@googlegroups.com
Hi,

sorry or the extremely late reply. I'm not a dce expert, and my current setup can't run dce, but I'll try.

I can be wrong, but I see some potential issues in your configuration. 

  10.0.0.1            10.0.0.2  10.0.0.3            10.0.0.4  10.0.0.5             10.0.0.6        
 n0--------------------------n1--------------------------n2---------------------------n3

The above picture is missing the network mask. In any case it's suspicious, because... because.
When you assign network addresses to a link, you must use at least 2 bits, in order to have 2 nodes and a broadcast address (with the possible exception of point-to-point links).

In your case you're using p2p links, so there's nothing wrong. BUT... let's see the network masks.
ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.0");

and here's the bug. It should have been:
ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.254");

Moreover, you told Quagga to use another network mask:
quagga.EnableOspf (nodes, "10.0.0.0/16");
instead of
quagga.EnableOspf (nodes, "10.0.0.0/31");

Summarizing, your nodes are all in the same network, thus routing went fishin'

Hope this helps,

T.

Hajime Tazaki

unread,
May 16, 2014, 10:20:26 PM5/16/14
to ns-3-...@googlegroups.com

Hi,

what about changing network address AFTER each address
assignment ?

> >> interfaces[i]=ipv4AddrHelper.Assign (devices[i]);

ipv4AddrHelper.NewNetwork ();

that would give a separate network address to each link,
which may relevant to Tommasso's suggestion.

note that QuaggaHelper can only configure broadcast type of
ospf links: no point-to-point type is configured.

-- Hajime

At Fri, 16 May 2014 11:44:03 -0700 (PDT),
Tommaso Pecorella wrote:
>
> Hi,
>
> sorry or the extremely late reply. I'm not a dce expert, and my current
> setup can't run dce, but I'll try.
>
> I can be wrong, but I see some potential issues in your configuration.
>
> 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 10.0.0.5
> 10.0.0.6
> n0--------------------------n1--------------------------n2---------------------------n3
>
> The above picture is missing the network mask. In any case it's suspicious,
> because... because.
> When you assign network addresses to a link, you must use at least 2 bits,
> in order to have 2 nodes and a broadcast address (with the possible
> exception of point-to-point links).
>
> In your case you're using p2p links, so there's nothing wrong. BUT... let's
> see the network masks.
> ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.0");
>
> and here's the bug. It should have been:
> ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.254");
>
> Moreover, you told Quagga to use another network mask:
> quagga.EnableOspf (nodes, "10.0.0.0/16");
> instead of
> quagga.EnableOspf (nodes, "10.0.0.0/ <http://10.0.0.0/16>31");
> --
> 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.

1989c...@gmail.com

unread,
May 16, 2014, 10:47:38 PM5/16/14
to ns-3-...@googlegroups.com
Hi Hajime,
   Great thanks for your reply. I've followed your instruction and add "ipv4AddrHelper.NewNetwork ()" to assign different subnet for each pointTopoint link.
   However, the UDP client didn't send any UDP packets at all this time! I can't find any UDP packets in the pcap traces.
   There must be something else wrong. Hope you can help me.

Really appreciate that! 

1989c...@gmail.com

unread,
May 16, 2014, 10:50:58 PM5/16/14
to ns-3-...@googlegroups.com
Hi Tommaso
   Great thanks for your reply! I've followed your and Hajime's instructions, but countered another problem. Please see my response to Hajime. 
   Thank you very much!

Tommaso Pecorella

unread,
May 17, 2014, 3:13:32 AM5/17/14
to ns-3-...@googlegroups.com
Hi,

Hajime pointed out that Quagga isn't very keen with p2p links.
As a consequence, you should assign addresses with a /30 subnet. Otherwise links will not have a broadcast address.

T.

1989c...@gmail.com

unread,
May 17, 2014, 8:18:56 PM5/17/14
to ns-3-...@googlegroups.com
Hi, 
I have solved this problem. You are right. I made two changes and everything worked:
1. I assigned different subnet for each p2p link;
2. I installed the internet stack to the nodes before p2p links were set.

The second point seems to be a bug. But anyway, my script works!
 Thanks again! It's very kind of you.

Hajime Tazaki

unread,
Jun 1, 2014, 7:58:09 PM6/1/14
to ns-3-...@googlegroups.com

would you mind if you share your script ?
two scripts (1: having an issue and, 2: no issue version)
are really helpful to investigate the bug.

thank you !

-- Hajime

At Sat, 17 May 2014 17:18:56 -0700 (PDT),
1989c...@gmail.com wrote:
>
> [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.
> [2 <text/html; UTF-8 (quoted-printable)>]
>

1989c...@gmail.com

unread,
Jun 3, 2014, 2:43:23 AM6/3/14
to ns-3-...@googlegroups.com
Sure not. 
1. The script having an issue:
=============================================================================
2. The script working well:
// Internet stack install
InternetStackHelper stack;    
Ipv4DceRoutingHelper ipv4RoutingHelper;
stack.SetRoutingHelper (ipv4RoutingHelper);
stack.Install (nodes);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer *devices;
devices=new NetDeviceContainer[nNodes-1];
for(int i=0;i<nNodes-1;i++)
{
devices[i]=pointToPoint.Install (nodes.Get(i),nodes.Get(i+1));
}
DceManagerHelper processManager;
Ipv4AddressHelper ipv4AddrHelper;


ipv4AddrHelper.SetBase ("10.0.0.0", "255.255.255.0");
Ipv4InterfaceContainer *interfaces;
interfaces=new Ipv4InterfaceContainer[nNodes-1];
for(int i=0;i<nNodes-1;i++)
{
interfaces[i]=ipv4AddrHelper.Assign (devices[i]);
ipv4AddrHelper.NewNetwork();
在 2014年6月2日星期一UTC+8上午7时58分09秒,Hajime写道:
Reply all
Reply to author
Forward
0 new messages