In this session, we explored various aspects of networking and virtualization, including TAP devices, clone devices in Linux, static and dynamic routing, and practical implementations using QEMU. The goal was to gain a deep understanding of how VMs interact with network interfaces, create and manage virtual network devices, and implement routing algorithms.
This session was focused on practical implementations and theoretical understanding of networking and virtualization concepts. We covered the creation and management of TAP devices, understanding clone devices in Linux, and implementing both static and dynamic routing in virtualized environments using QEMU.
- TAP Devices: Creation and management, interaction with VMs.
- Clone Devices in Linux: Understanding their role, ioctl system calls.
- Static Routing: Implementation in VMs, using QEMU.
- Dynamic Routing: Algorithms and their implementation.
- Practical Scripts and Programs: Writing and executing scripts to manage virtual network interfaces.
-
tap_client_and_clone_device_example/: Contains the example project for TAP client and clone device.
- src/: Source files for the project.
- internet_checksum.c: Function to compute the internet checksum.
- reply_to_ping.c: Function to reply to ping requests.
- tap_device_client.c: Main program to create and manage TAP devices.
- tun_alloc.c: Function to allocate TUN/TAP devices.
- include/: Header files for the project.
- arp_protocol_handler.h: Definitions and structures for ARP.
- ethernet_frame_handler.h: Definitions and structures for Ethernet.
- icmp_protocol_handler.h: Definitions and structures for ICMP.
- ipv4_protocol_handler.h: Definitions and structures for IPv4.
- tap_device_client.h: Declarations for the TAP device client functions.
- obj/: Directory for object files.
- lib/: Directory for static libraries.
- Makefile: Makefile to build the project.
- tapClientScript.cmd: Script to test the TAP client.
- .editorconfig: Configuration file to ensure consistent coding styles.
- src/: Source files for the project.
-
README-Dynamic-Routing.md: Detailed guide on dynamic routing and its implementation in VMs using QEMU.
-
README-Networking_and_Virtualization.md: Comprehensive guide covering networking topologies, IP addressing, virtual network devices, and practical demonstrations using scripts and tools.
-
Tun-tap-osi-layers-diagram.png: Diagram illustrating the position of TUN/TAP devices in the OSI model.
During this session, we achieved the following:
- Explored TAP Devices: Learned how to create and manage TAP devices, which operate at Layer 2 of the OSI model, handling Ethernet frames.
- Clone Devices in Linux: Understood the concept of clone devices, how they are dynamically created using the
/dev/net/tun
interface, and how to interact with them using ioctl system calls. - Implemented Static Routing: Wrote and tested scripts to set up static routes in virtualized environments using QEMU.
- Implemented Dynamic Routing: Discussed dynamic routing algorithms, implemented them in a virtual environment, and tested their functionality.
- Practical Examples: Wrote and executed C programs and scripts to manage virtual network devices and simulate network environments.
By following this session's materials and guides, you should have a solid understanding of how VMs interact with network interfaces, how to create and manage virtual network devices, and how to implement both static and dynamic routing in a virtualized environment.