1.1 --- a/src/devices/uan/uan-header-rc.h Wed Apr 01 00:31:47 2009 -0700
1.2 +++ b/src/devices/uan/uan-header-rc.h Wed Apr 01 01:35:43 2009 -0700
1.3 @@ -20,7 +20,7 @@
1.4 */
1.5
1.6 /**
1.7 - * \file uan-hearder-rc.h
1.8 + * \file uan-header-rc.h
1.9 *
1.10 * Headers (RTS, CTS, ACK, Data) used in UanMacRc and UanMacRcGw
1.11 *
2.1 --- a/src/devices/uan/uan-mac-rc-gw.h Wed Apr 01 00:31:47 2009 -0700
2.2 +++ b/src/devices/uan/uan-mac-rc-gw.h Wed Apr 01 01:35:43 2009 -0700
2.3 @@ -42,7 +42,7 @@
2.4 /**
2.5 * \class UanMacRcGw
2.6 *
2.7 - * MAC protocol for gateway nodes in a network using reservation channel MAC
2.8 + * MAC protocol for gateway nodes in a network using reservation channel MAC (UanMacRc)
2.9 */
2.10 class UanMacRcGw: public ns3::UanMac
2.11 {
3.1 --- a/src/devices/uan/uan-mac.h Wed Apr 01 00:31:47 2009 -0700
3.2 +++ b/src/devices/uan/uan-mac.h Wed Apr 01 01:35:43 2009 -0700
3.3 @@ -41,13 +41,15 @@
3.4
3.5
3.6
3.7 +/**
3.8 + * \class UanMac
3.9 + *
3.10 + * \brief Virtual base class for all UAN MAC protocols
3.11 + */
3.12 class UanMac : public ns3::Object
3.13 {
3.14 public:
3.15
3.16 - //UanMac();
3.17 - //virtual ~UanMac();
3.18 -
3.19 /**
3.20 * \returns MAC Address
3.21 */
4.1 --- a/src/devices/uan/uan-net-device.h Wed Apr 01 00:31:47 2009 -0700
4.2 +++ b/src/devices/uan/uan-net-device.h Wed Apr 01 01:35:43 2009 -0700
4.3 @@ -37,6 +37,11 @@
4.4 class UanMac;
4.5 class UanTransducer;
4.6
4.7 +/**
4.8 + * \class UanNetDevice
4.9 + *
4.10 + * \brief Net device for UAN models
4.11 + */
4.12 class UanNetDevice : public NetDevice
4.13 {
4.14 public:
5.1 --- a/src/devices/uan/uan-phy-dual.h Wed Apr 01 00:31:47 2009 -0700
5.2 +++ b/src/devices/uan/uan-phy-dual.h Wed Apr 01 01:35:43 2009 -0700
5.3 @@ -1,8 +1,22 @@
5.4 /*
5.5 - * uan-phy-dual.h
5.6 + * Copyright (c) 2008 University of Washington
5.7 *
5.8 - * Created on: 26-Feb-2009
5.9 - * Author: ltracy
5.10 + * This program is free software: you can redistribute it and/or modify
5.11 + * it under the terms of the GNU General Public License as published by
5.12 + * the Free Software Foundation, either version 3 of the License, or
5.13 + * (at your option) any later version.
5.14 + *
5.15 + * This program is distributed in the hope that it will be useful,
5.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.18 + * GNU General Public License for more details.
5.19 + *
5.20 + * You should have received a copy of the GNU General Public License
5.21 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
5.22 + *
5.23 + * Author: Leonard Tracy <lentracy@u.washington.edu>
5.24 + *
5.25 + *
5.26 */
5.27
5.28 #ifndef UANPHYDUAL_H_
5.29 @@ -19,6 +33,14 @@
5.30 class UanModesList;
5.31
5.32
5.33 +/**
5.34 + * \class UanPhyCalcSinrDual
5.35 + * \brief Default SINR model for UanPhyDual
5.36 + *
5.37 + * Considers interfering packet power as additional ambient noise only
5.38 + * if there is overlap in frequency band as found from supplied UanTxMode.
5.39 + * If there is no overlap, then the packets are considered not to interfere.
5.40 + */
5.41 class UanPhyCalcSinrDual : public UanPhyCalcSinr
5.42 {
5.43 public:
5.44 @@ -34,6 +56,20 @@
5.45 const UanTransducer::ArrivalList &arrivalList
5.46 ) const;
5.47 };
5.48 +
5.49 +/**
5.50 + * \class UanPhyDual
5.51 + *
5.52 + * A class that wraps two generic UAN Phy layers into a single PHY.
5.53 + * This is used to simulate two receivers (and transmitters) that use
5.54 + * the same front end hardware. When attached to a UanTransducerHd,
5.55 + * this results in a net device able to transmit on one or two channels
5.56 + * simultaneously or receive on one or two channels simultaneously but
5.57 + * that cannot transmit and receive simultaneously.
5.58 + *
5.59 + * Many of the standard PHY functions here become ambiguous. In most cases
5.60 + * information for "Phy1" are returned.
5.61 + */
5.62 class UanPhyDual : public UanPhy
5.63 {
5.64 public:
5.65 @@ -104,23 +140,68 @@
5.66 void SetRxGainDbPhy1(double);
5.67 void SetRxGainDbPhy2(double);
5.68
5.69 + /**
5.70 + * \returns List of available modes on Phy1
5.71 + */
5.72 UanModesList GetModesPhy1(void) const;
5.73 + /**
5.74 + * \returns List of available modes on Phy2
5.75 + */
5.76 UanModesList GetModesPhy2(void) const;
5.77 + /**
5.78 + * \param modes List of modes to use on Phy1 (index corresponds to mode #)
5.79 + */
5.80 void SetModesPhy1(UanModesList modes);
5.81 + /*
5.82 + * \param modes List of modes to use on Phy2 (index corresponds to mode #)
5.83 + */
5.84 void SetModesPhy2(UanModesList modes);
5.85
5.86 + /**
5.87 + * \returns Ptr to PER model for Phy1
5.88 + */
5.89 Ptr<UanPhyPer> GetPerFunctorPhy1(void) const;
5.90 + /**
5.91 + * \returns Ptr to PER model for Phy2
5.92 + */
5.93 Ptr<UanPhyPer> GetPerFunctorPhy2(void) const;
5.94 + /**
5.95 + * \param per Ptr to PER model to use on Phy1
5.96 + */
5.97 void SetPerFunctorPhy1(Ptr<UanPhyPer> per);
5.98 + /**
5.99 + * \param per Ptr to PER model to use on Phy2
5.100 + */
5.101 void SetPerFunctorPhy2(Ptr<UanPhyPer> per);
5.102
5.103 + /**
5.104 + * \returns Ptr to SINR model for Phy1
5.105 + */
5.106 Ptr<UanPhyCalcSinr> GetSinrFunctorPhy1(void) const;
5.107 + /*
5.108 + * \returns Ptr to SINR model for Phy2
5.109 + */
5.110 Ptr<UanPhyCalcSinr> GetSinrFunctorPhy2(void) const;
5.111 + /**
5.112 + * \param calcSinr Ptr to SINR model to use on Phy1
5.113 + */
5.114 void SetSinrFunctorPhy1(Ptr<UanPhyCalcSinr> calcSinr);
5.115 + /**
5.116 + * \param calcSinr Ptr to SINR model to use on Phy2
5.117 + */
5.118 void SetSinrFunctorPhy2(Ptr<UanPhyCalcSinr> calcSinr);
5.119
5.120 + /**
5.121 + * \returns Packet currently being received on Phy1 (Null Ptr if none)
5.122 + */
5.123 Ptr<Packet> GetPhy1PacketRx(void) const;
5.124 + /**
5.125 + * \returns Packet currently being received on Phy2 (Null Ptr if none)
5.126 + */
5.127 Ptr<Packet> GetPhy2PacketRx(void) const;
5.128 + /**
5.129 + * \returns Packet currenty being received on Phy1 (Null Ptr if none)
5.130 + */
5.131 Ptr<Packet> GetPacketRx(void) const;
5.132
5.133 private:
6.1 --- a/src/devices/uan/uan-phy-gen.h Wed Apr 01 00:31:47 2009 -0700
6.2 +++ b/src/devices/uan/uan-phy-gen.h Wed Apr 01 01:35:43 2009 -0700
6.3 @@ -32,6 +32,7 @@
6.4 {
6.5
6.6 /**
6.7 + * \class UanPhyPerGenDefault
6.8 * \brief Default Packet Error Rate calculator for UanPhyGen
6.9 * This class uses basic probability of error equations learned
6.10 * in any wireless comms course. Not accurate for
6.11 @@ -51,6 +52,7 @@
6.12 };
6.13
6.14 /**
6.15 + * \class UanPhyCalcSinrDefault
6.16 * \brief Default SINR calculator for UanPhyGen
6.17 */
6.18 class UanPhyCalcSinrDefault : public UanPhyCalcSinr
6.19 @@ -70,6 +72,10 @@
6.20 ) const;
6.21 };
6.22
6.23 +/**
6.24 + * \class UanPhyGen
6.25 + * \brief Generic PHY model
6.26 + */
6.27 class UanPhyGen : public ns3::UanPhy
6.28 {
6.29 public:
7.1 --- a/src/devices/uan/uan-phy-simple.h Wed Apr 01 00:31:47 2009 -0700
7.2 +++ b/src/devices/uan/uan-phy-simple.h Wed Apr 01 01:35:43 2009 -0700
7.3 @@ -31,6 +31,10 @@
7.4 namespace ns3
7.5 {
7.6
7.7 +/**
7.8 + * \class UanPhySimple
7.9 + * \brief Simple Phy model. This model is outdated. UanPhyGen should be used.
7.10 + */
7.11 class UanPhySimple : public ns3::UanPhy
7.12 {
7.13 public:
8.1 --- a/src/devices/uan/uan-phy.h Wed Apr 01 00:31:47 2009 -0700
8.2 +++ b/src/devices/uan/uan-phy.h Wed Apr 01 01:35:43 2009 -0700
8.3 @@ -86,7 +86,7 @@
8.4 /**
8.5 * \class UanPhyListener
8.6 *
8.7 - * Interface for PHY event listener
8.8 + * \brief Interface for PHY event listener
8.9 */
8.10 class UanPhyListener {
8.11 public:
8.12 @@ -98,7 +98,11 @@
8.13 virtual void NotifyTxStart(Time duration)=0;
8.14 };
8.15
8.16 -
8.17 +/**
8.18 + * \class UanPhy
8.19 + *
8.20 + * \brief Base class for UAN Phy models
8.21 + */
8.22 class UanPhy : public ns3::Object
8.23 {
8.24 public:
9.1 --- a/src/devices/uan/uan-prop-model-bh.h Wed Apr 01 00:31:47 2009 -0700
9.2 +++ b/src/devices/uan/uan-prop-model-bh.h Wed Apr 01 01:35:43 2009 -0700
9.3 @@ -20,6 +20,11 @@
9.4 namespace ns3
9.5 {
9.6
9.7 +/**
9.8 + * \class BhConfig
9.9 + *
9.10 + * \brief Holds configuration information for Bellhop environment
9.11 + */
9.12 class BhConfig
9.13 {
9.14 public:
9.15 @@ -163,7 +168,12 @@
9.16
9.17 };
9.18
9.19 -
9.20 +/**
9.21 + * \class UanPropModelBh
9.22 + * \brief Returns stored Bellhop environment information for use in determining prop. information
9.23 + *
9.24 + * This class makes use of stored Bellhop runs
9.25 + */
9.26 class UanPropModelBh: public ns3::UanPropagationModel
9.27 {
9.28 public:
9.29 @@ -172,6 +182,7 @@
9.30
9.31 static TypeId GetTypeId(void);
9.32
9.33 + //Inherited methods
9.34 virtual double GetPathLossDb(Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode);
9.35 virtual UanPdp GetPdp(Ptr<MobilityModel> src, Ptr<MobilityModel> dest, UanTxMode mode);
9.36 virtual Time GetDelay(Ptr<MobilityModel> src, Ptr<MobilityModel> dest, UanTxMode mode);
10.1 --- a/src/devices/uan/uan-prop-model-ideal.h Wed Apr 01 00:31:47 2009 -0700
10.2 +++ b/src/devices/uan/uan-prop-model-ideal.h Wed Apr 01 01:35:43 2009 -0700
10.3 @@ -28,6 +28,11 @@
10.4 namespace ns3
10.5 {
10.6
10.7 +/**
10.8 + * \class UanPropModelIdeal
10.9 + *
10.10 + * \brief Ideal propagation model (no pathloss, impulse PDP)
10.11 + */
10.12 class UanPropModelIdeal : public ns3::UanPropagationModel
10.13 {
10.14 public:
11.1 --- a/src/devices/uan/uan-prop-model-thorp.h Wed Apr 01 00:31:47 2009 -0700
11.2 +++ b/src/devices/uan/uan-prop-model-thorp.h Wed Apr 01 01:35:43 2009 -0700
11.3 @@ -15,6 +15,10 @@
11.4
11.5 class UanTxMode;
11.6
11.7 +/**
11.8 + * \class UanPropModelThorp
11.9 + * \brief Uses Thorp's approximation to compute pathloss. Assumes implulse PDP.
11.10 + */
11.11 class UanPropModelThorp: public ns3::UanPropagationModel
11.12 {
11.13 public:
12.1 --- a/src/devices/uan/uan-prop-model.h Wed Apr 01 00:31:47 2009 -0700
12.2 +++ b/src/devices/uan/uan-prop-model.h Wed Apr 01 01:35:43 2009 -0700
12.3 @@ -36,10 +36,24 @@
12.4
12.5 class UanTxMode;
12.6
12.7 +/**
12.8 + * \class Tap
12.9 + * \brief Holds PDP arrival information
12.10 + */
12.11 class Tap {
12.12 public:
12.13 + /**
12.14 + * \param delay Time delay (usually from first arrival) of signal
12.15 + * \param amp Complex amplitude of arrival
12.16 + */
12.17 Tap(Time delay, std::complex<double> amp);
12.18 + /**
12.19 + * \returns Complex amplitude of arrival
12.20 + */
12.21 std::complex<double> GetAmp(void) const;
12.22 + /**
12.23 + * \returns Time delay (usually from first arrival) of signal
12.24 + */
12.25 Time GetDelay(void) const;
12.26
12.27 bool operator<(const Tap &other) const;
12.28 @@ -53,6 +67,7 @@
12.29 std::complex<double> m_amplitude;
12.30 Time m_delay;
12.31 };
12.32 +
12.33 /**
12.34 * \class UanPdp
12.35 *
12.36 @@ -67,7 +82,6 @@
12.37 *
12.38 *
12.39 */
12.40 -
12.41 class UanPdp {
12.42 public:
12.43 typedef std::set<Tap>::const_iterator Iterator;
12.44 @@ -89,6 +103,11 @@
12.45 std::ostream &operator<<(std::ostream &os, UanPdp &pdp);
12.46 std::istream &operator>>(std::ostream &is, UanPdp &pdp);
12.47
12.48 +/**
12.49 + * \class UanPropagationModel
12.50 + *
12.51 + * Base class for implemented underwater propagation models
12.52 + */
12.53 class UanPropagationModel : public ns3::Object
12.54 {
12.55 public:
12.56 @@ -110,7 +129,6 @@
12.57 */
12.58 virtual Time GetDelay(Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode)=0;
12.59
12.60 -
12.61 };
12.62
12.63 }
13.1 --- a/src/devices/uan/uan-transducer-hd.cc Wed Apr 01 00:31:47 2009 -0700
13.2 +++ b/src/devices/uan/uan-transducer-hd.cc Wed Apr 01 01:35:43 2009 -0700
13.3 @@ -50,15 +50,8 @@
13.4 static TypeId tid = TypeId("ns3::UanTransducerHd")
13.5 .SetParent<Object> ()
13.6 .AddConstructor<UanTransducerHd>()
13.7 -// .AddAttribute("Channel", "A pointer to the accoustic channel",
13.8 -// PointerValue(),
13.9 -
13.10 - // MakePointerAccessor(&UanTransducerHd::GetChannel, &UanTransducerHd::SetChannel),
13.11 -// MakePointerChecker<UanChannel> () )
13.12 ;
13.13 -
13.14 return tid;
13.15 -
13.16 }
13.17
13.18 UanTransducer::State
14.1 --- a/src/devices/uan/uan-transducer-hd.h Wed Apr 01 00:31:47 2009 -0700
14.2 +++ b/src/devices/uan/uan-transducer-hd.h Wed Apr 01 01:35:43 2009 -0700
14.3 @@ -27,6 +27,12 @@
14.4 namespace ns3
14.5 {
14.6
14.7 +/**
14.8 + * \class UanTransducerHd
14.9 + * \brief Half duplex implementation of transducer object
14.10 + *
14.11 + * This class will only allow attached Phy's to receive packets if not in TX mode
14.12 + */
14.13 class UanTransducerHd : public ns3::UanTransducer
14.14 {
14.15 public:
14.16 @@ -34,6 +40,7 @@
14.17 virtual ~UanTransducerHd();
14.18 static TypeId GetTypeId(void);
14.19
14.20 + //inherited methods
14.21 virtual State GetState(void) const;
14.22 virtual bool IsRx(void) const;
14.23 virtual bool IsTx(void) const;
15.1 --- a/src/devices/uan/uan-transducer.h Wed Apr 01 00:31:47 2009 -0700
15.2 +++ b/src/devices/uan/uan-transducer.h Wed Apr 01 01:35:43 2009 -0700
15.3 @@ -37,7 +37,11 @@
15.4 class UanChannel;
15.5
15.6
15.7 -
15.8 +/**
15.9 + * \class UanPacketArrival
15.10 + *
15.11 + * \brief Class consisting of packet arrival information (Time, RxPower, mode, PDP)
15.12 + */
15.13 class UanPacketArrival
15.14 {
15.15 public:
15.16 @@ -62,6 +66,14 @@
15.17 Time m_arrTime;
15.18 };
15.19
15.20 +/**
15.21 + * \class UanTransducer
15.22 + * \brief Virtual base for Transducer objects
15.23 + *
15.24 + * The Transducer was added to support classes such as UanPhyDual.
15.25 + * In a generic Phy setting, this class functions to hold information about all
15.26 + * possibly interfering packets.
15.27 + */
15.28 class UanTransducer : public ns3::Object
15.29 {
15.30 public:
15.31 @@ -69,19 +81,56 @@
15.32
15.33 typedef std::list<UanPacketArrival> ArrivalList;
15.34 typedef std::list<Ptr<UanPhy> > UanPhyList;
15.35 +
15.36 + /**
15.37 + * \returns State (TX or RX) of this transducer
15.38 + */
15.39 virtual State GetState(void) const=0;
15.40
15.41 + /**
15.42 + * \returns True if this transducer is available for receiving an incoming packet.
15.43 + */
15.44 virtual bool IsRx(void) const=0;
15.45 + /**
15.46 + * \returns True if there is a packet being transmitted from this transducer.
15.47 + */
15.48 virtual bool IsTx(void) const=0;
15.49 + /**
15.50 + * \returns List of all packets currently crossing this node in the water.
15.51 + */
15.52 virtual const ArrivalList &GetArrivalList(void) const=0;
15.53 + /**
15.54 + * \brief Receive Notify this object that a new packet has arrived at this nodes location
15.55 + * \param packet Packet arriving
15.56 + * \param rxPowerDb Signal power in dB of arriving packet
15.57 + * \param txMode Mode arriving packet is using
15.58 + * \param pdp PDP of arriving signal
15.59 + */
15.60 virtual void Receive(Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)=0;
15.61 + /**
15.62 + * \brief Transmit a packet from this transducer
15.63 + * \param src Source PHY
15.64 + * \param packet Packet to transmit
15.65 + * \param txPowerDb Outgoing Tx power of packet
15.66 + * \param txMode Mode to transmit packet with.
15.67 + */
15.68 virtual void Transmit(Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode)=0;
15.69 + /**
15.70 + * \param chan Channel this transducer is attached to
15.71 + */
15.72 virtual void SetChannel(Ptr<UanChannel> chan)=0;
15.73 + /**
15.74 + * \returns Channel this transducer is attached to
15.75 + */
15.76 virtual Ptr<UanChannel> GetChannel(void) const=0;
15.77 - virtual void AddPhy(Ptr<UanPhy>)=0;
15.78 + /**
15.79 + * \param phy Add phy above this transducer (may connect > 1 Phy to a transducer)
15.80 + */
15.81 + virtual void AddPhy(Ptr<UanPhy> phy)=0;
15.82 + /**
15.83 + * \returns List of all Phy's this transducer sends packets to.
15.84 + */
15.85 virtual const UanPhyList &GetPhyList(void) const=0;
15.86 -
15.87 -
15.88 };
15.89
15.90 } //namespace ns3
16.1 --- a/src/devices/uan/uan-tx-mode.h Wed Apr 01 00:31:47 2009 -0700
16.2 +++ b/src/devices/uan/uan-tx-mode.h Wed Apr 01 01:35:43 2009 -0700
16.3 @@ -31,10 +31,10 @@
16.4 class UanTxMode;
16.5
16.6 /**
16.7 -
16.8 + * \class UanTxMode
16.9 + * \brief Abstraction of packet modulation information
16.10 + *
16.11 */
16.12 -
16.13 -
16.14 class UanTxMode
16.15 {
16.16 public: