Modeler Day2 (reupload)

download Modeler Day2 (reupload)

of 118

Transcript of Modeler Day2 (reupload)

  • 8/12/2019 Modeler Day2 (reupload)

    1/118

    OPNET Modeler

    Day 2

  • 8/12/2019 Modeler Day2 (reupload)

    2/118

    copyright 2001 OPNET Technologies, Inc.

    2

    Course Outline

    Events and Event List Concepts

    Process Modeling Process Modeling Lab Collecting Scalar Statistics Radio Modeling

  • 8/12/2019 Modeler Day2 (reupload)

    3/118

    Events and

    Event List Concepts

  • 8/12/2019 Modeler Day2 (reupload)

    4/118

    copyright 2001 OPNET Technologies, Inc.

    4

    Agenda

    Event-driven Simulation

    Event List and the Simulation Time Clock

    Simulation Kernel

    Interrupts

    Processes and Interrupts

    Event List Example

  • 8/12/2019 Modeler Day2 (reupload)

    5/118 copyright 2001 OPNET Technologies, Inc.

    5

    Event-Driven Simulation

    Events are specific activities that occur at a certain time

    OPNET simulations are event-driven

    Simulation time advances when an event occurs

    A different method might be to sample at regular intervals Disadvantages:

    Accuracy of results is limited by the sampling resolution Simulation is inefficient if nothing happens for long periods

  • 8/12/2019 Modeler Day2 (reupload)

    6/118 copyright 2001 OPNET Technologies, Inc.

    6

    Time Event Type Module0.0 Initialize src.gen0.0 Initialize src.rte4.3 Timer expires src.gen

    4.3 Packet arrives src.rte

    Head

    Event List Concepts

    Single global event list

    Shared simulation time clock

    Events scheduled in time order

    Event removed from event list when it completes

  • 8/12/2019 Modeler Day2 (reupload)

    7/118 copyright 2001 OPNET Technologies, Inc.

    7

    The Simulation Kernel

    Simulation Kernel (SK) manages the event list

    SK delivers each event, in sequence, to the appropriate module

    SK receives requests from processes and inserts new events in the event list

  • 8/12/2019 Modeler Day2 (reupload)

    8/118 copyright 2001 OPNET Technologies, Inc.

    8

    Event Generation and Cancellation

    Events can be generated in several ways

    BEGSIM/ENDSIM interrupts Self interrupts Packet arrivals (STRM interrupts) Writing to a statwire (STAT interrupts)

    Events can be cancelled before they occur

  • 8/12/2019 Modeler Day2 (reupload)

    9/118 copyright 2001 OPNET Technologies, Inc.

    9

    Interrupts

    First event in the event list becomes an interrupt

    Delivered by the Simulation Kernel to the designated module

    Data associated with the event can be obtained by the module

    Processors and queues can have BEGSIM interrupts

  • 8/12/2019 Modeler Day2 (reupload)

    10/118 copyright 2001 OPNET Technologies, Inc.

    10

    How Does the Event List Work?

    New event reaches head ofevent list, which causes

    Simulation Kernel to deliveran interrupt to the appropriate

    module

    Simulation Kernel regainscontrol from module

    Process within themodule gains control

    and processesinterrupt

    Simulation Kerneldeletes event fromevent list, allowingnew event to reach

    head of list

  • 8/12/2019 Modeler Day2 (reupload)

    11/118 copyright 2001 OPNET Technologies, Inc.

    11

    Event List Implementation

    The Simulation Kernel uses an efficient proprietary algorithm to maintainthe event list

    Event times are expressed as double-precision, floating-point numbers andare used to keep the event list sorted

    0.01234 56789 11111 11

    0.01234 56789 11111 22

    0.01234 56789 11111 33

    0.01234 56789 11111 44

    0.01234 56789 11111 55

    0.01234 56789 11111 66

    0.01234 56789 11111 77

    Suppose that this interrupt triggers an event to occur at0.01234 56789 11111 75.

    The Simulation Kernel minimizes the time required to place this event at the correct place on the list.

  • 8/12/2019 Modeler Day2 (reupload)

    12/118

    copyright 2001 OPNET Technologies, Inc.

    12

    Delivery of Interrupts

    When an interrupt is delivered to a module, control passes from theSimulation Kernel to the module

    If the module is a queue or processor, the interrupt is delivered to the process running within the module

    Other modules have default behaviors

  • 8/12/2019 Modeler Day2 (reupload)

    13/118

    copyright 2001 OPNET Technologies, Inc.

    13

    Event List Concepts Reviewed

    Events must exist in the event list at the start of a simulation

    A processor or queue module has the begsim interrupt attribute enabled

    An event list typically has a few events each event may schedule otherevents

    The event list is always growing and shrinking

    An event is pending until executed

    A pending event can be cancelled

  • 8/12/2019 Modeler Day2 (reupload)

    14/118

    copyright 2001 OPNET Technologies, Inc.

    14

    Forced States

    Forced (green) and unforced (red)states differ significantly inexecution timing

    In a forced state, the process: Invokes the enter executives

    Invokes the exit executives Evaluates all condition statements If exactly one condition statement

    evaluates to true, the transition istraversed to the next state

    OPNET convention: code in enterexecs only

    Transition to next state

    Transition to next state

    Forced (green) states

    Enter execsinvoked

    No blocking or waiting

    Exit execsinvoked

    Enter execsinvoked

    Exit execsinvoked

    No blocking or waiting

  • 8/12/2019 Modeler Day2 (reupload)

    15/118

    copyright 2001 OPNET Technologies, Inc.

    15

    Unforced States

    In an unforced state, the process:

    Invokes the enter executives Places a marker at the middle ofthe state

    Releases control to the SimulationKernel and becomes idle

    Resumes at the marker and processes the exit execs when nextinvoked

    Start of invocation

    End of invocation

    Unforced (red) states

    Transition to next state

    Blocking, waitingfor invocation

    Exit execs processedwhen invocation occurs

    Enter execsinvoked

    Next

    invocationstarts here

    Blocking, wait fornext invocation

  • 8/12/2019 Modeler Day2 (reupload)

    16/118

    copyright 2001 OPNET Technologies, Inc.

    16

    Transitions Between States

    After completing the exit executives, the process evaluates theconditions for all transitions from the state

    One and only one condition statement must evaluate to true

    The single true transition is taken to the next state

    A transition with condition = default is true if and only if no otherconditions are true

    A transition with no condition set is termed unconditional and isalways true

  • 8/12/2019 Modeler Day2 (reupload)

    17/118

    copyright 2001 OPNET Technologies, Inc.

    17

    How a Process Handles an Interrupt

    Flow diagram showing how a process handles an interrupt:

    (except the initial interrupt)

    Implementexit execs

    Set marker; block and wait

    for interrupt

    Receiveinterrupt

    Evaluateconditionstatements

    Red state? Yes

    No

    Follow transitionto next state Implement enter

    execs

    Find marker

  • 8/12/2019 Modeler Day2 (reupload)

    18/118

    copyright 2001 OPNET Technologies, Inc.

    18

    Process Model Example

    Model with three forced states and one unforced state:

    3. Transition occurs. 6. Transition occurs.

    2. Exit execs invoked immediately. Transitioncondition (pk_count == 0) evaluates totrue. 5. Exit execs invoked immediately.

    8. Marker is placed and process stops here.

    7. Enter execs invoked.4. Enter execs invoked.1. Initial interrupt delivered and the enterexecs invoked.

  • 8/12/2019 Modeler Day2 (reupload)

    19/118

    copyright 2001 OPNET Technologies, Inc.

    19

    The Simulation Kernel and Processes

    Control passes between the Simulation Kernel (SK) and multiple processes(pr1, pr2 , etc.), as described below:

    Description In control Idle Read first event on event list. Deliver to appropriate process ( pr1 ). SK All processes

    Invoke enter and exit execs of initial state ( forced1 ) . Evaluate pr1 SK; other processescondition statements and transition to next state ( forced2 ).Invoke enter and exit execs of forced2 . Transition to next state ( unforced ).Invoke enter execs of next state ( unforced ). Release control to SK. Become idle.

    Remove first event from event list. Advance next event to SK All processeshead of list. Deliver interrupt to pr2.

    Invoke enter and exit execs of initial state (this process model is not shown). pr2 SK ; other processesEvaluate condition statements and transition to next state

  • 8/12/2019 Modeler Day2 (reupload)

    20/118

    copyright 2001 OPNET Technologies, Inc.

    20

    Event List Example

    Consider this model:

    Network model

    Node model

    Node model

    Node model: src

    Node model: dest1

    Network model

  • 8/12/2019 Modeler Day2 (reupload)

    21/118

  • 8/12/2019 Modeler Day2 (reupload)

    22/118

    copyright 2001 OPNET Technologies, Inc.

    22

    The BEGSIM Interrupt

    BEGSIM is an interrupt that occurs at simulation time 0.0, before any othertype of interrupt

    A BEGSIM interrupt usually initializes a module and schedules futureevents

    Any processor or queue can have its begsim intrpt attribute enabled,resulting in an event being placed on the event list for time 0

  • 8/12/2019 Modeler Day2 (reupload)

    23/118

    copyright 2001 OPNET Technologies, Inc.

    23

    Event List Example (cont.)

    The begsim intrpt attribute for modules src.gen and src.queue is enabled; this places two events in the event list

    Time Event Type Module0.0 BEGSIM src.gen0.0 BEGSIM src.queue

    Node model

  • 8/12/2019 Modeler Day2 (reupload)

    24/118

    copyright 2001 OPNET Technologies, Inc.

    24

    Processing the First Interrupt

    Consider the process model specified by the src.gen module

    Node model: src

    Process model: gen

  • 8/12/2019 Modeler Day2 (reupload)

    25/118

    h ( )

  • 8/12/2019 Modeler Day2 (reupload)

    26/118

    copyright 2001 OPNET Technologies, Inc.

    26

    Processing the First Interrupt in Process gen (cont.)

    Process model

    Process model: gen

    P i h Fi I i P ( )

  • 8/12/2019 Modeler Day2 (reupload)

    27/118

    copyright 2001 OPNET Technologies, Inc.

    27

    Because Init is a forced (green) state, process immediately invokes andcompletes the exit execs.

    Process evaluates all condition statements. This state has only onedeparting transition which evaluates to true.

    Process transitions to Wait state.

    Processing the First Interrupt in Process gen (cont.)

    P i h Fi I i P ( )

  • 8/12/2019 Modeler Day2 (reupload)

    28/118

    copyright 2001 OPNET Technologies, Inc.

    28

    Process model

    Process invokes and completes the enter execs of Wait .

    Processing the First Interrupt in Process gen (cont.)

    P i th Fi t I t t i P ( t )

  • 8/12/2019 Modeler Day2 (reupload)

    29/118

    copyright 2001 OPNET Technologies, Inc.

    29

    Line 9 of the enter execsschedules a self interrupt usinga KP. This adds an event tothe event list.

    Process places a marker at the

    middle of Wait .

    Process becomes idle.

    Time Event Type Module0.0 BEGSIM src.gen0.0 BEGSIM src.queue4.3 SELF src.gen

    Marker

    Processing the First Interrupt in Process gen (cont.)

  • 8/12/2019 Modeler Day2 (reupload)

    30/118

    Processing the Next Interrupt at module src gen

  • 8/12/2019 Modeler Day2 (reupload)

    31/118

    copyright 2001 OPNET Technologies, Inc.

    31

    Processing the Next Interrupt at module src.gen

    Simulation Kernel removes the previous event and advances the nextevent to the head of the event list. The simulation time becomes 4.3

    seconds.

    Simulation Kernel delivers the SELF interrupt to the gen process. The process resumes at the marker in the middle of Wait .

    Process invokes and completes the exit execs of Wait .

    Time Event Type Module 4.3 SELF src.gen

  • 8/12/2019 Modeler Day2 (reupload)

    32/118

    Continuing the Process at gen (cont )

  • 8/12/2019 Modeler Day2 (reupload)

    33/118

    copyright 2001 OPNET Technologies, Inc.

    33

    Continuing the Process at gen (cont.)

    Process transitions to Send . Process invokes the enter execs of Send and calls op_pk_send( ) to

    send a packet. This results in an event of type STRM being placedon the event list.

    Time Event Type Module 4.3 SELF src.gen4.3 STRM src.queue

    Continuing the Process at gen (cont )

  • 8/12/2019 Modeler Day2 (reupload)

    34/118

    copyright 2001 OPNET Technologies, Inc.

    34

    Continuing the Process at gen (cont.)

    Process immediately invokes and completes the exit execs, becauseSend is a forced (green) state.

    Process evaluates all possible transitions. One evaluates to true.

    Process transitions to Wait

    Process invokes enter execs of Wait , schedules another SELF interruptin the event list and becomes idle.

    Simulation Kernel takes control and processes the next event in the list.

    Simulation Termination

  • 8/12/2019 Modeler Day2 (reupload)

    35/118

    copyright 2001 OPNET Technologies, Inc.

    35

    Simulations terminate in one of four ways: The event list is emptied Simulation attribute duration expires A process calls for termination, using the KP op_sim_end() A fatal error occurs

    How Does Time Advance?

  • 8/12/2019 Modeler Day2 (reupload)

    36/118

    copyright 2001 OPNET Technologies, Inc.

    36

    How Does Time Advance?

    Simulation time advances only when an event with a later time is processed from the event list

    No simulation time occurs during the execution of a process

    No time elapses during transitions between states

    A process model must always have an unforced (red) state so time canadvance Avoid endless looping between

    forced (green) states

    Events and Event List Concepts: Summary

  • 8/12/2019 Modeler Day2 (reupload)

    37/118

    copyright 2001 OPNET Technologies, Inc.

    37

    Events and Event List Concepts: Summary

    Forced and unforced states execute differently

    Any processor or queue can have the attribute begsim intrpt enabled,scheduling an event for time 0.0

    Control passes dynamically between the Simulation Kernel and individual

    processes

  • 8/12/2019 Modeler Day2 (reupload)

    38/118

    Process Modeling

    Agenda

  • 8/12/2019 Modeler Day2 (reupload)

    39/118

    copyright 2001 OPNET Technologies, Inc.

    39

    g

    Process models

    Process Editor State transitions Executive blocks

    Kernel Procedures

    Examine acb_fifo

    Lab: Modify a process model

    Process Models

  • 8/12/2019 Modeler Day2 (reupload)

    40/118

    copyright 2001 OPNET Technologies, Inc.

    40

    Process models represent algorithms Communications protocols and algorithms Shared-resource managers Queuing disciplines Specialized traffic generators Statistic-collection mechanisms Control Processes

    Process Editor provides the features for creating process models

    Process Editor

  • 8/12/2019 Modeler Day2 (reupload)

    41/118

    copyright 2001 OPNET Technologies, Inc.

    41

    1. Create state2. Create transition3. Set initial state4. Edit state variable5. Edit temporary variable6. Edit header block7. Edit function block8. Edit diagnostic block9. Edit termination block10. Compile process model

    1 2 3 4 5 6 7 8 9 10

    Toolbar Buttons:

    State Transitions

  • 8/12/2019 Modeler Day2 (reupload)

    42/118

    copyright 2001 OPNET Technologies, Inc.

    42

    Transitions connect states Conditional

    Unconditional Transition executive

    Exactly one condition must evaluate to true If the condition statement (x == y) is true, the transition executive (Reset_Timers)

    is invoked

    Transition executiveCondition statement

    State Executive Blocks

  • 8/12/2019 Modeler Day2 (reupload)

    43/118

    copyright 2001 OPNET Technologies, Inc.

    43

    Each state has two executive blocks Enter executives are invoked upon entering a state

    Exit executives are invoked before exiting a state

    Introduction to Kernel Procedures

  • 8/12/2019 Modeler Day2 (reupload)

    44/118

    copyright 2001 OPNET Technologies, Inc.

    44

    Pre-written functions for difficult, tedious, or common operations

    KPs free users from addressing memory management, data structure,handling event processing, etc.

    KPs focus on communication modeling

    All KPs begin with prefix op_

    Common Kernel Procedures

  • 8/12/2019 Modeler Day2 (reupload)

    45/118

    copyright 2001 OPNET Technologies, Inc.

    45

    Packet Package: op_pk_create ()op_pk_create_fmt ()op_pk_copy ()op_pk_get ()op_pk_total_size_get ()op_pk_nfd_set ()op_pk_nfd_get ()op_pk_send ()op_pk_send_delayed ()

    op_pk_destroy ()

    Subq Package :op_subq_pk_insert ()op_subq_pk_remove ()

    Interrupt Package:op_intrpt_schedule_self ()

    op_intrpt_type ()op_intrpt_strm ()op_intrpt_code ()

    Simulation andEvent Packages: op_ev_cancel ()

    op_sim_time ()

    ID, Topo and InternalModel Access Packages:op_id_self ()op_topo_parent ()op_topo_child ()

    op_ima_obj_attr_get ()

    Distribution Package :op_dist_load ()op_dist_outcome ()

    Naming convention for Kernel Procedures -

    op__

    Kernel Procedures Help

  • 8/12/2019 Modeler Day2 (reupload)

    46/118

    copyright 2001 OPNET Technologies, Inc.

    46

    From the Help menu, select Online Documentation and refer to theSimulation Kernel manual

    Press + to view Essential Kernel Procedures Press + + to view All Kernel Procedures

    Each KP is described in several paragraphs. Review at least theAbstract, Syntax, and ReturnValue fields.

    KP Name

    Syntax

    Return Value

    Example

    The manual is divided into sections by KP family (such as Anim, Dist,Sim, Stat) and sorted by KP namewithin each section.

    Details

    Purpose

    Errors

    Reference

    Abstract

    Proto- C

  • 8/12/2019 Modeler Day2 (reupload)

    47/118

    copyright 2001 OPNET Technologies, Inc.

    47

    State transition diagrams C programming language Library of OPNET Kernel Procedures (KPs) State variables (private to each process) Temporary variables

    Example Process Model: acb_fifo

  • 8/12/2019 Modeler Day2 (reupload)

    48/118

    copyright 2001 OPNET Technologies, Inc.

    48

    Queue process model

    Characteristics Has a service rate, in bits/sec FIFO queue

    Active Concentrating Bit-oriented First In First Out queue Active: Has a processor Concentrating: Will take from many input streams and output to only one

    stream Bit-oriented: Delay is based on number of bits processed

    acb_fifo: State Overview

  • 8/12/2019 Modeler Day2 (reupload)

    49/118

    copyright 2001 OPNET Technologies, Inc.

    49

    Purpose of each state init initializes state variables arrival queues packets svc_start calculates when the packet can be sent svc_compl sends the packet idle is the wait state

    acb_fifo: Idle state

  • 8/12/2019 Modeler Day2 (reupload)

    50/118

    copyright 2001 OPNET Technologies, Inc.

    50

    Packet arrival Packet is queued in arrival To svc_start if not busy Back to idle if busy

    Service completion Sends queued packet in svc_compl

    To svc_start if queue nonempty Back to idle if queue busy

    acb_fifo: arrival State

  • 8/12/2019 Modeler Day2 (reupload)

    51/118

    copyright 2001 OPNET Technologies, Inc.

    51

    Gets the incoming packet

    Tries to queue packet

    Destroys packet ifqueue is full

    acb_fifo: svc_start State

  • 8/12/2019 Modeler Day2 (reupload)

    52/118

    copyright 2001 OPNET Technologies, Inc.

    52

    Begins servicing the packet Schedules an interrupt for service completion

    acb_fifo: svc_compl State

  • 8/12/2019 Modeler Day2 (reupload)

    53/118

    copyright 2001 OPNET Technologies, Inc.

    53

    Sends the serviced packet Receiving module will get control immediately

  • 8/12/2019 Modeler Day2 (reupload)

    54/118

    Process Modeling: Summary

  • 8/12/2019 Modeler Day2 (reupload)

    55/118

    copyright 2001 OPNET Technologies, Inc.

    55

    Process models Finite state machines

    Proto-C acb_fifo

    Kernel Procedures

  • 8/12/2019 Modeler Day2 (reupload)

    56/118

    Process Modeling Lab

    Lab Description

  • 8/12/2019 Modeler Day2 (reupload)

    57/118

    copyright 2001 OPNET Technologies, Inc.

    57

    This lab uses the project bank_net , to model changes in the transaction rateand measure the effects of those changes

    Create modified sink process model to compute ETE delay Get the packet Obtain the creation time Write out its ETE delay as a global statistic Destroy the packet

    Incorporate new sink process model into existing node model

    Create ETE delay statistic probe

    Run simulation

    Filter the View Results graphs to answer questions

  • 8/12/2019 Modeler Day2 (reupload)

    58/118

  • 8/12/2019 Modeler Day2 (reupload)

    59/118

    CollectingScalar Statistics

    Agenda

  • 8/12/2019 Modeler Day2 (reupload)

    60/118

    copyright 2001 OPNET Technologies, Inc.

    60

    Conceptual goals: Creation of an attribute of a

    process model Collect scalar statistics

    Tool goals: View scalar analysis results

    Creating an Attribute for the Process Model

  • 8/12/2019 Modeler Day2 (reupload)

    61/118

    copyright 2001 OPNET Technologies, Inc.

    61

    2

    4

    4

    1

    3

    Scalar Statistics

  • 8/12/2019 Modeler Day2 (reupload)

    62/118

    copyright 2001 OPNET Technologies, Inc.

    62

    A scalar statistic is a single value representing a statistic computed over aninterval, typically the entire simulation. A scalar statistic:

    Allows for parametric studies. Must be plotted versus another scalar. Shows the effect that making a change has on certain output parameters. Is usually a summary of some aspect of a networks behavior.

  • 8/12/2019 Modeler Day2 (reupload)

    63/118

    Scalar Statistics

  • 8/12/2019 Modeler Day2 (reupload)

    64/118

    copyright 2001 OPNET Technologies, Inc.

    64

    A scalar statistic is a single value representing a statistic computed over aninterval, typically the entire simulation (example: average end-to-end delay

    for all received packets in a simulation).

    Scalar statistics: Must be plotted versus

    another scalar statistic

    Allows for parametric studies Requires many simulation

    runs because each run produces only one data point

    Collecting Scalar Statistics

  • 8/12/2019 Modeler Day2 (reupload)

    65/118

    copyright 2001 OPNET Technologies, Inc.

    65

    Use any of three methodsto collect a scalar

    statistic: A statistic probe created

    in the Probe Editor (as below)

    An attribute probe

    The KPop_stat_scalar_write(scstat_name, value)

    2

    1

    3

    Using the Simulation Sequence Editor

  • 8/12/2019 Modeler Day2 (reupload)

    66/118

    copyright 2001 OPNET Technologies, Inc.

    66

    In order to collect scalarstatistics, a scalar file must

    be specified. This output file will record

    the scalar simulationstatistics.

    There is only one data point per simulation run.

    The simulation programappends data to an existingfile, allowing for multi-simulation parametricstudies.

    Using the Simulation Sequence Editor

  • 8/12/2019 Modeler Day2 (reupload)

    67/118

    copyright 2001 OPNET Technologies, Inc.

    67

    By promoting an objectsattribute to the simulation

    level, multiple values forthat attribute can be set. By left-clicking on a blank

    under Attribute the usercan add a currently

    promoted attribute. After adding the attribute to

    the table, the user can selectmultiple values for thatstatistic, and simulations

    will run with each value.

    1

    2 3

    4

    Plotting a Scalar Panel

  • 8/12/2019 Modeler Day2 (reupload)

    68/118

    copyright 2001 OPNET Technologies, Inc.

    68

    1

    2

    5

    4

    3

    Understanding the Problem and Questions

  • 8/12/2019 Modeler Day2 (reupload)

    69/118

    copyright 2001 OPNET Technologies, Inc.

    69

    Modify the Bank_net project to include a custom generator that has anattribute transaction_rate , the transaction rate in transactions

    per second.

    Answer the following questions: Are your results the same with this customized generator as with the ideal

    generator? Hint: run the simulation with the same probe file as before.

    Verify that results are the same. What is the maximum generation rate such that the average ETE delay for

    all transactions is less than 5 seconds? Hint: run multiple simulations withdifferent transaction rates, collecting scalar data.

    Creating a Custom Generator Procedure

  • 8/12/2019 Modeler Day2 (reupload)

    70/118

    copyright 2001 OPNET Technologies, Inc.

    70

    1. Determine functionality of the process model.2. Determine necessary states.

    3. Create transitions between states. Write condition statements andcreate macros for them.

    4. Determine state variables.5. Use C code and KPs to implement each states enter and exit

    executives.6. Declare variables.7. Compile the process model.

  • 8/12/2019 Modeler Day2 (reupload)

    71/118

  • 8/12/2019 Modeler Day2 (reupload)

    72/118

    Useful KPs for This Model

    k d( k d ) f d k h h

  • 8/12/2019 Modeler Day2 (reupload)

    73/118

    copyright 2001 OPNET Technologies, Inc.

    73

    op_pk_send (pkptr , outstrm_index) forwards a packet through anoutput packet stream and schedules its arrival at a destination module.

    cur rent_ti me = op_sim_time () obtains the current simulation time. object_id = op_id_self () obtains the value of the surrounding

    processor or queue. op_ima_obj_attr _get (objid, attr_name, value_ptr) obtains the value

    of an attribute for the specified object.

    Lab Approach and HintsRemember the questions we are trying to answer:

  • 8/12/2019 Modeler Day2 (reupload)

    74/118

    copyright 2001 OPNET Technologies, Inc.

    74

    Are your results the same with this customized generator as with the ideal generator?

    What is the maximum generation rate such that the average ETE delay for all transactions is less than 5 seconds?

    1. Create a new generator process model.a. Create an attribute of the process named transaction_rate .

    b. Place states and transitions.c. Define code in executive blocks.d. Compile the process model.

    NOTE: if you do not want to create this model, it is available as model "mdlr_lab12_gen".Examine it to see how it was implemented.

    2. Modify the node model to include the new generator process (use a processor instead of anideal generator).

    3. Modify probe file to capture the scalar statistic ETE delay by adding a global statistic probe.

    4. Run multiple simulations and view output in the Analysis Tool. To ensure convergence,you may want to run with a duration longer than 1000 sec (however, the simulations willtake longer to complete).

    Lab Results

  • 8/12/2019 Modeler Day2 (reupload)

    75/118

    copyright 2001 OPNET Technologies, Inc.

    75

    If you finish early, try the Advanced Lab

    Modify the sink process to collect the total number of bits that it receives

  • 8/12/2019 Modeler Day2 (reupload)

    76/118

    copyright 2001 OPNET Technologies, Inc.

    76

    Modify the sink process to collect the total number of bits that it receives(use op_pk_total_size_get () ). At the end of the simulation, write out the

    the statistic: "Global Bit Throughput" = total bits received / total simulation time

    Add an additional receiver to the PHIL node model that also sends packetsto the sink module.

    Add an additional New York node that sends bank transactions to PHIL.

    Plot the scalar panel ETE Delay vs. Global Bit Throughput for a variety oftransaction rates.

  • 8/12/2019 Modeler Day2 (reupload)

    77/118

    Radio Modeling

    Agenda

    C l G l T l G l

  • 8/12/2019 Modeler Day2 (reupload)

    78/118

    copyright 2001 OPNET Technologies, Inc.

    78

    Conceptual Goals Introduction to radio modeling

    Introduction to TransceiverPipeline Stages

    Mobile/Satellite Nodes Custom Packets Custom Antennas

    Link Models Custom PDFs

    Tool Goals Define Trajectory

    Packet Format Editor Link Model Editor Antenna Pattern Editor PDF Editor

    Radio Modeling

    Modeler / Radio allows models to utilize

  • 8/12/2019 Modeler Day2 (reupload)

    79/118

    copyright 2001 OPNET Technologies, Inc.

    79

    Modeler / Radio allows models to utilizemobile nodes and mobile subnets using

    dynamic RF links.

    Node and subnet positions are updated (lazyevaluation) based on user specifications suchas time step, altitude and a defined path that is

    anchored on absolute or relative coordinates.

    Radio transceivers must be used that employ a14 stage link budget model called theTransceiver Pipeline

    Radio Modeling

    Radio is a broadcast technology and depends on dynamically changing

  • 8/12/2019 Modeler Day2 (reupload)

    80/118

    copyright 2001 OPNET Technologies, Inc.

    80

    Radio is a broadcast technology and depends on dynamically changing parameters. The simulation must evaluate the possible connectivity

    between a transmitter channel and every receiver channel for eachtransmission.

    The network level characteristics factored into these calculations are thelocations of the source and destination nodes, the distance between the

    nodes, and the direction the radio signal travels from the source node tothe destination node.

    If the nodes are mobile or satellite nodes, these position-related parametersmay change during simulation.

  • 8/12/2019 Modeler Day2 (reupload)

    81/118

  • 8/12/2019 Modeler Day2 (reupload)

    82/118

    Transceiver Pipeline

    Models the transmission of packets across a communications channel (link)

  • 8/12/2019 Modeler Day2 (reupload)

    83/118

    copyright 2001 OPNET Technologies, Inc.

    83

    p ( ) Implements the physical layer characteristics

    Divided into multiple stages , each modeling a particular aspect of thechannel

    Determines whether or not a packet can be received at the links destination

    S1 S2 S3 S4

    Transmitter Receiver

    Each stage models an aspect ofthe links behavior

    Radio Transceiver Attributes for Specifying Pipeline Stages

  • 8/12/2019 Modeler Day2 (reupload)

    84/118

    copyright 2001 OPNET Technologies, Inc.

    84

    8 Stages (6-13) Associatedwith Radio Receiver

    6 Stages (0-5) Associatedwith Radio Transmitter

    Receiver GroupTransmission DelayLink Closure (LOS)Channel MatchTx Antenna GainPropagation Delay

    Rx Antenna GainReceived PowerBackground NoiseInterference NoiseSignal-to-Noise RatioBit Error RateError AllocationError Correction

    Radio Transmitter Radio Receiver

    Radio Transmitter and Receiver Attributes

    Modulation - name of modulation table used to look up the bit error

  • 8/12/2019 Modeler Day2 (reupload)

    85/118

    copyright 2001 OPNET Technologies, Inc.

    85

    prate (BER) as a function of effective signal to noise ratio

    Channel - specifies the number and attributes of the channels in thetransceiver Noise figure - represents the effect of thermal noise on radio

    transmission (receiver only) Ecc threshold (err/bits) - specifies the highest proportion of bit

    errors allowed in a packet in order for the packet to be accepted by areceiver (receiver only)

    ... model - these attributes specify the various Transceiver PipelineStage models used

    Radio Channel Attributes Data rate (bps) - rate at which data may be transmitted or received

  • 8/12/2019 Modeler Day2 (reupload)

    86/118

    copyright 2001 OPNET Technologies, Inc.

    86

    Packet formats - determines the types of packets a channel cantransmit or receive

    Bandwidth (KHz) - specifies bandwidth of channel Min frequency (MHz) - specifies the base frequency of the channel Spreading code - used to specify a user-assigned code for the

    channel Power (W) - transmission power of packets transmitted through this

    channel (transmitter only)

  • 8/12/2019 Modeler Day2 (reupload)

    87/118

    Mobile Node Trajectories

    A trajectory is the path a mobile node moves along during simulation

  • 8/12/2019 Modeler Day2 (reupload)

    88/118

    copyright 2001 OPNET Technologies, Inc.

    88

    Trajectories can be created using the Define Trajectory selection in

    the Network pull down menu. During simulation, the mobile node follows the trajectory by

    traveling in a straight line from one defined position to the next. Once the simulation time exceeds the last specified time in the

    trajectory file, the mobile node remains at its final position.

    Defining a Trajectory1. Choose Define Trajectory

    from Network pull downmenu

  • 8/12/2019 Modeler Day2 (reupload)

    89/118

    copyright 2001 OPNET Technologies, Inc.

    89

    Mobile nodes support an attribute called trajectory which specifies the nameof an ASCII text file defining the path of the mobile node during thesimulation.

    2. Set the Trajectoryattributes to the desiredvalues.

    menu

    3. Click on Define Path.

    5. Left-click in the work space todefine intermediate positions for themobile node.

    4. Left-click at somelocation in the ProjectEditor to begin thetrajectory.

    Defining a Trajectory Continued6. Define Trajectory

    Segment Information

  • 8/12/2019 Modeler Day2 (reupload)

    90/118

    copyright 2001 OPNET Technologies, Inc.

    90

    8. Click on complete tofinish the trajectorycreation process.

    7. Left-click in the work space to

    define more intermediate positionsfor the mobile node.

    9. Type in a trajectoryname. Click OK tosave the trajectory.

    Satellite Nodes

    Satellite nodes model network elements in orbit around the earth, such as

  • 8/12/2019 Modeler Day2 (reupload)

    91/118

    copyright 2001 OPNET Technologies, Inc.

    91

    satellites and spacecraft

    Like mobile nodes, satellite nodes cannot be connected by point-to-pointand bus links because they change positions during a simulation Satellite nodes change position based on an assigned orbit or by direct

    changes to the nodes position attributes.

  • 8/12/2019 Modeler Day2 (reupload)

    92/118

    Lab Description

    This lab will model a mobile paging system.

  • 8/12/2019 Modeler Day2 (reupload)

    93/118

    copyright 2001 OPNET Technologies, Inc.

    93

    Parameters: Telephones initiate pages addressed to a specific mobile pager The pages are relayed through a central base station A radio tower broadcasts the pages If the appropriate mobile pager receives the page, an ack is transmitted back to

    the radio tower The radio tower relays the ack back to the base station and a successful page

    statistic is recorded

    Lab : Overview Create the acknowledgement and page packet formats

  • 8/12/2019 Modeler Day2 (reupload)

    94/118

    copyright 2001 OPNET Technologies, Inc.

    94

    Create the necessary antenna pattern, PDF, and link parameter models

    Use the provided node models and the newly created parameter models to build the mobile paging network

    Configure the radio transmitters and receivers

    Create trajectories for the mobile pagers

    Choose results, run the simulation, and view the results

    Lab : Node Specifications

    Telephone Node Specification

  • 8/12/2019 Modeler Day2 (reupload)

    95/118

    copyright 2001 OPNET Technologies, Inc.

    95

    Generates pages based on a custom PDF Determines destination of page based on a custom PDF Encapsulates an ack in the page Sends the pages on the single output port to the base station

    Lab : Node Specifications (cont.)

    Base Station SpecificationR i f i h i

  • 8/12/2019 Modeler Day2 (reupload)

    96/118

    copyright 2001 OPNET Technologies, Inc.

    96

    Receives pages on one of eight input ports

    Receives acks on one input port (paired with the output port) and records the Percentage of Successful Pages (i.e., the number of acks received/ pages sent)

    Radio Tower Specification Receives pages from the Base Station via an input port and broadcasts them to

    the mobiles Receives acks from the mobiles and forwards them to the Base Station via an

    output port

  • 8/12/2019 Modeler Day2 (reupload)

    97/118

    Lab : Create Packet Formats

    Open the Packet Format Editor C t k k t f t t i i 2 fi ld

  • 8/12/2019 Modeler Day2 (reupload)

    98/118

    copyright 2001 OPNET Technologies, Inc.

    98

    Create ack packet format containing 2 fields

    Source Node (64 bits) Destination Node (64 bits)

    Save as _ack_packet

    Lab : Create Signal Packet Formats Open the Packet Format Editor Create page packet format containing 3 fields

  • 8/12/2019 Modeler Day2 (reupload)

    99/118

    copyright 2001 OPNET Technologies, Inc.

    99

    Source Node (64 bits)

    Destination Node (64 bits) Encapsulated ack packet

    Be sure to name the encapsulated packet field Ack Packet as the process model in the pager that will send the acknowledgement to the base station is written to look for that namein the received packet.

    Save as _page_packet

    Lab : Create Antenna Pattern1

    2

  • 8/12/2019 Modeler Day2 (reupload)

    100/118

    copyright 2001 OPNET Technologies, Inc.

    100

    Create an antenna pattern for theradio tower. Number of phi planes = 10 Phi planes 90 to 162 degrees =

    10 db Phi plane 72 degrees = -5 db

    Save as _page_ant

    4

    5

    3

    Lab : Create Link Model Create a link model that supports the recently created packets and that

    represents a 16,384 bits/sec link.

  • 8/12/2019 Modeler Day2 (reupload)

    101/118

    copyright 2001 OPNET Technologies, Inc.

    101

    Select File , New , Link Model . Configure the link:

    Link types supported: ptsimpand ptdup

    Attributes = Values packet formats = ack_packet and

    page_packet data rate = 16,384 bits/sec ecc model = dpt_ecc error model = dpt_error propdel model = dpt_propdel txdel model = dpt_txdel

    Save as _page_link

    Lab : Create Destination PDF Create Page Destination PDF Select File New PDF Editor

  • 8/12/2019 Modeler Day2 (reupload)

    102/118

    copyright 2001 OPNET Technologies, Inc.

    102

    Select File, New, PDF Editor

    Determines which mobile pager is the destination The mobile pagers receive pages according to the following distribution:

    Mobile 0: 50% Mobile 1: 15% Mobile 2: 25% Mobile 3: 10%

    Use Add Impulse action button

    Normalize PDF

    Save As:

    _page_dest_pdf

  • 8/12/2019 Modeler Day2 (reupload)

    103/118

    Lab : Node Descriptions

    In the interest of time, we (OPNET) have created all the nodes required forthis lab based on the specifications outlined at the beginning of this

  • 8/12/2019 Modeler Day2 (reupload)

    104/118

    copyright 2001 OPNET Technologies, Inc.

    104

    p g gchapter.

    The next several slides focus on discussing the approach and logic thatwent into the development of the nodes and the process models.

    Although the students will not have time in this course to develop thesenodes themselves, we (OPNET) encourage everyone in the class to attemptto build these models at a later date as a good skill-building exercise.

    Lab : Paging Network Model Example

    Open the project page_net

  • 8/12/2019 Modeler Day2 (reupload)

    105/118

    copyright 2001 OPNET Technologies, Inc.

    105

    Lab : Telephone Node Model Description

    Added an Ideal Generator to generate page packets with the Page Interarrival PDF [Note - We used a PDF similar to the one built earlier in

  • 8/12/2019 Modeler Day2 (reupload)

    106/118

    copyright 2001 OPNET Technologies, Inc.

    106

    this lab.] Created a Source ID attribute to determine the origin of the page Created a process model that will set the fields of the page packet and

    encapsulate an ack packet

    Lab : Base Station Node Model Description

    Added 8 receivers for incoming telephone lines Added 1 transceiver pair for communication with the radio tower

  • 8/12/2019 Modeler Day2 (reupload)

    107/118

    copyright 2001 OPNET Technologies, Inc.

    107

    p

    Created a process model that will forward pages to the radio tower, receiveacks, and record the Percentage of Successful Pages

  • 8/12/2019 Modeler Day2 (reupload)

    108/118

    Lab : Mobile Node Model Description Created a process model with a custom attribute Mobile ID. This process

    compares the Destination ID of the packet with Mobile ID andd l t d t th k if th l

  • 8/12/2019 Modeler Day2 (reupload)

    109/118

    copyright 2001 OPNET Technologies, Inc.

    109

    decapsulates and returns the ack if they are equal.

    Configured the transceivers to receive pages and transmit acks onfrequencies matching the towers

    Configured the antenna module to use an isotropic antenna

  • 8/12/2019 Modeler Day2 (reupload)

    110/118

    Lab : Viewing the Results

    Under the Results pull -down menu, select View Results and thenunder Global Statistics view % of Packets Successfully Transmitted .

  • 8/12/2019 Modeler Day2 (reupload)

    111/118

    copyright 2001 OPNET Technologies, Inc.

    111

    Lab : Added Challenge

    If you have additional time, try any one or more of the following Modify the model to include 4 additional telephones

  • 8/12/2019 Modeler Day2 (reupload)

    112/118

    copyright 2001 OPNET Technologies, Inc.

    112

    Modify the model to include 4 additional pagers with pages evenly distributedamong all 8

    Modify the model to include another base station that shares the same radiotower (Hint: Modify the ack packet format)

    The added challenges are not dependent on one another

    Radio Features

    TMM: (Terrain Modeling Module) The Terrain Modeling Module allows users to take into account terrain and

    i l ff h d li i l k

  • 8/12/2019 Modeler Day2 (reupload)

    113/118

    copyright 2001 OPNET Technologies, Inc.

    113

    environmental effects when modeling wireless networks. With TMM, the user can import elevation maps that contain terrain data. Supported map formats are DTED and DEM. TMM also allows the user to select and compare signal loss from various

    propagation models.

    Simulation Efficiencies DRG

    Dynamic Receiver Group

    Parallel Processing

    Lab: Using TMM

    Switch to the scenario called TMM

  • 8/12/2019 Modeler Day2 (reupload)

    114/118

    copyright 2001 OPNET Technologies, Inc.

    114

    Lab: Viewing a Terrain Profile Using the Terrain Profile, you can view signal strength loss from a

    transmitter to a receiver.

  • 8/12/2019 Modeler Day2 (reupload)

    115/118

    copyright 2001 OPNET Technologies, Inc.

    115

    Lab: Running a Simulation with TMM Select Configure Simulation. Check the box entitled, Use TMM.

  • 8/12/2019 Modeler Day2 (reupload)

    116/118

    copyright 2001 OPNET Technologies, Inc.

    116

    Lab: Viewing Results of TMM Under the Results pull -down menu, select View Results and then

    under Global Statistics view % of Packets Successfully Transmitted .

  • 8/12/2019 Modeler Day2 (reupload)

    117/118

    copyright 2001 OPNET Technologies, Inc.

    117

    Summary Radio models depend on dynamically changing parameters, which the

    simulation evaluates to determine the possible connectivity between allradio transmitters and receivers

  • 8/12/2019 Modeler Day2 (reupload)

    118/118

    copyright 2001 OPNET Technologies, Inc.

    118

    radio transmitters and receivers.

    Modeler provides the user the ability to simulate the movement of mobilenodes along trajectories and satellite nodes in orbit.

    The antenna, PDF, link and packet editors further expands the userscapability to define and customize parameters that affect the behavior ofthe model.