Stage 5: Propagation Delay

The propagation delay stage is the sixth stage of the radio transceiver pipeline, and is specified by the “propdel model” attribute of the radio transmitter. It is invoked for each receiver channel that successfully passed both the link closure and channel match stages. This invocation takes place after the return of the transmitter antenna gain stage with no simulation time elapsing in between. The purpose of this stage is to calculate the amount of time required for the packet’s signal to travel from the radio transmitter to the radio receiver. This result is generally dependent on the distance between the source and the destination. The Kernel uses this result to schedule a beginning-of-reception event for the receiver channel that the packet is destined for. In addition, the propagation delay result is used in conjunction with the result of the transmission delay stage to compute the time at which the packet completes reception (i.e., the time at which the last bit finishes arriving is the time at which the packet begins transmission added to the sum of the transmission delay and the propagation delay).

The Simulation Kernel requires that the propagation delay stage procedure accept a packet address as its sole argument. The computed propagation delay is then expected by the Kernel within the TDA represented by the symbolic constants OPC_TDA_RA_START_PROPDEL and OPC_TDA_RA_END_PROPDEL. The assigned values should be nonnegative double-precision floating-point numbers. No other results are required. Syntax requirements for this stage are specified in Figure 92.

Figure 92: Templates for Radio Transceiver Pipeline: Propagation Delay Stage

Not MT-safe (will execute sequentially in a parallel simulation):

void
prop_delay_template (Packet* pk)
	{
	double start_prop_delay, end_prop_delay;

	FIN (prop_delay_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of propagation delay. */

	/* place result in TDA to return to Simulation Kernel. */
	op_td_set_dbl (pk, OPC_TDA_RA_START_PROPDEL, start_prop_delay);
	op_td_set_dbl (pk, OPC_TDA_RA_END	_PROPDEL, end_prop_delay);

	FOUT
	}

MT-safe (can execute in parallel in a parallel simulation):

void
prop_delay_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
	{
	double start_prop_delay, end_prop_delay;

	FIN_MT (prop_delay_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of propagation delay. */

	/* place result in TDA to return to Simulation Kernel. */
	op_td_set_dbl (pk, OPC_TDA_RA_START_PROPDEL, start_prop_delay);
	op_td_set_dbl (pk, OPC_TDA_RA_END	_PROPDEL, end_prop_delay);

	FOUT
	}