diff --git a/CHANGES.html b/CHANGES.html
index 31e6ae5dc..d17e894d5 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -58,7 +58,7 @@ us a note on ns-developers mailing list.
Changes to existing API:
-
+
internet: Support for Network Simulation Cradle (NSC) TCP has been removed.
Changes to build system:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3477c2f38..3d23aa22d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,7 +79,6 @@ option(NS3_MONOLIB
)
option(NS3_MPI "Build with MPI support" ON)
option(NS3_NATIVE_OPTIMIZATIONS "Build with -march=native -mtune=native" OFF)
-option(NS3_NSC "Build with NSC support" OFF) # currently not supported
set(NS3_OUTPUT_DIRECTORY "" CACHE STRING "Directory to store built artifacts")
option(NS3_PRECOMPILE_HEADERS
"Precompile module headers to speed up compilation" ON
diff --git a/buildsupport/custom_modules/waf_workaround_c4cache.cmake b/buildsupport/custom_modules/waf_workaround_c4cache.cmake
index ef877d1fc..606329e74 100644
--- a/buildsupport/custom_modules/waf_workaround_c4cache.cmake
+++ b/buildsupport/custom_modules/waf_workaround_c4cache.cmake
@@ -56,7 +56,6 @@ function(generate_c4che_cachepy)
"NS3_MODULE_PATH = ['${PATH_LIST}', '${CMAKE_OUTPUT_DIRECTORY}', '${CMAKE_LIBRARY_OUTPUT_DIRECTORY}']\n"
)
- cache_cmake_flag(NS3_NSC "NSC_ENABLED" cache_contents) # missing support
cache_cmake_flag(ENABLE_REALTIME "ENABLE_REAL_TIME" cache_contents)
cache_cmake_flag(NS3_PTHREAD "ENABLE_THREADING" cache_contents)
cache_cmake_flag(ENABLE_EXAMPLES "ENABLE_EXAMPLES" cache_contents)
diff --git a/doc/manual/source/new-modules.rst b/doc/manual/source/new-modules.rst
index 710cfaf6d..a269ef0ec 100644
--- a/doc/manual/source/new-modules.rst
+++ b/doc/manual/source/new-modules.rst
@@ -337,7 +337,8 @@ contains the tuple ``(example_name, do_run, do_valgrind_run)``, where
crashes with some tests when they are run under valgrind.)
Note that the two conditions are Python statements that
-can depend on ``ns3`` configuration variables. For example,
+can depend on ``ns3`` configuration variables. For example, using the
+NSC_ENABLED variable that was defined up until ns-3.35:
.. sourcecode:: python
diff --git a/examples/tcp/CMakeLists.txt b/examples/tcp/CMakeLists.txt
index 6fd059bec..f0f7fbb00 100644
--- a/examples/tcp/CMakeLists.txt
+++ b/examples/tcp/CMakeLists.txt
@@ -1,28 +1,3 @@
-if(${NS3_NSC})
- set(name tcp-nsc-lfn)
- set(source_files ${name}.cc)
- set(libraries_to_link ${libpoint-to-point} ${libapplications} ${libinternet})
- build_example(
- "${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
- )
-
- set(name tcp-nsc-zoo)
- set(source_files ${name}.cc)
- set(libraries_to_link ${libcsma} ${libinternet} ${libapplications})
- build_example(
- "${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
- )
-
- set(name tcp-nsc-comparison)
- set(source_files ${name}.cc)
- set(libraries_to_link ${libpoint-to-point} ${libinternet} ${libapplications}
- ${libflow-monitor}
- )
- build_example(
- "${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
- )
-endif()
-
set(name tcp-large-transfer)
set(source_files ${name}.cc)
set(libraries_to_link ${libpoint-to-point} ${libapplications} ${libinternet})
diff --git a/examples/tcp/examples-to-run.py b/examples/tcp/examples-to-run.py
index 24cebf81c..2306d071d 100644
--- a/examples/tcp/examples-to-run.py
+++ b/examples/tcp/examples-to-run.py
@@ -10,8 +10,6 @@
cpp_examples = [
("star", "True", "True"),
("tcp-large-transfer", "True", "True"),
- ("tcp-nsc-lfn", "NSC_ENABLED == True", "False"),
- ("tcp-nsc-zoo", "NSC_ENABLED == True", "False"),
("tcp-star-server", "True", "True"),
("tcp-variants-comparison", "True", "True"),
("tcp-validation --firstTcpType=dctcp --linkRate=50Mbps --baseRtt=10ms --queueUseEcn=1 --stopTime=15s --validate=dctcp-10ms", "True", "True"),
diff --git a/examples/tcp/tcp-nsc-comparison.cc b/examples/tcp/tcp-nsc-comparison.cc
deleted file mode 100644
index 80468a66a..000000000
--- a/examples/tcp/tcp-nsc-comparison.cc
+++ /dev/null
@@ -1,211 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2012 NICT
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Hajime Tazaki
- *
- * This code is a modified version of the code used for the the experiments in the paper
- * "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
- * by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
- *
- * By default, TCP timestamps, window scale, and SACK are disabled because
- * they were not supported in ns-3 at the time of this paper. TCP timestamp
- * and window scale can be enabled by command line arguments.
- *
- */
-
-#include "ns3/log.h"
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/internet-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/flow-monitor-module.h"
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
-
-std::string m_stack = "nsc-linux";
-std::string sock_factory;
-uint32_t m_seed = 1;
-double startTime = 4.0;
-double stopTime = 20.0;
-uint32_t m_nNodes = 2;
-bool enablePcap = false;
-bool enableTimestamps = false;
-bool enableWindowScale = false;
-
-int
-main (int argc, char *argv[])
-{
-
- //ensure the ns3 TCP default values match what nsc is using
- Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1448));
- Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
-
- CommandLine cmd (__FILE__);
- cmd.AddValue ("stack", "choose network stack", m_stack);
- cmd.AddValue ("seed", "randomize seed", m_seed);
- cmd.AddValue ("nNodes", "the number of source and sink nodes", m_nNodes);
- cmd.AddValue ("stopTime", "duration", stopTime);
- cmd.AddValue ("enablePcap", "pcap", enablePcap);
- cmd.AddValue ("enableTimestamps", "use TCP Timestamps option", enableTimestamps);
- cmd.AddValue ("enableWindowScale", "use TCP Window Scale option", enableWindowScale);
- cmd.Parse (argc, argv);
-
- SeedManager::SetSeed (m_seed);
-
- if (m_stack != "nsc-linux" && m_stack != "ns3")
- {
- NS_FATAL_ERROR ("Error, stack named " << m_stack << " is not supported");
- }
-
- NodeContainer lefts, routers, rights, nodes;
- lefts.Create (m_nNodes);
- routers.Create (2);
- rights.Create (m_nNodes);
- nodes = NodeContainer (lefts, routers, rights);
-
- InternetStackHelper internetStack;
-
- GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
- if (m_stack == "ns3")
- {
- sock_factory = "ns3::TcpSocketFactory";
- if (enableTimestamps == false)
- {
- Config::SetDefault ("ns3::TcpSocketBase::WindowScaling", BooleanValue (false));
- }
- if (enableWindowScale == false)
- {
- Config::SetDefault ("ns3::TcpSocketBase::Timestamp", BooleanValue (false));
- }
- internetStack.Install (nodes);
- }
- else if (m_stack == "nsc-linux")
- {
- internetStack.Install (routers);
- sock_factory = "ns3::TcpSocketFactory";
- internetStack.SetTcp ("ns3::NscTcpL4Protocol",
- "Library", StringValue ("liblinux2.6.26.so"));
- internetStack.Install (lefts);
- internetStack.Install (rights);
-
- // at the time this program was written, these were not implemented
- // in ns3 tcp, so disable for comparison
- Config::Set ("/NodeList/*/$ns3::Ns3NscStack/net.ipv4.tcp_sack", StringValue ("0"));
- if (enableTimestamps == false)
- {
- Config::Set ("/NodeList/*/$ns3::Ns3NscStack/net.ipv4.tcp_timestamps", StringValue ("0"));
- }
- if (enableWindowScale == false)
- {
- Config::Set ("/NodeList/*/$ns3::Ns3NscStack/net.ipv4.tcp_window_scaling", StringValue ("0"));
- }
- }
-
- PointToPointHelper pointToPoint;
- pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
- pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
-
- Ipv4AddressHelper address;
- Ipv4InterfaceContainer interfaces;
-
- NetDeviceContainer dev0, dev1, dev2;
- for (uint32_t i = 0; i < m_nNodes; i++)
- {
- std::ostringstream oss;
- oss << "10.0." << i << ".0";
- address.SetBase (oss.str ().c_str (), "255.255.255.0");
- dev0 = pointToPoint.Install (NodeContainer (lefts.Get (i), routers.Get (0)));
- address.Assign (dev0);
- }
-
- // bottle neck link
- pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
- pointToPoint.SetChannelAttribute ("Delay", StringValue ("100ms"));
- dev1 = pointToPoint.Install (NodeContainer (routers.Get (0), routers.Get (1)));
-
- pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
- pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
- // for right links
- for (uint32_t i = 0; i < m_nNodes; i++)
- {
- std::ostringstream oss;
- oss << "10.2." << i << ".0";
- address.SetBase (oss.str ().c_str (), "255.255.255.0");
- dev2 = pointToPoint.Install (NodeContainer (routers.Get (1), rights.Get (i)));
- address.Assign (dev2);
- }
-
- // bottle neck link
- Ptr em1 =
- CreateObjectWithAttributes (
- "ErrorRate", DoubleValue (0.05),
- "ErrorUnit", EnumValue (RateErrorModel::ERROR_UNIT_PACKET)
- );
- dev1.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
-
- address.SetBase ("10.1.0.0", "255.255.255.0");
- address.Assign (dev1);
- Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
- ApplicationContainer apps;
-
- OnOffHelper onoff = OnOffHelper (sock_factory,
- InetSocketAddress (Ipv4Address ("10.2.0.2"), 2000));
- onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
- onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
-
- // Flow 1 - n
- for (uint32_t i = 0; i < m_nNodes; i++)
- {
- std::ostringstream oss;
- oss << "10.2." << i << ".2";
- onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address (oss.str ().c_str ()), 2000)));
- onoff.SetAttribute ("PacketSize", StringValue ("1024"));
- onoff.SetAttribute ("DataRate", StringValue ("1Mbps"));
- onoff.SetAttribute ("StartTime", TimeValue (Seconds (startTime)));
- apps = onoff.Install (lefts.Get (i));
- }
-
- PacketSinkHelper sink = PacketSinkHelper (sock_factory,
- InetSocketAddress (Ipv4Address::GetAny (), 2000));
- apps = sink.Install (rights);
- apps.Start (Seconds (3.9999));
-
- if (enablePcap)
- {
- pointToPoint.EnablePcapAll ("nsc.pcap");
- }
-
- Simulator::Stop (Seconds (stopTime));
- Simulator::Run ();
-
- Ptr pktsink;
- std::cout << "Total ";
- for (uint32_t i = 0; i < m_nNodes; i++)
- {
- pktsink = apps.Get (i)->GetObject ();
- std::cout << "Rx(" << i << ") = " << pktsink->GetTotalRx () <<
- " bytes (" << pktsink->GetTotalRx () * 8 / (stopTime - startTime) << " bps), ";
- }
- std::cout << std::endl;
-
- Simulator::Destroy ();
- return 0;
-}
diff --git a/examples/tcp/tcp-nsc-lfn.cc b/examples/tcp/tcp-nsc-lfn.cc
deleted file mode 100644
index 3bba31746..000000000
--- a/examples/tcp/tcp-nsc-lfn.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-//
-// Network topology
-//
-// 6Mb/s, 500ms
-// n0-----------------n1
-//
-// - a 'lossy' network with long delay
-// - TCP flow from n0 to n1 and from n1 to n0
-// - pcap traces generated as tcp-nsc-lfn-0-0.pcap and tcp-nsc-lfn-1-0.pcap
-// Usage (e.g.): ./ns3 --run 'tcp-nsc-lfn --TCP_CONGESTION=hybla --runtime=30'
-
-#include
-#include
-#include
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/internet-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/ipv4-global-routing-helper.h"
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("TcpNscLfn");
-
-int main (int argc, char *argv[])
-{
-
- Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (4096));
- Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("6Mbps"));
-
- // cubic is the default congestion algorithm in Linux 2.6.26
- std::string tcpCong = "cubic";
- // this is the default error rate of our link, that is, the the probability of a single
- // byte being 'corrupted' during transfer.
- double errRate = 0.000001;
- // how long the sender should be running, in seconds.
- unsigned int runtime = 120;
- // the name of the NSC stack library that should be used
- std::string nscStack = "liblinux2.6.26.so";
-
- CommandLine cmd (__FILE__);
- // Here, we define additional command line options.
- // This allows a user to override the defaults set above from the command line.
- cmd.AddValue ("TCP_CONGESTION", "Linux 2.6.26 Tcp Congestion control algorithm to use", tcpCong);
- cmd.AddValue ("error-rate", "Error rate to apply to link", errRate);
- cmd.AddValue ("runtime", "How long the applications should send data (default 120 seconds)", runtime);
- cmd.AddValue ("nscstack", "Set name of NSC stack (shared library) to use (default liblinux2.6.26.so)", nscStack);
- cmd.Parse (argc, argv);
-
- NodeContainer n;
- n.Create (2);
-
- PointToPointHelper p2p;
- // create point-to-point link with a bandwidth of 6MBit/s and a large delay (0.5 seconds)
- p2p.SetDeviceAttribute ("DataRate", DataRateValue (DataRate (6 * 1000 * 1000)));
- p2p.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (500)));
-
- NetDeviceContainer p2pInterfaces = p2p.Install (n);
- // The default MTU of the p2p link would be 65535, which doesn't work
- // well with our default errRate (most packets would arrive corrupted).
- p2pInterfaces.Get (0)->SetMtu (1500);
- p2pInterfaces.Get (1)->SetMtu (1500);
-
- InternetStackHelper internet;
- // The next statement switches the nodes to 'NSC'-Mode.
- // It disables the native ns-3 TCP model and loads the NSC library.
- internet.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue (nscStack));
- internet.Install (n);
-
- if (tcpCong != "cubic") // make sure we only fail if both --nscstack and --TCP_CONGESTION are used
- {
- // This uses ns-3s attribute system to set the 'net.ipv4.tcp_congestion_control' sysctl of the
- // stack.
- // The same mechanism could be used to e.g. disable TCP timestamps:
- // Config::Set ("/NodeList/*/$ns3::Ns3NscStack/net.ipv4.tcp_timestamps", StringValue ("0"));
- Config::Set ("/NodeList/*/$ns3::Ns3NscStack/net.ipv4.tcp_congestion_control", StringValue (tcpCong));
- }
- Ipv4AddressHelper ipv4;
- ipv4.SetBase ("10.0.0.0", "255.255.255.0");
- Ipv4InterfaceContainer ipv4Interfaces = ipv4.Assign (p2pInterfaces);
-
- DoubleValue rate (errRate);
- Ptr em1 =
- CreateObjectWithAttributes ("RanVar", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=1.0]"), "ErrorRate", rate);
- Ptr em2 =
- CreateObjectWithAttributes ("RanVar", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=1.0]"), "ErrorRate", rate);
-
- // This enables the specified errRate on both link endpoints.
- p2pInterfaces.Get (0)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
- p2pInterfaces.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em2));
-
- Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
- uint16_t servPort = 8080;
- PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
- ApplicationContainer sinkApp = sinkHelper.Install (n);
- sinkApp.Start (Seconds (0.0));
- // this makes sure that the receiver will run one minute longer than the sender applicaton.
- sinkApp.Stop (Seconds (runtime + 60.0));
-
- // This sets up two TCP flows, one from A -> B, one from B -> A.
- for (int i = 0, j = 1; i < 2; j--, i++)
- {
- Address remoteAddress (InetSocketAddress (ipv4Interfaces.GetAddress (i), servPort));
- OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress);
- clientHelper.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
- clientHelper.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
- ApplicationContainer clientApp = clientHelper.Install (n.Get (j));
- clientApp.Start (Seconds (1.0 + i));
- clientApp.Stop (Seconds (runtime + 1.0 + i));
- }
-
- // This tells ns-3 to generate pcap traces.
- p2p.EnablePcapAll ("tcp-nsc-lfn");
-
- Simulator::Stop (Seconds (900));
- Simulator::Run ();
- Simulator::Destroy ();
-
- return 0;
-}
diff --git a/examples/tcp/tcp-nsc-zoo.cc b/examples/tcp/tcp-nsc-zoo.cc
deleted file mode 100644
index 08383e67b..000000000
--- a/examples/tcp/tcp-nsc-zoo.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-// Network topology
-//
-// n0 n1 n2 n3
-// | | | |
-// =================
-// LAN
-//
-// - Pcap traces are saved as tcp-nsc-zoo-$n-0.pcap, where $n represents the node number
-// - TCP flows from n0 to n1, n2, n3, from n1 to n0, n2, n3, etc.
-// Usage (e.g.): ./ns3 --run 'tcp-nsc-zoo --nodes=5'
-
-#include
-#include
-
-#include "ns3/core-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/network-module.h"
-#include "ns3/csma-module.h"
-#include "ns3/internet-module.h"
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("TcpNscZoo");
-
-// Simulates a diverse network with various stacks supported by NSC.
-int main (int argc, char *argv[])
-{
- CsmaHelper csma;
- unsigned int MaxNodes = 4;
- unsigned int runtime = 3;
-
- Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (2048));
- Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("8kbps"));
- CommandLine cmd (__FILE__);
- // this allows the user to raise the number of nodes using --nodes=X command-line argument.
- cmd.AddValue ("nodes", "Number of nodes in the network (must be > 1)", MaxNodes);
- cmd.AddValue ("runtime", "How long the applications should send data (default 3 seconds)", runtime);
- cmd.Parse (argc, argv);
-
- if (MaxNodes < 2)
- {
- std::cerr << "--nodes: must be >= 2" << std::endl;
- return 1;
- }
- csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (100 * 1000 * 1000)));
- csma.SetChannelAttribute ("Delay", TimeValue (MicroSeconds (200)));
-
- NodeContainer n;
- n.Create (MaxNodes);
- NetDeviceContainer ethInterfaces = csma.Install (n);
-
- InternetStackHelper internetStack;
- internetStack.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue ("liblinux2.6.26.so"));
- // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
- internetStack.Install (n.Get (0));
- internetStack.Install (n.Get (1));
- // this disables TCP SACK, wscale and timestamps on node 1 (the attributes represent sysctl-values).
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_sack", StringValue ("0"));
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_timestamps", StringValue ("0"));
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_window_scaling", StringValue ("0"));
-
- if (MaxNodes > 2)
- {
- internetStack.Install (n.Get (2));
- }
-
- if (MaxNodes > 3)
- {
- // the next statement doesn't change anything for the nodes 0, 1, and 2; since they
- // already have a stack assigned.
- internetStack.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue ("liblinux2.6.26.so"));
- // this switches node 3 to NSCs Linux 2.6.26 stack.
- internetStack.Install (n.Get (3));
- // and then again disables sack/timestamps/wscale on node 3.
- Config::Set ("/NodeList/3/$ns3::Ns3NscStack/net.ipv4.tcp_sack", StringValue ("0"));
- Config::Set ("/NodeList/3/$ns3::Ns3NscStack/net.ipv4.tcp_timestamps", StringValue ("0"));
- Config::Set ("/NodeList/3/$ns3::Ns3NscStack/net.ipv4.tcp_window_scaling", StringValue ("0"));
- }
- // the freebsd stack is not yet built by default, so its commented out for now.
- // internetStack.SetNscStack ("libfreebsd5.so");
- for (unsigned int i =4; i < MaxNodes; i++)
- {
- internetStack.Install (n.Get (i));
- }
- Ipv4AddressHelper ipv4;
-
- ipv4.SetBase ("10.0.0.0", "255.255.255.0");
- Ipv4InterfaceContainer ipv4Interfaces = ipv4.Assign (ethInterfaces);
-
- Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
- uint16_t servPort = 8080;
- PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
- // start a sink client on all nodes
- ApplicationContainer sinkApp = sinkHelper.Install (n);
- sinkApp.Start (Seconds (0));
- sinkApp.Stop (Seconds (30.0));
-
- // This tells every node on the network to start a flow to all other nodes on the network ...
- for (unsigned int i = 0; i < MaxNodes; i++)
- {
- for (unsigned int j = 0; j < MaxNodes; j++)
- {
- if (i == j)
- { // ...but we don't want a node to talk to itself.
- continue;
- }
- Address remoteAddress (InetSocketAddress (ipv4Interfaces.GetAddress (j), servPort));
- OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress);
- clientHelper.SetAttribute
- ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
- clientHelper.SetAttribute
- ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
- ApplicationContainer clientApp = clientHelper.Install (n.Get (i));
- clientApp.Start (Seconds (j)); /* delay startup depending on node number */
- clientApp.Stop (Seconds (j + runtime));
- }
- }
-
- csma.EnablePcapAll ("tcp-nsc-zoo", false);
-
- Simulator::Stop (Seconds (100));
- Simulator::Run ();
- Simulator::Destroy ();
-
- return 0;
-}
diff --git a/examples/tcp/wscript b/examples/tcp/wscript
index efaebec41..2962c3d9d 100644
--- a/examples/tcp/wscript
+++ b/examples/tcp/wscript
@@ -5,14 +5,6 @@ def build(bld):
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-large-transfer.cc'
- obj = bld.create_ns3_program('tcp-nsc-lfn',
- ['point-to-point', 'applications', 'internet'])
- obj.source = 'tcp-nsc-lfn.cc'
-
- obj = bld.create_ns3_program('tcp-nsc-zoo',
- ['csma', 'internet', 'applications'])
- obj.source = 'tcp-nsc-zoo.cc'
-
obj = bld.create_ns3_program('tcp-star-server',
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-star-server.cc'
@@ -29,11 +21,6 @@ def build(bld):
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-pcap-nanosec-example.cc'
- obj = bld.create_ns3_program('tcp-nsc-comparison',
- ['point-to-point', 'internet', 'applications', 'flow-monitor'])
-
- obj.source = 'tcp-nsc-comparison.cc'
-
obj = bld.create_ns3_program('tcp-variants-comparison',
['point-to-point', 'internet', 'applications', 'flow-monitor'])
diff --git a/src/internet/CMakeLists.txt b/src/internet/CMakeLists.txt
index 453dd2700..053c49e3e 100644
--- a/src/internet/CMakeLists.txt
+++ b/src/internet/CMakeLists.txt
@@ -1,18 +1,6 @@
set(name internet)
-set(nsc_sources)
-set(nsc_headers)
-if(${NS3_NSC})
- set(nsc_sources nsc-sysctl.cc nsc-tcp-l4-protocol.cc
- nsc-tcp-socket-factory-impl.cc nsc-tcp-socket-impl.cc
- )
- set(nsc_headers nsc-sysctl.h nsc-tcp-l4-protocol.h
- nsc-tcp-socket-factory-impl.h nsc-tcp-socket-impl.h
- )
-endif()
-
set(source_files
- ${nsc_sources}
helper/internet-stack-helper.cc
helper/internet-trace-helper.cc
helper/ipv4-address-helper.cc
diff --git a/src/internet/doc/tcp.rst b/src/internet/doc/tcp.rst
index 99ee96a3c..a2bf77488 100644
--- a/src/internet/doc/tcp.rst
+++ b/src/internet/doc/tcp.rst
@@ -25,16 +25,12 @@ There are three important abstract base classes:
* class :cpp:class:`TcpCongestionOps`: This supports different variants of
congestion control-- a key topic of simulation-based TCP research.
-There are presently two active and one legacy implementations of TCP available for |ns3|.
+There are presently two active implementations of TCP available for |ns3|.
* a natively implemented TCP for ns-3
* support for kernel implementations via `Direct Code Execution (DCE) `__
-* (legacy) support for kernel implementations for the `Network Simulation Cradle (NSC) `__
-NSC is no longer actively supported; it requires use of gcc-5 or gcc-4.9, and
-only covers up to Linux kernel version 2.6.29.
-
-Direct Code Execution is also limited in its support for newer kernels; at
+Direct Code Execution is limited in its support for newer kernels; at
present, only Linux kernel 4.4 is supported. However, the TCP implementations
in kernel 4.4 can still be used for ns-3 validation or for specialized
simulation use cases.
@@ -137,8 +133,7 @@ The careful reader will note above that we have specified the TypeId of an
abstract base class :cpp:class:`TcpSocketFactory`. How does the script tell
|ns3| that it wants the native |ns3| TCP vs. some other one? Well, when
internet stacks are added to the node, the default TCP implementation that is
-aggregated to the node is the |ns3| TCP. This can be overridden as we show
-below when using Network Simulation Cradle. So, by default, when using the |ns3|
+aggregated to the node is the |ns3| TCP. So, by default, when using the |ns3|
helper API, the TCP that is aggregated to nodes with an Internet stack is the
native |ns3| TCP.
@@ -1406,14 +1401,9 @@ section below on :ref:`Writing-tcp-tests`.
* **tcp-pacing-test:** Unit tests on dynamic TCP pacing rate
Several tests have dependencies outside of the ``internet`` module, so they
-are located in a system test directory called ``src/test/ns3tcp``. Three
-of these six tests involve use of the Network Simulation Cradle, and are
-disabled if NSC is not enabled in the build.
+are located in a system test directory called ``src/test/ns3tcp``.
-* **ns3-tcp-cwnd:** Check to see that ns-3 TCP congestion control works against liblinux2.6.26.so implementation
-* **ns3-tcp-interoperability:** Check to see that ns-3 TCP interoperates with liblinux2.6.26.so implementation
* **ns3-tcp-loss:** Check behavior of ns-3 TCP upon packet losses
-* **nsc-tcp-loss:** Check behavior of NSC TCP upon packet losses
* **ns3-tcp-no-delay:** Check that ns-3 TCP Nagle's algorithm works correctly and that it can be disabled
* **ns3-tcp-socket:** Check that ns-3 TCP successfully transfers an application data write of various sizes
* **ns3-tcp-state:** Check the operation of the TCP state machine for several cases
@@ -2171,307 +2161,3 @@ and then, hit "Run".
process. For instance, commits created to make this test case running without
errors are 11633:6b74df04cf44, (others to be merged).
-Network Simulation Cradle
-*************************
-
-The `Network Simulation Cradle (NSC) `_ is a
-framework for wrapping real-world network code into simulators, allowing
-simulation of real-world behavior at little extra cost. This work has been
-validated by comparing situations using a test network with the same situations
-in the simulator. To date, it has been shown that the NSC is able to produce
-extremely accurate results. NSC supports four real world stacks: FreeBSD,
-OpenBSD, lwIP and Linux. Emphasis has been placed on not changing any of the
-network stacks by hand. Not a single line of code has been changed in the
-network protocol implementations of any of the above four stacks. However, a
-custom C parser was built to programmatically change source code.
-
-NSC has previously been ported to |ns2| and OMNeT++, and was
-was added to |ns3| in September 2008 (ns-3.2 release). This section
-describes the |ns3| port of NSC and how to use it.
-
-NSC has been obsoleted by the Linux kernel support within
-`Direct Code Execution (DCE) `__. However, NSC is still available through the bake build
-system. NSC supports Linux kernels 2.6.18 and 2.6.26, and an experimental
-version of 2.6.29 exists on ns-3's code server
-(http://code.nsnam.org/fw/nsc-linux-2.6.29/), but newer
-versions of the kernel have not been ported.
-
-Prerequisites
-+++++++++++++
-
-Presently, NSC has been tested and shown to work on these platforms:
-Linux i386 and Linux x86-64. NSC does not support powerpc. Use on
-FreeBSD or OS X is unsupported (although it may be able to work).
-
-Building NSC requires the packages flex and bison.
-
-NSC requires use of gcc-4.9 or gcc-5 series, and will not build on
-newer systems lacking the older compilers.
-
-Configuring and Downloading
-+++++++++++++++++++++++++++
-
-NSC must either be downloaded separately from
-its own repository, or downloading when using the
-`bake build system `_ of
-|ns3|.
-
-For ns-3.17 through ns-3.28 releases, when using bake, one obtains NSC implicitly as part of an "allinone" configuration, such as:
-
-.. sourcecode:: bash
-
- $ cd bake
- $ python bake.py configure -e ns-allinone-3.27
- $ python bake.py download
- $ python bake.py build
-
-For ns-3.29 and later versions, including the 'ns-3-allinone' development
-version, one must explicitly add NSC ('nsc-0.5.3') to the bake configuration,
-such as:
-
-.. sourcecode:: bash
-
- $ cd bake
- $ python bake.py configure -e ns-allinone-3.29 -e nsc-0.5.3
- $ python bake.py download
- $ python bake.py build
-
-Instead of a released version, one may use the ns-3 development version
-by specifying "ns-3-allinone" to the configure step above.
-
-NSC may also be downloaded from
-`its download site `_
-using Mercurial:
-
-.. sourcecode:: bash
-
- $ hg clone https://secure.wand.net.nz/mercurial/nsc
-
-Prior to the ns-3.17 release, NSC was included in the allinone tarball and
-the released version did not need to be separately downloaded.
-
-Building and validating
-+++++++++++++++++++++++
-
-NSC may be built as part of the bake build process; alternatively, one
-may build NSC by itself using its build system; e.g.:
-
-.. sourcecode:: bash
-
- $ cd nsc-dev
- $ python scons.py
-
-Once NSC has been built either manually or through the bake system, change
-into the |ns3| source directory and try running the following configuration:
-
-.. sourcecode:: bash
-
- $ ./ns3 configure
-
-If NSC has been previously built and found by ns3, then you will see:
-
-.. sourcecode:: bash
-
- Network Simulation Cradle : enabled
-
-If NSC has not been found, you will see:
-
-.. sourcecode:: bash
-
- Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc))
-
-In this case, you must pass the relative or absolute path to the NSC libraries
-with the "--with-nsc" configure option; e.g.
-
-.. sourcecode:: bash
-
- $ ./ns3 configure --with-nsc=/path/to/my/nsc/directory
-
-For |ns3| releases prior to the ns-3.17 release, using the ``build.py``
-script in ns-3-allinone directory, NSC will be built by default unless the
-platform does not support it. To explicitly disable it when building |ns3|,
-type:
-
-.. sourcecode:: bash
-
- $ ./ns3 configure --enable-examples --enable-tests --disable-nsc
-
-If ns3 detects NSC, then building |ns3| with NSC is performed the same way
-with ns3 as without it. Once |ns3| is built, try running the following
-test suite:
-
-.. sourcecode:: bash
-
- $ ./test.py -s ns3-tcp-interoperability
-
-If NSC has been successfully built, the following test should show up
-in the results:
-
-.. sourcecode:: text
-
- PASS TestSuite ns3-tcp-interoperability
-
-This confirms that NSC is ready to use.
-
-Usage
-+++++
-
-There are a few example files. Try:
-
-.. sourcecode:: bash
-
- $ ./ns3 --run tcp-nsc-zoo
- $ ./ns3 --run tcp-nsc-lfn
-
-These examples will deposit some ``.pcap`` files in your directory,
-which can be examined by tcpdump or wireshark.
-
-Let's look at the ``examples/tcp/tcp-nsc-zoo.cc`` file for some typical
-usage. How does it differ from using native |ns3| TCP? There is one main
-configuration line, when using NSC and the |ns3| helper API, that needs to be
-set::
-
- InternetStackHelper internetStack;
-
- internetStack.SetNscStack ("liblinux2.6.26.so");
- // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
- internetStack.Install (n.Get(0));
- internetStack.Install (n.Get(1));
-
-
-The key line is the ``SetNscStack``. This tells the InternetStack
-helper to aggregate instances of NSC TCP instead of native |ns3| TCP
-to the remaining nodes. It is important that this function be called
-**before** calling the ``Install()`` function, as shown above.
-
-Which stacks are available to use? Presently, the focus has been on
-Linux 2.6.18 and Linux 2.6.26 stacks for |ns3|. To see which stacks
-were built, one can execute the following find command at the |ns3| top level
-directory:
-
-.. sourcecode:: bash
-
- $ find nsc -name "*.so" -type f
- nsc/linux-2.6.18/liblinux2.6.18.so
- nsc/linux-2.6.26/liblinux2.6.26.so
-
-This tells us that we may either pass the library name liblinux2.6.18.so or
-liblinux2.6.26.so to the above configuration step.
-
-Stack configuration
-+++++++++++++++++++
-
-NSC TCP shares the same configuration attributes that are common across TCP
-sockets, as described above and documented in `Doxygen
-`_
-
-Additionally, NSC TCP exports a lot of configuration variables into the
-|ns3| attributes system, via a `sysctl `_-like interface. In the ``examples/tcp/tcp-nsc-zoo`` example, you
-can see the following configuration::
-
-
- // this disables TCP SACK, wscale and timestamps on node 1 (the attributes
- represent sysctl-values).
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_sack",
- StringValue ("0"));
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_timestamps",
- StringValue ("0"));
- Config::Set ("/NodeList/1/$ns3::Ns3NscStack/net.ipv4.tcp_window_scaling",
- StringValue ("0"));
-
-These additional configuration variables are not available to native |ns3| TCP.
-
-Also note that default values for TCP attributes in |ns3| TCP may differ from the NSC TCP implementation. Specifically in |ns3|:
-
- 1) TCP default MSS is 536
- 2) TCP Delayed ACK count is 2
-
-Therefore when making comparisons between results obtained using NSC and |ns3| TCP, care must be taken to ensure these values are set appropriately. See /examples/tcp/tcp-nsc-comparison.cc for an example.
-
-NSC API
-+++++++
-
-This subsection describes the API that NSC presents to |ns3| or any other
-simulator. NSC provides its API in the form of a number of classes that are
-defined in ``sim/sim_interface.h`` in the nsc directory.
-
-* **INetStack** INetStack contains the 'low level' operations for the operating
- system network stack, e.g. in and output functions from and to the network
- stack (think of this as the 'network driver interface'). There are also
- functions to create new TCP or UDP sockets.
-* **ISendCallback** This is called by NSC when a packet should be sent out to
- the network. This simulator should use this callback to re-inject the packet
- into the simulator so the actual data can be delivered/routed to its
- destination, where it will eventually be handed into Receive() (and eventually
- back to the receivers NSC instance via INetStack->if_receive()).
-* **INetStreamSocket** This is the structure defining a particular connection
- endpoint (file descriptor). It contains methods to operate on this endpoint,
- e.g. connect, disconnect, accept, listen, send_data/read_data, ...
-* **IInterruptCallback** This contains the wakeup() callback, which is called by
- NSC whenever something of interest happens. Think of wakeup() as a replacement
- of the operating systems wakeup function: Whenever the operating system would
- wake up a process that has been waiting for an operation to complete (for
- example the TCP handshake during connect()), NSC invokes the wakeup() callback
- to allow the simulator to check for state changes in its connection endpoints.
-
-ns-3 implementation
-+++++++++++++++++++
-
-The |ns3| implementation makes use of the above NSC API, and is implemented as
-follows.
-
-The three main parts are:
-
-* :cpp:class:`ns3::NscTcpL4Protocol`: a subclass of Ipv4L4Protocol (and two NSC
- classes: ISendCallback and IInterruptCallback)
-* :cpp:class:`ns3::NscTcpSocketImpl`: a subclass of TcpSocket
-* :cpp:class:`ns3::NscTcpSocketFactoryImpl`: a factory to create new NSC
- sockets
-
-``src/internet/model/nsc-tcp-l4-protocol`` is the main class. Upon
-Initialization, it loads an NSC network stack to use (via dlopen()). Each
-instance of this class may use a different stack. The stack (=shared library) to
-use is set using the SetNscLibrary() method (at this time its called indirectly
-via the internet stack helper). The NSC stack is then set up accordingly (timers
-etc). The NscTcpL4Protocol::Receive() function hands the packet it receives
-(must be a complete TCP/IP packet) to the NSC stack for further processing. To
-be able to send packets, this class implements the NSC send_callback() method.
-This method is called by NSC whenever the NSC stack wishes to send a packet out
-to the network. Its arguments are a raw buffer, containing a complete TCP/IP
-packet, and a length value. This method therefore has to convert the raw data to
-a Ptr usable by |ns3|. In order to avoid various IPv4 header issues,
-the NSC IP header is not included. Instead, the TCP header and the actual
-payload are put into the Ptr, after this the Packet is passed down to
-layer 3 for sending the packet out (no further special treatment is needed in
-the send code path).
-
-This class calls ``ns3::NscTcpSocketImpl`` both from the NSC wakeup() callback
-and from the receive path (to ensure that possibly queued data is scheduled for
-sending).
-
-``src/internet/model/nsc-tcp-socket-impl`` implements the NSC socket interface.
-Each instance has its own m_nscTcpSocket. Data that is sent will be handed to
-the NSC stack via m_nscTcpSocket->send_data() (and not to NscTcpL4Protocol, this
-is the major difference compared to |ns3| TCP). The class also queues up data
-that is sent before the underlying descriptor has entered an ESTABLISHED state.
-This class is called from the NscTcpL4Protocol class, when the NscTcpL4Protocol
-wakeup() callback is invoked by NSC. NscTcpSocketImpl then checks the current
-connection state (SYN_SENT, ESTABLISHED, LISTEN...) and schedules appropriate
-callbacks as needed, e.g. a LISTEN socket will schedule accept() to see if a new
-connection must be accepted, an ESTABLISHED socket schedules any pending data
-for writing, schedule a read() callback, etc.
-
-Note that ``ns3::NscTcpSocketImpl`` does not interact with NSC TCP directly:
-instead, data is redirected to NSC. NSC TCP calls the NSC TCP sockets of a node
-when its wakeup() callback is invoked by NSC.
-
-Limitations
-+++++++++++
-
-* NSC only works on single-interface nodes; attempting to run it on a
- multi-interface node will cause a program error.
-* Cygwin and OS X PPC are not supported; OS X Intel is not supported but may work
-* The non-Linux stacks of NSC are not supported in |ns3|
-* Not all socket API callbacks are supported
-
-For more information, see `this wiki page `_.
diff --git a/src/internet/model/nsc-sysctl.cc b/src/internet/model/nsc-sysctl.cc
deleted file mode 100644
index 9f166238e..000000000
--- a/src/internet/model/nsc-sysctl.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Mathieu Lacage
- */
-
-#include "ns3/string.h"
-#include "nsc-sysctl.h"
-
-#include "sim_interface.h"
-
-namespace ns3 {
-
-/**
- * \ingroup nsctcp
- *
- * This object represent the underlying nsc stack attributes and
- * provide a ns-3-like system to access them though sysctls
- */
-class NscStackStringAccessor : public AttributeAccessor
-{
-public:
- /**
- * \brief Constructor
- * \param name name of the attribute
- */
- NscStackStringAccessor (std::string name) : m_name (name) {}
-
- virtual bool Set (ObjectBase * object, const AttributeValue &val) const;
- virtual bool Get (const ObjectBase * object, AttributeValue &val) const;
- virtual bool HasGetter (void) const;
- virtual bool HasSetter (void) const;
-private:
- std::string m_name; //!< name of the attribute
-};
-
-bool NscStackStringAccessor::HasGetter (void) const
-{
- return true;
-}
-
-bool NscStackStringAccessor::HasSetter (void) const
-{
- return true;
-}
-
-
-bool NscStackStringAccessor::Set (ObjectBase * object, const AttributeValue & val) const
-{
- const StringValue *value = dynamic_cast (&val);
- if (value == 0)
- {
- return false;
- }
- Ns3NscStack *obj = dynamic_cast (object);
- if (obj == 0)
- {
- return false;
- }
- obj->Set (m_name, value->Get ());
- return true;
-}
-
-bool NscStackStringAccessor::Get (const ObjectBase * object, AttributeValue &val) const
-{
- StringValue *value = dynamic_cast (&val);
- if (value == 0)
- {
- return false;
- }
- const Ns3NscStack *obj = dynamic_cast (object);
- if (obj == 0)
- {
- return false;
- }
- value->Set (obj->Get (m_name));
- return true;
-}
-
-
-TypeId
-Ns3NscStack::GetInstanceTypeId (void) const
-{
- if (m_stack == 0)
- {
- // if we have no stack, we are a normal NscStack without any attributes.
- return GetTypeId ();
- }
- std::string name = "ns3::Ns3NscStack<";
- name += m_stack->get_name ();
- name += ">";
- TypeId tid;
- if (TypeId::LookupByNameFailSafe (name, &tid))
- {
- // if the relevant TypeId has already been registered, no need to do it again.
- return tid;
- }
- else
- {
- // Now, we register a new TypeId for this stack which will look
- // like a subclass of the Ns3NscStack. The class Ns3NscStack is effectively
- // mutating into a subclass of itself from the point of view of the TypeId
- // system _here_
- tid = TypeId (name.c_str ());
- tid.SetParent ();
- char buf[256];
- for (int i=0; m_stack->sysctl_getnum (i, buf, sizeof(buf)) > 0; i++)
- {
- char value[256];
- if (m_stack->sysctl_get (buf, value, sizeof(value)) > 0)
- {
- tid.AddAttribute (buf, "Help text",
- StringValue (value),
- Create (buf),
- MakeStringChecker ());
- }
- }
- return tid;
- }
-}
-
-std::string
-Ns3NscStack::Get (std::string name) const
-{
- char buf[512];
- if (m_stack->sysctl_get (name.c_str (), buf, sizeof(buf)) <= 0)
- { // name.c_str () is not a valid sysctl name, or internal NSC error (eg. error converting value)
- return NULL;
- }
- return std::string (buf);
-}
-
-void
-Ns3NscStack::Set (std::string name, std::string value)
-{
- int ret = m_stack->sysctl_set (name.c_str (), value.c_str ());
- if (ret < 0)
- {
- NS_FATAL_ERROR ("setting " << name << " to " << value << "failed (retval " << ret << ")");
- }
-}
-
-NS_OBJECT_ENSURE_REGISTERED (Ns3NscStack);
-
-TypeId
-Ns3NscStack::Ns3NscStack::GetTypeId (void)
-{
- static TypeId tid = TypeId ("ns3::Ns3NscStack")
- .SetParent