2.2 Ethernet VLAN Switch 2.4 IP Services
Ethernet Networking Technology Guide  /  2 Network Simulation  / 

2.3 Link Object Timing

All frames that are sent over a link are delivered to the receiving devices after a small delay. The delay is the same for every frame, and is called the latency of the link. Each link object has a goal_latency configuration parameter that controls the ideal latency the link wants to obtain.

Link objects are most often used to communicate between network devices using separate clocks. Due to the way Simics handles simulated time, different clocks are not always completely synchronized. In order to avoid nondeterministic simulation, the link latency must be high enough that any data sent over the link will never reach the recipient at a point in time it has already passed. This imposes a lower boundary on the latency, called the minimum latency of the link. The value of the minimum latency depends on the simulation setup, in particular whether the simulation is multithreaded or distributed across several Simics processes. See chapter Scaling Simics of the Simics User's Guide for more information about links and latencies.

The latency of a link can be specified in the create-ethernet-cable/hub/switch command as a time in seconds. If the latency of a link is set too low, it will be automatically adjusted to the lowest value allowed by the setup when the component is instantiated. For example, when creating two instances of the QSP-x86 machine and connecting them to an Ethernet link with a too low latency, Simics will adjust the latency automatically. Let us look at an example with the firststeps-multi.simics script. It uses the new- command to create instantiated components instead of the create- variant:

simics> load-module eth-links
simics> new-ethernet-hub goal_latency = 0.000001
Created instantiated 'ethernet_hub' component 'ethernet_hub0'
simics> connect board0.mb.sb.eth_slot ethernet_hub0.device0
simics> connect board1.mb.sb.eth_slot ethernet_hub0.device1

The effective latency of a link can be displayed by the status command provided by the link object. The actual Ethernet links are not created until the components are instantiated. To get access to the Ethernet link implementation, just request the link object in the component:

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')

Note the higher effective latency the link obtained, despite a goal latency of 1us. The default latency can be adjusted using the set-min-latency command.

2.2 Ethernet VLAN Switch 2.4 IP Services