Closed tnull closed 4 years ago
Hi,
the problem is in the stack installation: the QUIC stack is not installed on the nodes, as you're using the Internet module's stack. The following code executes correctly:
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/socket.h"
#include "ns3/quic-socket.h"
#include "ns3/quic-socket-factory.h"
#include "ns3/quic-helper.h"
int
main (int argc, char *argv[])
{
ns3::NodeContainer nodes;
nodes.Create (1);
ns3::QuicHelper stack;
stack.InstallQuic (nodes);
ns3::Ptr<ns3::Node> node = nodes.Get(0);
ns3::TypeId tid = ns3::TypeId::LookupByName ("ns3::QuicSocketFactory");
ns3::Ptr<ns3::Socket> m_socket = 0;
m_socket = ns3::Socket::CreateSocket (node, tid);
ns3::Simulator::Run ();
ns3::Simulator::Destroy ();
return 0;
}
The InstallQuic() module also calls Install(), so you will get the full internet stack along with the QUIC stack. Hope this solved your problem :)
Ah, thank you, that works! :)
Hello,
I'm trying to get the QUIC implementation working in an application of mine. For that I try to create a QUIC socket:
While this code builds fine for me, ns-3 crashes during runtime, giving the error:
It seems, that curiously, the QuicSocketFactory is not found during runtime. I tried this on
ns-3.32
andns-3-dev
running on macOS, and with the quic version living incontrib
(as described in the ns-3 App Store), as well as cloning it directly into source and modifying thewscript
file (as described in the quic repository's README).What am I missing/doing wrong?
You can replicate this by running the following MVE out of the
scratch
folder: