Objective
This tutorial provides a quick introduction to
System-in-the-Loop (SITL) functionality, which allows
physical hardware and a simulation to interact as a
unified system. It shows how you can use SITL to do
the following:
• Allow physical hardware to interact with a
simulation
• Allow multiple physical networks to communicate
through a simulation
After you finish this tutorial, you will know how to use
Modeler and SITL to incorporate physical hardware in
a simulation.
1
Before You Begin
To do this tutorial, you should:
• Know how to use Modeler to build network
models and run simulations
• Know how to configure Ethernet interfaces and
firewalls on your computer
2
— A third interface might be needed to let
Modeler contact an OPNET license server
(not needed if a license server is running on
the local computer or if Modeler is running in
Standalone license mode)
Note—Each network interface card (NIC) used for
a SITL interface must be compatible with the
Pcap library that SITL uses to capture and send
packets. You can check for supported cards at the
website for the Pcap library used by SITL:
Winpcap on Windows (www.winpcap.com) and
libpcap on Linux (www.tcpdump.org). (SITL prints
the Pcap library version being used at the
beginning of each simulation.)
• One or two additional computers to represent the
physical hardware in the simulations
3
Tasklist
The tasks you will perform in this tutorial comprise the
following procedures:
• Task 1—Preparing the simulation environment
— Preparing the hardware
— Preparing the Modeler software
• Task 2—Creating a Real–Sim Scenario
— Creating the simulated network
— Running the simulation
— Sending packets through the simulation
• Task 3—Creating a Real–Sim–Real Scenario
— Creating the simulated network
— Running the simulation
— Sending packets through the simulation
4
Preparing the Simulation Environment
In this task, you will set up Modeler and the computers
to be used so that they are ready to run a SITL
simulation.
License
server
5
• Real2—Represents a second physical network
or piece of hardware. Required only for the
Real–Sim–Real scenario.
• License server—Required only if Modeler
needs a remote license server. (We
recommend using a local license server or
running Modeler in Standalone license mode.)
Note the following:
• All computers must be able to communicate
with each other as indicated by the links in the
preceding figure. The links are Ethernet
connections, either direct or through a network.
• The SITL computer must be running a version
of Windows or Linux supported by Modeler and
SITL. Real1 and Real2 can be running any
operating system.
6
2.2 If the SITL computer is running Windows,
disable Netbios over TCP/IP and all items on
the connection except “Internet Protocol
(TCP/IP)”.
7
Prepare the Modeler Software
SITL models are not included in the default repository,
so you must disable the use of repositories. This will
cause all models to be rebuilt the first time you run a
simulation.
1 Start Modeler.
8
Real–Sim Scenario
This scenario models communications between two
computers. One computer is the physical computer
Real1. The other computer is a workstation modeled in
a simulation running on the SITL computer. The
simulation will comprise two nodes, one representing
the connection to the physical computer and the other
being the simulated workstation.
Real–Sim Scenario
Real 1 SITL
9
Build and Configure the Simulated Network
You already have the Real1 and SITL computers
connected to each other. Now you’ll create the
simulated network that will run on the SITL computer.
10
5 Locate the link model called sitl_virtual_eth_link
and use it to connect the sitl gateway node to the
wkstn node.
➥ The network model should now resemble the
following figure.
Real–Sim Model
11
7.2 Set the Incoming Packet Filter String
attribute to (arp or icmp) and ether src
<SOURCE_MAC_ADDRESS>, where
<SOURCE_MAC_ADDRESS> is the MAC
address of the interface on Real1 that will be
sending packets to SITL.
12
8.2 Expand the Ethernet > Ethernet
Parameters tree and set the Address
attribute to 3 (or any single-digit number
greater than zero). Some real systems don’t
like zero for Ethernet addresses and using a
small number will be useful in debugging
later on. Like all Ethernet addresses, this
should be unique in your system.
13
Run the Simulation
You now are ready to configure and run the simulation.
While the simulation is running, you will test it by
pinging the simulated workstation from the external
computer (Real1) and observing the response.
14
3.2 In the Global Attributes pane, expand
Simulation Efficiency and disable
ARP Sim Efficiency.
5 Click Run.
➥ After the model library has been recompiled,
the simulation runs. You should get output
similar to the following figure.
15
Simulation Progress Output
16
Simulation Console Output
17
Send Packets Through the Simulation
To demonstrate that the physical hardware and
simulated workstation are working together as a single
network, ping the simulated workstation from Real1
and view the response.
If you don’t get any replies to the ping, verify that you
have configured everything correctly. If necessary, look
at the Troubleshooting SITL Simulations section in the
SITL User Guide. You can observe the packets being
sent with a packet capture utility such as Wireshark or
by running the simulation with the OPNET Simulation
Debugger (ODB) enabled and turning on SITL tracing
(with the ltrace sitl command).
18
Real–Sim–Real Scenario
This scenario models communications between two
physical nodes by way of a simulated network. The
model will comprise three nodes, two representing the
physical hardware (with a SITL interface for each) and
the third being a simulated network switch.
Real–Sim–Real Scenario
19
Build and Configure the Simulated Network
To create the simulated network for this scenario, you’ll
duplicate the previous scenario, change the
workstation to a switch, and add a second SITL
interface to connect to the Real2 computer.
20
5 Locate the node model called
sitl_virtual_gateway_to_real_world and drop a
new instance of this model into the workspace.
Name it sitl2.
22
Run the Simulation
You now are ready to configure and run the simulation.
While the simulation is running, you will test it by
streaming video through the simulated switch from one
external computer to the other.
4 Click Run.
➥ The simulation runs. You should get output
similar to the following figure.
23
Simulation Progress Output
24
Simulation Console Output
25
Send Packets Through the Simulation
To demonstrate that the simulated switch is routing
traffic between the two physical computers, you can
stream video from Real1 to Real2 through the SITL
simulation.
27
VLC Media Player Setup for MP1: Open File
28
VLC Media Player Setup for MP2: Streaming Video
30
Summary
You’ve seen how to use System-in-the-Loop
functionality to map physical interfaces to addresses in
a simulated network. In this tutorial, you have
• Build and run a SITL system in which physical
hardware interacts with a simulation
• Build and run a SITL system that allowed multiple
physical networks to communicate through a
simulation
31