Connecting simulated machines over a simulated Ethernet connection is done by
creating a link using one of the components in the eth-links module:
ethernet-cable, ethernet-hub or ethernet_switch. Any of these components
can connect to the Ethernet devices of the simulated machines. They model
Ethernet at the frame level, in that they perform delivery of complete frames
sent from one device to another, and do not model collisions or lower-level
signaling details. Each of the three Ethernet links has its own particularities:
As all three models work more or less at the frame level; they can be used for any type of Ethernet connection, without limitations due to speed or technology. Traffic sent over the link can be anything, including TCP/IP or any other protocol stack that works on top of Ethernet. The link does not need to be configured for the intended use.
The three components are provided in the eth-links module. They can be
manipulated in the same way as any other component: after loading eth-links,
the create-ethernet-cable/hub/switch commands are made available. They create
non-instantiated components:
simics> load-module eth-links
simics> create-ethernet-hub
Created non-instantiated 'ethernet-hub' component 'ethernet_hub0'.
The name will be automatically chosen by Simics unless it is provided as an argument to the command:
simics> create-ethernet-hub my_ethernet_hub
Created non-instantiated 'ethernet-hub' component 'my_ethernet_hub'.
When a link component has been created, it is possible to connect the network
devices by running the connect command for each Ethernet port. For
demonstration, we will use x86 machines from the QSP-x86 package. Start the
simulation with the firststeps-multi.simics start script and run the following
commands:
simics> load-module eth-links
simics> create-ethernet-hub my_ethernet_hub
Created non-instantiated 'ethernet_hub' component 'my_ethernet_hub'
simics> connect board0.mb.sb.eth_slot my_ethernet_hub.device0
To find a connector which is not connected for ethernet_cable/hub/switch
components the get-free-connector command can be used. This command returns
the name of a free connector:
simics> my_ethernet_hub.get-free-connector
"my_ethernet_hub.device1"
Together the get-free-connector and connect commands can be used to connect
an Ethernet device to a free connector:
simics> connect (my_ethernet_hub.get-free-connector) board1.mb.sb.eth_slot
Now, when all of the components of the system are configured and connected together, instantiate the link components:
simics> instantiate-components
It is also possible to create instantiated links with the
new-ethernet-cable/hub/switch commands, but note that this only works if there
is already at least one instantiated top-level component in the simulation.