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 10.10.0.50 and the other one 10.10.0.51. 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.

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

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

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

                    Latency : 10 us
               Distribution : local
                  Filtering : enabled

Devices:
              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 10.10.0.51
PING 10.10.0.51 (10.10.0.51): 56 data bytes
64 bytes from 10.10.0.51: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 10.10.0.51: icmp_seq=1 ttl=64 time=0.0 ms

--- 10.10.0.51 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