You are on page 1of 6

11Packet Format Editor

11 Packet Format Editor


Packet formats define the internal structure of packets as a set of fields. For each field, the packet format specifies a unique name, a data type, a default value, a size in bits, an encoding style, a conversion method, and optional comments. Packet formats are referenced as attributes of transmitter and receiver modules within node models, in calls to Kernel Procedures, and by the Declare Packet Formats operation in the File menu of the Process Editor. A packet format contains one or more fields, represented in the graphical environment as a set of colored, rectangular boxes. The size of the box is proportional to the number of bits specified in the size attribute.
Figure 11-1 Packet Format

Right-click on a packet field to open the Attributes dialog box for that field. In addition to attributes, the dialog box contains buttons that allow you to add comments to the packet field and edit the conversion method assigned to the field. In general, fields can be placed in any order and can be dragged from one row to another as you like. Order does not matter because packet formats are typically referenced by the field name. However, if your model references packet fields by index, changing the graphic representation makes a big difference. OPNET assigns an index of 0 to the top left field (in Figure 11-1, service type has an index of 0) and the highest index to the bottom right field (in Figure 11-1, application_info has an index of 23).

Modeler/Release 14.0

ER-11-1

11Packet Format Editor

Menus
The Packet Format Editor provides several operations for creating and working with packet formats. You access these operations from the Packet Format Editor menu bar, which contains the following menus:
Table 11-1 Packet Format Editor Menus
Menu File Description Contains operations that relate to high-level functions such as opening and closing projects, saving scenarios, importing models, and printing graphics and reports. Contains operations that allow you to edit the preferences that control program operation and to manipulate text and objects Contains operations that add fields to a packet format Contains operations that allow you to edit the packet format attributes Lists all open editor windows and allows you to make one active Provides access to context-sensitive help, the product documentation and tutorials, and information about the program Reference File Menu on page ER-2-2

Edit

Edit Menu on page ER-2-5

Fields

Fields Menu on page ER-11-3 Interfaces Menu on page ER-11-3 Windows Menu on page ER-2-7 Help Menu on page ER-2-8

Interfaces

Windows

Help

End of Table 11-1

NoteThe editor menus on your machine may vary from those described here, particularly if there has been any UI customization or use of ETS. The following sections list the items in the Packet Format Editor menus and give a reference to where you can get more information about each operation: Fields Menu on page ER-11-3 Interfaces Menu on page ER-11-3

ER-11-2

Modeler/Release 14.0

11Packet Format Editor

Fields Menu
The Fields menu contains an operation that adds fields to a packet format.
Table 11-2 Fields Menu Summary
Menu item Create Field Description Creates a new field within the packet. Reference Create Field on page ER-11-5

End of Table 11-2

Interfaces Menu
The Interfaces menu includes operations that enable you to edit the packet formats interfaces.
Table 11-3 Interfaces Menu Summary
Menu item Packet Interfaces Description Opens a dialog box for specifying packet-level attributes. Opens an edit pad in which you can enter comments about the packet format Specifies whether conversion to/from value vector form is supported and provides information about how conversion should be done. Reference

Model Documentation

Model Documentation on page ER-11-6 Binary Conversion on page ER-11-6

Binary Conversion

End of Table 11-3

Modeler/Release 14.0

ER-11-3

11Packet Format Editor

Toolbar Buttons
The Packet Format Editor has toolbar buttons for frequently-used operations.
Figure 11-2 Toolbar Buttons (Packet Format Editor)

Table 11-4 lists the name of each toolbar buttonthe name appears as a tooltip when you rest the cursor on the buttonand its equivalent menu command. To configure the toolbar buttons, see Configuring the Toolbar on page ER-1-6.
Table 11-4 Toolbar Buttons in the Packet Format Editor
Button 1 2 Name in the Toolbar Create New Field Edit Packet Format Attributes Equivalent Menu Command Fields > Create Field Interfaces > Packet Interfaces

End of Table 11-4

ER-11-4

Modeler/Release 14.0

11Packet Format Editor

Fields Menu Operations


This section contains descriptions and procedures for using the operations available from the Fields Menu of the Packet Format Editor.

Create Field
This operation creates a new field within the current packet format. Fields are represented graphically as colored, rectangular boxes. Right-click on a field to display the Attributes dialog box for that field. Each field within a packet has several attributes: Namea user selected string Typecan be integer, floating point, structure, packet, information, integer (64 bit), packet ID, or object ID Encodingspecifies binary encoding for integer and floating point field values. Can be signed big endian, unsigned big endian, signed little endian, unsigned little endian, or other Sizemeasured in bits Default Valueused to specify a numerical value for integer and floating point fields, or a bulk fill pattern for information fields Set At Creationif set, the value specified in Default Value is assigned to the field at the packets creation; if unset, no value is assigned to the field at packet creation Conversion Methodspecifies the packet field conversion method to be used to convert this field to and from value vector (vvec) form at simulation time Colorthe color in which to display the field Conversion Orderspecifies the order in which the fields will be converted to value vector form For more information about packet fields, see Packet Format Editor on page MC-1-46.

Modeler/Release 14.0

ER-11-5

11Packet Format Editor

Interfaces Menu Operations


This section contains descriptions and procedures for using the operations available from the Interfaces Menu of the Packet Format Editor.

Binary Conversion
This operation enables you to specify whether the packet format supports conversion to and from value vector form. If conversion is supported, you can specify a bulk fill pattern and conversion method.

Model Documentation
This operation enables you to add comments to a packet format. These comments can describe the formats intended use and give a user any other information that may be useful.

ER-11-6

Modeler/Release 14.0

You might also like