op_sar_buf_size()

Abstract

Obtains the number of bits stored in the specified buffer.

Syntax

op_sar_buf_size (sb_hndl)
Argument Type Description
sb_hndl Sbhandle handle identifying the buffer-of-interest
[This value can identify any of the three Sar buffer types: segmentation, reassembly, or resegmentation. A Sar buffer handle is obtained when a buffer is created via the KP op_sar_buf_create().]

Return Type

OpT_Sar_Size

Total number of bits stored in the specified buffer.

Example

/* Obtain a segment from input stream. */
seg_pkptr = op_pk_get (SEG_INSTRM);

/* Determine the size of the segment. */
seg_size = op_pk_total_size_get (seg_pkptr);

/* Loop from 3 minutes to 20 seconds, successively reducing the flush time   */
/* and flushing the reassembly buffer of packets older than this time.  Stop */
/* when the buffer is less than threshold value for adding new segment.       */
for (ft = 180.0, buf_overflow = 0; ((pksize + op_sar_buf_size (rsm_sbh))
	> MAX_RSM_BUF_SIZE); ft -= 20.0)
	{
	if (ft == 0.0) { buf_overflow = 1; break; }

	/* Flush buffer using current iteration of flush time. */
	op_sar_rsmbuf_pk_flush (rsm_sbh, ft);
	}

/* Insert segment into reassembly buffer if buffer overflow has not occurred. */
if (!buf_overflow)
	op_sar_rsmbuf_seg_insert (rsm_sbh, seg_pkptr);

Details

This KP can be applied to all three types of Sar buffer. The definition of the total number of bits in a Sar buffer is always comprehensive, but the computation method depends on the type of buffer:

  • segmentation buffer—sum of the bits contained in all stored source packets awaiting segmentation, including the first packet, which may be partially reduced due to segmentation.
  • resegmentation buffer—sum of the bits contained in all stored segments, including the first segment, which may be partially reduced due to resegmentation.
  • reassembly buffer—sum of the bits contained in all stored source packets, including complete and incomplete packets.

Purpose

Provides a mechanism for determining the number of data bits stored in a Sar buffer. This is useful when a Sar buffer is representing a packet data storage resource in a real system, and the utilization of that resource is a concern. For instance, the available storage for packet reassembly at a real node may be limited, so the size of a Sar reassembly buffer that represents this storage will have to be monitored and restricted.

Errors

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