Support more than 1 NIC connected to the TANSIV network
This was submitted for an "advanced" L3 internship. French description at the bottom.
Currently the changes in Qemu and the tansiv-client library only support 1 NIC per VM connected to the TANSIV network. However many server setups use 2 or more NICs. Examples of considered alternatives:
- adapt the TANSIV protocol to support more than 1 NICs on a same socket;
- adapt the tansiv-client library and its connection to Qemu without changing the TANSIV protocol.
Without changing the TANSIV protocol, the tansiv-client library should probably create a separate Context
(struct vsg_context
in C) for each NIC. Then those multiple contexts could be managed in different ways, e.g.:
- [simpler with tanqemu, not sure about tanproc (not even sure that it is useful)] dedicate one Qemu timer for each context and let Qemu run those timers in sequence at deadlines (which per the TANSIV protocol should be the same on all NICs);
- [more complex but maybe faster at runtime] create 1 thread per NIC, with subtleties to remain deterministic with Qemu TCG single-threaded mode;
- [even more complex but maybe faster at runtime than the first alternative and better CPU utilization than the second alternative, which is better to scale the number of VMs] rework the handling of sockets and deadlines using event-based programming.
Internship description in French
Contexte
Afin de simuler un environnement réseau réaliste pour un outil d'analyse dynamique de malware, nous nous penchons sur l'aspect performance du réseau environnant le malware analysé. Nous avons ainsi un prototype de couplage de l'émulateur de PC Qemu avec le simulateur de réseau à grande échelle Simgrid. Ce couplage passe par une bibliothèque écrite en Rust qui fait le lien entre une carte réseau émulée par Qemu et le simulateur de réseau.
Objectif
Le couplage actuel ne permet de connecter au simulateur qu'une seule carte réseau de l'émulateur, alors que des environnements de type serveur utilisent fréquemment plusieurs interfaces réseau. Parmi les options envisagées pour lever cette limitation, plusieurs consistent à modifier la bibliothèque Rust avec différents compromis entre simplicité des modifications, rapidité d'exécution, et utilisation de la ressource CPU.