From 400781292e7ead863c3e0b10e9a0c635d0ae5069 Mon Sep 17 00:00:00 2001 From: Pavel Boyko Date: Thu, 16 Jul 2009 12:24:41 +0400 Subject: [PATCH] AODV copyright changed to IITP --- src/routing/aodv/aodv-packet.cc | 14 +- src/routing/aodv/aodv-packet.h | 14 +- src/routing/aodv/aodv-routing-protocol.cc | 14 +- src/routing/aodv/aodv-routing-protocol.h | 14 +- src/routing/aodv/aodv-rqueue.cc | 281 +++++++++++----------- src/routing/aodv/aodv-rqueue.h | 14 +- src/routing/aodv/aodv-rtable.cc | 15 +- src/routing/aodv/aodv-rtable.h | 14 +- src/routing/aodv/aodv.h | 12 +- 9 files changed, 215 insertions(+), 177 deletions(-) diff --git a/src/routing/aodv/aodv-packet.cc b/src/routing/aodv/aodv-packet.cc index 5eb3b6773..5134ddbac 100644 --- a/src/routing/aodv/aodv-packet.cc +++ b/src/routing/aodv/aodv-packet.cc @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #include "ns3/test.h" #include "aodv-packet.h" diff --git a/src/routing/aodv/aodv-packet.h b/src/routing/aodv/aodv-packet.h index 2c93bdf0e..9be19038b 100644 --- a/src/routing/aodv/aodv-packet.h +++ b/src/routing/aodv/aodv-packet.h @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #ifndef AODVPACKET_H_ #define AODVPACKET_H_ diff --git a/src/routing/aodv/aodv-routing-protocol.cc b/src/routing/aodv/aodv-routing-protocol.cc index f819cf591..6be7006a9 100644 --- a/src/routing/aodv/aodv-routing-protocol.cc +++ b/src/routing/aodv/aodv-routing-protocol.cc @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #include "aodv-routing-protocol.h" #include "ns3/socket-factory.h" diff --git a/src/routing/aodv/aodv-routing-protocol.h b/src/routing/aodv/aodv-routing-protocol.h index 6a54deefa..b380cda03 100644 --- a/src/routing/aodv/aodv-routing-protocol.h +++ b/src/routing/aodv/aodv-routing-protocol.h @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #ifndef AODVROUTINGPROTOCOL_H_ #define AODVROUTINGPROTOCOL_H_ diff --git a/src/routing/aodv/aodv-rqueue.cc b/src/routing/aodv/aodv-rqueue.cc index ce82e9e5d..f0164fe7f 100644 --- a/src/routing/aodv/aodv-rqueue.cc +++ b/src/routing/aodv/aodv-rqueue.cc @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,177 +15,180 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ - #include "aodv-rqueue.h" #include "ns3/simulator.h" #include "ns3/test.h" #include namespace ns3 { - namespace aodv { +namespace aodv { - aodv_rqueue::aodv_rqueue() : limit_(AODV_RTQ_MAX_LEN), timeout_(Seconds(AODV_RTQ_TIMEOUT)) - { - } +aodv_rqueue::aodv_rqueue() : limit_(AODV_RTQ_MAX_LEN), timeout_(Seconds(AODV_RTQ_TIMEOUT)) +{ +} - uint32_t - aodv_rqueue::size () - { - purge(); - return queue.size(); - } +uint32_t +aodv_rqueue::size () +{ + purge(); + return queue.size(); +} - void - aodv_rqueue::enque(QueueEntry & entry) - { - // Purge any packets that have timed out. - purge(); - entry.enExpire = Simulator::Now() + timeout_; +void +aodv_rqueue::enque(QueueEntry & entry) +{ + // Purge any packets that have timed out. + purge(); + entry.enExpire = Simulator::Now() + timeout_; - if (queue.size() == limit_) drop(remove_head()); // drop the most aged packet - queue.push_back(entry); - } + if (queue.size() == limit_) drop(remove_head()); // drop the most aged packet + queue.push_back(entry); +} - QueueEntry - aodv_rqueue::deque() - { - purge(); - return remove_head(); - } +QueueEntry +aodv_rqueue::deque() +{ + purge(); + return remove_head(); +} - bool - aodv_rqueue::deque(Ipv4Address dst, QueueEntry & entry) - { - purge(); - for(std::vector::iterator i = queue.begin(); i != queue.end(); ++i) - if(i->header.GetDestination() == dst) - { - entry = *i; - queue.erase(i); - return true; - } - return false; - } - - bool - aodv_rqueue::find(Ipv4Address dst) - { - for( std::vector::const_iterator i = queue.begin(); i != queue.end(); ++i) - if(i->header.GetDestination() == dst) - return true; - return false; - } - - QueueEntry - aodv_rqueue::remove_head() - { - QueueEntry entry = queue.front(); - queue.erase(queue.begin()); - return entry; - } - - struct IsExpired - { - bool operator() (QueueEntry const & e) const +bool +aodv_rqueue::deque(Ipv4Address dst, QueueEntry & entry) +{ + purge(); + for(std::vector::iterator i = queue.begin(); i != queue.end(); ++i) + if(i->header.GetDestination() == dst) { - return (e.enExpire < Simulator::Now()); + entry = *i; + queue.erase(i); + return true; } - }; + return false; +} - void - aodv_rqueue::purge() - { - std::vector::iterator i = std::remove_if(queue.begin(), queue.end(), IsExpired()); - for (std::vector::iterator j = i ; j < queue.end(); ++j) - drop (*j); - queue.erase(i, queue.end()); - } +bool +aodv_rqueue::find(Ipv4Address dst) +{ + for( std::vector::const_iterator i = queue.begin(); i != queue.end(); ++i) + if(i->header.GetDestination() == dst) + return true; + return false; +} - void - aodv_rqueue::drop(QueueEntry) - { - // TODO do nothing now. - } +QueueEntry +aodv_rqueue::remove_head() +{ + QueueEntry entry = queue.front(); + queue.erase(queue.begin()); + return entry; +} + +struct IsExpired +{ + bool operator() (QueueEntry const & e) const + { + return (e.enExpire < Simulator::Now()); + } +}; + +void +aodv_rqueue::purge() +{ + std::vector::iterator i = std::remove_if(queue.begin(), queue.end(), IsExpired()); + for (std::vector::iterator j = i ; j < queue.end(); ++j) + drop (*j); + queue.erase(i, queue.end()); +} + +void +aodv_rqueue::drop(QueueEntry) +{ + // TODO do nothing now. +} #ifdef RUN_SELF_TESTS - /// Unit test for aodv_rqueue - struct AodvRqueueTest : public Test - { - AodvRqueueTest () : Test ("AODV/Rqueue"), result(true) {} - virtual bool RunTests(); +/// Unit test for aodv_rqueue +struct AodvRqueueTest : public Test +{ + AodvRqueueTest () : Test ("AODV/Rqueue"), result(true) {} + virtual bool RunTests(); - void CheckSizeLimit (); - void CheckTimeout (); + void CheckSizeLimit (); + void CheckTimeout (); - aodv_rqueue q; - bool result; - }; + aodv_rqueue q; + bool result; +}; - /// Test instance - static AodvRqueueTest g_AodvRqueueTest; +/// Test instance +static AodvRqueueTest g_AodvRqueueTest; - bool - AodvRqueueTest::RunTests () - { - Ptr packet = Create(); - Ipv4Header header; - QueueEntry e1 (packet, header); - q.enque (e1); - QueueEntry e2 = q.deque (); - NS_TEST_ASSERT (e1 == e2); +bool +AodvRqueueTest::RunTests () +{ + Ptr packet = Create(); + Ipv4Header header; + QueueEntry e1 (packet, header); + q.enque (e1); + QueueEntry e2 = q.deque (); + NS_TEST_ASSERT (e1 == e2); - Ipv4Address dst("1.2.3.4"); - header.SetDestination (dst); - e1 = QueueEntry (packet, header); - q.enque (e1); + Ipv4Address dst("1.2.3.4"); + header.SetDestination (dst); + e1 = QueueEntry (packet, header); + q.enque (e1); - bool ok = q.deque (dst, e2); - NS_TEST_ASSERT (ok); - NS_TEST_ASSERT (e1 == e2); - NS_TEST_ASSERT (! q.find(dst)); - q.enque (e1); - NS_TEST_ASSERT (q.find(dst)); + bool ok = q.deque (dst, e2); + NS_TEST_ASSERT (ok); + NS_TEST_ASSERT (e1 == e2); + NS_TEST_ASSERT (! q.find(dst)); + q.enque (e1); + NS_TEST_ASSERT (q.find(dst)); - CheckSizeLimit (); + CheckSizeLimit (); - Ipv4Header header2; - Ipv4Address dst2("1.2.3.4"); - header2.SetDestination (dst2); + Ipv4Header header2; + Ipv4Address dst2("1.2.3.4"); + header2.SetDestination (dst2); - Simulator::Schedule (Seconds(AODV_RTQ_TIMEOUT+1), & AodvRqueueTest::CheckTimeout, this); + Simulator::Schedule (Seconds(AODV_RTQ_TIMEOUT+1), & AodvRqueueTest::CheckTimeout, this); - Simulator::Run (); - Simulator::Destroy (); + Simulator::Run (); + Simulator::Destroy (); - return result; - } + return result; +} - void - AodvRqueueTest::CheckSizeLimit () - { - Ptr packet = Create(); - Ipv4Header header; - QueueEntry e1 (packet, header); +void +AodvRqueueTest::CheckSizeLimit () +{ + Ptr packet = Create(); + Ipv4Header header; + QueueEntry e1 (packet, header); - for (uint32_t i = 0; i < AODV_RTQ_MAX_LEN; ++i) - q.enque (e1); - NS_TEST_ASSERT (q.size() == AODV_RTQ_MAX_LEN); + for (uint32_t i = 0; i < AODV_RTQ_MAX_LEN; ++i) + q.enque (e1); + NS_TEST_ASSERT (q.size() == AODV_RTQ_MAX_LEN); - for (uint32_t i = 0; i < AODV_RTQ_MAX_LEN; ++i) - q.enque (e1); - NS_TEST_ASSERT (q.size() == AODV_RTQ_MAX_LEN); - } + for (uint32_t i = 0; i < AODV_RTQ_MAX_LEN; ++i) + q.enque (e1); + NS_TEST_ASSERT (q.size() == AODV_RTQ_MAX_LEN); +} - void - AodvRqueueTest::CheckTimeout () - { - NS_TEST_ASSERT (q.size() == 0); - } +void +AodvRqueueTest::CheckTimeout () +{ + NS_TEST_ASSERT (q.size() == 0); +} #endif - }} +}} diff --git a/src/routing/aodv/aodv-rqueue.h b/src/routing/aodv/aodv-rqueue.h index 5f6bbdcfc..abae709a4 100644 --- a/src/routing/aodv/aodv-rqueue.h +++ b/src/routing/aodv/aodv-rqueue.h @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #ifndef __aodv_rqueue_h__ #define __aodv_rqueue_h__ diff --git a/src/routing/aodv/aodv-rtable.cc b/src/routing/aodv/aodv-rtable.cc index 8889467db..a58d7a360 100644 --- a/src/routing/aodv/aodv-rtable.cc +++ b/src/routing/aodv/aodv-rtable.cc @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,13 +15,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ - #include "aodv-rtable.h" #include #include "ns3/test.h" diff --git a/src/routing/aodv/aodv-rtable.h b/src/routing/aodv/aodv-rtable.h index 1725472fd..96bfaecc4 100644 --- a/src/routing/aodv/aodv-rtable.h +++ b/src/routing/aodv/aodv-rtable.h @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 1997, 1998 Carnegie Mellon University. + * Copyright (c) 2009 IITP RAS * * 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 @@ -15,11 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: The AODV code developed by the CMU/MONARCH group was optimized and - * tuned by Samir Das and Mahesh Marina, University of Cincinnati. - * The work was partially done in Sun Microsystems. + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU * - * Ported to ns-3 by Elena Borovkova + * Authors: Elena Borovkova + * Pavel Boyko */ #ifndef __aodv_rtable_h__ #define __aodv_rtable_h__ diff --git a/src/routing/aodv/aodv.h b/src/routing/aodv/aodv.h index fddf05d33..4dec57c08 100644 --- a/src/routing/aodv/aodv.h +++ b/src/routing/aodv/aodv.h @@ -15,7 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Pavel Boyko + * Based on + * NS-2 AODV model developed by the CMU/MONARCH group and optimized and + * tuned by Samir Das and Mahesh Marina, University of Cincinnati; + * + * AODV-UU implementation by Erik Nordström of Uppsala University + * http://core.it.uu.se/core/index.php/AODV-UU + * + * Authors: Elena Borovkova + * Pavel Boyko */ #ifndef AODV_H_ @@ -25,7 +33,7 @@ * \ingroup routing * \defgroup aodv AODV * - * \brief RFC-conformant AODV model ported from ns-2 + * \brief RFC concerted AODV manet routing model * * TODO more docs */