# A Petri Net Model for Cognitive Radio Internet of Things Networks Exploiting GSM Bands +
## 4 QoS Evaluation of Secondary User Based on NMSPNs
### The Primary User Model  
The model in Figure 4 is used to derive the probabilities at a steady state to find a free slot in a transceiver assuming a given traffic load generated by the GSM users. These probabilities are then used in the NMSPN of Figure 5 to model the PU's active connections in the system. In this way, we implement the dependency of SUs with respect to PUs. Our transceiver model assumes that the first time slot (TS0) is reserved for signaling, a specific amount of time slots (from TS1 to TS3) are reserved for circuit switching phone calls, and the remaining ones (from TS4 to TS7) can be used for both circuit switching phone calls and data transmission in the packet switching mode. A single GSM/EDGE transceiver model is characterized by five blocks: a block to model the generation of PU phone calls, a block to model the data packet arrival, a block to model the time slots that are only used in the circuit switching mode, a block to model the slots used in both the circuit switching and packet switching modes, and a block to represent the activation of slots in slotted periodical time-division multiplexing (TDM). The _SPEECH WORKLOAD_ block the models generation of PU phone calls; it is made by the places CS_load and CS_choice and the transitions CS_arrival and CS_reject. Tokens in place CS_load enable the timed transition CS_arrival to fire. In this work, we assume that the PU phone calls arrive according to a Poisson process; thus, the timed transition CS_arrival is an exponential transition with parameter \(\lambda_{a}\), with \(\lambda_{a}\) being the parameter of the arrival process. The number of tokens \(N\) in place CS_load represents the available free slots; thus, when the place is empty, the system is full of calls, and no new call can start. Because we are considering a transceiver that uses TS0 for signaling, only seven calls can be simultaneously managed by a station; thus, we set \(N=7\). When a new call request arrives (firing of CS_arrival), a token is put in place CS_choice and all of the enabled immediate transitions CS_slot\({}_{1}\), with \(i=1,\ldots,7\) corresponding to free slots, are triggered. One of the triggered transitions CS_slot\({}_{1}\) is randomly selected to fire; we set all their weights to 1.0 in such a way that the random selection follows a uniform distribution. The transition CS_reject has lower priority than CS_slot\({}_{1}\); it only fires when a call arrives (we have a token in place CS_choice) and all of the time slots are busy (we have no transition CS_slot\({}_{1}\) enabled) emulating the call reject due to system congestion. The circuit switching speech service is modeled through places CS_busy1, V1, and S1 in order to take into account DTX. A token in place CS_busy1 means that the slot \(i\) is currently  
Figure 4: The _PU model_: primary users NMSPN model. Figure 5: The _SU model_: secondary user performance model. used by a phone call; thus, an inhibitor arc to the transition CS_slot\({}_{\text{i}}\) (and also to PS_slot\({}_{\text{i}}\) in CS+PS slot blocks) ensures that it is disabled the immediate transition for selecting the slot when it is busy. The DTX mechanism is modeled through timed transitions V\({}_{\text{i}}\)2S\({}_{\text{i}}\) and S\({}_{\text{i}}\)2V\({}_{\text{i}}\). One token in place V\({}_{\text{i}}\) means that the output of the VAD is true (_Voice detected_) and, accordingly, the time slot is actually used; meanwhile, a token in place S\({}_{\text{i}}\) means that the output of the VAD is false (_Silence detected_) and, accordingly, no transmission occur in the time slot. According to [40], the duration of the on (talk spurt) and off (silent gap) periods follow exponential distributions with mean \(\frac{1}{\lambda_{ls}}\) and \(\frac{1}{\lambda_{sg}}\), respectively. We used the timed transition CS\({}_{\text{i}}\) to model the call duration with a mean time equal to \(\frac{1}{\lambda_{i}}\).