Default Transmission Delay Model (dbu_txdel)

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

Invocation Context

The Transmission Delay Model is invoked by the Simulation Kernel immediately upon the start of a packet transmission. This is computed independently for each new packet transmission, and represents the simulated time interval which the transmitter requires to completely process and transmit the packet.

The result of the Transmission Delay Model invocation for each packet is one double-precision floating-point value which represents the transmission delay for the packet. The Simulation Kernel expects that this result will be placed in the packet's OPC_TDA_BU_TX_DELAY transmission data attribute. The returned value is used in scheduling events in the packet transfer across the link, namely, the end of transmission in the source node, and the end of reception in the destination node.

Transmission Delay Computation

For all transmitted packets, dbu_txdel computes the transmission delay based on the channel data rate and the length of the packet.

dbu_txdel calls the op_td_get_int() Kernel Procedure to obtain the object ID of the transmitter channel which is forwarding the transmission. This object ID is then used when calling the op_ima_obj_attr_get() Kernel Procedure to obtain the transmitting channel's data rate.

The Kernel Procedure op_pk_total_size_get() is used to obtain the packet's length. The transmission delay is then calculated as the packet length divided by the transmitter channel data rate. This result is assigned to the packet's OPC_TDA_BU_TX_DELAY transmission data attribute for use by later pipeline stages and the Simulation Kernel. These operations are shown in source code form in the following figure.

Figure 3: Source Code for Pipeline Procedure dbu_txdel

/* dbu_txdel.ps.c */
/* Default transmission 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_txdel (Packet * pkptr)
	{
	OpT_Packet_Size					pklen;
	Objid					tx_ch_obid;
	double					tx_drate, tx_delay;

	/** Compute the transmission delay associated with	  **/
	/** a packet transmission on a bus link.				  **/
	FIN (dbu_txdel (pkptr));

	/* Obtain object id of transmitter channel forwarding transmission. */
	tx_ch_obid = op_td_get_int (pkptr, OPC_TDA_BU_TX_CH_OBJID);

	/* Obtain the transmission rate of the channel. */
	if (op_ima_obj_attr_get (tx_ch_obid, "data rate", &tx_drate) ==
		OPC_COMPCODE_FAILURE)
		op_sim_end ("Error in bus transmission delay pipeline stage (dbu_txdel):",
			"Unable to get transmission rate from channel attribute.", OPC_NIL,
			OPC_NIL);

	/* Obtain length of packet. */
	pklen = op_pk_total_size_get (pkptr);

	/* Compute time required to complete transmission of packet. */
	tx_delay = pklen / tx_drate;

	/* Place transmission delay in packet transmission data. */
	op_td_set_dbl (pkptr, OPC_TDA_BU_TX_DELAY, tx_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