base station operating at two frequencies

148 views
Skip to first unread message

Mallesh Yadhav

unread,
Jun 11, 2015, 4:57:16 AM6/11/15
to ns-3-...@googlegroups.com
Hi,

      Is there any way to operate a node on NS-3 in frequencies. I am trying to create a scenario, where two slave nodes operate in different frequencies and one base station operate in two frequencies. The communication should take place on all 3 nodes.

    please help me.

Thanks & regards,
  Mallesh

Konstantinos

unread,
Jun 11, 2015, 5:22:37 AM6/11/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Hi Mallesh,

Please give more information on your design. I guess you want to use WiFi module as this was in your tags, but make it clear.
Do you want the AP to have TWO radios or have a multi-channel operation on a single radio?

Please consider studying the WAVE module and specifically the multi-channel operation of IEEE 1609.4 that has been implemented.
The WAVE module does not work in infrastructure mode, but  I guess that with some development you could place the 1609.4 ontop of the WiFi.

Regards,
K.

Mallesh Yadhav

unread,
Jun 11, 2015, 8:51:34 AM6/11/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Thank you very much for quick response,

       I want the AP to have a multi-channel operation on a single radio. While installing nodes, how to select two channels for AP and only single channel for stations.

Thanks & regards,
    Mallesh

Konstantinos

unread,
Jun 11, 2015, 9:00:55 AM6/11/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
As I said, multi-channel operation with WIFI in infrastructure mode is currently not available.
There is a multi-channel operation based on IEEE 1609.4 implemented in WAVE module which is only for ad-hoc mode.
You need to understand that and then implement the required functionality (either re-using that code or re-implementing the same functionality).

Mallesh Yadhav

unread,
Jun 12, 2015, 5:21:58 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Hi, Thank you very much for the response.

      I am trying to install two netdevices with two different channels as shown in the below code. I am getting error  sg="InternetStackHelper::Install (): Aggregating an InternetStack to a node with an existing Ipv4 object", file=../src/internet/helper/internet-stack-helper.cc, line=430

            ns3::NodeContainer n1;
            ns3::NodeContainer n2;
            ns3::NodeContainer m;
            m.Create(3);
            n1.Add(m.Get(0));
            n1.Add(m.Get(1));
            n2.Add(m.Get(1));
            n2.Add(m.Get(2));

            /* Configure the wireless channel characteristics */
            ns3::YansWifiChannelHelper wifiChannel;
            ns3::YansWifiChannelHelper c_wifiChannel;

            wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel");
            ns3::Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", ns3::DoubleValue(range));
            wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");

            c_wifiChannel.AddPropagationLoss("ns3::LogDistancePropagationLossModel");
            ns3::Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", ns3::DoubleValue(1.85));
            ns3::Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", ns3::DoubleValue(59.7));
            c_wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");

            ns3::YansWifiPhyHelper wifiPhy = ns3::YansWifiPhyHelper::Default();
            ns3::YansWifiPhyHelper c_wifiPhy = ns3::YansWifiPhyHelper::Default();
            wifiPhy.SetChannel(wifiChannel.Create());
            c_wifiPhy.SetChannel(c_wifiChannel.Create());
            /* Install wifiPhy and link it with STDMA medium access control layer implementation */
            NetDeviceContainer devices1;
            NetDeviceContainer devices2;
            devices1 = stdma.Install(wifiPhy, stdmaMac, n1);
            devices2 = stdma.Install(c_wifiPhy, stdmaMac, n2);
            mobility.InstallAll();
            AnimationInterface anim("multi.xml");
            anim.EnablePacketMetadata(true);
            anim.EnableIpv4RouteTracking("routing-table.txt",Seconds(0.0),Seconds(100.0),Seconds(5.0));

            AodvHelper aodv;

            /* Install internet stack on all nodes */
            InternetStackHelper internet1, internet2;
            internet1.SetRoutingHelper (aodv);
            internet1.Install (n1);
            internet2.SetRoutingHelper (aodv);
            internet2.Install (n2);

            /* Assign ip address to each node */
            Ipv4AddressHelper ipv4;
            ipv4.SetBase ("10.1.1.0", "255.255.255.0");
            Ipv4InterfaceContainer I1 = ipv4.Assign (devices1);
            Ipv4InterfaceContainer I2 = ipv4.Assign (devices2);
            ns3::Config::SetDefault("ns3::Ipv4GlobalRouting::RespondToInterfaceEvents", BooleanValue (true));

..

         Please help why it is like that.

Konstantinos

unread,
Jun 12, 2015, 5:36:56 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
The error is clear. You are trying to install the InternetStack on a node that already has one.
Since with respect to internet stack, all the nodes are the same, 
this code:
    InternetStackHelper internet1, internet2;
            internet1
.SetRoutingHelper (aodv);
            internet1
.Install (n1);
            internet2
.SetRoutingHelper (aodv);
            internet2
.Install (n2);
can be revised to this:
    InternetStackHelper internet;
            internet
.SetRoutingHelper (aodv);
            internet
.Install (m);

In addition, when you want to use Config::SetDefault(), you have to call it at the beginning of your scenario, before the actual usage of the class. Similar for the Range model and GlobalRouting.
 ns3::Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", ns3::DoubleValue(1.85));
 ns3
::Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", ns3::DoubleValue(59.7));

   c_wifiChannel.AddPropagationLoss("ns3::LogDistancePropagationLossModel");

Mallesh Yadhav

unread,
Jun 12, 2015, 5:48:59 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Hi, thank you very much sir, the error is solved. But when installing an application I am getting 100% packet loss with below code.

            /* Create network nodes */

            ns3::NodeContainer n1;
            ns3::NodeContainer n2;
            ns3::NodeContainer m;
            m.Create(4);
            n1.Add(m.Get(0));
            n1.Add(m.Get(1));
            n2.Add(m.Get(2));
            n2.Add(m.Get(3));


            /* Configure the wireless channel characteristics */
            ns3::YansWifiChannelHelper wifiChannel;
            ns3::YansWifiChannelHelper c_wifiChannel;

            wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel");
            ns3::Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", ns3::DoubleValue(range));
            wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");

            ns3::Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", ns3::DoubleValue(1.85));
            ns3::Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", ns3::DoubleValue(59.7));
            c_wifiChannel.AddPropagationLoss("ns3::LogDistancePropagationLossModel");
            c_wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");

            ns3::YansWifiPhyHelper wifiPhy = ns3::YansWifiPhyHelper::Default();
            ns3::YansWifiPhyHelper c_wifiPhy = ns3::YansWifiPhyHelper::Default();
            wifiPhy.SetChannel(wifiChannel.Create());
            c_wifiPhy.SetChannel(c_wifiChannel.Create());

            /* Install wifiPhy and link it with STDMA medium access control layer implementation */
            NetDeviceContainer devices1;
            NetDeviceContainer devices2;
            devices1 = stdma.Install(wifiPhy, stdmaMac, n1);
            devices2 = stdma.Install(c_wifiPhy, stdmaMac, n2);

            /* Define positions of the two nodes */
            ns3::MobilityHelper mobility;

            mobility.InstallAll();
            AnimationInterface anim("multi.xml");
            anim.EnablePacketMetadata(true);
            anim.EnableIpv4RouteTracking("routing-table.txt",Seconds(0.0),Seconds(100.0),Seconds(5.0));

            AodvHelper aodv;

            /* Install internet stack on all nodes */
            InternetStackHelper internet;
            internet.SetRoutingHelper (aodv);
            internet.Install (m);

            /* Assign ip address to each node */
            Ipv4AddressHelper ipv4;
            ipv4.SetBase ("10.1.1.0", "255.255.255.0");
            Ipv4InterfaceContainer I1 = ipv4.Assign (devices1);
            Ipv4InterfaceContainer I2 = ipv4.Assign (devices2);
            ns3::Config::SetDefault("ns3::Ipv4GlobalRouting::RespondToInterfaceEvents", BooleanValue (true));

            InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (),80);
            /* Install the applications. */
            uint32_t packetSize = 400; /* bytes */
            uint32_t numPackets = 1500;
            double interval = 0.1;
            uint16_t port = 45000;
            UdpServerHelper server (port);
            Time interPacketInterval = Seconds (interval);
            uint16_t serverNode = 1;
            uint16_t clientNode = 0;
            int itr=0;
            for( itr=0; itr<1; itr++)
           {
                 ApplicationContainer apps = server.Install (n1.Get(serverNode));
                 std::cout<<"server: "<<n1.Get(serverNode)<<"\n";
                 apps.Start (Seconds (0+itr));
                 apps.Stop (Seconds (150+itr));
                 UdpClientHelper client(I1.GetAddress (serverNode), port+itr*10);
                 client.SetAttribute ("MaxPackets", UintegerValue (numPackets));
                 client.SetAttribute ("Interval", TimeValue (interPacketInterval));
                 client.SetAttribute ("PacketSize", UintegerValue (packetSize));
                 apps = client.Install (n1.Get(clientNode));
                 std::cout<<"client: "<<n1.Get(clientNode)<<"\n";
                 apps.Start (Seconds (1+10*itr));
                 apps.Stop (Seconds (140+itr));
            }

            numPackets = 5000;
            port = 46000;
            UdpServerHelper server2 (port);
            uint16_t servern = 0;
            uint16_t client = 1;
            for( itr=0; itr<1; itr++)
            {
                 ApplicationContainer apps2 = server2.Install (n2.Get(servern));
                 apps2.Start (Seconds (0+itr));
                 apps2.Stop (Seconds (200+itr));
                 UdpClientHelper client2 (I2.GetAddress (servern), port+itr*10);
                 client2.SetAttribute ("MaxPackets", UintegerValue (numPackets));
                 client2.SetAttribute ("Interval", TimeValue (interPacketInterval));
                 client2.SetAttribute ("PacketSize", UintegerValue (packetSize));
                 apps2 = client2.Install (n2.Get(client));
                 apps2.Start (Seconds (1+10*itr));
                 apps2.Stop (Seconds (200+itr));
            }


The first application is 0% loss but second application is resulting into 100% loss.                                         

Konstantinos

unread,
Jun 12, 2015, 6:00:42 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
I can't comment on that, since STDMA is not a native NS-3 module. 
You have added it yourself. 
Try with a single pair, using STDMA and all the rest the same, do you still have 100% loss?

Mallesh Yadhav

unread,
Jun 12, 2015, 6:07:59 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Thank you for the quick response sir,

      Yes sir, the second application alone getting resulted in 100% loss. But first application is 0% loss.

Konstantinos

unread,
Jun 12, 2015, 7:03:59 AM6/12/15
to ns-3-...@googlegroups.com, dasari.m...@gmail.com
Please check your application configuration again.

You start the two applications at exactly the same time, which has been discussed several times.
Try to give the clients some random start time.
Reply all
Reply to author
Forward
0 new messages