Simics supports four types of connections to connect virtual target boards with real physical networks.
1). port forwarding:Port forwarding
2). layer-2 bridging:Ethernet bridging connection
3). layer-3 routing:IP routing connection
4) Direct host connection:Host connection
The most convenient and commonly used method is direct host connection. This method uses the tap interface to connect a virtual target board to a real physical network.
Take Ubuntu as an example. First install tunctl.
Sudo apt-Get install UML-utilities
Currently, most Linux distributions have their own/dev/NET/TUN devices.
Make sure that/dev/NET/TUN can read and write all programs.
Sudo chmod 0666/dev/NET/TUN
Create a tap interface named sim_tap0 and allow the account with the username foobar to perform operations.
Here, the foobar account is a user who uses the simics program.
Sudo tunctl-T sim_tap0-u foobar
Configure and activate the IP address and subnet mask of the sim_tap0 network interface.
Sudo ifconfig sim_tap0 10.10.0.10 netmask running 255.255.0 up
Open the simics command line window and enter the following command to achieve connectivity:
Simics> connect-real-Network-host interface = sim_tap0
[Rn0.rn info] connecting to existing tun/TAP device 'sim _ tap0' <br/> 'ethernet _ switch0' connected to real network. <br/> enabling DNS lookup on real network. <br/> adding default route to 10.10.0.10 in service-node' <the STD-service-node 'service _ node_cmp0'>'
Then you can implement any form of network communication from the host or simics virtual machine, such as ping and FTP.
PS: The above instance assigns the IP address of the 10.10.0.x network segment to the host's tap interface. This address must be in the same network segment as the gateway simulated by simics's service node.
The gateway IP address is defined in the add-eth-link.include file in the target/common directory where the simics-base installation directory is located.
If not defined service_node_ip_address {$ service_node_ip_address = "10.10.0.1 "}