Stage 8: Interference Noise
The interference noise stage is the ninth stage of the radio transceiver pipeline, and is specified by the “inoise model” attribute of the radio receiver. It might be executed for a packet under two circumstances: the packet is valid and arrives at its destination channel while another packet is already being received, or the packet is valid and already being received when another packet (valid or invalid) arrives. Clearly, the first circumstance can occur at most once for each packet, and the second can occur any number of times depending upon the transmission activities of other transmitters in the model. Note that a single invocation of this stage can be shared by the pipelines of the two packets if both are valid (the call syntax appearing below provides the addresses of both packets to the interference stage so that mutual effects can be evaluated).
The purpose of this stage is to account for the interactions between transmissions that arrive concurrently at the same receiver channel. The Simulation Kernel reserves a TDA, represented by the symbolic constant OPC_TDA_RA_NOISE_ACCUM, for the purpose of storing the current level of noise from all interfering transmissions. This accumulator is maintained only for valid packets (as determined by the channel match stage) because there is generally no need to evaluate link quality for noise packets. Thus, the interference noise stage is expected to augment the value of this accumulator in each valid packet by the received power of the interfering packet. When a packet (valid or invalid) completes reception, the Kernel automatically subtracts its received power from the noise accumulator of all valid packets that are still arriving at the channel. In this manner, the accumulator reflects only the current noise level.
The Kernel requires that the interference noise stage procedure accept two packet addresses as arguments. The first packet address represents the packet that arrived earliest, and the second represents the new arrival that caused the stage to be invoked. Syntax requirements for this stage are specified in Figure 95.
Figure 95: Templates for Radio Transceiver Pipeline: Interference Noise Stage
Not MT-safe (will execute sequentially in a parallel simulation):
void
interference_noise_template (Packet* earlier_pk, Packet* later_pk)
{
int e_status, l_status;
double e_power, l_power;
FIN (interference_noise_template (earlier_pk, later_pk))
/* extract match status and received power from each packet */
e_status = op_td_get_int (earlier_pk, OPC_TDA_RA_MATCH_STATUS);
e_power = op_td_get_dbl (earlier_pk, OPC_TDA_RCVD_POWER);
l_status = op_td_get_int (later_pk, OPC_TDA_RA_MATCH_STATUS);
l_power = op_td_get_dbl (later_pk, OPC_TDA_RCVD_POWER);
/* if earlier packet is valid, augment noise accumulator */
if (e_status == OPC_TDA_RA_MATCH_VALID)
op_td_increment_dbl (earlier_pk, OPC_TDA_RA_NOISE_ACCUM, l_power);
/* Similarly, if later packet is valid, */
/* augment its noise accumulator */
if (l_status == OPC_TDA_RA_MATCH_VALID)
op_td_increment_dbl (later_pk, OPC_TDA_RA_NOISE_ACCUM, e_power);
FOUT
}
MT-safe (can execute in parallel in a parallel simulation):
void
interference_noise_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* earlier_pk,
Packet* later_pk)
{
int e_status, l_status;
double e_power, l_power;
FIN_MT (interference_noise_template (earlier_pk, later_pk))
/* extract match status and received power from each packet */
e_status = op_td_get_int (earlier_pk, OPC_TDA_RA_MATCH_STATUS);
e_power = op_td_get_dbl (earlier_pk, OPC_TDA_RCVD_POWER);
l_status = op_td_get_int (later_pk, OPC_TDA_RA_MATCH_STATUS);
l_power = op_td_get_dbl (later_pk, OPC_TDA_RCVD_POWER);
/* if earlier packet is valid, augment noise accumulator */
if (e_status == OPC_TDA_RA_MATCH_VALID)
op_td_increment_dbl (earlier_pk, OPC_TDA_RA_NOISE_ACCUM, l_power);
/* Similarly, if later packet is valid, */
/* augment its noise accumulator */
if (l_status == OPC_TDA_RA_MATCH_VALID)
op_td_increment_dbl (later_pk, OPC_TDA_RA_NOISE_ACCUM, e_power);
FOUT
}
In addition to the OPC_TDA_RA_NOISE_ACCUM TDA, the Kernel provides a TDA to keep track of the number of collisions experienced by each packet. This TDA is represented by the symbolic constant OPC_TDA_RA_NUM_COLLS and is provided for convenience in developing application-specific pipeline stages that might need this result when deciding whether to accept or reject a packet in the final stages of the pipeline. Although the interference stage is an appropriate location to update this TDA’s value, the Kernel makes no use of this TDA and it is therefore not mandatory to maintain its accuracy.