Border Gateway Protocol (BGP) is the standard exterior gateway protocol designed to exchange routing and reachability information among autonomous systems (AS) on the Internet. It is the glue of the Internet and a fundamental part of its infrastructure.
The project provides fundamental Internet components implemented as Python classes, including:
- Internet exchanges
- Autonomous systems (AS)
- BGP routers
- DNS infrastructure
- A range of other services
These components serve as modular building blocks that users can assemble to construct their own programmable Internet emulations.
To run the emulator, ensure the following are installed on your system:
To enable the emulator code:
-
Add the project's root folder to the
PYTHONPATH
environment variable. -
Run the following command inside the root directory to temporarily set it:
source development.env
Only needed if you're having issues downloading Docker images (e.g., you're in Mainland China).
The emulator pulls Docker images from Docker Hub. If you encounter slow or failed downloads:
-
Use a Docker Hub proxy
📘 Follow the proxy setup instructions to configure your environment. -
If proxies are slow or unreliable, we recommend building the Docker images locally.
🛠️ Follow the local build instructions to build images directly on your machine.
Leverage the SDK to easily construct key internet infrastructure components:
- 🏢 Internet Exchange Points (IXPs)
- 🌐 Autonomous Systems (ASes)
- 🧭 DNS Infrastructure
(Root, TLD, and authoritative servers) - 💻 Host Systems and Networks
Create a Python script using the SDK to define your emulated internet.
📌 Example Use Case:
Build a mini internet with:
- 63 Virtual Machines
- 34 Networks
- 6 IXPs
- Full DNS infrastructure
…all in under 100 lines of code.
♻️ Use reusable components like the DNS
class to streamline development.
Run your Python script to auto-generate all necessary Dockerfiles and configuration files:
python your_emulation_script.py
Use Docker Compose or standard Docker CLI commands to deploy the emulated internet environment:
docker compose up
Ensure everything is functioning correctly:
- ✅ Validate service behavior (e.g., DNS lookups, network routing)
- 📈 Monitor logs and container performance
- 🔗 Test connectivity between nodes
Explore the examples and videos provided in the repository to understand practical use cases:
- 🧪 DNS emulation demo
- 🌐 Custom topologies
- 💡 High-scale setups using minimal hardware (e.g., 2 CPU cores, 8GB RAM)
- 🐍 Python
- 🖥️ Bash
- 📦 Docker and Docker Compose
- 🌍 BIRD Internet Routing Daemon
- 📡 tcpdump
- 🏗️ Linux Command-Line Utilities
- 🏴☠️ Ubuntu 20.04 VM
- 🏢 Windows 10 (21H2)
-
Understanding of Realistic Internet Modeling
Learned how to emulate real-world Internet environments by modeling components such as ASes, IXes, DNS servers, and blockchain networks. -
Limitations of GUI-Based Emulation Tools
Gained insight into the limitations of traditional GUI emulators like GNS3 and Packet Tracer, especially for large-scale or specialized networks. -
Benefits of Code-Based Emulation
Discovered that code-driven emulators offer better flexibility, scalability, and automation for network design and experimentation. -
Docker and SDK Integration
Understood how to use Docker and a custom SDK to create lightweight, programmable virtual network nodes. -
Hands-on with Internet Protocols and Infrastructure
Acquired practical experience configuring and testing key Internet protocols (e.g., DNS, BGP) in an emulated environment. -
Network Customization and Automation
Learned to define network topologies programmatically, enabling repeatable and customizable network scenarios. -
Emulation of Advanced Network Use Cases
Gained knowledge in simulating complex use cases like cybersecurity attacks and blockchain mining in a controlled environment. -
Component-Based Network Design Philosophy
Learned the benefits of abstracting network functions into components, promoting modular and reusable network designs. -
Scalability and Reusability in Emulation Environments
Understood how programmatic emulation allows for scalable, resource-efficient setups that can be reused across multiple scenarios.
This lab provided a comprehensive hands-on exploration of the Border Gateway Protocol (BGP)—the protocol that binds the global Internet together by enabling communication between Autonomous Systems (ASes).