Installing LTE and Wifi on same node in ns3

47 views
Skip to first unread message

drajesh

unread,
Feb 27, 2023, 6:01:34 AM2/27/23
to ns-3-users
Hi,
I am trying to simulate a scenario where the same node in a nodecontainer would have 2 interfaces, one for Wifi and one for LTE (could be in different bands to avoid complication or co-existence scenario). I am trying to use the example mixed-wireless.cc where the backbone nodes have wifi enabled already. When I try to install LTE on those nodes in backbone, I get the error "Aggregating an InternetStack to a node with an existing Ipv4 object" . However, enB devices do not install internet, its only the uedevices and a remote host.
Has anyone seen similar error or any suggestion please?
Thanks,
Rajesh

*Shahid*

unread,
Feb 27, 2023, 6:12:50 AM2/27/23
to ns-3-...@googlegroups.com
Check your code carefully, you are installing internal stack on some nodes which already have been installed on stack. 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/231a5b2a-d10e-4bb7-9832-437db8576587n%40googlegroups.com.

Tommaso Pecorella

unread,
Feb 27, 2023, 7:51:33 AM2/27/23
to ns-3-users
As a side note:
1) DO NOT POST ON OLD THREADS (I'm not referring to this one, you know what I'm referring to).
2) You can not install twice the IP stack on a node.
3) Study the tutorial, do not blindly copy-paste code.

Rajesh Dawadi

unread,
Feb 27, 2023, 8:08:07 AM2/27/23
to ns-3-...@googlegroups.com
Hello Tommaso,
From the error, "Aggregating an InternetStack to a node with an existing Ipv4 object", I looked at my code to see where I am installing the InternetStackHelper on a node twice but the only place where i am installing anything on my nodes are , first I install InternetStackHelper and then I call lteHelper->InstallEnbDevice which is giving me the error. Looking at the source code of the InstallEnbDevice function, I do not see it installing internetStackHelper, hence the confusion.


Tommaso Pecorella

unread,
Feb 27, 2023, 8:18:12 AM2/27/23
to ns-3-users
Attach the code, and be prepared to face the truth.

Rajesh Dawadi

unread,
Feb 27, 2023, 11:59:16 AM2/27/23
to ns-3-...@googlegroups.com
Hi Tom, Below is a snapshot of the code, basically I installed internet on the backbone nodes first and then create LTE nodes per backbone. However, I dont reinstall internet on the older backbone nodes and hence was surprised why the LTE install failed:
```
// 1. backbone nodecontainer has internet installed on them :
    InternetStackHelper internet;
    internet.SetRoutingHelper(olsr); // has effect on the next Install ()
    internet.Install(backbone);

    // 2. Creating a number of LTE enodeBs per backbone node, and installing LTE on them
    for (uint32_t i = 0; i < backboneNodes; ++i)
    {
        NS_LOG_INFO("Configuring LTE nodes in backbone node " << i);

        // new nodes per backbone node.
        NodeContainer newLTENodes;
        newLTENodes.Create(lteNodes - 1);
        // Now, create the container with all nodes on this link
        NodeContainer lte(backbone.Get(i), newLTENodes);
        Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
        Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper>();
        lteHelper->SetEpcHelper(epcHelper);
        Ptr<Node> pgw = epcHelper->GetPgwNode();
        NS_LOG_INFO("PGW created" << i);

        // RemoteHost
        NodeContainer remoteHostContainer;
        remoteHostContainer.Create(1);
        Ptr<Node> remoteHost = remoteHostContainer.Get(0);
        InternetStackHelper internet;
        NS_LOG_INFO("RemoteHost created" << i);
        internet.Install(remoteHostContainer);
        NS_LOG_INFO("Internet installed on remotehost" << i);


        // Internet
        PointToPointHelper p2ph;
        p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
        p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
        p2ph.SetChannelAttribute("Delay", TimeValue(MilliSeconds(10)));
        NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
        Ipv4AddressHelper ipv4h;
        ipv4h.SetBase("1.0.0.0", "255.0.0.0");
        Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
        // interface 0 is localhost, 1 is the p2p device
        Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);

        Ipv4StaticRoutingHelper ipv4RoutingHelper;
        Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
        ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
    remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);


        NS_LOG_INFO("Installing LTE device" << i);
        NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice(newLTENodes); // ------------------->
        //NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice(lte);
        NS_LOG_INFO("LTE installed on node: " << i);
    }
```

Tommaso Pecorella

unread,
Feb 27, 2023, 3:06:55 PM2/27/23
to ns-3-users
Hi,
I'm sorry, but I have no time to waste. When I said "Attach the code", I mean exactly that. Not a snippet, the whole script.

The difference is this:
- A script can be run and we can use a debugger to find exactly where the problem is.
- A snippet have to be inspected manually, and we have to figure out what you was thinking when you wrote the code.

Hence, since you think that we should do your work, my best suggestion is: use a debugger, find where the code stops, use the backtrack function to pinpoint the exact instruction, done.

Tommaso Pecorella

unread,
Feb 27, 2023, 3:13:06 PM2/27/23
to ns-3-users
Oh, BTW... your code will fail anyway when "backboneNodes" is greater than 1.

Why? Because you're assigning the same subnet to nodes inside the for loop.

Read the tutorial and the examples - you have bigger issues than a simple double InternetStack on a node, and this code clearly shows that you copy-pasted some code without actually understanding it.


Reply all
Reply to author
Forward
0 new messages