Error when executing leo-bulk-send-example.cc in Leo module

163 views
Skip to first unread message

kei

unread,
Nov 21, 2023, 3:02:22 AM11/21/23
to ns-3-users
Hi, I am currently doing some research on the LEO module.
So I am testing three existing example files, but only leo-bulk-send-example.cc is giving me errors.
The error is as follows.
This file has not been changed except for setting islEnabled to false.
This topic seems close but I have not found a solution.
I'm using ns-3.35.


user@ns-3:~/ns-allinone-3.35/ns-3.35$ ./waf --run leo-bulk-send-example
Waf: Entering directory `/home/user/ns-allinone-3.35/ns-3.35/build'
[2214/2755] Compiling src/leo/examples/leo-bulk-send-example.cc
[2711/2755] Compiling scratch/leo-bulk-send-example.cc
[2712/2755] Linking build/src/leo/examples/ns3.35-leo-bulk-send-debug
[2713/2755] Linking build/scratch/leo-bulk-send-example
Waf: Leaving directory `/home/user/ns-allinone-3.35/ns-3.35/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (3.574s)
msg="Could not connect callback to /NodeList/*/$ns3::TcpL4Protocol/SocketList/*/Tx", +0.000000000s -1 file=../src/core/model/config.cc, line=925
terminate called without an active exception
Command ['/home/user/ns-allinone-3.35/ns-3.35/build/scratch/leo-bulk-send-example'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").

Tommaso Pecorella

unread,
Nov 21, 2023, 4:40:49 AM11/21/23
to ns-3-users
The error means that the trace you're trying to hook to is not there.

In the case of TCP, it's also possible that the trace is not **yet** there, because some TCP objects are created only after the socket is connected.
Usually we fix that by scheduling the trace connect to a moment where we're sure that the socket is open.

djab _eR

unread,
Nov 21, 2023, 4:47:10 AM11/21/23
to ns-3-...@googlegroups.com
Hello everyone I hope this email finds you well.
and I am currently working on a project that involves integrating the zmq library with ndnSIM to facilitate communication between a strategy implemented in ndnSIM and an external code within the same simulation.
I have encountered some technical challenges in linking the zmq library to ndnSIM, and I believe that your expertise in the group could provide valuable insights to overcome these obstacles.Specifically, I am seeking guidance on how to effectively integrate the zmq library into the ndnSIM environment and establish communication channels between the ndnSIM strategy and the external code.

Best regards.


--
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/df561494-451c-4e22-84f3-eb630f267f97n%40googlegroups.com.

kei

unread,
Nov 21, 2023, 7:50:20 AM11/21/23
to ns-3-users
Probably, the sockets are connected in the following parts.
This source code appears to make a trace connection after the socket is connected, is that different?


Ipv4Address remote = users.Get (1)->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal ();
BulkSendHelper sender ("ns3::TcpSocketFactory",
InetSocketAddress (remote, port));
// Set the amount of data to send in bytes. Zero is unlimited.
sender.SetAttribute ("MaxBytes", UintegerValue (0));
ApplicationContainer sourceApps = sender.Install (users.Get (0));
sourceApps.Start (Seconds (0.0));

//
// Create a PacketSinkApplication and install it on node 1
//
PacketSinkHelper sink ("ns3::TcpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), port));
ApplicationContainer sinkApps = sink.Install (users.Get (1));
sinkApps.Start (Seconds (0.0));

Config::Connect ("/NodeList/*/$ns3::TcpL4Protocol/SocketList/*/Tx",
MakeCallback (&EchoTxRx));
Config::Connect ("/NodeList/*/$ns3::TcpL4Protocol/SocketList/*/Rx",
MakeCallback (&EchoTxRx));
//
// Set up tracing if enabled
//
if (pcap)
{
AsciiTraceHelper ascii;
utCh.EnableAsciiAll (ascii.CreateFileStream ("tcp-bulk-send.tr"));
utCh.EnablePcapAll ("tcp-bulk-send", false);
}

std::cerr << "LOCAL =" << users.Get (0)->GetId () << std::endl;
std::cerr << "REMOTE=" << users.Get (1)->GetId () << ",addr=" << Ipv4Address::ConvertFrom (remote) << std::endl;


2023年11月21日火曜日 18:40:49 UTC+9 Tommaso Pecorella:
leo-bulk-send-example.cc

Tommaso Pecorella

unread,
Nov 21, 2023, 9:27:17 AM11/21/23
to ns-3-users
The sockets will be connected after the simulation is started, not before.
I'd schedule the connection to some time after the applications are effectively started, let's say 0.1 seconds into the simulation.

kei

unread,
Nov 21, 2023, 10:18:14 AM11/21/23
to ns-3-users
Thanks for the reply.
In the original source file, it is socket connect -> simulation start, and that could be the cause of the error, so are you saying that I should change it to simulation start -> socket connect?
But that change of order would cause many new errors...

2023年11月21日火曜日 23:27:17 UTC+9 Tommaso Pecorella:

Tommaso Pecorella

unread,
Nov 21, 2023, 7:13:02 PM11/21/23
to ns-3-users
Unfortunately I can't run the code because the code is too old for my computer. So I'm mostly guessing what the error might be.

The trace should be there, and it *should* work as it is. If the original code, with this lines, do work, then the problem is elsewhere.
Now, you said "in the original code" - this means that you made some changes somewhere, either in the script, or in the codebase.

So, the first thing to check is... do the "original" script works?

kei

unread,
Nov 21, 2023, 7:40:39 PM11/21/23
to ns-3-users
Thanks for the reply.
I ran the original script first and got the same error as the first message.

2023年11月22日水曜日 9:13:02 UTC+9 Tommaso Pecorella:

Tommaso Pecorella

unread,
Nov 22, 2023, 10:04:05 AM11/22/23
to ns-3-users
#@%$£"!@#§ [comment deleted].

If the problem is in the model example, the best course of action is to highlight it to the model author. The LEO model is an out-of-tree source, and we're not responsible for its bugs.

Said so, as I *already* said, the error is most probably due to the lack of sockets in the list, because they're created at runtime, i.e., AFTER the call to Run.
What you should try is what is highlighted also in the post you linked:
1) define a function that does the connections
2) Schedule that function at a moment later in time, let's say 0.01 seconds into the simulation.

If other errors pop up, then you fix these errors as well.

Zoe Jiang

unread,
Mar 25, 2024, 6:23:37 AMMar 25
to ns-3-users
Hello guys,
I got the same error right now, I have tried to reset the simulation time order, but still can’t solve the problem, could anyone give me some advice?

kei

unread,
Mar 25, 2024, 11:18:15 AMMar 25
to ns-3-users
I could not resolve this error until the end.
However, the part that is causing the error, viz.

Config::Connect ("/NodeList/*/$ns3::TcpL4Protocol/SocketList/*/Tx",
MakeCallback (&EchoTxRx));
Config::Connect ("/NodeList/*/$ns3::TcpL4Protocol/SocketList/*/Rx",
MakeCallback (&EchoTxRx));
and
static void
EchoTxRx (std::string context, const Ptr< const Packet > packet, const TcpHeader &header, const Ptr< const TcpSocketBase > socket)
{
  std::cout << Simulator::Now () << ":" << context << ":" << packet->GetUid() << ":" << socket->GetNode () << ":" << header.GetSequenceNumber () << std:: endl;
}
By commenting out these parts, I think I can eliminate the error and run the program for now.
I was satisfied with this method because the information output by this part was not that important to me, otherwise I may not be able to help you...

2024年3月25日月曜日 19:23:37 UTC+9 Zoe Jiang:

Raouane Dehimi

unread,
May 21, 2024, 5:24:02 AMMay 21
to ns-3-users
Hello everyone,

I am encountering the same error. Has anyone found a fix for this issue?

Thank you!
Reply all
Reply to author
Forward
0 new messages