netSim - The Sienda AVB Network Simulator

Sienda netSim is an AVB network simulator for windows 10, macos, linux and qnx. It simulates AVB networks either in realtime, or optionally, as fast as possible. Realtime simulation is useful for AVB device developers as the simulated network can be bridged to a real AVB network to provide a large network for developing, testing and profiling. 1

Non-realtime simulation is useful to perform protocol diagnostics, profiling or automated testing in a purely simulated environment. Simple simulations run faster-than-realtime to produce results in seconds (that would take many minutes, hours or days at realtime). Large networks comprising thousands of devices, switches and links can be simulated at slower-than-realtime, to provide insight into large network operation.

Contents

Quick Start Introduction

netSim is a command line application. Unzip the archive you have received from Sienda in to a convenient folder, open your terminal, cd in to the netSim folder and run netSim. (netSim.exe on Windows).

% cd netSim
./netSim

You will be greeted by the netSim command processor:

netSim - AVB Network Simulator
Copyright 2021 Sienda Multimedia Ltd
>

The command processor is used to control the simulation. Commands may be entered one-by-one at the command processor prompt, or batched together in a file and executed as a script.

To get something up and running quickly let’s instanciate an AVB endpoint entity in the simulator. To do this we use the createEntity command, which has the following syntax:

createEntity entityName entityXMLFile

The entityName is a name that you wish to give the entity within the context of the simulator, and is used later when you connect other devices to the entity or when you make virtual ethernet links to the entity’s port(s). This name will not be visible outside the simulator (it is NOT the AVDECC entity name).

The entityXMLFile is the XML file containing the AVDECC entity model and other data associated with the entity.

Let’s create an entity called loudspeaker from the XML file loudspeaker.xml located in the xml folder:

>createEntity loudspeaker xml/loudspeaker.xml
created entity loudspeaker.
>

We have now instanciated a virtual entity in the simulator. To list the entities use the listEntities command:

>listEntities
 entity name     | nb ports
loudspeaker      |  1
>

Here we can see the entity loudspeaker we have just created, and we see that it has one (virtual) ethernet port.

At this stage the simulation is not running, so nothing will happen. To start the simulation, use the start command:

>start
Simulation started
>

Now the simulation is running! But the endpoint entity (the loudspeaker) is not connected to anything, so it’s not really much use. Let’s connect it to a real physical ethernet port on the host computer, so we can interact with the simulated entity.

To list the physical network interfaces on your computer use the listInterfaces command:

>listInterfaces
>listInterfaces
0. en0 (No description available)
1. awdl0 (No description available)
2. llw0 (No description available)
3. lo0 (No description available)
>

Depending on the platform you are running on the output may look different. To connect a physical network interface we use the connectHost command, which has the syntax:

connectHost interfaceName entityName entityPort

We would like to connect en0 of our local machine to the loudspeaker entity we have running in the simulator, so we use:

>connectHost en0 loudspeaker 0
connected host port en0 to entity loudspeaker port 0
>

Now if we fire up Hive (or any other AVB controller) you can see the virtual entity on the network:

You can interrogate the entity from the controller, and if you have some real AVB devices on the network you can now connect up a stream between a real AVB device and the simulated loudspeaker.

Diving deeper, wiring up a virtual network, and running a script

Now that we have simulated a simple ‘network’ with just one device and an external controller, let’s look at a more complex example with a few devices and a switch.

To reset the simulator, enter the reset command. This resets the simulator to its initial state.

>reset
simulation stopped
disconnected host port
simulator reset
>

You now have a blank canvas again.

We are now going to instanciate two virtual loudspeakers and one virtual mixer, and connect them all to a virtual switch. The commands to create the entities we require are:

createEntity loudspeaker1 xml/loudspeaker.xml
createEntity loudspeaker2 xml/loudspeaker.xml
createEntity mixer xml/mixer.xml
createEntity switch xml/br.xml

The last one creates a switch/bridge entity from br.xml. This entity has 48 ports and supports software switching. It’s a virtual 48 port switch.

To connect up the entities we need virtual ethernet cables, or links. The createLink command is used for this. Its syntax is:

createLink entityName entityPort entityName entityPort

To connect loudspeaker1 to the switch we use:

createLink loudspeaker1 0 switch 1

It doesn’t matter which device you specify first. Alternatively you could have entered:

createLink switch 1 loudspeaker1 0

Both connect ethernet port 0 of the loudspeaker to ethernet port 1 of the switch. (We’ll reserve port 0 for the host connection).

Now we must do the same for loudspeaker2 and mixer:

createLink loudspeaker2 0 switch 2
createLink mixer 0 switch 3

Finally we connect the host port to switch port 0 and start the simulation:

connectHost en0 switch 0
start

Now check in hive and you should see all the devices. Please note that the switch is also shown in hive as it implements AVDECC and is discoverable.

Command Summary

Commands are case sensitive.

command parameters description
listInterfaces   list the physical network interfaces on the host computer
listEntities   list the virtual entities that are active in the simulator
start   start the simulation
stop   stop the simulation
quit   quit netSim
createEntity name entityXMLFile [nbEntites] create a virtual entity identified by the name name from the xml file entityXMLFile. nbEntities may be specified if multiple entities should be created
destroyEntity name destroy the entity name
connectHost interfaceName entityName entityPort connect the physical network interface interfaceName on the host computer to virtual entity entityName port entityPort. entityPort is a zero-based index
createLink entityName entityPort entityName entityPort creates a link (a virtual ethernet cable) between two ports in the simulation. The link connects the first entity entityName port entityPort to the second entity entityName port entityPort
waitFor microseconds pauses the command processor for microseconds microseconds. Note this does NOT pause the simulation, only the command processor, so it may be used to insert waits in scripts
trueTime 0|1 disables/enables trueTime mode. When trueTime mode is enabled (1) the simulation will attempt to run in realtime. This allows the simulated network to bridge to a real network in real time (on supported platforms1). When trueTime mode is disabled (0) the simulation will run ‘as fast as possible’, allowing small simulations to complete very quickly, and also allowing extremely large simulations.
run file run a script file named file. This file can have any (or no) extension and should be plain text with a separate command on each line. Please see the section on script files for more info.
reset   resets the similator to its initial startup state. This will destroy all entities and links, and remove any host interface connection. MAC address assignments will be reset, and global time will reset. This can be useful for running several scripts sequentially (possibly from another script)
  1. Although simulations can be run in realtime on all plaforms, only qnx (ti/dm814x, denverton/iegbx) and linux (i210/igb) provide an AVB capable bridge to a physical network. Windows and macos simulators can still bridge AVDECC/MRP etc but will not provide an asCapable link between the simulated network and physical network.  2