How anirudhsudhir/snoopy works
Project Type & Purpose
• Snoopy is a network tool that implements a VPN. It leverages Rust’s capabilities for network programming.
• The project is structured as a command-line application (with a clear entry point in src/main.rs) that uses additional library code (src/lib.rs) to encapsulate VPN functionality.
• It is also containerized via a Dockerfile, which indicates it can run in isolated environments and demonstrate connectivity (as shown by the netcat demo).
File Structure
• Top-level files and directories:
• Cargo.toml, Cargo.lock: Indicates the Rust project structure and dependency management.
• src/ directory: Contains main.rs (the application entry point) and lib.rs (likely where the VPN logic is implemented).
• Dockerfile: Suggests container deployment.
• Makefile: May be used for build automation.
• This structure points to a clean separation between application code (core VPN functionality) and deployment (containerization, build automation).
Reading the README
• The README informs us that Snoopy operates as a VPN and demonstrates connectivity between a host and a container via virtual network (tun interface) settings.
• The demo details (physical and virtual IP addresses) imply that the system design should clearly represent both local (host) and virtual (container-based) network interfaces.
a. Main Components:
• Snoopy VPN Application:
• Main Application (src/main.rs) – handles runtime concerns.
• VPN Library (src/lib.rs) – encapsulates the core VPN features.
• Deployment Components:
• Docker Container – showing where the VPN code is run in a containerized environment.
• Host System – the physical machine running the host’s VPN client, netcat, and other tools.
• Networking Components:
• Virtual Network Interfaces (tun interfaces) – indicate the virtual IPs (10.0.0.2 on host and 10.0.0.3 in container).
• Physical Interfaces – the actual network connectivity (e.g., 192.168.97.x addresses).
b. Relationships and Interactions:
• The Snoopy application runs inside a Docker container and interacts with the host via its configured tun interface.
• From the Host (producing network traffic via netcat) → to the Container’s virtual network interface.
• Inside the container, highlight how the VPN application routes traffic over the virtual tunnel.
• That the VPN library encapsulates the logic for handling the VPN’s network packets, possibly interfacing with OS-level tun operations.
c. Architectural Patterns & Design Principles:
• Separation of concerns:
• Application entry: main.rs
• Core functionality: lib.rs
• Containerization: Dockerfile alongside deployment artifacts.
• That the design leverages standard Rust project organization and container-based deployment, which is common in microservices or network daemons.
d. Relevant Technologies & Frameworks:
• Rust (for system implementation).
• Docker (for container orchestration).
• Networking (tun interfaces, netcat for demo/testing).
• Build and package tools such as Cargo and Make.