--- a/src/test/csma-system-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/csma-system-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -81,13 +81,13 @@
// Network topology
//
-// n0 n1
+// n0 n1
// | |
// ----------
// | Switch |
// ----------
// | |
-// n2 n3
+// n2 n3
//
// - CBR/UDP test flow from n0 to n1; test that packets received on n1
//
@@ -207,8 +207,8 @@
// Network topology
// ==============
// | |
-// n0 n1 n2
-// | |
+// n0 n1 n2
+// | |
// ==========
//
// n0 originates UDP broadcast to 255.255.255.255/discard port, which
@@ -249,7 +249,7 @@
// Make packets be sent about every DefaultPacketSize / DataRate =
// 4096 bits / (5000 bits/second) = 0.82 second.
OnOffHelper onoff ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (Ipv4Address ("255.255.255.255"), port)));
+ Address (InetSocketAddress (Ipv4Address ("255.255.255.255"), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (5000)));
@@ -261,7 +261,7 @@
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+ Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
app = sink.Install (c0.Get (1));
app.Add (sink.Install (c1.Get (1)));
app.Start (Seconds (1.0));
@@ -271,7 +271,7 @@
Config::ConnectWithoutContext ("/NodeList/1/ApplicationList/0/$ns3::PacketSink/Rx", MakeCallback (&CsmaBroadcastTestCase::SinkRxNode1, this));
Config::ConnectWithoutContext ("/NodeList/2/ApplicationList/0/$ns3::PacketSink/Rx", MakeCallback (&CsmaBroadcastTestCase::SinkRxNode2, this));
- Simulator::Run ();
+ Simulator::Run ();
Simulator::Destroy ();
// We should have sent and received 10 packets
@@ -334,17 +334,17 @@
CsmaMulticastTestCase::DoRun (void)
{
//
- // Set up default values for the simulation.
+ // Set up default values for the simulation.
//
// Select DIX/Ethernet II-style encapsulation (no LLC/Snap header)
- Config::SetDefault ("ns3::CsmaNetDevice::EncapsulationMode", StringValue ("Dix"));
+ Config::SetDefault ("ns3::CsmaNetDevice::EncapsulationMode", StringValue ("Dix"));
NodeContainer c;
c.Create (5);
// We will later want two subcontainers of these nodes, for the two LANs
NodeContainer c0 = NodeContainer (c.Get (0), c.Get (1), c.Get (2));
NodeContainer c1 = NodeContainer (c.Get (2), c.Get (3), c.Get (4));
-
+
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (5000000)));
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
@@ -367,7 +367,7 @@
// source is at node zero, which we assigned the IP address of 10.1.1.1
// earlier. We need to define a multicast group to send packets to. This
// can be any multicast address from 224.0.0.0 through 239.255.255.255
- // (avoiding the reserved routing protocol addresses).
+ // (avoiding the reserved routing protocol addresses).
//
Ipv4Address multicastSource ("10.1.1.1");
@@ -387,8 +387,8 @@
outputDevices.Add (nd1.Get (0)); // (we only need one NetDevice here)
multicast.AddMulticastRoute (multicastRouter, multicastSource,
- multicastGroup, inputIf, outputDevices);
-
+ multicastGroup, inputIf, outputDevices);
+
// 2) Set up a default multicast route on the sender n0
Ptr<Node> sender = c.Get (0);
Ptr<NetDevice> senderIf = nd0.Get(0);
@@ -406,7 +406,7 @@
// Make packets be sent about every defaultPacketSize / dataRate =
// 4096 bits / (5000 bits/second) = 0.82 second.
OnOffHelper onoff ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (multicastGroup, multicastPort)));
+ Address (InetSocketAddress (multicastGroup, multicastPort)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (5000)));
@@ -540,7 +540,7 @@
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+ Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
app = sink.Install (nodes.Get (1));
app.Start (Seconds (0.0));
@@ -630,8 +630,8 @@
// create the shared medium used by all csma devices.
Ptr<CsmaChannel> channel = CreateObjectWithAttributes<CsmaChannel> (
- "DataRate", DataRateValue (DataRate(5000000)),
- "Delay", TimeValue (MilliSeconds(2)));
+ "DataRate", DataRateValue (DataRate(5000000)),
+ "Delay", TimeValue (MilliSeconds(2)));
// use a helper function to connect our nodes to the shared channel.
CsmaHelper csma;
@@ -1007,19 +1007,19 @@
//
Ipv4AddressHelper address;
for(uint32_t i = 0; i < star.SpokeCount (); ++i)
- {
- std::ostringstream subnet;
- subnet << "10.1." << i << ".0";
+ {
+ std::ostringstream subnet;
+ subnet << "10.1." << i << ".0";
address.SetBase (subnet.str ().c_str (), "255.255.255.0", "0.0.0.3");
- for (uint32_t j = 0; j < nFill; ++j)
- {
- address.Assign (fillDevices.Get (i * nFill + j));
- }
- }
+ for (uint32_t j = 0; j < nFill; ++j)
+ {
+ address.Assign (fillDevices.Get (i * nFill + j));
+ }
+ }
//
- // Create a packet sink on the star "hub" to receive packets.
+ // Create a packet sink on the star "hub" to receive packets.
//
uint16_t port = 50000;
Address hubLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
--- a/src/test/global-routing-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/global-routing-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -173,8 +173,8 @@
csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps"));
csma.SetChannelAttribute ("Delay", StringValue ("2ms"));
NetDeviceContainer d2345 = csma.Install (n2345);
-
- // Later, we add IP addresses.
+
+ // Later, we add IP addresses.
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (d0d2);
@@ -212,7 +212,7 @@
// Create a second OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
OnOffHelper onoff2 ("ns3::UdpSocketFactory",
- InetSocketAddress (i1i6.GetAddress (1), port));
+ InetSocketAddress (i1i6.GetAddress (1), port));
onoff2.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff2.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff2.SetAttribute ("DataRate", StringValue ("2kbps"));
@@ -336,7 +336,7 @@
deviceC->SetAddress (Mac48Address::Allocate ());
nC->AddDevice (deviceC);
- // Later, we add IP addresses.
+ // Later, we add IP addresses.
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.252");
Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB);
@@ -368,7 +368,7 @@
// 210 bytes at a rate of 448 Kb/s
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (ifInAddrC.GetLocal(), port)));
+ Address (InetSocketAddress (ifInAddrC.GetLocal(), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000)));
@@ -378,7 +378,7 @@
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+ Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (nC);
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
--- a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -82,7 +82,7 @@
void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
private:
- virtual void StartApplication (void);
+ virtual void StartApplication (void);
virtual void StopApplication (void);
void ScheduleTx (void);
@@ -183,8 +183,8 @@
virtual void DoRun (void);
bool m_writeResults;
- class CwndEvent {
- public:
+ class CwndEvent {
+public:
uint32_t m_oldCwnd;
uint32_t m_newCwnd;
};
@@ -284,7 +284,7 @@
// CongestionWindow attribute on the socket. Normally one would use an on-off
// application to generate a flow, but this has a couple of problems. First,
// the socket of the on-off application is not created until Application Start
- // time, so we wouldn't be able to hook the socket now at configuration time.
+ // time, so we wouldn't be able to hook the socket now at configuration time.
// Second, even if we could arrange a call after start time, the socket is not
// public.
//
@@ -386,8 +386,8 @@
virtual void DoRun (void);
bool m_writeResults;
- class CwndEvent {
- public:
+ class CwndEvent {
+public:
uint32_t m_oldCwnd;
uint32_t m_newCwnd;
};
--- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -115,30 +115,30 @@
void
Ns3TcpLossTestCase::DoSetup (void)
{
- //
- // We expect there to be a file called ns3tcp-state-response-vectors.pcap in
- // response-vectors/ of this directory
- //
- std::ostringstream oss;
- oss << "/response-vectors/ns3tcp-loss-" << m_tcpModel << m_testCase << "-response-vectors.pcap";
- m_pcapFilename = NS_TEST_SOURCEDIR + oss.str ();
+ //
+ // We expect there to be a file called ns3tcp-state-response-vectors.pcap in
+ // response-vectors/ of this directory
+ //
+ std::ostringstream oss;
+ oss << "/response-vectors/ns3tcp-loss-" << m_tcpModel << m_testCase << "-response-vectors.pcap";
+ m_pcapFilename = NS_TEST_SOURCEDIR + oss.str ();
- if (m_writeVectors)
- {
- m_pcapFile.Open (m_pcapFilename, std::ios::out|std::ios::binary);
- m_pcapFile.Init(PCAP_LINK_TYPE, PCAP_SNAPLEN);
- }
- else
- {
- m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
- NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
- }
+ if (m_writeVectors)
+ {
+ m_pcapFile.Open (m_pcapFilename, std::ios::out|std::ios::binary);
+ m_pcapFile.Init(PCAP_LINK_TYPE, PCAP_SNAPLEN);
+ }
+ else
+ {
+ m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
+ NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
+ }
}
void
Ns3TcpLossTestCase::DoTeardown (void)
{
- m_pcapFile.Close ();
+ m_pcapFile.Close ();
}
void
@@ -164,7 +164,7 @@
//
Time tNow = Simulator::Now ();
int64_t tMicroSeconds = tNow.GetMicroSeconds ();
-
+
uint32_t size = p->GetSize ();
uint8_t *buf = new uint8_t[size];
p->CopyData (buf, size);
@@ -208,8 +208,8 @@
if (m_writeLogging)
{
*(m_osw->GetStream ()) << "Moving cwnd from " << oldval << " to " << newval
- << " at time " << Simulator::Now ().GetSeconds ()
- << " seconds" << std::endl;
+ << " at time " << Simulator::Now ().GetSeconds ()
+ << " seconds" << std::endl;
}
}
@@ -233,7 +233,7 @@
if (m_writeLogging)
{
std::clog << "Submitting " << toWrite
- << " bytes to TCP socket" << std::endl;
+ << " bytes to TCP socket" << std::endl;
}
int amountSent = localSocket->Send (0, toWrite, 0);
NS_ASSERT (amountSent > 0); // Given GetTxAvailable() non-zero, amountSent should not be zero
@@ -244,7 +244,7 @@
if (m_writeLogging)
{
std::clog << "Close socket at "
- << Simulator::Now ().GetSeconds () << std::endl;
+ << Simulator::Now ().GetSeconds () << std::endl;
}
localSocket->Close ();
m_needToClose = false;
@@ -253,21 +253,21 @@
void
Ns3TcpLossTestCase::StartFlow (Ptr<Socket> localSocket,
- Ipv4Address servAddress,
- uint16_t servPort)
+ Ipv4Address servAddress,
+ uint16_t servPort)
{
if (m_writeLogging)
{
std::clog << "Starting flow at time "
- << Simulator::Now ().GetSeconds () << std::endl;
+ << Simulator::Now ().GetSeconds () << std::endl;
}
localSocket->Connect (InetSocketAddress (servAddress, servPort)); // connect
// tell the tcp implementation to call WriteUntilBufferFull again
// if we blocked and new tx buffer space becomes available
localSocket->SetSendCallback (MakeCallback
- (&Ns3TcpLossTestCase::WriteUntilBufferFull,
- this));
+ (&Ns3TcpLossTestCase::WriteUntilBufferFull,
+ this));
WriteUntilBufferFull (localSocket, localSocket->GetTxAvailable ());
}
@@ -304,7 +304,7 @@
////////////////////////////////////////////////////////
// Topology construction
//
-
+
// Create three nodes: s1, r1, and k1
NodeContainer s1r1;
s1r1.Create (2);
@@ -363,8 +363,8 @@
MakeCallback (&Ns3TcpLossTestCase::Ipv4L3Tx, this));
Config::ConnectWithoutContext
- ("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
- MakeCallback (&Ns3TcpLossTestCase::CwndTracer, this));
+ ("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
+ MakeCallback (&Ns3TcpLossTestCase::CwndTracer, this));
////////////////////////////////////////////////////////
// Set up loss model at node k1
@@ -425,7 +425,7 @@
*(m_osw->GetStream ()) << std::setprecision (9) << std::fixed;
p2p.EnableAsciiAll (m_osw);
}
-
+
// Finally, set up the simulator to run. The 1000 second hard limit is a
// failsafe in case some change above causes the simulation to never end
Simulator::Stop (Seconds (1000));
--- a/src/test/ns3tcp/ns3tcp-state-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/ns3tcp/ns3tcp-state-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -110,30 +110,30 @@
void
Ns3TcpStateTestCase::DoSetup (void)
{
- //
- // We expect there to be a file called ns3tcp-state-response-vectors.pcap in
- // response-vectors/ of this directory
- //
- std::ostringstream oss;
- oss << "/response-vectors/ns3tcp-state" << m_testCase << "-response-vectors.pcap";
- m_pcapFilename = NS_TEST_SOURCEDIR + oss.str ();
+ //
+ // We expect there to be a file called ns3tcp-state-response-vectors.pcap in
+ // response-vectors/ of this directory
+ //
+ std::ostringstream oss;
+ oss << "/response-vectors/ns3tcp-state" << m_testCase << "-response-vectors.pcap";
+ m_pcapFilename = NS_TEST_SOURCEDIR + oss.str ();
- if (m_writeVectors)
- {
- m_pcapFile.Open (m_pcapFilename, std::ios::out|std::ios::binary);
- m_pcapFile.Init(PCAP_LINK_TYPE, PCAP_SNAPLEN);
- }
- else
- {
- m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
- NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
- }
+ if (m_writeVectors)
+ {
+ m_pcapFile.Open (m_pcapFilename, std::ios::out|std::ios::binary);
+ m_pcapFile.Init(PCAP_LINK_TYPE, PCAP_SNAPLEN);
+ }
+ else
+ {
+ m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
+ NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
+ }
}
void
Ns3TcpStateTestCase::DoTeardown (void)
{
- m_pcapFile.Close ();
+ m_pcapFile.Close ();
}
void
@@ -159,7 +159,7 @@
//
Time tNow = Simulator::Now ();
int64_t tMicroSeconds = tNow.GetMicroSeconds ();
-
+
uint32_t size = p->GetSize ();
uint8_t *buf = new uint8_t[size];
p->CopyData (buf, size);
@@ -217,7 +217,7 @@
if (m_writeLogging)
{
std::clog << "Submitting "
- << toWrite << " bytes to TCP socket" << std::endl;
+ << toWrite << " bytes to TCP socket" << std::endl;
}
int amountSent = localSocket->Send (0, toWrite, 0);
NS_ASSERT (amountSent > 0); // Given GetTxAvailable() non-zero, amountSent should not be zero
@@ -228,8 +228,8 @@
if (m_writeLogging)
{
std::clog << "Close socket at "
- << Simulator::Now ().GetSeconds ()
- << std::endl;
+ << Simulator::Now ().GetSeconds ()
+ << std::endl;
}
localSocket->Close ();
m_needToClose = false;
@@ -244,8 +244,8 @@
if (m_writeLogging)
{
std::clog << "Starting flow at time "
- << Simulator::Now ().GetSeconds ()
- << std::endl;
+ << Simulator::Now ().GetSeconds ()
+ << std::endl;
}
localSocket->Connect (InetSocketAddress (servAddress, servPort)); // connect
@@ -253,8 +253,8 @@
// tell the tcp implementation to call WriteUntilBufferFull again
// if we blocked and new tx buffer space becomes available
localSocket->SetSendCallback (MakeCallback
- (&Ns3TcpStateTestCase::WriteUntilBufferFull,
- this));
+ (&Ns3TcpStateTestCase::WriteUntilBufferFull,
+ this));
WriteUntilBufferFull (localSocket, localSocket->GetTxAvailable ());
}
@@ -288,7 +288,7 @@
////////////////////////////////////////////////////////
// Topology construction
//
-
+
// Create three nodes
NodeContainer n0n1;
n0n1.Create (2);
@@ -328,7 +328,7 @@
ApplicationContainer sinkApps = sink.Install (n1n2.Get (1));
sinkApps.Start (Seconds (0.0));
sinkApps.Stop (Seconds (100.0));
-
+
// Create a data source to send packets on node n0
// Instead of full application, here use the socket directly by
// registering callbacks in function StarFlow().
@@ -426,7 +426,7 @@
p2p.EnableAsciiAll (osw);
std::clog << std::endl << "Running TCP test-case " << m_testCase << ": "
- << caseDescription << std::endl;
+ << caseDescription << std::endl;
}
// Finally, set up the simulator to run. The 1000 second hard limit is a
--- a/src/test/ns3wifi/wifi-interference-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/ns3wifi/wifi-interference-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -61,7 +61,7 @@
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval);
void PrintEndSync (std::string context, uint32_t dataRate, double snr, double per);
double WifiSimpleInterference (std::string phyMode, double Prss, double Irss, double delta, uint32_t PpacketSize,
- uint32_t IpacketSize, bool verbose, InternetStackHelper internet);
+ uint32_t IpacketSize, bool verbose, InternetStackHelper internet);
double m_PER;
double m_SNR;
uint32_t m_DataRate;
@@ -112,22 +112,22 @@
double
WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prss, double Irss, double delta, uint32_t PpacketSize, uint32_t IpacketSize, bool verbose, InternetStackHelper internet)
{
-
+
uint32_t numPackets = 1;
double interval = 1.0; // seconds
double startTime = 10.0; // seconds
double distanceToRx = 100.0; // meters
-
+
double offset = 91; // This is a magic number used to set the
// transmit power, based on other configuration
-
+
m_PER = 0;
m_SNR = 0;
m_DataRate = 0;
-
+
// Convert to time object
Time interPacketInterval = Seconds (interval);
-
+
// disable fragmentation for frames below 2200 bytes
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
// turn off RTS/CTS for frames below 2200 bytes
@@ -135,28 +135,28 @@
// Fix non-unicast data rate to be the same as that of unicast
Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
StringValue (phyMode));
-
+
NodeContainer c;
c.Create (3);
-
+
// The below set of helpers will help us to put together the wifi NICs we want
WifiHelper wifi;
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
-
+
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
// This is one parameter that matters when using FixedRssLossModel
// set it to zero; otherwise, gain will be added
wifiPhy.Set ("RxGain", DoubleValue (0) );
wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0) );
-
+
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
-
+
YansWifiChannelHelper wifiChannel ;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::LogDistancePropagationLossModel");
wifiPhy.SetChannel (wifiChannel.Create ());
-
+
// Add a non-QoS upper mac, and disable rate control
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
@@ -172,7 +172,7 @@
devices.Add (wifi.Install (wifiPhy, wifiMac, c.Get (1)));
wifiPhy.Set ("TxGain", DoubleValue (offset + Irss) );
devices.Add (wifi.Install (wifiPhy, wifiMac, c.Get (2)));
-
+
// Note that with FixedRssLossModel, the positions below are not
// used for received signal strength.
MobilityHelper mobility;
@@ -184,45 +184,45 @@
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (c);
- // InternetStackHelper internet;
+ // InternetStackHelper internet;
internet.Install (c);
Ipv4AddressHelper ipv4;
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (devices);
-
+
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (0), tid);
InetSocketAddress local = InetSocketAddress (Ipv4Address("10.1.1.1"), 80);
recvSink->Bind (local);
recvSink->SetRecvCallback (MakeCallback (&WifiInterferenceTestCase::ReceivePacket, this));
-
+
Ptr<Socket> source = Socket::CreateSocket (c.Get (1), tid);
InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), 80);
source->Connect (remote);
-
+
// Interferer will send to a different port; we will not see a
// "Received packet" message
Ptr<Socket> interferer = Socket::CreateSocket (c.Get (2), tid);
InetSocketAddress interferingAddr = InetSocketAddress (Ipv4Address ("255.255.255.255"), 49000);
interferer->Connect (interferingAddr);
-
+
Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/EndSync", MakeCallback (&WifiInterferenceTestCase::PrintEndSync, this));
// Tracing
// wifiPhy.EnablePcap ("wifi-simple-interference", devices.Get (0));
-
+
Simulator::ScheduleWithContext (source->GetNode ()->GetId (),
- Seconds (startTime), &GenerateTraffic,
- source, PpacketSize, numPackets, interPacketInterval);
-
+ Seconds (startTime), &GenerateTraffic,
+ source, PpacketSize, numPackets, interPacketInterval);
+
Simulator::ScheduleWithContext (interferer->GetNode ()->GetId (),
- Seconds (startTime + delta/1000000.0), &GenerateTraffic,
- interferer, IpacketSize, numPackets, interPacketInterval);
-
+ Seconds (startTime + delta/1000000.0), &GenerateTraffic,
+ interferer, IpacketSize, numPackets, interPacketInterval);
+
Simulator::Run ();
Simulator::Destroy ();
-
+
return m_PER;
}
@@ -239,28 +239,28 @@
bool verbose = false;
double PER, PER1, PER2;
InternetStackHelper internet;
-
+
// Compute the packet error rate (PER) when delta=0 microseconds. This
// means that the interferer arrives at exactly the same time as the
// intended packet
PER = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet);
-
+
// Now rerun this test case and compute the PER when the delta time between
// arrival of the intended frame and interferer is 1 microsecond.
delta = 1;
PER1 = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet);
-
+
// Now rerun this test case and compute the PER when the delta time between
// arrival of the intended frame and interferer is 2 microseconds.
delta = 2;
PER2 = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet);
-
+
double PERDiff1 = PER - PER1;
-
+
double PERDiff2 = PER1 - PER2;
-
+
NS_TEST_ASSERT_MSG_EQ (PERDiff1, PERDiff2,
- "The PER difference due to 1 microsecond difference in arrival shouldn't depend on absolute arrival");
+ "The PER difference due to 1 microsecond difference in arrival shouldn't depend on absolute arrival");
}
class WifiInterferenceTestSuite : public TestSuite
--- a/src/test/perf/perf-io.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/perf/perf-io.cc Fri May 13 15:00:34 2011 -0400
@@ -83,7 +83,7 @@
cmd.Parse (argc, argv);
uint64_t result = std::numeric_limits<uint64_t>::max ();
-
+
char buffer[1024];
if (doStream)
--- a/src/test/static-routing-test-suite.cc Fri May 13 15:00:11 2011 -0400
+++ b/src/test/static-routing-test-suite.cc Fri May 13 15:00:34 2011 -0400
@@ -89,7 +89,7 @@
NetDeviceContainer dAdB = p2p.Install (nAnB);
NetDeviceContainer dBdC = p2p.Install (nBnC);;
-
+
Ptr<CsmaNetDevice> deviceA = CreateObject<CsmaNetDevice> ();
deviceA->SetAddress (Mac48Address::Allocate ());
nA->AddDevice (deviceA);
@@ -98,7 +98,7 @@
deviceC->SetAddress (Mac48Address::Allocate ());
nC->AddDevice (deviceC);
- // Later, we add IP addresses.
+ // Later, we add IP addresses.
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.252");
Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB);
@@ -109,10 +109,10 @@
Ptr<Ipv4> ipv4A = nA->GetObject<Ipv4> ();
Ptr<Ipv4> ipv4B = nB->GetObject<Ipv4> ();
Ptr<Ipv4> ipv4C = nC->GetObject<Ipv4> ();
-
+
int32_t ifIndexA = ipv4A->AddInterface (deviceA);
int32_t ifIndexC = ipv4C->AddInterface (deviceC);
-
+
Ipv4InterfaceAddress ifInAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("/32"));
ipv4A->AddAddress (ifIndexA, ifInAddrA);
ipv4A->SetMetric (ifIndexA, 1);
@@ -135,7 +135,7 @@
// 210 bytes at a rate of 448 Kb/s
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (ifInAddrC.GetLocal (), port)));
+ Address (InetSocketAddress (ifInAddrC.GetLocal (), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000)));
@@ -145,7 +145,7 @@
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
- Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+ Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (nC);
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));