Network emulation

From Grid5000
Jump to navigation Jump to search

Introduction

The Grid'5000 network is built with high-performance network hardware and dedicated network links. This ensures that it can support demanding experiments that make heavy use of network resources.

However, some scientific experiments may actually require a lower-performance network. This is especially the case for experiments that target lower-performance network environments, such as Edge / Fog computing, Peer-to-peer networks, or public blockchains. In other cases, an experimenter may want to vary network parameters (such as latency or packet loss) to study the impact of these parameters on application performance.

Grid'5000 offers a variety of resources in several geographic areas, which may be enough in some cases to build an experiment with the desired level of performance. If more control on network parameters is required, then network emulation can be used instead.

TODO: what is emulation.

TODO: main parameters: bandwidth, latency and packet loss.

This tutorial walks through a few methods to setup network emulation in Grid'5000.

Alternatives to network emulation

Network emulation can be difficult to get right, so if there is a simpler way to obtain the required network parameters, it should be used first.

We describe two possible methods: how to obtain a specific link speed on a node, and how to use multiple sites to obtain higher latency.

Using nodes with a specific link speed

Nodes in Grid'5000 have network interfaces with different speed. For Ethernet, this is typically 1 Gbit/s, 10 Gbit/s, or 25 Gbit/s. See Hardware#Networking for a complete and up-to-date list.

Select a node with the desired interface speed, and if necessary follow the multi-NICs tutorial if the interface is not the first one.

In addition, it possible to force an interface to run at a lower speed: typically, force a 1 Gbit/s interface to run at 100 Mbit/s.

For instance, grisou nodes in Nancy have a secondary 1 Gbit/s interface called eno3. To set it up to 100 Mbit/s:

grisou$ sudo-g5k ethtool -s eno3 speed 100 duplex full autoneg off
grisou$ sudo-g5k ip link set eno3 up

You then have to make sure you are using this specific interface for your experiment: it means using KaVLAN if you want to isolate it, and configure appropriate routing.

Using two sites with high latency

Grid'5000 network

Grid'5000 has infrastructure in several geographical sites: see Grid5000:Network

As such, you can use nodes on two sites that are far apart, and this will result in natural network latency between groups of nodes. For instance, the latency between Nancy:Home and Rennes:Home is around 25 milliseconds.

There are several options to reserve nodes on different sites:

By default, nodes in different sites are not in the same Ethernet network: traffic goes through backbone routers. If you need direct layer-2 connectivity between your nodes, you can use a global VLAN that is propagated to all Grid'5000 sites.

Emulation with netem on a physical node

Reserve a physical node and use netem to emulate network conditions on it.

Emulation with netem on a physical node with Kavlan

Same idea, but physically separate networks.

Advanced network emulation tools

Deploy a topology in containers with distem or distrinet (based on mininet), which both support network emulation.

Automation with Enoslib

Enoslib is a generic solution where it is possible (in theory) to describe a topology and instantiate it on either Grid'5000 or distem.