Default Collision Model (dbu_coll)

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

Invocation Context

Because the bus link is a broadcast medium with any number of stations which may transmit independently, it is possible for several transmitters to simultaneously attempt to use the bus. Due to propagation delay effects, the overlapping of multiple transmissions on the bus may not be noticed at all receiving nodes at the same time. However, all bus receivers will be made aware of this situation with appropriate delays. The simultaneous presence of several packets at a specific receiver on the bus is called a collision. The Bus Transceiver Pipeline allows for special cases to be made where overlapping transmissions would not be considered to interfere with each other. The resolution of the collision may be modeled in the Collision Model stage of the pipeline, where special criteria may be applied; this criteria may be based on the timing of the transmissions, the properties of the transmitters, or possibly event the contents of the packets themselves.

No specific result is required of the Collision Model pipeline stage. Typically however, if a collision is judged to be relevant and affects the correct reception of either of the packets, this stage will increment a collision counter in the OPC_TDA_BU_NUM_COLLS transmission data attribute.

Collision Resolution

In almost all cases, packets which overlap in time at a bus receiver will be considered collided by the default collision model, dbu_coll. However, when dbu_coll is given two packets which are contiguous in time (i.e, one packet ends reception as the other begins reception), the packets are not considered to be collided.

dbu_coll determines the time at which reception is to end for the earlier arriving packet (this is the first argument passed to the pipeline procedure) by extracting its OPC_TDA_BU_END_RX transmission data attribute. This time is compared to the current time because this is the time of the second packet's arrival. If the times are equal, then the event is not considered a collision. The source code for dbu_coll is shown in the following figure.

Figure 6: Source Code for Pipeline Procedure dbu_coll

/* dbu_coll.ps.c */
/* Default collision 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_coll (Packet * pkptr_prev, Packet * pkptr_arriv)
	{
	/** Determine collision due to arrival of packet pkptr_arriv	  **/
	/** at channel where packet pkptr_prev was already arriving.	  **/
	FIN (dbu_coll (pkptr_prev, pkptr_arriv));

	/* If the previous packet ends just as the new one begins, this is not  */
	/* a collision (just a near miss, or perhaps back-to-back packets).	  */
	if (op_td_get_dbl (pkptr_prev, OPC_TDA_BU_END_RX) != op_sim_time ())
		{
		/* Increment the number of collisions in previous packet. */
		op_td_set_int (pkptr_prev, OPC_TDA_BU_NUM_COLLS,
			op_td_get_int (pkptr_prev, OPC_TDA_BU_NUM_COLLS) + 1);

		/* Increment number of collisions in arriving packet. */
		op_td_set_int (pkptr_arriv, OPC_TDA_BU_NUM_COLLS,
			op_td_get_int (pkptr_arriv, OPC_TDA_BU_NUM_COLLS) + 1);
		}

	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