NetSim Source Code Help
Loading...
Searching...
No Matches
Cellular.h File Reference
#include "IP_Addressing.h"
#include "GSM.h"
Include dependency graph for Cellular.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stru_Cellular_VLR
 Data structure for Visitor Location Register. More...
 
struct  stru_Cellular_ChannelList
 
struct  stru_Cellular_BaseStation_Mac
 
struct  stru_Cellular_BaseStation_Mac::stru_BS_GSM_Var
 
struct  stru_Cellular_BaseStation_Mac::stru_BS_CDMA_Var
 
struct  stru_Cellular_MSC
 
struct  stru_MS_Metrics
 
struct  stru_Cellular_MS_Mac
 
struct  stru_Cellular_MS_Phy
 
struct  stru_Cellular_BaseStation_Phy
 
struct  stru_Cellular_ChannelRequest
 
struct  stru_Cellular_ChannelResponse
 
struct  stru_Cellular_Packet
 

Macros

#define DATA_RATE   0.270
 
#define CELLULAR_PACKET_TYPE(protocol, type)   protocol*100+type
 
#define CELLULAR_SUBEVENT(protocol, type)   protocol*100+type
 

Typedefs

typedef struct stru_Cellular_VLR VLR
 
typedef struct stru_Cellular_MSC DEVVAR_MSC
 
typedef struct stru_Cellular_BaseStation_Phy Cellular_BS_PHY
 
typedef struct stru_Cellular_BaseStation_Mac Cellular_BS_MAC
 
typedef struct stru_Cellular_MS_Phy Cellular_MS_PHY
 
typedef struct stru_Cellular_MS_Mac Cellular_MS_MAC
 
typedef struct stru_MS_Metrics Cellular_MS_Metrics
 
typedef struct stru_Cellular_ChannelList Cellular_CHANNEL
 
typedef struct stru_Cellular_ChannelRequest Cellular_CHANNEL_REQUEST
 
typedef struct stru_Cellular_Packet Cellular_PACKET
 
typedef struct stru_Cellular_ChannelResponse Cellular_CHANNEL_RESPONSE
 

Enumerations

enum  CELLULAR_CHANNEL_TYPE { ChannelType_Pilot =0 , ChannelType_RACH =0 , ChannelType_TRAFFICCHANNEL =1 }
 Enumeration for cellular channel types. More...
 
enum  MS_STATUS {
  Status_IDLE =0 , Status_ChannelRequested , Status_ChannelRequestedForIncoming , Status_ChannelRequestedForHandover ,
  Status_CallRequested , Status_CallInProgress , Status_CallEnd
}
 Enumeration for mobile station status. More...
 
enum  enum_cellular_packet_type {
  PacketType_ChannelRequest , PacketType_CallRequest , PacketType_ChannelGranted , PacketType_ChannelUngranted ,
  PacketType_ChannelRequestForIncoming , PacketType_CallAccepted , PacketType_CallRejected , PacketType_ChannelRelease ,
  PacketType_ChannelRequestForHandover , PacketType_DropCall , PacketType_HandoverInfo , PacketType_CallEnd
}
 Emumeration for cellular packetype. More...
 
enum  enum_cellular_subevent { Subevent_DropCall , Subevent_TxNextBurst }
 Enumeration for cellular subevent. More...
 

Functions

NetSim_PACKETfn_NetSim_Cellular_createPacket (double time, unsigned int nPacketType, NETSIM_ID nSourceId, NETSIM_ID nDestinationId, double dSize, MAC_LAYER_PROTOCOL protocol)
 
int fn_NetSim_FormCDMAChannel (NETSIM_ID nBTSId, Cellular_BS_MAC *BSMac, int nCDMA_ETA, int nCDMA_SIGMA, double dCDMA_DATARATE)
 
int fn_NetSim_Cellular_MoveMS (NETSIM_ID nDeviceId, NETSIM_ID nBTSId)
 
int fn_NetSim_Cellular_Run ()
 
int fn_NetSim_Cellular_FreePacket (NetSim_PACKET *packet)
 
int fn_NetSim_Cellular_FormBurst (NetSim_PACKET *packet, Cellular_MS_MAC *MSMac)
 
int fn_NetSim_Cellular_MS_SendChannelRelease (Cellular_CHANNEL *channel, NETSIM_ID nMSId, NETSIM_ID nMSInterface, double time)
 
int isCellularChannelAllocated (NETSIM_ID nMSId, NETSIM_ID nInterfaceId, NETSIM_ID nApplicationId)
 
int fn_NetSim_Cellular_AddPacketToBuffer (NetSim_PACKET *packet, NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
 
int fn_NetSim_Cellular_AllocateChannel (NetSim_EVENTDETAILS *pstruEventDetails, NetSim_PACKET *packet)
 
int fn_NetSim_Cellular_ChannelResponse (NetSim_PACKET *packet)
 
int fn_NetSim_Cellular_MS_ProcessCallRequest ()
 
int fn_NetSim_Cellular_MS_ProcessCallResponse ()
 
int fn_NetSim_Cellular_DropCall ()
 
int fn_NetSim_Cellular_MS_ReassembleBurst ()
 
int fn_NetSim_Cellular_allocateChannel (NetSim_PACKET *packet)
 
int fn_NetSim_Cellular_BS_ReleaseChannel ()
 
int fn_NetSim_GSM_BS_PhyOut ()
 
int fn_NetSim_Cellular_BS_AssignTimeSlot (NetSim_PACKET *packet, NETSIM_ID nBTSId)
 
int fn_NetSim_Cellular_ChannelResponseForHandover ()
 
int fn_NetSim_Cellular_ForwardToMSC ()
 
int fn_NetSim_Cellular_HandoverCall (NETSIM_ID nMSId, NETSIM_ID nMSInterface, double time)
 
int fn_NetSim_Cellular_InitBTSList (NETSIM_ID nBTSId)
 
int fn_NetSim_Cellular_InitVLRList (NETSIM_ID nMSId, NETSIM_ID nMSInterface)
 
int fn_NetSim_Cellular_Metrics (PMETRICSWRITER metricsWriter)
 
int fn_NetSim_Cellular_MS_PhyOut ()
 
int fn_NetSim_Cellular_Msc_ProcessPacket ()
 
int fn_NetSim_Cellular_SendCallend (NETSIM_ID nMSID, NETSIM_ID nMSInterface, NETSIM_ID nDestinationId, double time)
 
int fn_NetSim_Cellular_TransmitOnwireline ()
 
int fn_NetSim_FormGSMChannel (DEVVAR_MSC *mscVar)
 
int fn_NetSim_Cellular_CopyPacket (NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
 

Macro Definition Documentation

◆ CELLULAR_PACKET_TYPE

#define CELLULAR_PACKET_TYPE (   protocol,
  type 
)    protocol*100+type

Definition at line 66 of file Cellular.h.

◆ CELLULAR_SUBEVENT

#define CELLULAR_SUBEVENT (   protocol,
  type 
)    protocol*100+type

Definition at line 73 of file Cellular.h.

◆ DATA_RATE

#define DATA_RATE   0.270

Definition at line 31 of file Cellular.h.

Typedef Documentation

◆ Cellular_BS_MAC

Definition at line 22 of file Cellular.h.

◆ Cellular_BS_PHY

Definition at line 21 of file Cellular.h.

◆ Cellular_CHANNEL

Definition at line 26 of file Cellular.h.

◆ Cellular_CHANNEL_REQUEST

Definition at line 27 of file Cellular.h.

◆ Cellular_CHANNEL_RESPONSE

Definition at line 29 of file Cellular.h.

◆ Cellular_MS_MAC

Definition at line 24 of file Cellular.h.

◆ Cellular_MS_Metrics

Definition at line 25 of file Cellular.h.

◆ Cellular_MS_PHY

Definition at line 23 of file Cellular.h.

◆ Cellular_PACKET

Definition at line 28 of file Cellular.h.

◆ DEVVAR_MSC

typedef struct stru_Cellular_MSC DEVVAR_MSC

Definition at line 20 of file Cellular.h.

◆ VLR

typedef struct stru_Cellular_VLR VLR

Definition at line 19 of file Cellular.h.

Enumeration Type Documentation

◆ CELLULAR_CHANNEL_TYPE

Enumeration for cellular channel types.

Enumerator
ChannelType_Pilot 
ChannelType_RACH 
ChannelType_TRAFFICCHANNEL 

Definition at line 33 of file Cellular.h.

◆ enum_cellular_packet_type

Emumeration for cellular packetype.

Enumerator
PacketType_ChannelRequest 
PacketType_CallRequest 
PacketType_ChannelGranted 
PacketType_ChannelUngranted 
PacketType_ChannelRequestForIncoming 
PacketType_CallAccepted 
PacketType_CallRejected 
PacketType_ChannelRelease 
PacketType_ChannelRequestForHandover 
PacketType_DropCall 
PacketType_HandoverInfo 
PacketType_CallEnd 

Definition at line 51 of file Cellular.h.

◆ enum_cellular_subevent

Enumeration for cellular subevent.

Enumerator
Subevent_DropCall 
Subevent_TxNextBurst 

Definition at line 68 of file Cellular.h.

◆ MS_STATUS

enum MS_STATUS

Enumeration for mobile station status.

Enumerator
Status_IDLE 
Status_ChannelRequested 
Status_ChannelRequestedForIncoming 
Status_ChannelRequestedForHandover 
Status_CallRequested 
Status_CallInProgress 
Status_CallEnd 

Definition at line 40 of file Cellular.h.

Function Documentation

◆ fn_NetSim_Cellular_AddPacketToBuffer()

int fn_NetSim_Cellular_AddPacketToBuffer ( NetSim_PACKET packet,
NETSIM_ID  nDeviceId,
NETSIM_ID  nInterfaceId 
)

This function is used to add a packet to the MAC buffer of the mobile station

Definition at line 123 of file GSM.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_AllocateChannel()

int fn_NetSim_Cellular_AllocateChannel ( NetSim_EVENTDETAILS pstruEventDetails,
NetSim_PACKET packet 
)

This function is used to allocate the channels

Definition at line 130 of file GSM.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_allocateChannel()

int fn_NetSim_Cellular_allocateChannel ( NetSim_PACKET packet)

This function is used to allocate the channels. Channel allocation deals with the allocation of channels to cells in a cellular network. Once the channels are allocated, cells may then allow users within the cell to communicate via the available channels.

Definition at line 233 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_BS_AssignTimeSlot()

int fn_NetSim_Cellular_BS_AssignTimeSlot ( NetSim_PACKET packet,
NETSIM_ID  nBTSId 
)

This function runs at base station to assign the time slots

Definition at line 639 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_BS_ReleaseChannel()

int fn_NetSim_Cellular_BS_ReleaseChannel ( )

This funtion is used by the base station to release the assigned channels

Definition at line 697 of file Cellular.c.

Here is the caller graph for this function:

◆ fn_NetSim_Cellular_ChannelResponse()

int fn_NetSim_Cellular_ChannelResponse ( NetSim_PACKET packet)

This functio is called to perform the channel response functionality This function determines if the call is accepted or rejected based on channel availability

Definition at line 288 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_ChannelResponseForHandover()

int fn_NetSim_Cellular_ChannelResponseForHandover ( )

This function is called as a response for handover

Definition at line 67 of file Handover.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_CopyPacket()

int fn_NetSim_Cellular_CopyPacket ( NetSim_PACKET pstruDestPacket,
NetSim_PACKET pstruSrcPacket 
)
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_createPacket()

NetSim_PACKET * fn_NetSim_Cellular_createPacket ( double  time,
unsigned int  nPacketType,
NETSIM_ID  nSourceId,
NETSIM_ID  nDestinationId,
double  dSize,
MAC_LAYER_PROTOCOL  protocol 
)
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_DropCall()

int fn_NetSim_Cellular_DropCall ( )

This function is called to drop a call

Definition at line 103 of file Handover.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_FormBurst()

int fn_NetSim_Cellular_FormBurst ( NetSim_PACKET packet,
Cellular_MS_MAC MSMac 
)

Burst is used for the standard communications between the basestation and the mobile, and typically transfers the digitised voice data. This function is used to form the burst.

Definition at line 22 of file Burst.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_ForwardToMSC()

int fn_NetSim_Cellular_ForwardToMSC ( )

This functio is called to forward the packet to the MSC

Definition at line 423 of file Cellular.c.

Here is the caller graph for this function:

◆ fn_NetSim_Cellular_FreePacket()

int fn_NetSim_Cellular_FreePacket ( NetSim_PACKET packet)
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_HandoverCall()

int fn_NetSim_Cellular_HandoverCall ( NETSIM_ID  nMSId,
NETSIM_ID  nMSInterface,
double  time 
)

As the mobile stations moves out of one cell to the next, it must be possible to hand the call over from the base station of the first cell, to that of the next with no discernable disruption to the call. It is necessary to ensure it can be performed reliably and without disruption to any calls. Failure for it to perform reliably can result in dropped calls. When the handover occurs it is necessary to re-route the call to the relevant base station along with changing the communication between the mobile and the base station to a new channel. All of this needs to be undertaken without any noticeable interruption to the call.

Definition at line 28 of file Handover.c.

Here is the call graph for this function:

◆ fn_NetSim_Cellular_InitBTSList()

int fn_NetSim_Cellular_InitBTSList ( NETSIM_ID  nBTSId)

◆ fn_NetSim_Cellular_InitVLRList()

int fn_NetSim_Cellular_InitVLRList ( NETSIM_ID  nMSId,
NETSIM_ID  nMSInterface 
)

◆ fn_NetSim_Cellular_Metrics()

int fn_NetSim_Cellular_Metrics ( PMETRICSWRITER  metricsWriter)

◆ fn_NetSim_Cellular_MoveMS()

int fn_NetSim_Cellular_MoveMS ( NETSIM_ID  nDeviceId,
NETSIM_ID  nBTSId 
)
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_MS_PhyOut()

int fn_NetSim_Cellular_MS_PhyOut ( )

This funcion is called at the mobile station when the PHYSICAL_OUT event is triggered

Definition at line 718 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_MS_ProcessCallRequest()

int fn_NetSim_Cellular_MS_ProcessCallRequest ( )

This function is used to process the call request at the mobile station

Definition at line 506 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_MS_ProcessCallResponse()

int fn_NetSim_Cellular_MS_ProcessCallResponse ( )

This function is used to process the call response at the mobile station

Definition at line 570 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_MS_ReassembleBurst()

int fn_NetSim_Cellular_MS_ReassembleBurst ( )

This function is used to reassemble the burst.

Definition at line 149 of file Burst.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_MS_SendChannelRelease()

int fn_NetSim_Cellular_MS_SendChannelRelease ( Cellular_CHANNEL channel,
NETSIM_ID  nMSId,
NETSIM_ID  nMSInterface,
double  time 
)

This function is used by the mobile station to send the request for channel release to the base station

Definition at line 666 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_Msc_ProcessPacket()

int fn_NetSim_Cellular_Msc_ProcessPacket ( )

This function is used to process the packet at the MSC

Definition at line 485 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_Run()

int fn_NetSim_Cellular_Run ( )

This function is called by NetworkStack.dll, whenever the event gets triggered
inside the NetworkStack.dll for CDMA or GSM protocols. This is the main function for GSM / CDMA. It processes MAC_OUT,MAC_IN, PHYSICAL_OUT, PHYSICAL_IN and TIMER events for mobile station and base station.

Definition at line 23 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_SendCallend()

int fn_NetSim_Cellular_SendCallend ( NETSIM_ID  nMSID,
NETSIM_ID  nMSInterface,
NETSIM_ID  nDestinationId,
double  time 
)

This function is called at the end of a call

Definition at line 215 of file GSM.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Cellular_TransmitOnwireline()

int fn_NetSim_Cellular_TransmitOnwireline ( )

This function is used to tranmit packet on wired link

Definition at line 434 of file Cellular.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_FormCDMAChannel()

int fn_NetSim_FormCDMAChannel ( NETSIM_ID  nBTSId,
Cellular_BS_MAC BSMac,
int  nCDMA_ETA,
int  nCDMA_SIGMA,
double  dCDMA_DATARATE 
)

◆ fn_NetSim_FormGSMChannel()

int fn_NetSim_FormGSMChannel ( DEVVAR_MSC mscVar)
This function is called from init block for allocating the channel to each BTS if the
user choice is FCA (Fixed Carreir allocation).
This function first calculate the bandwidth allocated for the GSM
Bandwidth = Maximum frequency - Minimum frequency;
After that, calculate the total no of the channel.
Total no of channel = Bandwidth * 8 * (1000/200); // KHz to MHz.
Calculate no of channel per BTS.
no of channel per BTS = (Total no of channel/no of BTS).
Initiallize the channel list.
Allocate channel to the BTS.
Set, no of busy channel = 0;
set, no of free channel = No of channel per BTS.
set, Total no of channel = No of channel per BTS.
NOTE: In netSim we have only two type of channel:
1. Random Access Channel (RACH) First channel of each BTS.
2. Traffic Channel.
------------------------------ Input parameters -----------------------------------------------
This function takes three parameters as input,
1. Minimum value of down link frequency
2. Maximum value of up link frequency.
3. No of BTS.
All these parameters are user input.
------------------------------ Output Parameters ----------------------------------------------
This function return 1 on successfull completion
#define free(p)
Definition: Memory.h:31

Definition at line 53 of file GSM_Channel.c.

◆ fn_NetSim_GSM_BS_PhyOut()

int fn_NetSim_GSM_BS_PhyOut ( )

This function is called whenever PHYSICAL OUT event is triggered at the base station

Definition at line 187 of file GSM.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCellularChannelAllocated()

int isCellularChannelAllocated ( NETSIM_ID  nMSId,
NETSIM_ID  nInterfaceId,
NETSIM_ID  nApplicationId 
)

This function is used to check whether cellular channel is allocated or not

Definition at line 129 of file GSM_Channel.c.

Here is the caller graph for this function: