Packet Streams
Figure 166: Packet Stream representation

Packet streams are connections that carry data packets from a source module to a destination module. They represent the flow of data across the hardware and software interfaces within a communication node. They are also regarded as completely reliable (that is, no packets are lost and no errors are introduced) and of potentially infinite bandwidth (because an arbitrarily large packet can traverse a stream with no delay). Furthermore, streams have an unlimited capacity to buffer data packets at the destination module in the order of their arrival.
Modeler provides three different methods for transferring a packet over a stream and notifying the destination module of its arrival: scheduled, forced, or quiet. In a scheduled arrival, a “stream interrupt” is scheduled for the destination module, occurring after all other events of lower priority previously scheduled for that time. In a forced arrival, the “stream interrupt” occurs immediately, before any other scheduled events. Finally, with a quiet arrival, no “stream interrupt” occurs at all, and the packet remains buffered within the stream. The destination module can obtain the packet only if it explicitly checks for its presence when it responds to some other event. (For a detailed description of various interrupt methods, see “Interrupt Methods” on page 157 and “Packet Streams” on page 333.)
Output streams of generators and receivers (that is, modules which have no process models) use the type of arrival specified by the “intrpt method” attribute of the stream. For output streams of processors or queues, the module’s process model overrides the value of this attribute by sending the packet to the output stream using one of the Kernel Procedures op_pk_send(), op_pk_send_delayed(), op_pk_send_quiet(), or op_pk_send_forced(). See “Packet Package” on page 1 for more information.
Packet streams support the introduction of a delay between the time a packet is placed on a stream by the source module and the time it arrives at the destination module. By default, this value is zero, and in many cases this is appropriate. However, a nonzero value may be used to model a constant processing time, propagation delay, or transfer rate. Furthermore, a process model executing in a processor or queue module may specify its own delay when it places a packet on an output stream. In this way the delay may be computed as a function of the size or contents of the transferred packet, for example.
Packet streams are normally used to carry the actual data packets that the modeled communication node is intended to process, rather than control data which represents communication between adjacent modules. While it is possible to send such control data between processor modules over packet streams, it is often more appropriate to use other mechanisms, such as statistic wires or ICIs (Interface Control Information structures). The use of ICIs to communicate control data between layers of a protocol stack is shown in the Modeling Layered Protocols. For more information about communication between modules, see Chapter 9 “Communication Mechanisms” on page 331.