op_pk_bcast_unique()

Abstract

Assigns the broadcast property of the specified packet to restrict its broadcast to eligible receivers within a single specified node.

Syntax

op_pk_bcast_unique ()
Argument Type Description
pkptr Packet* pointer to the packet-of-interest
[A pointer to a packet can be obtained from many KPs, including op_pk_create(), op_pk_create_fmt(), op_pk_copy(), op_pk_get(), op_subq_pk_access(), and op_subq_pk_remove().]
node_objid Objid object ID of the node which is to be the unique target of broadcasts of the specified packet
[A node object ID can be obtained from several KPs in the Topo and Id packages: op_topo_parent(), op_topo_child(), op_id_from_userid(), and op_id_from_name().]

Return Type

void

No return value.

Example

/* broadcast packet to only nodes in local group */
for (i = 0; i < num_grp_nodes; i++)
	{
	/* prepare name of node */
	sprintf (nd_name, "lgA_%d", i);

	/* obtain object ID of node */
	nd_objid = op_id_from_name (0, OPC_OBJTYPE_NODE_FIXED, nd_name);

	/* create copy of outgoing packet */
	bcast_pkptr = op_pk_copy (ref_pkptr);

	/* set the broadcast property of outgoing packet */
	op_pk_bcast_unique (bcast_pkptr, nd_objid);

	/* forward packet copy to transmitter */
	op_pk_send (bcast_pkptr, 0);
	}

Details

Under default conditions, transmitting a packet using a bus transmitter or radio transmitter will result in a broadcast of the packet to all receivers which are eligible to receive the broadcast. In the case of a bus broadcast, any receiver attached to the same bus link will be eligible to receive. In the case of a radio broadcast, there are a number of transmitter and receiver attributes which must match for a receiver to be eligible to receive. In both cases, multiple receivers will typically be eligible and will receive broadcasted packets.

Each packet has an internal broadcast property; the default conditions discussed above are due to the broadcast property of a packet being set to be general (i.e., all eligible receivers pick up a broadcast). The opposite situation is for the broadcast property of a packet to be set to unique (i.e., only eligible receivers at a single specified node will pick up a broadcast). This KP sets the broadcast property of a packet to be unique, and specifies the single node which will be permitted to receive broadcasts of the packet. Even though the broadcast is unique with respect to nodes, multiple eligible receivers within that node may independently receive the broadcast. The broadcast property of a packet may be set at any time but it will only affect the operation of the Simulation Kernel when the packet enters a bus or radio transmitter. If a node with no eligible receivers is selected as the unique target, no error condition will result and the broadcast will not be received.

This KP requires a process context, so it must only be invoked from a process model, or a function that has been directly or indirectly invoked by a process model. Both unformatted and formatted packets can be operated on via this KP.

Purpose

Provides a way to direct a transmission over a bus or radio link to a single node. This is typically useful when modeling a logically point-to-point network using broadcast transmitters and receivers. In the bus case, uniquely broadcasted packets will not collide with each other if they arrive concurrently at different receivers attached to the bus link. However, they will collide with each other if they arrive concurrently at the same receiver, or if a generally broadcasted packet is concurrently being transmitted. In the radio case, uniquely broadcasted packets will only execute the transceiver pipeline stages associated with receivers at the single target node, thus dramatically improving execution efficiency in large networks. Other nodes with eligible receivers will not receive any radio energy from the transmission.

Errors

  • Program Abort: Segmentation violation. (due to an invalid packet pointer or malformed packet)
  • Program Abort: KP requires process context.
  • Program Abort: Packet pointer is NIL.
  • Program Abort: Packet pointer references destroyed packet.
  • Program Abort: Packet pointer references unowned packet (<pk_id>).
  • Program Abort: Packet pointer references static packet (<pk_id>).

Reference

  • Use the KP op_pk_bcast_general() to set a packet’s broadcast property to include all possible nodes
  • Use the KP op_pk_send() to forward a packet to a bus or radio transmitter for the actual broadcasting operation to take place

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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