Default Propagation Delay Model (dbu_propdel)

This section describes the functionality and implementation of the default model occupying stage two of the Bus Link Transceiver Pipeline. This model is named dbu_propdel. Source code is provided in the file dbu_propdel.ps.c, which resides in the <reldir>/models/std/links directory.

Invocation Context

Whenever a bus transmitter initiates a transmission, propagation delay is computed independently for each bus receiver which can be reached on the bus. The Propagation Delay Model is invoked by the Simulation Kernel to compute this upon the completion of the Closure Model of the pipeline, if this stage was successful. The simulation time at invocation is the starting time of the packet transmission. The propagation delay represents the duration separating the time at which the first bit is transmitted from the time at which this same bit is received in the destination node.

The result of the Propagation Delay Model invocation for each packet is one double-precision floating-point value which is the propagation delay for the transmitted packet. The Simulation Kernel expects this result to be placed in the packet's OPC_TDA_BU_PROP_DELAY transmission data attribute.

Propagation Delay Computation

dbu_propdel's computation of propagation delay for all transmitted packets is based on the distance separating the bus transmitter and bus receiver and the propagation delay per unit distance assigned to the bus link.

dbu_propdel obtains the object ID of the bus link carrying the transmission from the OPC_TDA_BU_LINK_OBJID transmission data attribute of the packet. The bus object ID is then used when calling the op_ima_obj_attr_get() Kernel Procedure to obtain the value of the delay attribute of the bus. This attribute represents the propagation delay per meter.

dbu_propdel obtains the distance in meters separating the bus transmitter and the bus receiver by extracting the value of the packet's OPC_TDA_BU_DISTANCE transmission data attribute. This attribute, which is provided by the Simulation Kernel, measures distance traveled by signals traveling within the bus link, as opposed to straight euclidean distance between the transmitter and the receiver. The propagation delay is then calculated as the product of the distance and the normalized propagation delay. This result is placed in the OPC_TDA_BU_PROP_DELAY transmission data attribute of the packet for later use by other pipeline stages and the Simulation Kernel. Source code for dbu_propdel is shown in the following figure.

Figure 5: Source Code for Pipeline Procedure dbu_propdel

/* dbu_propdel.ps.c */
/* Default propagation delay model for bus link Transceiver Pipeline */

/**********************************/
/*       Copyright (c) 2013       */
/*   Riverbed Technology, Inc.    */
/*      All Rights Reserved.      */
/**********************************/


#include "opnet.h"


#if defined (__cplusplus)
extern "C"
#endif
void
dbu_propdel (Packet * pkptr)
	{
	double		prop_delay, unit_delay, prop_distance;
	Objid		bus_obid;

	/** Compute propagation delay separating a transmitter	  **/
	/** from a receiver connected by a bus link.				  **/
	FIN (dbu_propdel (pkptr));

	/* Determine ID of bus supporting the transmission. */
	bus_obid = op_td_get_int (pkptr, OPC_TDA_BU_LINK_OBJID);

	/* Determine the propagation delay per unit distance assigned to this bus. */
	if (op_ima_obj_attr_get (bus_obid, "delay", &unit_delay) ==
		OPC_COMPCODE_FAILURE)
		op_sim_end ("Error in bus propagation delay pipeline stage (dbu_propdel):",
			"Unable to get propagation delay from bus attribute.", OPC_NIL, OPC_NIL);

	/* Get the distance between transmitter and receiver. */
	prop_distance = op_td_get_dbl (pkptr, OPC_TDA_BU_DISTANCE);

	/* Compute the propagation delay for the reception of the packet. */
	prop_delay = unit_delay * prop_distance;

	/* Place propagation delay in packet transmission data attribute. */
	op_td_set_dbl (pkptr, OPC_TDA_BU_PROP_DELAY, prop_delay);

	FOUT
	}

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com