From 1d540581a27286a2d8c7ad067bb4ac912f72fb68 Mon Sep 17 00:00:00 2001
From: Sascha Alexander Jopen
Date: Fri, 20 Jan 2012 16:04:07 +0100
Subject: [PATCH 01/16] Shutdown Click router during
Ipv4ClickRouting::DoDispose()
---
src/click/model/ipv4-click-routing.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/click/model/ipv4-click-routing.cc b/src/click/model/ipv4-click-routing.cc
index faf74292e..2d5e239c4 100644
--- a/src/click/model/ipv4-click-routing.cc
+++ b/src/click/model/ipv4-click-routing.cc
@@ -114,6 +114,7 @@ Ipv4ClickRouting::SetIpv4 (Ptr ipv4)
void
Ipv4ClickRouting::DoDispose ()
{
+ simclick_click_kill (m_simNode);
m_ipv4 = 0;
delete m_simNode;
Ipv4RoutingProtocol::DoDispose ();
From 370c4b35606f85e95e3d3b76f8568c485b861b9e Mon Sep 17 00:00:00 2001
From: Lalith Suresh
Date: Fri, 20 Jan 2012 17:08:11 +0100
Subject: [PATCH 02/16] Fix memory leak with Ipv4ClickRouting::ReadHandler()
---
src/click/model/ipv4-click-routing.cc | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/click/model/ipv4-click-routing.cc b/src/click/model/ipv4-click-routing.cc
index 2d5e239c4..7e8f97031 100644
--- a/src/click/model/ipv4-click-routing.cc
+++ b/src/click/model/ipv4-click-routing.cc
@@ -417,8 +417,15 @@ Ipv4ClickRouting::Receive (Ptr p, Mac48Address receiverAddr, Mac48Addres
std::string
Ipv4ClickRouting::ReadHandler (std::string elementName, std::string handlerName)
{
- std::string s = simclick_click_read_handler (m_simNode, elementName.c_str (), handlerName.c_str (), 0, 0);
- return s;
+ char *handle = simclick_click_read_handler (m_simNode, elementName.c_str (), handlerName.c_str (), 0, 0);
+ std::string ret (handle);
+
+ // This is required because Click does not free
+ // the memory allocated to the return string
+ // from simclick_click_read_handler()
+ free(handle);
+
+ return ret;
}
int
From fd760775bde531094e364632e07f8dfdbfee572e Mon Sep 17 00:00:00 2001
From: "Gustavo J. A. M. Carneiro"
Date: Fri, 20 Jan 2012 20:05:33 +0000
Subject: [PATCH 03/16] Fix issue with --enable-sudo, broken by the versioning
of programs
---
wscript | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wscript b/wscript
index a913bffee..7f46cb9e0 100644
--- a/wscript
+++ b/wscript
@@ -541,7 +541,7 @@ class SuidBuild_task(Task.TaskBase):
super(SuidBuild_task, self).__init__(*args, **kwargs)
self.m_display = 'build-suid'
try:
- program_obj = wutils.find_program(self.generator.target, self.generator.env)
+ program_obj = wutils.find_program(self.generator.name, self.generator.env)
except ValueError, ex:
raise WafError(str(ex))
program_node = program_obj.path.find_or_declare(program_obj.target)
From e6806b35f6a2ff713b5aff17669177e1beb4edc6 Mon Sep 17 00:00:00 2001
From: "Gustavo J. A. M. Carneiro"
Date: Mon, 23 Jan 2012 11:11:08 +0000
Subject: [PATCH 04/16] Fix small bug in SuidBuild_task
---
wscript | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/wscript b/wscript
index 7f46cb9e0..352cdf3df 100644
--- a/wscript
+++ b/wscript
@@ -558,7 +558,10 @@ class SuidBuild_task(Task.TaskBase):
def runnable_status(self):
"RUN_ME SKIP_ME or ASK_LATER"
- st = os.stat(self.filename)
+ try:
+ st = os.stat(self.filename)
+ except OSError:
+ return Task.ASK_LATER
if st.st_uid == 0:
return Task.SKIP_ME
else:
From af8b4891d6abd37925239f696b3d4bcfeaa98b83 Mon Sep 17 00:00:00 2001
From: "Gustavo J. A. M. Carneiro"
Date: Mon, 23 Jan 2012 11:50:25 +0000
Subject: [PATCH 05/16] Make sure the call tap-creator with the new program
name
---
src/tap-bridge/model/tap-bridge.cc | 4 ++--
src/tap-bridge/wscript | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/tap-bridge/model/tap-bridge.cc b/src/tap-bridge/model/tap-bridge.cc
index 4a0ea6326..fe5fd0d68 100644
--- a/src/tap-bridge/model/tap-bridge.cc
+++ b/src/tap-bridge/model/tap-bridge.cc
@@ -524,8 +524,8 @@ TapBridge::CreateTap (void)
//
// Execute the socket creation process image.
//
- status = ::execlp ("tap-creator",
- "tap-creator", // argv[0] (filename)
+ status = ::execlp (TAP_CREATOR,
+ TAP_CREATOR, // argv[0] (filename)
ossDeviceName.str ().c_str (), // argv[1] (-d)
ossGateway.str ().c_str (), // argv[2] (-g)
ossIp.str ().c_str (), // argv[3] (-i)
diff --git a/src/tap-bridge/wscript b/src/tap-bridge/wscript
index ab1376b60..376adffed 100644
--- a/src/tap-bridge/wscript
+++ b/src/tap-bridge/wscript
@@ -43,12 +43,14 @@ def build(bld):
]
if not bld.env['PLATFORM'].startswith('freebsd'):
- obj = bld.create_suid_program('tap-creator')
- obj.source = [
+ tap_creator = bld.create_suid_program('tap-creator')
+ tap_creator.source = [
'model/tap-creator.cc',
'model/tap-encode-decode.cc',
]
+ module.env.append_value("DEFINES", "TAP_CREATOR=\"%s\"" % (tap_creator.target,))
+
if bld.env['ENABLE_EXAMPLES']:
bld.add_subdirs('examples')
From 251ddfc332c802423f8bb8de353a0d37d4884a37 Mon Sep 17 00:00:00 2001
From: "Gustavo J. A. M. Carneiro"
Date: Mon, 23 Jan 2012 11:53:28 +0000
Subject: [PATCH 06/16] Idem for the emu-sock-creator
---
src/emu/model/emu-net-device.cc | 4 ++--
src/emu/wscript | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/emu/model/emu-net-device.cc b/src/emu/model/emu-net-device.cc
index ef4dd217d..450aa6d04 100644
--- a/src/emu/model/emu-net-device.cc
+++ b/src/emu/model/emu-net-device.cc
@@ -476,8 +476,8 @@ EmuNetDevice::CreateSocket (void)
//
// Execute the socket creation process image.
//
- status = ::execlp ("emu-sock-creator",
- "emu-sock-creator", // argv[0] (filename)
+ status = ::execlp (EMU_SOCK_CREATOR,
+ EMU_SOCK_CREATOR, // argv[0] (filename)
oss.str ().c_str (), // argv[1] (-p
Date: Wed, 25 Jan 2012 19:13:11 +0100
Subject: [PATCH 07/16] Bug 1319 - Fix Ipv6RawSocketImpl Icmpv6 filter
---
src/internet/model/ipv6-raw-socket-impl.cc | 43 ++++++++++++++++---
src/internet/model/ipv6-raw-socket-impl.h | 49 +++++++++++++++++++++-
2 files changed, 85 insertions(+), 7 deletions(-)
diff --git a/src/internet/model/ipv6-raw-socket-impl.cc b/src/internet/model/ipv6-raw-socket-impl.cc
index 9d519e89d..2b34bd05f 100644
--- a/src/internet/model/ipv6-raw-socket-impl.cc
+++ b/src/internet/model/ipv6-raw-socket-impl.cc
@@ -51,10 +51,6 @@ TypeId Ipv6RawSocketImpl::GetTypeId ()
UintegerValue (0),
MakeUintegerAccessor (&Ipv6RawSocketImpl::m_protocol),
MakeUintegerChecker ())
- .AddAttribute ("IcmpFilter", "Any ICMPv6 header whose type field matches a bit in this filter is dropped.",
- UintegerValue (0),
- MakeUintegerAccessor (&Ipv6RawSocketImpl::m_icmpFilter),
- MakeUintegerChecker ())
;
return tid;
}
@@ -69,6 +65,7 @@ Ipv6RawSocketImpl::Ipv6RawSocketImpl ()
m_protocol = 0;
m_shutdownSend = false;
m_shutdownRecv = false;
+ Icmpv6FilterSetPassAll();
}
Ipv6RawSocketImpl::~Ipv6RawSocketImpl ()
@@ -328,7 +325,7 @@ bool Ipv6RawSocketImpl::ForwardUp (Ptr p, Ipv6Header hdr, PtrPeekHeader (icmpHeader);
uint8_t type = icmpHeader.GetType ();
- if ((1 << type) & m_icmpFilter)
+ if (Icmpv6FilterWillBlock(type))
{
/* packet filtered */
return false;
@@ -372,5 +369,41 @@ Ipv6RawSocketImpl::GetAllowBroadcast () const
return true;
}
+void
+Ipv6RawSocketImpl::Icmpv6FilterSetPassAll()
+{
+ memset(&m_icmpFilter, 0xff, sizeof(icmpv6Filter));
+}
+
+void
+Ipv6RawSocketImpl::Icmpv6FilterSetBlockAll()
+{
+ memset(&m_icmpFilter, 0x00, sizeof(icmpv6Filter));
+}
+
+void
+Ipv6RawSocketImpl::Icmpv6FilterSetPass(uint8_t type)
+{
+ (m_icmpFilter.icmpv6Filt[(type) >> 5]) |= (uint32_t(1) << ((type) & 31));
+}
+
+void
+Ipv6RawSocketImpl::Icmpv6FilterSetBlock(uint8_t type)
+{
+ (m_icmpFilter.icmpv6Filt[(type) >> 5]) &= ~(uint32_t(1) << ((type) & 31));
+}
+
+bool
+Ipv6RawSocketImpl::Icmpv6FilterWillPass(uint8_t type)
+{
+ return (((m_icmpFilter.icmpv6Filt[(type) >> 5]) & (uint32_t(1) << ((type) & 31))) != 0);
+}
+
+bool
+Ipv6RawSocketImpl::Icmpv6FilterWillBlock(uint8_t type)
+{
+ return (((m_icmpFilter.icmpv6Filt[(type) >> 5]) & (uint32_t(1) << ((type) & 31))) == 0);
+}
+
} /* namespace ns3 */
diff --git a/src/internet/model/ipv6-raw-socket-impl.h b/src/internet/model/ipv6-raw-socket-impl.h
index 10581a447..c50f5dfb4 100644
--- a/src/internet/model/ipv6-raw-socket-impl.h
+++ b/src/internet/model/ipv6-raw-socket-impl.h
@@ -219,10 +219,47 @@ public:
virtual bool SetAllowBroadcast (bool allowBroadcast);
virtual bool GetAllowBroadcast () const;
+ /**
+ * \brief Clean the ICMPv6 filter structure
+ */
+ void Icmpv6FilterSetPassAll();
+
+ /**
+ * \brief Set the filter to block all the ICMPv6 types
+ */
+ void Icmpv6FilterSetBlockAll();
+
+ /**
+ * \brief Set the filter to pass one ICMPv6 type
+ * \param the ICMPv6 type to pass
+ */
+ void Icmpv6FilterSetPass(uint8_t type);
+
+ /**
+ * \brief Set the filter to block one ICMPv6 type
+ * \param the ICMPv6 type to block
+ */
+ void Icmpv6FilterSetBlock(uint8_t type);
+
+ /**
+ * \brief Ask the filter about the status of one ICMPv6 type
+ * \param the ICMPv6 type
+ * \return true if the ICMP type is passing through
+ */
+ bool Icmpv6FilterWillPass(uint8_t type);
+
+ /**
+ * \brief Ask the filter about the status of one ICMPv6 type
+ * \param the ICMPv6 type
+ * \return true if the ICMP type is being blocked
+ */
+ bool Icmpv6FilterWillBlock(uint8_t type);
+
+
private:
/**
* \struct Data
- * \brief IPv6 raw data and additionnal information.
+ * \brief IPv6 raw data and additional information.
*/
struct Data
{
@@ -276,10 +313,18 @@ private:
*/
bool m_shutdownRecv;
+ /**
+ * \brief Struct to hold the ICMPv6 filter
+ */
+ typedef struct
+ {
+ uint32_t icmpv6Filt[8];
+ } icmpv6Filter;
+
/**
* \brief ICMPv6 filter.
*/
- uint32_t m_icmpFilter;
+ icmpv6Filter m_icmpFilter;
};
} /* namespace ns3 */
From 75d8bc67700bf8964b30125792486b87e7134bbe Mon Sep 17 00:00:00 2001
From: Tommaso Pecorella
Date: Wed, 25 Jan 2012 19:16:56 +0100
Subject: [PATCH 08/16] Bug 1319 - Clarify Ipv4RawSocketImpl ICMP filter
limitations
---
src/internet/model/ipv4-raw-socket-impl.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/internet/model/ipv4-raw-socket-impl.cc b/src/internet/model/ipv4-raw-socket-impl.cc
index bcc26e8be..8fc84f031 100644
--- a/src/internet/model/ipv4-raw-socket-impl.cc
+++ b/src/internet/model/ipv4-raw-socket-impl.cc
@@ -29,7 +29,7 @@ Ipv4RawSocketImpl::GetTypeId (void)
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_protocol),
MakeUintegerChecker ())
.AddAttribute ("IcmpFilter",
- "Any icmp header whose type field matches a bit in this filter is dropped.",
+ "Any icmp header whose type field matches a bit in this filter is dropped. Type must be less than 32.",
UintegerValue (0),
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_icmpFilter),
MakeUintegerChecker ())
@@ -326,7 +326,7 @@ Ipv4RawSocketImpl::ForwardUp (Ptr p, Ipv4Header ipHeader, PtrPeekHeader (icmpHeader);
uint8_t type = icmpHeader.GetType ();
if (type < 32 &&
- ((1 << type) & m_icmpFilter))
+ ((uint32_t(1) << type) & m_icmpFilter))
{
// filter out icmp packet.
return false;
From 9be79255112cdf1044b5a30b6390e06c325b6840 Mon Sep 17 00:00:00 2001
From: Tommaso Pecorella
Date: Thu, 26 Jan 2012 19:22:49 +0100
Subject: [PATCH 09/16] Update Changes.html and Release_notes with the latest
-dev info
---
CHANGES.html | 10 ++++++++++
RELEASE_NOTES | 23 +++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/CHANGES.html b/CHANGES.html
index af79cd803..93c27fe20 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -43,6 +43,16 @@ the cracks, unfortunately. If you, as a user, can suggest improvements
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list.
+
+Changes from ns-3.13 to ns-3-dev
+
+Changes to existing API:
+
+- The Ipv6RawSocketImpl "IcmpFilter" attribute has been removed. Six
+new member functions have been added to enable the same functionality.
+
+
+
Changes from ns-3.12 to ns-3.13
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 1a4492a9c..cbe7ef562 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -9,6 +9,29 @@ http://www.nsnam.org including tutorials: http://www.nsnam.org/tutorials.html
Consult the file CHANGES.html for more detailed information about changed
API and behavior across ns-3 releases.
+Release 3-dev
+==============
+
+Availability
+------------
+This release is available from:
+
+Supported platforms
+-------------------
+
+New user-visible features
+-------------------------
+
+Bugs fixed
+----------
+ - bug 1319 - Fix Ipv6RawSocketImpl Icmpv6 filter
+ - bug 1318 - Asserts for IPv6 malformed packets
+
+Known issues
+------------
+In general, known issues are tracked on the project tracker available
+at http://www.nsnam.org/bugzilla/
+
Release 3.13
==============
From bcc722f2197d703b940e6b3938a7e8515a6ab4b0 Mon Sep 17 00:00:00 2001
From: Nicola Baldo
Date: Fri, 27 Jan 2012 17:58:48 +0100
Subject: [PATCH 10/16] use proper log macros in trace-fading-loss-model.cc
---
src/lte/model/trace-fading-loss-model.cc | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/lte/model/trace-fading-loss-model.cc b/src/lte/model/trace-fading-loss-model.cc
index 85ca7cee6..13bd77646 100644
--- a/src/lte/model/trace-fading-loss-model.cc
+++ b/src/lte/model/trace-fading-loss-model.cc
@@ -170,7 +170,7 @@ TraceFadingLossModel::DoCalcRxPowerSpectralDensity (
//double speed = sqrt (pow (aSpeedVector.x-bSpeedVector.x,2) + pow (aSpeedVector.y-bSpeedVector.y,2));
- NS_LOG_FUNCTION (this << *rxPsd);
+ NS_LOG_LOGIC (this << *rxPsd);
int now_ms = static_cast (Simulator::Now ().GetMilliSeconds () * m_timeGranularity);
int lastUpdate_ms = static_cast (m_lastWindowUpdate.GetMilliSeconds () * m_timeGranularity);
@@ -186,11 +186,11 @@ TraceFadingLossModel::DoCalcRxPowerSpectralDensity (
double power = *vit; // in Watt/Hz
power = 10 * log10 (180000 * power); // in dB
- NS_LOG_FUNCTION (this << subChannel << *vit << power << fading);
+ NS_LOG_LOGIC (this << subChannel << *vit << power << fading);
*vit = pow (10., ((power + fading) / 10)) / 180000; // in Watt
- NS_LOG_FUNCTION (this << subChannel << *vit);
+ NS_LOG_LOGIC (this << subChannel << *vit);
}
@@ -199,7 +199,7 @@ TraceFadingLossModel::DoCalcRxPowerSpectralDensity (
}
- NS_LOG_FUNCTION (this << *rxPsd);
+ NS_LOG_LOGIC (this << *rxPsd);
return rxPsd;
}
@@ -215,10 +215,7 @@ TraceFadingLossModel::CreateFadingChannelRealization (Ptr e
m_lastWindowUpdate = Simulator::Now ();
}
-
- NS_LOG_FUNCTION (this <<
- "insert new channel realization, m_windowOffsetMap.size () = "
- << m_windowOffsetsMap.size ());
+ NS_LOG_LOGIC (this << "insert new channel realization, m_windowOffsetMap.size () = " << m_windowOffsetsMap.size ());
UniformVariable* startV = new UniformVariable (1, (m_traceLength.GetSeconds () - m_windowSize.GetSeconds ()) * 1000.0);
ChannelRealizationId_t mobilityPair = std::make_pair (enbMobility,ueMobility);
m_startVariableMap.insert (std::pair (mobilityPair, startV));
From 28c14f53a7cfb0dbe582f2078b3f5eb1119e2d0e Mon Sep 17 00:00:00 2001
From: Nicola Baldo
Date: Fri, 27 Jan 2012 18:00:35 +0100
Subject: [PATCH 11/16] proper use of log macros in lte-net-device.cc
---
src/lte/model/lte-net-device.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/lte/model/lte-net-device.cc b/src/lte/model/lte-net-device.cc
index cb46aba80..095a34b69 100644
--- a/src/lte/model/lte-net-device.cc
+++ b/src/lte/model/lte-net-device.cc
@@ -238,8 +238,7 @@ LteNetDevice::IsBridge (void) const
Address
LteNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
- NS_LOG_FUNCTION (this);
- NS_LOG_FUNCTION (multicastGroup);
+ NS_LOG_FUNCTION (this << multicastGroup);
Mac48Address ad = Mac48Address::GetMulticast (multicastGroup);
From 57595f5147c89fc5f2b4df6267cd86a7defd0e34 Mon Sep 17 00:00:00 2001
From: Nicola Baldo
Date: Fri, 27 Jan 2012 18:06:23 +0100
Subject: [PATCH 12/16] proper use of log macros in lte-enb-mac.cc
---
src/lte/model/lte-enb-mac.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc
index 0dd9e30f1..87ecd6d38 100644
--- a/src/lte/model/lte-enb-mac.cc
+++ b/src/lte/model/lte-enb-mac.cc
@@ -480,7 +480,7 @@ LteEnbMac::DoReceiveIdealControlMessage (Ptr msg)
}
else
{
- NS_LOG_FUNCTION (this << " IdealControlMessage not recognized");
+ NS_LOG_LOGIC (this << " IdealControlMessage not recognized");
}
}
@@ -501,10 +501,9 @@ void
LteEnbMac::ReceiveDlCqiIdealControlMessage (Ptr msg)
{
NS_LOG_FUNCTION (this << msg);
- // NS_LOG_FUNCTION (this << msg->GetSourceDevice () << msg->GetDestinationDevice ());
CqiListElement_s dlcqi = msg->GetDlCqi ();
- NS_LOG_FUNCTION (this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
+ NS_LOG_LOGIC (this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
m_dlCqiReceived.push_back (dlcqi);
}
@@ -753,7 +752,6 @@ LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
void
LteEnbMac::DoSchedUlConfigInd (FfMacSchedSapUser::SchedUlConfigIndParameters ind)
{
-
NS_LOG_FUNCTION (this);
for (unsigned int i = 0; i < ind.m_dciList.size (); i++)
From 8e36faa421b058b9b0612b354a5c4897ff9abea8 Mon Sep 17 00:00:00 2001
From: Nicola Baldo
Date: Fri, 27 Jan 2012 18:11:56 +0100
Subject: [PATCH 13/16] proper use of log macros in lte-amc.cc
---
src/lte/model/lte-amc.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lte/model/lte-amc.cc b/src/lte/model/lte-amc.cc
index 01f224a21..f5c88b396 100644
--- a/src/lte/model/lte-amc.cc
+++ b/src/lte/model/lte-amc.cc
@@ -238,7 +238,7 @@ LteAmc::GetCqiFromSpectralEfficiency (double s)
{
++cqi;
}
- NS_LOG_FUNCTION (s << cqi);
+ NS_LOG_LOGIC ("cqi = " << cqi);
return cqi;
}
@@ -254,7 +254,7 @@ LteAmc::GetMcsFromCqi (int cqi)
{
++mcs;
}
- NS_LOG_FUNCTION (cqi << mcs);
+ NS_LOG_LOGIC ("mcs = " << mcs);
return mcs;
}
@@ -274,8 +274,9 @@ LteAmc::GetTbSizeFromMcs (int mcs, int nprb)
double
LteAmc::GetSpectralEfficiencyFromCqi (int cqi)
{
+ NS_LOG_FUNCTION (cqi);
NS_ASSERT_MSG (cqi >= 0 && cqi <= 15, "CQI must be in [0..15] = " << cqi);
- NS_LOG_FUNCTION (cqi << SpectralEfficiencyForCqi[cqi]);
+ NS_LOG_LOGIC ("Spectral efficiency = " << SpectralEfficiencyForCqi[cqi]);
return SpectralEfficiencyForCqi[cqi];
}
@@ -283,7 +284,7 @@ LteAmc::GetSpectralEfficiencyFromCqi (int cqi)
std::vector
LteAmc::CreateCqiFeedbacks (const SpectrumValue& sinr)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
std::vector cqi;
Values::const_iterator it;
From 62f428bc4702d691b130b6a35a6ec3c76d75fe35 Mon Sep 17 00:00:00 2001
From: Nicola Baldo
Date: Fri, 27 Jan 2012 18:14:59 +0100
Subject: [PATCH 14/16] proper use of log macros in lte-rlc.cc
---
src/lte/model/lte-rlc.cc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lte/model/lte-rlc.cc b/src/lte/model/lte-rlc.cc
index 73b9b7eb8..ee27277d2 100644
--- a/src/lte/model/lte-rlc.cc
+++ b/src/lte/model/lte-rlc.cc
@@ -202,7 +202,10 @@ LteRlcSm::DoReceivePdu (Ptr p)
{
delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
}
- NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize () << delay.GetNanoSeconds ());
+ NS_LOG_LOGIC (" RNTI=" << m_rnti
+ << " LCID=" << (uint32_t) m_lcid
+ << " size=" << p->GetSize ()
+ << " delay=" << delay.GetNanoSeconds ());
m_rxPdu(m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
}
@@ -218,7 +221,9 @@ LteRlcSm::DoNotifyTxOpportunity (uint32_t bytes)
// RLC Performance evaluation
RlcTag tag (Simulator::Now());
params.pdu->AddByteTag (tag);
- NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
+ NS_LOG_LOGIC (" RNTI=" << m_rnti
+ << " LCID=" << (uint32_t) m_lcid
+ << " size=" << bytes);
m_txPdu(m_rnti, m_lcid, bytes);
m_macSapProvider->TransmitPdu (params);
From 42c93dd71537de7d88d32e8a8e6ec56ee6c9be5a Mon Sep 17 00:00:00 2001
From: Tommaso Pecorella
Date: Sun, 29 Jan 2012 01:14:23 +0100
Subject: [PATCH 15/16] Bug 1109 - Point out the effects of
ArpCache::PendingQueueSize attribute
---
src/internet/doc/internet-stack.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/internet/doc/internet-stack.rst b/src/internet/doc/internet-stack.rst
index 23582c735..81cc7b32f 100644
--- a/src/internet/doc/internet-stack.rst
+++ b/src/internet/doc/internet-stack.rst
@@ -127,6 +127,16 @@ paired with an IPv4 representation of such device. In Linux, this class
main purpose is to provide address-family specific information (addresses) about
an interface.
+All the classes have appropriate traces in order to track sent, received and lost packets.
+The users is encouraged to use them so to find out if (and where) a packet is dropped. A
+common mistake is to forget the effects of local queues when sending packets, e.g., the ARP
+queue. This can be particularly puzzling when sending jumbo packets or packet bursts using UDP.
+The ARP cache pending queue is limited (3 datagrams) and IP packets might be fragmented, easily
+overfilling the ARP cache queue size. In those cases it is useful to increase the ARP cache
+pending size to a proper value, e.g.:::
+
+ Config::SetDefault ("ns3::ArpCache::PendingQueueSize", UintegerValue (MAX_BURST_SIZE/L2MTU*3));
+
The IPv6 implementation follows a similar architecture.
Layer-4 protocols and sockets
From 179f6bebe5b433531fdb8c699350e5b8567c6124 Mon Sep 17 00:00:00 2001
From: Jaume Nin
Date: Mon, 30 Jan 2012 11:48:29 +0100
Subject: [PATCH 16/16] Replaced access to vector, using .at() instead of []
---
src/lte/examples/lena-profiling.cc | 18 ++++-----
src/lte/examples/lena-rem-sector-antenna.cc | 44 ++++++++++-----------
2 files changed, 29 insertions(+), 33 deletions(-)
diff --git a/src/lte/examples/lena-profiling.cc b/src/lte/examples/lena-profiling.cc
index 63d3a142a..0bf1e547b 100644
--- a/src/lte/examples/lena-profiling.cc
+++ b/src/lte/examples/lena-profiling.cc
@@ -108,7 +108,7 @@ main (int argc, char *argv[])
Vector v (roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
positionAlloc->Add (v);
enbPosition.push_back (v);
- mobility.Install (ueNodes[plantedEnb]);
+ mobility.Install (ueNodes.at(plantedEnb));
}
}
mobility.SetPositionAllocator (positionAlloc);
@@ -117,17 +117,17 @@ main (int argc, char *argv[])
// Position of UEs attached to eNB
for (uint32_t i = 0; i < nEnb; i++)
{
- UniformVariable posX (enbPosition[i].x - roomLength * 0.5,
- enbPosition[i].x + roomLength * 0.5);
- UniformVariable posY (enbPosition[i].y - roomLength * 0.5,
- enbPosition[i].y + roomLength * 0.5);
+ UniformVariable posX (enbPosition.at(i).x - roomLength * 0.5,
+ enbPosition.at(i).x + roomLength * 0.5);
+ UniformVariable posY (enbPosition.at(i).y - roomLength * 0.5,
+ enbPosition.at(i).y + roomLength * 0.5);
positionAlloc = CreateObject ();
for (uint32_t j = 0; j < nUe; j++)
{
positionAlloc->Add (Vector (posX.GetValue (), posY.GetValue (), nodeHeight));
mobility.SetPositionAllocator (positionAlloc);
}
- mobility.Install (ueNodes[i]);
+ mobility.Install (ueNodes.at(i));
}
}
@@ -164,10 +164,10 @@ main (int argc, char *argv[])
mmEnb->SetRoomNumberY (column);
// Positioning UEs attached to eNB
- mobility.Install (ueNodes[plantedEnb]);
+ mobility.Install (ueNodes.at(plantedEnb));
for (uint32_t ue = 0; ue < nUe; ue++)
{
- Ptr mmUe = ueNodes[plantedEnb].Get (ue)->GetObject ();
+ Ptr mmUe = ueNodes.at(plantedEnb).Get (ue)->GetObject ();
Vector vUe (v.x, v.y, v.z);
mmUe->SetPosition (vUe);
mmUe->SetIndoor (building);
@@ -191,7 +191,7 @@ main (int argc, char *argv[])
enbDevs = lteHelper->InstallEnbDevice (enbNodes);
for (uint32_t i = 0; i < nEnb; i++)
{
- NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes[i]);
+ NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
ueDevs.push_back (ueDev);
lteHelper->Attach (ueDev, enbDevs.Get (i));
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
diff --git a/src/lte/examples/lena-rem-sector-antenna.cc b/src/lte/examples/lena-rem-sector-antenna.cc
index 40b9a4060..240f59b42 100644
--- a/src/lte/examples/lena-rem-sector-antenna.cc
+++ b/src/lte/examples/lena-rem-sector-antenna.cc
@@ -47,8 +47,6 @@ main (int argc, char *argv[])
cmd.Parse (argc, argv);
- Config::SetDefault ("ns3::LteSpectrumPhy::PemEnabled", BooleanValue (false));
-
// Geometry of the scenario (in meters)
// Assume squared building
double nodeHeight = 1.5;
@@ -61,7 +59,7 @@ main (int argc, char *argv[])
Ptr < LteHelper > lteHelper = CreateObject ();
//lteHelper->EnableLogComponents ();
- lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel"));
+ lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisPropagationLossModel"));
// Create Nodes: eNodeB and UE
NodeContainer enbNodes;
@@ -114,10 +112,10 @@ main (int argc, char *argv[])
mmEnb->SetRoomNumberY (column);
// Positioning UEs attached to eNB
- mobility.Install (ueNodes.at (plantedEnb));
+ mobility.Install (ueNodes.at(plantedEnb));
for (uint32_t ue = 0; ue < nUe; ue++)
{
- Ptr mmUe = ueNodes.at (plantedEnb).Get (ue)->GetObject ();
+ Ptr mmUe = ueNodes.at(plantedEnb).Get (ue)->GetObject ();
Vector vUe (v.x, v.y, v.z);
mmUe->SetPosition (vUe);
mmUe->SetIndoor (building);
@@ -132,7 +130,7 @@ main (int argc, char *argv[])
Vector v (500, 3000, nodeHeight);
positionAlloc->Add (v);
enbPosition.push_back (v);
- mobility.Install (ueNodes.at (plantedEnb));
+ mobility.Install (ueNodes.at(plantedEnb));
plantedEnb++;
// Add the 3-sector site
@@ -141,7 +139,7 @@ main (int argc, char *argv[])
Vector v (500, 2000, nodeHeight);
positionAlloc->Add (v);
enbPosition.push_back (v);
- mobility.Install (ueNodes.at (plantedEnb));
+ mobility.Install (ueNodes.at(plantedEnb));
}
@@ -151,24 +149,24 @@ main (int argc, char *argv[])
// Position of UEs attached to eNB
for (uint32_t i = 0; i < nEnb; i++)
{
- UniformVariable posX (enbPosition.at (i).x - roomLength * 0,
- enbPosition.at (i).x + roomLength * 0);
- UniformVariable posY (enbPosition.at (i).y - roomLength * 0,
- enbPosition.at (i).y + roomLength * 0);
+ UniformVariable posX (enbPosition.at(i).x - roomLength * 0,
+ enbPosition.at(i).x + roomLength * 0);
+ UniformVariable posY (enbPosition.at(i).y - roomLength * 0,
+ enbPosition.at(i).y + roomLength * 0);
positionAlloc = CreateObject ();
for (uint32_t j = 0; j < nUe; j++)
{
if ( i == nEnb - 3 )
{
- positionAlloc->Add (Vector (enbPosition.at (i).x + 10, enbPosition.at (i).y, nodeHeight));
+ positionAlloc->Add (Vector (enbPosition.at(i).x + 10, enbPosition.at(i).y, nodeHeight));
}
else if ( i == nEnb - 2 )
{
- positionAlloc->Add (Vector (enbPosition.at (i).x - sqrt (10), enbPosition.at (i).y + sqrt (10), nodeHeight));
+ positionAlloc->Add (Vector (enbPosition.at(i).x - sqrt (10), enbPosition.at(i).y + sqrt (10), nodeHeight));
}
else if ( i == nEnb - 1 )
{
- positionAlloc->Add (Vector (enbPosition.at (i).x - sqrt (10), enbPosition.at (i).y - sqrt (10), nodeHeight));
+ positionAlloc->Add (Vector (enbPosition.at(i).x - sqrt (10), enbPosition.at(i).y - sqrt (10), nodeHeight));
}
else
{
@@ -176,7 +174,7 @@ main (int argc, char *argv[])
}
mobility.SetPositionAllocator (positionAlloc);
}
- mobility.Install (ueNodes.at (i));
+ mobility.Install (ueNodes.at(i));
}
BuildingsHelper::MakeMobilityModelConsistent ();
@@ -208,7 +206,7 @@ main (int argc, char *argv[])
for (uint32_t i = 0; i < nEnb; i++)
{
- NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at (i));
+ NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
ueDevs.push_back (ueDev);
lteHelper->Attach (ueDev, enbDevs.Get (i));
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
@@ -217,19 +215,17 @@ main (int argc, char *argv[])
}
Simulator::Stop (Seconds (simTime));
-
- // better to leave traces disabled
- //lteHelper->EnableTraces ();
+ lteHelper->EnableTraces ();
Ptr remHelper = CreateObject ();
remHelper->SetAttribute ("ChannelPath", StringValue ("/ChannelList/0"));
remHelper->SetAttribute ("OutputFile", StringValue ("rem.out"));
- remHelper->SetAttribute ("XMin", DoubleValue (-200.0));
- remHelper->SetAttribute ("XMax", DoubleValue (1200.0));
- remHelper->SetAttribute ("XRes", UintegerValue (300));
- remHelper->SetAttribute ("YMin", DoubleValue (-300.0));
+ remHelper->SetAttribute ("XMin", DoubleValue (-2000.0));
+ remHelper->SetAttribute ("XMax", DoubleValue (+2000.0));
+ remHelper->SetAttribute ("XRes", UintegerValue (100));
+ remHelper->SetAttribute ("YMin", DoubleValue (-500.0));
remHelper->SetAttribute ("YMax", DoubleValue (+3500.0));
- remHelper->SetAttribute ("YRes", UintegerValue (300));
+ remHelper->SetAttribute ("YRes", UintegerValue (100));
remHelper->SetAttribute ("Z", DoubleValue (1.5));
remHelper->Install ();
// Recall the buildings helper to place the REM nodes in its position