op_pk_creation_time_get()

Abstract

Obtains the simulation time when the specified packet was created.

Syntax

op_pk_creation_time_get (pkptr)
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().]

Return Type

double

Simulation time when the specified packet was created.

Example

/* A packet has arrived at our receiver */
pkptr = op_pk_get (op_intrpt_strm ());

/* Calculate the end-to-end delay for this packet */
pk_create_time = op_pk_creation_time_get (pkptr);
ete_delay = op_sim_time () - pk_create_time;

Details

New packets enter circulation via one of the following methods:

  1. creation explicitly by the KPs op_pk_create() or op_pk_create_fmt()
  2. duplication of existing packets via the KP op_pk_copy()
  3. automatic duplication by the Simulation Kernel of packets engaged in transmission over bus or radio links to multiple destinations

Packets created via methods 1) and 2) above are assigned fresh creation module object ID and creation time values (except in the case where method 2) is invoked from outside a process context, in which case the creation module object ID is set to the constant OPC_OBJID_INVALID). Packets copied via method 3) above are assigned the creation information of the originally transmitted packet.

Most operations performed on packets will not affect their creation information. As mentioned above, transmission over bus and radio links may create multiple copies of a packet, but each copy retains the original creation information. However, explicitly copying a packet via the KP op_pk_copy() will produce a duplicate packet with fresh creation information.

Both unformatted and formatted packets can be operated on via this KP.

Purpose

Provides a mechanism to determine the simulation time when a packet was created. Typically this KP is used to compute end-to-end transmission and processing delays, and it can be used in conjunction with the KP op_pk_creation_mod_get() to compare end-to-end delays with reference to different source locations.

Errors

  • Program Abort: Segmentation violation. (due to an invalid packet pointer or malformed packet)
  • Program Abort: Packet pointer is NIL.
  • Program Abort: Packet pointer references destroyed packet.

Reference

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