diff --git a/.hgtags b/.hgtags index 57619abe6..64abffec4 100644 --- a/.hgtags +++ b/.hgtags @@ -18,3 +18,4 @@ ea16c44eb90db579c83d3434fc8a960be506a7f5 ns-3.1-RC3 5768685f9fdba9fbf2e9561a840f085142c73575 ns-3.1 dfd634417b8d1896d981b6f44d8f71030611596a ns-3.2-RC1 319eb29611b18998abbad01548825643a8017bcb ns-3.2-RC2 +d783a951f8f5e64b33bc518f0415f76cae1ca6f3 ns-3.2-RC2-bis diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a38e7f82c..42b0b03be 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -66,6 +66,8 @@ ns-3 build is known to fail on the following platforms: - gcc 3.3 and earlier - optimized builds on gcc 3.4.4 and 3.4.5 - optimized builds on linux x86 gcc 4.0.x + - optimized builds on Ubuntu 8.10 alpha 5 x86 gcc4.3.2 + - MinGW The IPv4 API defined in src/node/ipv4.h is expected to undergo major changes in preparation of the merge of the IPv6 API and implementation. diff --git a/doc/release_steps.txt b/doc/release_steps.txt index 0802632fd..f4d666be4 100644 --- a/doc/release_steps.txt +++ b/doc/release_steps.txt @@ -14,23 +14,23 @@ Steps in doing an ns-3 release 4. test dev tarball on release platforms (waf check and maybe some other scripts) 5. once you are happy with the tarball, tag ns-3-dev and ns-3-dev-ref-traces - - hg tag "ns-3.1x" + - hg tag "ns-3.x" - hg push - cd into regression/ns-3-dev-ref-traces - - hg tag "ns-3.1x" + - hg tag "ns-3.x" - hg push 6. clone the tagged ns-3-dev and place it on the repository - ssh code.nsnam.org; sudo tcsh; su code; - cp -r /home/code/repos/ns-3-dev /home/code/repos/ns-3.1x - - cd /home/code/repos/ns-3.1x/.hg and edit the hgrc appropriately: - "description = ns-3.1x release - name = ns-3.1x" + - cd /home/code/repos/ns-3.x/.hg and edit the hgrc appropriately: + "description = ns-3.x release + name = ns-3.x" - clone the ns-3-dev-ref-traces and place it on the repository as above - but use the name ns-3.1x-ref-traces and edit the hgrc appropriately -7. check out a clean version of the new release (ns-3.1x) somewhere + but use the name ns-3.x-ref-traces and edit the hgrc appropriately +7. check out a clean version of the new release (ns-3.x) somewhere 8. Update the VERSION for this new release - change the string 3-dev in the VERSION file to the real version - (e.g. 3.1) This must agree with the version name you chose in the clone + (e.g. 3.2) This must agree with the version name you chose in the clone for the regression tests to work. - hg commit - hg push @@ -46,16 +46,17 @@ Steps in doing an ns-3 release - There should be no regression errors at this time 10. Create final tarballs - ./waf configure; ./waf dist - - this will create an ns-3.1x.tar.bz2 tarball - - this will also create a ns-3.1x-ref-traces.tar.bz2 tarball -11. upload "ns-3.1x.tar.bz2" to the /var/www/html/releases/ directory on + - this will create an ns-3.x.tar.bz2 tarball + - this will also create a ns-3.x-ref-traces.tar.bz2 tarball +11. upload "ns-3.x.tar.bz2" to the /var/www/html/releases/ directory on the www.nsnam.org server - give it 644 file permissions, and user/group = apache -12. upload "ns-3.1x-ref-traces.tar.bz2" to the /var/www/html/releases/ +12. upload "ns-3.x-ref-traces.tar.bz2" to the /var/www/html/releases/ directory on the www.nsnam.org server - give it 644 file permissions, and user/group = apache 13. update web pages on www.nsnam.org (source is in the www/ module) - clone the source repo (hg clone http://code.nsnam.org/www) + - update index.html - add link to news.html - update getting_started.html - update documents.html diff --git a/regression/tests/test-udp-echo.py b/regression/tests/test-udp-echo.py index e3dd72194..46346f5a4 100644 --- a/regression/tests/test-udp-echo.py +++ b/regression/tests/test-udp-echo.py @@ -8,5 +8,5 @@ import tracediff def run(verbose, generate, refDirName): """Execute a test.""" - + #print tracediff.env return tracediff.run_test(verbose, generate, refDirName, "udp-echo") diff --git a/samples/main-propagation-loss.cc b/samples/main-propagation-loss.cc index 2ab140bfa..e86d569bd 100644 --- a/samples/main-propagation-loss.cc +++ b/samples/main-propagation-loss.cc @@ -51,8 +51,8 @@ PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min, int main (int argc, char *argv[]) { - Config::SetGlobal ("LogDistancePropagationLossModel::ReferenceDistance", StringValue ("1.0")); - Config::SetGlobal ("LogDistancePropagationLossModel::Exponent", StringValue ("4")); + Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceDistance", StringValue ("1.0")); + Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", StringValue ("4")); PrintOne (-10, 20, 5, 0, 10000, 2); diff --git a/src/core/random-variable.cc b/src/core/random-variable.cc index 6a08378b2..86c7d5f5b 100644 --- a/src/core/random-variable.cc +++ b/src/core/random-variable.cc @@ -196,7 +196,12 @@ void RandomVariableBase::GetRandomSeeds(uint32_t seeds[6]) { for (int i = 0; i < 6; ++i) { - read(RandomVariableBase::devRandom, &seeds[i], sizeof(seeds[i])); + ssize_t bytes_read = read (RandomVariableBase::devRandom, + &seeds[i], sizeof (seeds[i])); + if (bytes_read != sizeof (seeds[i])) + { + NS_FATAL_ERROR ("Read from /dev/random failed"); + } } if (RngStream::CheckSeed(seeds)) break; // Got a valid one } diff --git a/src/devices/csma/csma-net-device.cc b/src/devices/csma/csma-net-device.cc index db2fc0042..391027d46 100644 --- a/src/devices/csma/csma-net-device.cc +++ b/src/devices/csma/csma-net-device.cc @@ -128,58 +128,64 @@ CsmaNetDevice::DoDispose () NetDevice::DoDispose (); } - uint16_t -CsmaNetDevice::MtuFromFrameSize (uint16_t frameSize) + uint32_t +CsmaNetDevice::MtuFromFrameSize (uint32_t frameSize) { NS_LOG_FUNCTION (frameSize); + NS_ASSERT_MSG (frameSize <= std::numeric_limits::max (), + "CsmaNetDevice::MtuFromFrameSize(): Frame size should be derived from 16-bit quantity: " << frameSize); + + uint32_t newSize; + switch (m_encapMode) { case DIX: - return frameSize - ETHERNET_OVERHEAD; + newSize = frameSize - ETHERNET_OVERHEAD; + break; case LLC: { LlcSnapHeader llc; NS_ASSERT_MSG ((uint32_t)(frameSize - ETHERNET_OVERHEAD) >= llc.GetSerializedSize (), "CsmaNetDevice::MtuFromFrameSize(): Given frame size too small to support LLC mode"); - return frameSize - ETHERNET_OVERHEAD - llc.GetSerializedSize (); + newSize = frameSize - ETHERNET_OVERHEAD - llc.GetSerializedSize (); } + break; case ILLEGAL: default: NS_FATAL_ERROR ("CsmaNetDevice::MtuFromFrameSize(): Unknown packet encapsulation mode"); return 0; } - // - // Prevent compiler from complaining - // - return 0; + + return newSize; } - uint16_t -CsmaNetDevice::FrameSizeFromMtu (uint16_t mtu) + uint32_t +CsmaNetDevice::FrameSizeFromMtu (uint32_t mtu) { NS_LOG_FUNCTION (mtu); + uint32_t newSize; + switch (m_encapMode) { case DIX: - return mtu + ETHERNET_OVERHEAD; + newSize = mtu + ETHERNET_OVERHEAD; + break; case LLC: { LlcSnapHeader llc; - return mtu + ETHERNET_OVERHEAD + llc.GetSerializedSize (); + newSize = mtu + ETHERNET_OVERHEAD + llc.GetSerializedSize (); } + break; case ILLEGAL: default: NS_FATAL_ERROR ("CsmaNetDevice::FrameSizeFromMtu(): Unknown packet encapsulation mode"); return 0; } - // - // Prevent compiler from complaining - // - return 0; + return newSize; } void @@ -207,7 +213,15 @@ CsmaNetDevice::SetMtu (uint16_t mtu) { NS_LOG_FUNCTION (mtu); - m_frameSize = FrameSizeFromMtu (mtu); + uint32_t newFrameSize = FrameSizeFromMtu (mtu); + + if (newFrameSize > std::numeric_limits::max ()) + { + NS_LOG_WARN ("CsmaNetDevice::SetMtu(): Frame size overflow, MTU not set."); + return false; + } + + m_frameSize = newFrameSize; m_mtu = mtu; NS_LOG_LOGIC ("m_encapMode = " << m_encapMode); diff --git a/src/devices/csma/csma-net-device.h b/src/devices/csma/csma-net-device.h index 8a8faafd3..08f25cae5 100644 --- a/src/devices/csma/csma-net-device.h +++ b/src/devices/csma/csma-net-device.h @@ -461,13 +461,13 @@ private: * Calculate the value for the MTU that would result from * setting the frame size to the given value. */ - uint16_t MtuFromFrameSize (uint16_t frameSize); + uint32_t MtuFromFrameSize (uint32_t frameSize); /** * Calculate the value for the frame size that would be required * to be able to set the MTU to the given value. */ - uint16_t FrameSizeFromMtu (uint16_t mtu); + uint32_t FrameSizeFromMtu (uint32_t mtu); /** * Start Sending a Packet Down the Wire. diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index a68f72c2b..159d8a004 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -504,20 +504,21 @@ PointToPointNetDevice::GetRemote (void) const return Address (); } - uint16_t -PointToPointNetDevice::MtuFromFrameSize (uint16_t frameSize) + uint32_t +PointToPointNetDevice::MtuFromFrameSize (uint32_t frameSize) { NS_LOG_FUNCTION (frameSize); - + NS_ASSERT_MSG (frameSize <= std::numeric_limits::max (), + "PointToPointNetDevice::MtuFromFrameSize(): Frame size should be derived from 16-bit quantity: " << + frameSize); PppHeader ppp; - NS_ASSERT_MSG ((uint32_t)frameSize >= ppp.GetSerializedSize (), "PointToPointNetDevice::MtuFromFrameSize(): Given frame size too small to support PPP"); return frameSize - ppp.GetSerializedSize (); } - uint16_t -PointToPointNetDevice::FrameSizeFromMtu (uint16_t mtu) + uint32_t +PointToPointNetDevice::FrameSizeFromMtu (uint32_t mtu) { NS_LOG_FUNCTION (mtu); @@ -548,7 +549,15 @@ PointToPointNetDevice::SetMtu (uint16_t mtu) { NS_LOG_FUNCTION (mtu); - m_frameSize = FrameSizeFromMtu (mtu); + uint32_t newFrameSize = FrameSizeFromMtu (mtu); + + if (newFrameSize > std::numeric_limits::max ()) + { + NS_LOG_WARN ("PointToPointNetDevice::SetMtu(): Frame size overflow, MTU not set."); + return false; + } + + m_frameSize = newFrameSize; m_mtu = mtu; NS_LOG_LOGIC ("m_frameSize = " << m_frameSize); diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h index a0c755cc9..67636fa71 100644 --- a/src/devices/point-to-point/point-to-point-net-device.h +++ b/src/devices/point-to-point/point-to-point-net-device.h @@ -286,13 +286,13 @@ private: * Calculate the value for the MTU that would result from * setting the frame size to the given value. */ - uint16_t MtuFromFrameSize (uint16_t frameSize); + uint32_t MtuFromFrameSize (uint32_t frameSize); /** * Calculate the value for the frame size that would be required * to be able to set the MTU to the given value. */ - uint16_t FrameSizeFromMtu (uint16_t mtu); + uint32_t FrameSizeFromMtu (uint32_t mtu); /** * \returns the address of the remote device connected to this device diff --git a/src/devices/wifi/propagation-loss-model.cc b/src/devices/wifi/propagation-loss-model.cc index b9d09ff32..b54e90a0b 100644 --- a/src/devices/wifi/propagation-loss-model.cc +++ b/src/devices/wifi/propagation-loss-model.cc @@ -277,12 +277,10 @@ LogDistancePropagationLossModel::GetLoss (Ptr a, * * rx = rx0(tx) - 10 * n * log (d/d0) */ - static Ptr zero = - CreateObject ("Position", - VectorValue (Vector (0.0, 0.0, 0.0))); - static Ptr reference = - CreateObject ("Position", - VectorValue (Vector (m_referenceDistance, 0.0, 0.0))); + static Ptr zero = CreateObject (); + static Ptr reference = CreateObject (); + zero->SetPosition (Vector (0.0, 0.0, 0.0)); + reference->SetPosition (Vector (m_referenceDistance, 0.0, 0.0)); double ref = m_reference->GetLoss (zero, reference); double pathLossDb = 10 * m_exponent * log10 (distance / m_referenceDistance); double rxc = ref - pathLossDb; diff --git a/wscript b/wscript index 190f735f2..80a900e47 100644 --- a/wscript +++ b/wscript @@ -272,9 +272,12 @@ def configure(conf): conf.env['NS3_ENABLED_MODULES'] = ['ns3-'+mod for mod in Params.g_options.enable_modules.split(',')] - ## we cannot run regression tests without diff + # we cannot run regression tests without diff conf.find_program('diff', var='DIFF') + # we cannot pull regression traces without mercurial + conf.find_program('hg', var='MERCURIAL') + # Write a summary of optional features status print "---- Summary of optional NS-3 features:" for (name, caption, was_enabled, reason_not_enabled) in conf.env['NS3_OPTIONAL_FEATURES']: @@ -815,8 +818,7 @@ def dev_null(): class Regression(object): def __init__(self, testdir): self.testdir = testdir - env = Params.g_build.env_of_name('default') - self.diff = env['DIFF'] + self.env = Params.g_build.env_of_name('default') def run_test(self, verbose, generate, refDirName, testName, *arguments): refTestDirName = os.path.join(refDirName, (testName + ".ref")) @@ -853,7 +855,7 @@ class Regression(object): if verbose: #diffCmd = "diff traces " + refTestDirName + " | head" - diffCmd = subprocess.Popen([self.diff, "traces", refTestDirName], + diffCmd = subprocess.Popen([self.env['DIFF'], "traces", refTestDirName], stdout=dev_null()) headCmd = subprocess.Popen("head", stdin=diffCmd.stdout) rc2 = headCmd.wait() @@ -861,7 +863,7 @@ class Regression(object): rc1 = diffCmd.wait() rc = rc1 or rc2 else: - rc = subprocess.Popen([self.diff, "traces", refTestDirName], stdout=dev_null()).wait() + rc = subprocess.Popen([self.env['DIFF'], "traces", refTestDirName], stdout=dev_null()).wait() if rc: print "----------" print "Traces differ in test: test-" + testName @@ -907,8 +909,8 @@ def run_regression(): print "========== Running Regression Tests ==========" dir_name = APPNAME + '-' + VERSION + REGRESSION_SUFFIX - - if subprocess.Popen(["hg", "version"], stdout=dev_null(), stderr=dev_null()).wait() == 0: + env = Params.g_build.env_of_name('default') + if env['MERCURIAL']: print "Synchronizing reference traces using Mercurial." if not os.path.exists(dir_name): print "Cloning " + REGRESSION_TRACES_REPO + dir_name + " from repo." @@ -934,7 +936,7 @@ def run_regression(): print "Done." if not os.path.exists(dir_name): - print "Reference traces directory does not exist" + print "Reference traces directory (%s) does not exist" % dir_name return 3 bad = []