Network emulation: Difference between revisions

From Grid5000
Jump to navigation Jump to search
mNo edit summary
Line 4: Line 4:
= Introduction =
= 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.
The Grid'5000 network is built with '''high-performance network hardware''' and dedicated network links. This way, the infrastructure 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.
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.

Revision as of 16:07, 8 March 2021

Introduction

The Grid'5000 network is built with high-performance network hardware and dedicated network links. This way, the infrastructure 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. Emulation allows to artificially degrade network performance to a desired level, while still using real hardware and a real network (unlike simulation).

The main network parameters that can be emulated are bandwidth, latency, and packet loss. Of course, these parameters can only be made worse than what the real network provides: if the base latency between two nodes is 5 milliseconds, emulation will not be able to provide a lower latency than this.

After reviewing simpler alternatives, this tutorial walks through two main methods to setup network emulation in Grid'5000: one using netem (the Linux NETwork EMulator) directly, and the other one using high-level tools such as distem and enoslib. These high-level tools add a layer of abstraction, but under the hood they also use netem to setup network emulation.

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 obtain higher latency using multiple geographical sites.

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 the sites of Nancy and Rennes 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.

Basic network emulation with netem

Reserve nodes and use netem to emulate network conditions on it.

Use-case

Use-case: apply emulation directly on the nodes of your experiment.

Insist on egress emulation (much easier to do than ingress emulation, and often enough).

It means a node will have a specific latency/bandwidth constraint towards all other hosts (other nodes, DNS server, home NFS...)

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.