![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef LTE_CONTROLPLANE_ASSOCIATIONSPROXY_HPP 00029 #define LTE_CONTROLPLANE_ASSOCIATIONSPROXY_HPP 00030 00031 #include <LTE/helper/Keys.hpp> 00032 #include <LTE/controlplane/flowmanagement/IFlowManager.hpp> 00033 00034 #include <WNS/ldk/tools/Synchronizer.hpp> 00035 #include <WNS/ldk/buffer/Dropping.hpp> 00036 #include <WNS/service/dll/Address.hpp> 00037 #include <WNS/logger/Logger.hpp> 00038 #include <WNS/probe/bus/ContextCollector.hpp> 00039 #include <DLL/Layer2.hpp> 00040 #include <DLL/UpperConvergence.hpp> 00041 00042 namespace lte { namespace macg { class MACg;}} 00043 namespace lte { namespace rlc { class UERLC;}} 00044 00045 namespace lte { namespace controlplane { 00046 00047 typedef std::string ModeName; 00048 00049 struct ModeInfo 00050 { 00051 ModeName mode; 00052 wns::service::dll::UnicastAddress rapAdr; 00053 }; 00054 00055 typedef std::map<wns::service::dll::UnicastAddress, ModeInfo> UserInfoLookup; // for RAP 00056 00057 struct AssociationInfo { 00058 ModeName mode; 00059 wns::service::dll::UnicastAddress rap; 00060 wns::service::dll::UnicastAddress bs; 00061 }; // for UT 00062 00063 class AssociationsProxy : 00064 public wns::ldk::ControlService, 00065 public wns::events::PeriodicTimeout 00066 { 00067 public: 00068 AssociationsProxy(wns::ldk::ControlServiceRegistry* csr, const wns::pyconfig::View& config); 00069 00070 virtual ~AssociationsProxy(); 00071 00072 virtual void 00073 onCSRCreated(); 00074 00075 virtual void 00076 periodically(); 00077 00078 protected: 00079 dll::ILayer2* layer2; 00080 wns::ldk::CommandReaderInterface* rlcReader; 00081 std::list<ModeName> myModes; 00082 wns::logger::Logger logger; 00083 UserInfoLookup activeUsers; 00084 00085 bool probed; 00086 wns::probe::bus::ContextCollectorPtr numUsers; 00087 }; 00088 00089 class AssociationsProxyBS : 00090 public AssociationsProxy 00091 { 00092 public: 00093 AssociationsProxyBS(wns::ldk::ControlServiceRegistry* csr, const wns::pyconfig::View& config); 00094 00095 virtual ~AssociationsProxyBS(); 00096 00097 virtual void 00098 onCSRCreated(); 00099 00102 virtual lte::controlplane::flowmanagement::IFlowSwitching::ControlPlaneFlowIDs 00103 associatedPerMode(wns::service::dll::UnicastAddress userAdr, 00104 wns::service::dll::UnicastAddress rapAdr, 00105 ModeName mode); 00106 00110 virtual void 00111 disassociatedPerMode(wns::service::dll::UnicastAddress userAdr, 00112 wns::service::dll::UnicastAddress targetRAP, 00113 ModeName mode); 00114 00115 bool 00116 hasAssociatedPerMode(wns::service::dll::UnicastAddress userAdr, 00117 ModeName mode) const; 00118 00119 wns::service::dll::UnicastAddress 00120 getRAPforUserPerMode(wns::service::dll::UnicastAddress userAdr, ModeName mode) const; 00121 00122 void 00123 addRAPofREC(wns::service::dll::UnicastAddress rap); 00124 00125 bool 00126 inMyREC(wns::service::dll::UnicastAddress adr) const ; 00127 00128 private: 00129 00130 bool 00131 hasPreserved(wns::service::dll::UnicastAddress userAdr) const; 00132 00133 virtual bool 00134 hasAssociationTo(const wns::service::dll::UnicastAddress& dstAdr) const ; 00135 00136 lte::controlplane::flowmanagement::IFlowManagerENB* flowManagerENB; 00137 dll::APUpperConvergence* myUpperConvergence; 00138 wns::ldk::tools::Synchronizer* upperSynchronizer; 00139 std::set<wns::service::dll::UnicastAddress> myRECRAPs; 00140 std::set<wns::service::dll::UnicastAddress> preservedUsers; 00141 }; 00142 00143 class AssociationsProxyUT : 00144 public AssociationsProxy 00145 { 00146 public: 00147 AssociationsProxyUT(wns::ldk::ControlServiceRegistry* csr, const wns::pyconfig::View& config); 00148 00149 virtual ~AssociationsProxyUT(); 00150 00151 virtual void 00152 onCSRCreated(); 00153 00154 // Also used by AssociationsProxyUTusingMIH 00155 virtual void 00156 associatedPerMode(wns::service::dll::UnicastAddress rapAdr, 00157 wns::service::dll::UnicastAddress bsAdr, 00158 ModeName mode, 00159 lte::controlplane::flowmanagement::IFlowSwitching::ControlPlaneFlowIDs controlPlaneFlowIDs); 00160 00161 // Also used by AssociationsProxyUTusingMIH 00162 virtual void 00163 disassociatedPerMode(wns::service::dll::UnicastAddress rapAdr, 00164 ModeName mode, bool preserve); 00165 00166 wns::service::dll::UnicastAddress 00167 getBSforMode(ModeName mode) const; 00168 00169 void 00170 disassociationOnTimeout(wns::service::dll::UnicastAddress dst, ModeName mode); 00171 00172 // check statement 00173 bool 00174 isBusy() const; 00175 00176 // mode detection report from association handler 00177 void 00178 modeDetected(ModeName mode, wns::service::dll::UnicastAddress rapAdr); 00179 00180 // inform from associationHandler that the SINR is below 00181 // the threshold and this mode should be disassociated 00182 void 00183 disassociationNeeded(ModeName mode, wns::service::dll::UnicastAddress rapAdr); 00184 00185 void 00186 flowBuilt(); 00187 00188 virtual void 00189 periodically(){} 00190 00191 ModeInfo 00192 getBestDetected() const; 00193 00194 bool 00195 hasAssociation() const; 00196 00197 protected: 00198 virtual bool 00199 hasAssociationTo(const wns::service::dll::UnicastAddress& dstAdr) const ; 00200 00201 void 00202 writeProbes(const bool alreadyAfterAssociation); 00203 00204 lte::rlc::UERLC* rlc; 00205 wns::ldk::tools::Synchronizer* upperSynchronizer; 00206 lte::macg::MACg* macg; 00207 AssociationInfo activeAssociation; 00208 std::map<ModeName, wns::service::dll::UnicastAddress> detectedModes; 00209 ModeInfo interMode; 00210 bool busy; 00211 bool plainDisassociation; 00212 bool preserve; 00213 wns::simulator::Time associationStartTime; 00214 wns::simulator::Time disAssociationStartTime; 00215 private: 00216 std::map<ModeName, int> modePriorityLookup; 00217 wns::probe::bus::ContextCollector* associationDurationProbe; 00218 wns::probe::bus::ContextCollector* initialaccessDurationProbe; 00219 bool initialaccessFirstTime; 00220 wns::probe::bus::ContextCollector* handoverDurationProbe; 00221 lte::controlplane::flowmanagement::IFlowManagerUE* flowManagerUE; 00222 }; 00223 00224 } // controlplane 00225 } // lte 00226 00227 #endif // NOT defined LTE_CONTROLPLANE_ASSOCIATIONSPROXY_HPP
1.5.5