14#ifndef _NETSIM_802_22_H_
15#define _NETSIM_802_22_H_
17#pragma comment(lib,"CognitiveRadio.lib")
18#pragma comment(lib,"Metrics.lib")
19#pragma comment(lib,"NetworkStack.lib")
20#pragma comment(lib,"PropagationModel.lib")
23#define CHANNEL_LOSS -1.7
59#define B16_1111111111111111 65535
64#define UPSTREAM_GRANT_MANAGEMENT_BIT 0
65#define FRAGMANET_BIT 1
67#define ARQ_FEEDBACK_BIT 3
68#define BW_REQUEST_BIT 4
123# define FRAGMENT_SIZE 3
124# define MAX_SDU_SIZE 255
125#define SCH_DURATION 160000
126#define SCH_PHY_MODE 2
127#define FCH_PHY_MODE 4
128#define MAX_PHY_MODE 17
130#define MULTIPLEACCESS_OFDMA 1
235#define CR_CONTROL_PACKET(MMM) MAC_PROTOCOL_IEEE802_22*100+MMM
1226#define GET_RX_POWER_dbm(tx, rx) (propagation_get_received_power_dbm(propagationHandle, tx, 1, rx, 1, pstruEventDetails->dEventTime))
1227#define GET_RX_POWER_mw(tx,rx) (DBM_TO_MW(GET_RX_POWER_dbm(tx,rx)))
1246 unsigned int nLowerFrequency,
1247 unsigned int nHigherFrequency);
enum enum_802_22_MAC_Management_Message MANAGEMENT_MESSAGE
int fn_NetSim_CR_StartSCH(int nBTSId, int nInterfaceId)
int fn_NetSim_CR_FormDSFrame(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, double dTime)
int fn_NetSim_CR_TransmitSCH()
unsigned int g_FragmentId
int fn_NetSim_CR_CPE_ProcessDSMAP()
char * fn_NetSim_CR_Trace_F(int nSubEvent)
enum enum_802_22_ChannelState CHANNEL_STATE
QUALITY_OF_SERVICE fnGetQOS(char *Qos)
int fn_NetSim_CR_Metrics_F(PMETRICSWRITER metricsWriter)
enum enum_802_22_IncumbentStatus INCUMBENT_STATUS
int fn_NetSim_CR_BS_ProcessDSDReq()
int fn_NetSim_CR_FormChannelSet(BS_PHY *pstruBSPhy)
int fn_NetSim_CR_FillDSFrame(unsigned int size, DS_BURST **pstruDSBurst, SYMBOL_PARAMETER *pstruSymbolParameter, int nFlag, unsigned int *nSlotRequire)
enum enum_802_22_SubEvent SUBEVENT
int fn_NetSim_CR_GetFID(QUALITY_OF_SERVICE nQOS)
struct stru_802_22_SSFOutput * fn_NetSim_CR_CPE_SSF(struct stru_802_22_SSFInput *input, NETSIM_ID nDevId, NETSIM_ID nInterfaceId)
int fn_NetSim_CR_ConfigIncumbent(void *xmlNetSimNode, BS_MAC *pstruBSMAC)
int fn_NetSim_CR_IncumbentEnd()
NetSim_PACKET * fn_NetSim_CR_UNFillSlot(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, unsigned int nBurstId)
int fn_NetSim_CR_SSA_Initialization(BS_MAC *pstruBSMAC, BS_PHY *pstruBSPHY)
@ ChannelState_UNCLASSIFIED
@ ChannelState_DISALLOWED
int fn_NetSim_CR_BS_ProcessDSAReq()
int fn_NetSim_AddPacketToList(NetSim_PACKET **list, NetSim_PACKET *packet)
int fnIsinRange(double l1, double u1, double l2, double u2)
int fn_NetSim_CR_FreePacket_F(const NetSim_PACKET *pstruPacket)
int fn_NetSim_CR_CreateServiceFlow(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, int nId, NetSim_PACKET *packet, double dTime)
PROPAGATION_HANDLE propagationHandle
int fn_NetSim_CR_TransmitP2PPacket(NetSim_PACKET *pstruPacket, NETSIM_ID nDevId, NETSIM_ID nInterface)
int fn_NetSim_CR_BS_AllocateBandwidth()
int fn_NetSim_CR_CPE_ProcessDSA_RSP()
int fn_NetSim_CR_BS_ForwardDataPacket()
int fn_NetSim_CR_CPE_ProcessSCH(NetSim_PACKET *pstruPacket)
int fn_NetSim_CR_TransmitDSBurst()
int fn_NetSim_CR_MulticastPacket(NetSim_PACKET *pstruPacket, NETSIM_ID nDevId, NETSIM_ID nInterface)
int fn_NetSim_Check_Interference(unsigned int nChannelNumber, struct stru_802_22_Channel *pstruChannelList, unsigned int nLowerFrequency, unsigned int nHigherFrequency)
int fn_NetSim_CR_InitIncumbent(BS_MAC *pstruBSMAC, NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
int fn_NetSim_CR_CPE_ProcessFCH(NetSim_PACKET *pstruPacket)
int fn_NetSim_CR_TransmitFCH()
int fn_NetSim_CR_CalulateReceivedPower()
int fn_NetSim_CR_UpdateChannel()
int fn_NetSim_CR_UpdateIncumbentMetrics(BS_MAC *pstruBSMAC, BS_PHY *pstruBSPHY, double dTime)
static unsigned long ulIncumbentSeed1
enum_802_22_MAC_Management_Message
@ MMM_CHS_REQ
Channel switch request, Sent by BS in order to switch the entire cell operation to new channel.
@ MMM_MCA_REQ
Not implemented.
@ MMM_RNG_CMD
Not implemented.
@ MMM_DREG_CMD
Not implemented.
@ MMM_DSC_ACK
Dynamic service change Acknowledgement.
@ MMM_CBC_RSP
Not implemented.
@ MMM_ARQFeedback
Not implemented.
@ MMM_BLM_REP
Bulk measurement report.
@ MMM_TFTP_RSP
Not implemented.
@ MMM_US_MAP
Upstream access definition, defines the access to the upstream information.
@ MMM_DSC_REQ
Dynamic service change request
@ MMM_SCM_RSP
Not implemented.
@ MMM_DSA_REQ
Dynamic service addition request, This message is sent by BS or CPE to create new service request.
@ MMM_CHQ_REQ
Channel quiet request.
@ MMM_SCM_REQ
Not implemented.
@ MMM_CBC_REQ
Not implemented.
@ MMM_MCA_RSP
Not implemented.
@ MMM_DSA_ACK
Dynamic service addition acknowledgement.
@ MMM_REG_REQ
Not implemented.
@ MMM_REG_RSP
Not implemented.
@ MMM_FRM_UPD
Not implemented.
@ MMM_DSA_RSP
This message is generated in response to DSA-REQ message.
@ MMM_DSD_REQ
Dynamic service deletion request.
@ MMM_TFTP_CPLT
Not implemented.
@ MMM_RNG_REQ
Not implemented.
@ MMM_IPC_UPD
Not implemented.
@ MMM_CBP_RLY
Not implemented.
@ MMM_DSC_REP
Dynamic service change reply.
@ MMM_BLM_REQ
Bulk measurement request.
@ MMM_ARQ_Discard
Not implemented.
@ MMM_DS_MAP
Downstream access definition, defines the access to the downstream information.
@ MMM_DREG_REQ
Not implemented.
@ MMM_ARQ_Reset
Not implemented.
int fn_NetSim_CR_Configure_F(void **var)
int fn_NetSim_CR_IncumbentStart()
NetSim_PACKET * fn_NetSim_CR_FormUSMAP(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
double fn_NetSim_CR_CalculateTransmissionTime(double dPacketSize, SYMBOL_PARAMETER *pstruSymbolParameter)
static unsigned long ulIncumbentSeed2
int fn_NetSim_CR_CPE_ProcessDSD_REP()
int fn_NetSim_CR_PacketArrive()
int fn_NetSim_CR_TransmitUSBurst()
int fn_NetSim_CR_ScanChannel(BS_MAC *pstruBSMAC, BS_PHY *pstruBSPhy)
int fn_NetSim_CR_CPE_PhysicalOut()
NetSim_PACKET * fn_NetSim_CR_BS_PackPacket(BS_MAC *pstruBSMac, NetSim_PACKET *pstruPacket)
struct stru_802_22_Phy_Mode struPhyMode[MAX_PHY_MODE]
long long int fn_NetSim_CR_TransmitPacket(NetSim_PACKET *pstruPacket, int nDevId, int nInterfaceId, int nConDevId, int nConInterface)
int fn_NetSim_CR_AssociateCPE(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
NetSim_PACKET * fn_NetSim_CR_FormDSMAP(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
int fn_NetSim_TerminateServiceFlow(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, NetSim_PACKET *pstruPacket)
int fn_NetSim_CR_FormUSBurst()
int fn_NetSim_CR_UpdateOperatingChannel(BS_PHY *pstruBSPhy)
int fn_NetSim_Init_OFDMA(BS_PHY *pstruBSPhy)
char * fn_NetSim_CR_Trace(int nSubEvent)
int fn_NetSim_CR_Finish_F()
int fn_NetSim_CR_CPE_PackPacket()
int fn_NetSim_CR_AllocBandwidth(NETSIM_ID nSID, QUALITY_OF_SERVICE nQos, UPLINKALLOCINFO **ppstruInfo, unsigned int nSlotRequired, unsigned int nTotalSlot)
int fn_Netsim_CR_SM_ScheduleQuietPeriod(BS_PHY *pstruBSPhy, SCH *pstruSCH)
@ TRANSMIT_US_BURST_CONTROL
@ INCUMBENT_OPERATION_START
@ INCUMBENT_OPERATION_END
enum enum_802_22_Modulation MODULATION_TECHNIQUE
int fn_NetSim_CR_QuietPeriod()
NetSim_PACKET * fn_NetSim_CR_FormDCD(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
int fn_NetSim_CR_AddPacketToDSBurst(DS_BURST *pstruDSBurst, NetSim_PACKET *pstruPacket)
int fn_NetSim_CR_Init_F(struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type, void **fnPointer)
NetSim_PACKET * fn_NetSim_CR_FormUCD(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
int fn_NetSim_CR_IniScanChannel(BS_MAC *pstruBSMAC, BS_PHY *pstruBSPhy)
int fn_NetSim_CR_CPE_SwitchChannel()
NetSim_PACKET * fn_NetSim_CR_GenerateBroadcastCtrlPacket(int nDeviceId, int nInterfaceId, MANAGEMENT_MESSAGE nMessageType)
int fn_NetSim_CR_BS_UCS()
enum_802_22_IncumbentStatus
@ IncumbentStatus_OPERATIOAL
@ IncumbentStatus_NONOPERATIONAL
int fn_NetSim_CR_UpdateInfo(BS_MAC *pstruBSMAC, BS_PHY *pstruBSPHY)
int fn_NetSim_CR_CPE_ProcessUSMAP()
int fn_NetSim_CR_BS_MACIN()
int fn_NetSim_CR_FragmentPacket(NetSim_PACKET *pstruPacket, double dSDUSize)
int fn_NetSim_CR_CopyPacket_F(const NetSim_PACKET *pstruDestPacket, const NetSim_PACKET *pstruSrcPacket)
enum enum_802_22_CodingRate CODING_RATE
int fn_NetSim_CR_BroadCastPacket(NetSim_PACKET *pstruPacket, NETSIM_ID nDevId, NETSIM_ID nInterface)
CHANNELS * pstruChannelList
#define _declspec(dllexport)
This function is used to trigger the update.
void * PROPAGATION_HANDLE
NetSim_EVENTDETAILS * pstruEventDetails_Formal
NetSim_EVENTDETAILS char * pszAppPath_Formal
NetSim_EVENTDETAILS char char int nVersion_Type
NetSim_EVENTDETAILS char char * pszWritePath_Formal
NetSim_EVENTDETAILS char char int void ** fnPointer
@ MAC_PROTOCOL_IEEE802_22
enum enum_Modulation PHY_MODULATION
enum enum_Packet_QOS QUALITY_OF_SERVICE
enum enum_Distribution DISTRIBUTION
enum enum_ServiceType SERVICE_TYPE
int nDSXRequestRetries
3 fixed
int nDSXResponseReties
3 fixed
int nCandidateChannelRefreshTime
unsigned int nDSBurst
Current DS burst
int nBackupChannelRefreshTime
double dChannelAvailabilityCheckTime
! Wait for BLM-REP timeout. >= 1MAC frame
NetSim_PACKET * pstruFragmentPacketList
int nCandidateChannelTransitionTime
int * anSIDFromDevId
Have the list of CPE associated with BS. If SID is set CPE is associated else not.
struct stru_802_22_UplinkAlloctioninfo * uplinkAllocInfo
double T8
Wait for DSA/DSC Acknowledge timeout. Max 300 ms
NetSim_PACKET * pstruDSPacketList
DS_BURST ** pstruDSBurst
DS-Burst each is one symbol long.
double dSensingPeriodDuration
int nFalseAlramProbability
double dSensingPeriodInterval
int nWaitBeforeChannelMove
double T7
Wait for DSA/DSC/DSD Response timeout. Max 1 sec
INCUMBENT ** pstruIncumbent
NETSIM_ID nIncumbentCount
double dSuperframeStartTime
int nChannelDetectionTime
NetSim_PACKET * pstruBroadcastPDU
double dTTG
Transmit Transition Gap. 105-333 micro sec. default 210 microsec.
int nSelfCoexitenceCapability
unsigned int nIntraFrameQuietPeriodCycleLength
unsigned int nMINFrequency
double dUpstreamChannelChangeResponseWaitTime
unsigned int nSuperframeNumber
Current super frame number
unsigned int nFrameNumber
Current super frame number
PHY_MODULATION nModulation
char szIntraframeQuietPeiordBitmap[17]
double dRTG
Receive Transition Gap.
int nBWRequestBackoffEnd
Final size of BW Request opportunity used by CPEs to contend to send BW requests to BS....
unsigned int nIntraFrameQuietPeriodDuration
struct stru_802_22_Channel * pstruOpratingChannel
Currently operating channel.
int nBWRequestBackoffStart
Initial size of BW Request opportunity used by CPEs to contend to send BW requests to BS....
SYMBOL_PARAMETER * pstruSymbolParameter
unsigned int nMAXFrequency
Maximum frequency <=862 MHz.
struct stru_802_22_Channel * pstruChannelSet
Channel set where BS can operate
double dDCDInterval
Time between transmission of DCD messages. Max 10 sec
unsigned int nChannelBandwidth
! Minimum frequency >=54 MHz
CPE structure for IEEE 802.22 MAC.
unsigned int nMaxProbabilityofFalseAlarm
double T7
Wait for DSA/DSC/DSD Response timeout. Max 1 sec.
int nDSXResponseReties
3 fixed
struct stru_802_22_CPE_BWRequestInfo * BWRequestInfo
int nDSXRequestRetries
3 fixed
CPE_METRICS struCPEMetrics
int nBLM_REPRetries
Number of retries allowed for sending BLMREP. Default 3.
NetSim_PACKET * pstruUSBurst
double T16
Wait for bandwidth request grant. Min 10 ms.
double T8
Wait for DSA/DSC Acknowledge timeout. Max 300 ms.
NetSim_PACKET * pstruFragmentPacketList
CR_SERVICE * pstruServiceParameter
unsigned int nSID
Unique station idetifier.
double T29
Wait for BLM-ACK timeout. Range 10-300 ms.
NetSim_PACKET * pstruQueuedPacketList[MAX_FID]
double T14
Wait for DSx-RSP/DSX-RVD Timeout. Max 200 ms.
CPE structure for CPE PHY.
unsigned int nFrameNumber
SYMBOL_PARAMETER * pstruSymbol
Same parameter as BS have.
struct stru_802_22_Channel * pstruChannelSet
unsigned int nIntraFrameQuietPeriodDuration
double T20
Time the CPE searches for preambles on a given channel.
int nBWRequestBackoffStart
Initial size of BW Request opportunity used by CPEs to contend to send BW requests to BS....
unsigned int nIntraFrameQuietPeriodLength
char szIntraFrameQuietPeriodBitmap[17]
int nBWRequestBackoffEnd
Final size of BW Request opportunity used by CPEs to contend to send BW requests to BS....
struct stru_802_22_Channel * pstruOperatingChannel
CHANNEL_STATE nChannelState
unsigned int nChannelNumber
CHANNEL_METRICES struChannelMetrics
struct stru_802_22_Channel * pstruNextChannel
unsigned int nUnfilledSlot
NetSim_PACKET * pstruMACPDU
unsigned int nManagementMessageType
struct stru_802_22_DSMAP_IE ** pstruIE
unsigned int nPaddingBits
int nChannelBandwidth
Channel Bandwidth in MHz.
int nTTG
Transmitter-receiver turnaround gap. in TU.
int nRTG
Receiver_transmitter turnaround gap. in TU.
INCUMBENT_METRICS struIncumbentMetrics
double dPrevOperationalInterval
double dPrevOperationalTime
int nOperationalIntervalTime
NetSim_COORDINATES * position
DISTRIBUTION nOperationalDistribution
INCUMBENT_STATUS nIncumbentStatus
MODULATION_TECHNIQUE n_Modulation
double dSpectralEfficency
Spectrum Sensing Function output signals.
double dIntercarrierSpacing
Inter carrier spacing ^f (Hz) = Fs/2048 Hz.
int nBitsCountInOneSymbol
Data subCarrier count*Bits based on modulation * coding rate.
unsigned int nUPlinkFrameStartSymbol
unsigned int nUPlinkSymbol
unsigned int nDownLinkSymbol
double dDataRate
Number of uncoded bits/OFDM symbol duration.
int nUsedSubCarrierCount
Used Sub-carrier count Nt = 1680.
int nDataSubCarrierCount
Data Sub-carrier count Nd = 1440.
int nOFDMSlots
OFDM Slot = 1 symbol * 1 subChannel.
int nChannelBandwidth
Channel Bandwidth in MHz.
double dSubCarrierSpacing
Sub carrier spacing Tfft (micro sec) = 1/^f.
double dTimeUnit
Time Unit TU = Tfft/2048.
double dSymbolDuration
Tsym = Tfft + Tcp in microsec.
int nPilotSubCarrierCount
Pilot Sub-carrier count Np = 240.
int nGuardSubcarrierCount
Guard Sub-carrier count Ng = 368.
double dBasicSamplingFrequency
Sampling Frequency Fs (in MHz)
double dCPDuration
Tcp In micro sec.
unsigned int nContentionBasedReservationTimeOut
unsigned int nUpstreamBurstProfile
unsigned int nUCSNotificationRequestCode
unsigned int nPeriodicRangingCode
unsigned int nStartOfCDMACodeGroups
unsigned int nUCSNotificationRequestOpportunitySize
unsigned int nBandwidthRequestCode
unsigned int nBWRequestOpportunitySize
unsigned int nInitialRangingCode
unsigned int nEIRPDensityLevel
unsigned int nTimingAdvance
unsigned int nChannelNumber
unsigned int nSynchronizationMode
struct stru_802_22_USMAPIE::struUIUC_0_1::struUIUC_1 UIUC_1
struct stru_802_22_USMAPIE::struUIUC_0_1::struUIUC_0 UIUC_0
unsigned int nCBPFrameNumber
unsigned int nSubChannelCount
unsigned int nSubSymbolsCount
unsigned int nSubChannelCount
void * CDMA_Allocation_IE
unsigned int nSubChannelCount
void * USMAP_EIRP_Control_IE
struct stru_802_22_USMAPIE::struUIUC_7 UIUC_7
struct stru_802_22_USMAPIE::struUIUC_2_3 UIUC_2_3
struct stru_802_22_USMAPIE::struUIUC_8 UIUC_8
struct stru_802_22_USMAPIE::struUIUC_62 UIUC_62
struct stru_802_22_USMAPIE::struUIUC_9 UIUC_9
struct stru_802_22_USMAPIE::struUIUC_0_1 UIUC_0_1
struct stru_802_22_USMAPIE::struUIUC_4_6 UIUC_4_6
struct stru_802_22_USMAPIE::struUIUC UIUC
unsigned int nSlotRequested
struct stru_802_22_UplinkAlloctioninfo * next
unsigned int nSlotAllocated
unsigned int nRangingDataRatio
unsigned int nNormalizedCNROverride
unsigned int nDSC_REQReceived
unsigned int nDSC_REPSent
unsigned int nDSA_REQReceived
unsigned int nDSD_REPSent
unsigned int nDSD_REQReceived
unsigned int nCHS_REQSent
unsigned int nDSA_REPSent
unsigned int nDSA_REPReceived
unsigned int nDSD_REQSent
unsigned int nCHS_REQReceived
unsigned int nDSC_REQSent
unsigned int nSCHReceived
unsigned int nDSA_REQSent
unsigned int nDSC_REPReceived
unsigned int nFCHReceived
unsigned int nDSD_REPReceived
unsigned int nChannelNumber
unsigned int nOperationTime
unsigned int nInterferenceTime
double dInterferenceStartTime