Previous - Up - Next

4.9   Simple Virtual Network

Simics can simulate several machines simultaneously. These machines can be connected together using a simulated Ethernet link.

This chapter uses a different launch configuration than the rest of the First Steps chapters. Before continuing, launch the ebony-linux-firststeps-multi.simics configuration.

joe@computer: simics-workspace$ ./simics targets/ebony/ebony-linux-firststeps-multi.simics

This configuration contains two similar machines, with their own CPU. Simics will run the machines synchronized, by executing some instructions on one CPU and then switch to the other.

Boot the two simulated machines by starting the simulation.

simics>  c

One of them will be assigned the Internet Protocol (IP) address and the other one If you try to ping from one of the machines to the other, it will fail. This is because the two machines have not yet been connected to the simulated network.

An Ethernet link is simulated using ethernet-link module. You can connect any number of simulated network cards to the link.

simics>  new-ethernet-link
[ethlink0 info] Adjusting latency to 1e-05 s [...]
Created ethernet-link ethlink0

Next, we must connect the simulated network cards to this link:

simics>  ebony0_emac0.connect ethlink0
simics>  ebony1_emac0.connect ethlink0
Information about ethlink0 [class ethernet-link]

                    Latency : 10 us
               Distribution : local
                  Filtering : enabled

              Local devices : <0:0> ebony0_emac0, <1:1> ebony1_emac0
             Remote devices : none

Real network connection:
                  Connected : No
simics>  c

Now it should be possible to ping between the two simulated machines. Enter the following commands in the first machine.

root@firststeps: ~# ping -c 2
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from icmp_seq=1 ttl=64 time=0.0 ms

--- ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

root@firststeps: ~#

You can read more about network simulation in chapter 9.

Previous - Up - Next