Modeling Communications with Packets

The previous sections describe the support Modeler provides for representing the structure of a network, including the elements that appear at different hierarchical levels. Communication of data takes place at all levels of this hierarchy and most of the supported objects play some role in implementing this communication: processes can be considered to be both the sources and sinks of data and control information; the node domain is the context in which processes communicate information with each other and with physical layer transmitters and receivers; and the network domain allows nodes to exchange information with each other via various types of communication links.

There are many forms of communication that are supported by the Modeler modeling environment. However, there is one fundamental structure, called packet, that provides the most commonly used mechanism for information exchange. Packets are objects that contain formatted information that can change dynamically. They can be stored by and transferred between objects in each of the modeling domains. In the Node Domain, packets typically travel over streams; in the Network Domain, they are typically transferred over links. Packets are essentially composed of three main storage areas. The first area can be viewed as a list of user-defined values called packet fields; the second area consists of a set of predefined values that are used by the simulation system for tracing and accounting purposes; and the third area contains transmission data attributes that are used to support customizable models for communication links.

Key Concept—Packets carry formatted information between simulation entities. They represent messages, packets, cells, transactions, etc. Packets can be transferred between objects in the Node and Network domains. Each packet contains 3 areas: user-defined fields, pre-defined fields for accounting, and transmission data used by link models.

Figure 10: Three Main Storage Areas of Packet Contents

Three Main Storage Areas of Packet Contents

Because discrete event simulations model each individual packet in a network model, and the packet fields contain actual data values, fully accurate models of protocol interactions can be implemented. Processes can modify and obtain values of fields and base their actions upon their contents. Packet fields may contain data of one of several supported data types. Integer and double (floating-point) fields can be used to represent flags, counters, timer values, network addresses, etc. Packet fields allow packets to be encapsulated within other packets, which is a fundamental mechanism supporting layered protocol modeling, because higher-layer protocols request that lower-layer protocols transport packets to remote peers. Structure fields provide general support for carrying user-defined C/C++ language data structures within packets; this is sometimes useful for sophisticated applications where complex information, such as routing tables, are transferred across networks. The information field type is provided for convenient support of bulk or filler data in a packet, which can be important to accurately model packet size; information fields contain no values.

Table 6: Packet Field Types

Type Use
integer Whole numbers: flags, counters, addresses, etc.
double Floating point numbers: timer values, statistics, etc.
packet Encapsulation of higher-layer protocol data
structure Transport of complex user-defined data types
information Modeling of field size when content is irrelevant

Key Concept—Each packet is modeled individually and can have arbitrary content in its fields. Several data types are supported for fields, including numerical values, encapsulated packets, and general data structures. Field size is specified, allowing accurate modeling of processing delays, transmission delays, buffer occupancy, etc.

Packets fall into the following three broad categories:

  • Formatted packets have fields defined according to a template called a packet format. Packet formats are created in the Packet Format Editor and specify a list of field names, data types, sizes (that is, field lengths specified in bits), and default values. When formatted packets are created, they instantly acquire the fields defined in their format and, when applicable, default values are installed in those fields.
  • Unformatted packets have no fields when they are created; fields are added one at a time and can only be referenced by numeric index, not by name. Unformatted packets are typically useful only for very simple applications and the recommended approach is to define packet formats for most models, particularly when several different types of packets are used in a network.
  • Value vector packets do not contain user-defined fields. Instead, they contain a sequence of binary numbers representing data passed between simulators. Value vector packets are used primarily with cosimulations.

Key Concept—Packets can be made to conform to a packet format. Packet formats are defined in the Packet Format Editor and specify a template for a packet’s fields, including the names, types, and sizes of each supported field.

Packets can be used to transfer data at all levels of a network model via several communication mechanisms. Processors, queues, and other modules forward packets within nodes via packet streams, which were introduced earlier in this section. Packet streams may introduce delay and also queue packets until a destination module is ready to accept them. At the network level, packets are sent between nodes over communication links. Communication links use customizable underlying models to model delays and errors in packet transmission. A third packet transfer mechanism, called packet delivery, supports transfer of packets between modules, regardless of their location in a network, without requiring any physical connection to exist between them.

Packets are intended to represent information-carrying structures of various types that appear in communications and systems architectures, including packets, messages, frames, cells, datagrams, and transactions. The term packet has been chosen as a general term and should not be interpreted as restricting the types of applications for which Modeler can be used.

For some communication networks, information transfer does not necessarily occur in packet form. In particular, some devices communicate with streams of data where information flow is continuous. In such cases, packets can be treated as messages that carry only model-relevant information between the communicating entities. This may include information such as the amount of data transferred, or signaling data that is needed by the application models at either end of the stream. Depending on what the goal of the modeling effort is, the data streams can be adequately represented by modeling the important phases of their operation (setup, tear-down, and control information transfer) with packets, or even with other communication mechanisms that will be described later in this manual.

Key Concept—Although the generic term “packet” is used, Modeler can use packets to represent other forms of communication as well. In stream-oriented communications, for example, packets may be used to represent key signalling information, allowing the connection to be modeled in terms of its duration, bandwidth requirements, etc.