Teaching Networking using Simics

By Jakob Engblom

Engblom_lgWind River Education Services provides user training for a variety of topics, including Wind River operating systems and tools, as well as more general topics like networking. Training always includes hands-on labs, which can complicate logistics for training sessions. Shipping boards and configuring networks is time-consuming and error-prone. For that reason, we are looking into using Simics as an alternative to physical hardware to streamline training logistics. It also makes it simple to encapsulate configurations, while maintaining the reality of cross-development. In this blog post, we will look at how Simics is used as a tool to facilitate network labs in the context of education.

To make an interesting lab, we need a few machines, connected over a few networks. The starting setup currently used is shown below:

Networking class setup

We have eight machines inside the Simics process, four used as routers ("Router N" in the picture, with yellow borders) and four used as end points for communications ("Target N" in the picture). These eight machines are connected using six Ethernet network links. In the real world, each such network link would have been an Ethernet switch, for a total of fourteen physical units.

One of the target machines connects out to the host to allow host-based software such as Wind River Workbench to control and monitor the operations. To monitor the traffic, we attach live Wireshark capture points to two of the simulated networks. Each Wireshark capture point is connected to a Wireshark process on the host, which gets the packets flowing in the simulation and presents them just as if they had been captured from an Ethernet interface on the host. This lets students monitor and investigate the traffic flows in the labs. Compared to using a regular network sniffer on a host interface, the Simics Wireshark trace does not require any administrative rights on the host – it is just a stream of data from one user-level process to another.

The target machines shown here are all Power Architecture-based Wind River SBC8548 boards. In their physical incarnation, these boards only expose two of the four Ethernet controllers on the MPC8548 SoC to the outside. In Simics, all four Ethernets are available for connection, as making that change in a model is very simple. In this setup, most of the targets run VxWorks, but a few also run Linux to make the network more heterogeneous and realistic. The software stacks running on the targets are complete OS stacks, the same as would be running had this lab been configured from physical boards and cables. This includes aspects like IPv4 and IPv6 network stacks, SNMP, routing protocol handlers, and higher-level software like web servers. This makes the labs very realistic, and allows us to teach how to use a particular real software stack if that is desired.

Since this setup is created by Simics scripts, it is very easy to change the topology or nature of the machines. For example, adding in more machines and networks, changing their architecture from the Freescale MPC8548 to another SoC or another instruction set architecture altogether. We could also mix different architectures in the setup to emulate the effects of a mixed-endian network or mixed-OS network.

With this setup, many different labs exercises can be performed, such as:

  • Policy based routing from the Linux targets to the VxWorks targets, making routing decisions based on network protocols used for traffic rather than IP addresses. For example, TCP could be routed over "Router 6" and UDP over "Router 5", by making routing changes on "Router 7".  
  • Dynamic routing protocols between subnets, by artificially disconnecting the link between "Router 7" and "Router 5". Such a network disconnect is trivial to achieve in Simics.
  • Watching the ARP broadcast distribution in the system when one of the Linux targets is trying to reach one of the VxWorks targets for the first time. 
  • Injecting packet streams from the host, running the pktgen utility, and inserting them in the Ethernet port of "Router 7" that is connected to the host machine. Other external traffic sources could also be used, such as IXIA and Agilent traffic generators. 
  • Simulating the effects of long-distance WAN links by introducing jitter, delays, and dropped packets on the network traffic on certain links. Simics can be used to provide a model of the world, not just a local lab, to add realism to the training.

With Simics, you get a "network in a box" that is ready to go at any training session, anywhere, without needing anything else but a laptop and a virtual machine image with Simics and the lab setups installed. This is using Simics as a tool to achieve the goal of teaching networking – users do not need to learn much about Simics at all, they can just start the session and get going on the labs with minimal overhead. The Simics setup is stable and does not need to be double-checked as a physical setup would.

Networking class screen cap

 In action, the setup can look like the above screenshot (using Simics 4.6 and the stand-alone GUI). Note the commands to set up network adapters and their IP addresses in the router serial consoles along the bottom (which is a task that is best scripted so that Simcis does it for you, although in a teaching setting it might be pedagogic to have the students do this manually once just to think about what they do). After this, a user would enter the routing commands manually to perform the configurations which are part of the labs.


For additional information from Wind River, visit us on Facebook.