Simics can simulate several computers in the same session, and connect them together using simulated Ethernet links.
Before reading on, launch the
firststeps-multi.simics configuration: in the File
menu, select New Session from Script and select
the qsp-x86\firststeps-multi.simics file as a start
script. This configuration contains two identical QSP-x86 machines.
Simics will simulate both machines in the same session, keeping them
synchronized.
Boot the two simulated machines by starting the simulation:
simics> c
The machines' network cards will not be connected to any media. The machines will not have any Internet Protocol (IP) addresses assigned either. As a result, an attempt to ping one of the machines from the other will fail.
The eth-links module provides several ready-to-use simulated network models. The simplest is the ethernet-hub which is a simple cloud, or hub, to which any number of Ethernet devices can be connected to and talk together. Other variants include an Ethernet cable, with only two ends, and an Ethernet switch, that will act somewhat like a real Ethernet switch, sending packets to the right destination whenever it can.
simics> stop simics> load-module eth-links simics> new-ethernet-hub Created instantiated 'ethernet_hub' component 'ethernet_hub0' simics>
Next, let us connect the simulated network cards to the hub:
simics> connect board0.mb.sb.eth_slot ethernet_hub0.device0
simics> connect board1.mb.sb.eth_slot ethernet_hub0.device1
simics> ethernet_hub0.link.status
Status of ethernet_hub0.link [class eth-hub-link]
=================================================
Effective latency : 10.0 ms
Connected devices : ('board0.mb.sb.phy', 'board0.cell')
('board1.mb.sb.phy', 'board1.cell')
simics> c
Once the simulation is resumed the machines will get IPv6 link-local addresses assigned automatically. It should now be possible to ping between the two simulated machines. Enter the following command in the first machine.
~# ping6 -c 3 -I enp0s25 fe80::217:a0ff:fe00:1 PING fe80::217:a0ff:fe00:1(fe80::217:a0ff:fe00:1) from fe80::217:a0ff:fe00:0 enp0s25: 56 data bytes 64 bytes from fe80::217:a0ff:fe00:1: icmp_seq=1 ttl=64 time=20.1 ms 64 bytes from fe80::217:a0ff:fe00:1: icmp_seq=2 ttl=64 time=20.1 ms 64 bytes from fe80::217:a0ff:fe00:1: icmp_seq=3 ttl=64 time=20.1 ms --- fe80::217:a0ff:fe00:1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 20.190/20.191/20.192/0.000 ms ~#
Network simulation is covered in more details in chapter 3.