A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ss-link-manager.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008,2009 INRIA, UDcast
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20  * <amine.ismail@UDcast.com>
21  */
22 
23 #ifndef LINK_MANAGER_H
24 #define LINK_MANAGER_H
25 
26 #include <stdint.h>
27 #include "wimax-net-device.h"
28 #include "ss-net-device.h"
29 #include "ns3/event-id.h"
30 #include "cid.h"
31 #include "mac-messages.h"
32 #include "ns3/nstime.h"
33 
34 namespace ns3 {
35 
41 class SSLinkManager : public Object
42 {
43 public:
44  static TypeId GetTypeId (void);
46  ~SSLinkManager (void);
47  void DoDispose (void);
48 
49  void SetBsEirp (uint16_t bs_eirp);
50  void SetEirXPIrMax (uint16_t eir_x_p_ir_max);
51  void SetRangingIntervalFound (bool rangingIntervalFound);
52  bool GetRangingIntervalFound (void) const;
53  void SetNrRangingTransOpps (uint8_t nrRangingTransOpps);
54  void SetRangingCW (uint8_t rangingCW);
55  void IncrementNrInvitedPollsRecvd (void);
57 
58  void PerformRanging (Cid cid, RngRsp rngrsp);
60  bool deleteParameters);
61  void SendRangingRequest (uint8_t uiuc, uint16_t allocationSize);
62  void StartContentionResolution (void);
63  void PerformBackoff (void);
64  bool IsUlChannelUsable (void);
65  void ScheduleScanningRestart (Time interval,
67  bool deleteUlParameters, EventId &eventId);
68 private:
69  SSLinkManager (const SSLinkManager &);
71 
72  void EndScanning (bool status, uint64_t frequency);
73  void StartSynchronizing (void);
74  bool SearchForDlChannel (uint8_t channel);
75  void SelectRandomBackoff (void);
76  void IncreaseRangingRequestCW (void);
77  void ResetRangingRequestCW (void);
78  void DeleteUplinkParameters (void);
79  void AdjustRangingParameters (const RngRsp &rngrsp);
80  void NegotiateBasicCapabilities (void);
81  uint16_t CalculateMaxIRSignalStrength (void);
82  uint16_t GetMinTransmitPowerLevel (void);
83 
85 
87  // initial ranging parameters obtained from DCD (in channel encodings)
88  uint16_t m_bsEirp;
89  uint16_t m_eirXPIrMax; // initial ranging maximum equivalent isotropic received power at BS
90  uint16_t m_pTxIrMax; // maximum transmit signal strength for initial ranging calculated by SS
91 
92  uint8_t m_initRangOppNumber; // Initial Ranging opportunity (1–255) in which SS transmitted the RNG_REQ
94  uint32_t m_rngReqFrameNumber; // frame number in which SS sent RNG_REQ message
96 
97  uint8_t m_dlChnlNr; // indicates the channel/frequency currently the SS is scanning
98  uint64_t m_frequency; // frequency on which it is currently operating, i.e., where scanning was successful
100 
101  // stats members
102  uint16_t m_nrRngReqsSent;
105 
106  uint8_t m_rangingCW;
107  uint8_t m_rangingBO;
111 
113 };
114 
115 } // namespace ns3
116 
117 #endif /* LINK_MANAGER_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:79
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
Doxygen introspection did not find any typical Config paths.
Definition: mac-messages.h:97
Doxygen introspection did not find any typical Config paths.
Definition: mac-messages.h:476
Definition: cid.h:35
an identifier for simulation events.
Definition: event-id.h:46
a base class which provides memory management and object aggregation
Definition: object.h:64
a unique identifier for an interface.
Definition: type-id.h:49