Getting Started
Installation Video
Prerequisites
Before getting started, ensure Docker is installed and running on your system:
- Docker: Version 20.10 or higher
- Docker Compose: Version 2.0 or higher
Verify Docker installation:
docker --version
docker compose versionIf Docker is not installed, visit the Docker Official Website for installation instructions.
One-Click Deployment (Recommended)
PacketScope provides a convenient deployment script that automatically builds and starts all services using Docker Compose.
Clone the Repository
git clone https://github.com/Internet-Architecture-and-Security/PacketScope.git
cd PacketScopeRun the Deployment Script
Execute the startup script with root privileges:
sudo bash starter.shThe script will automatically complete the following operations:
- âś“ Check Docker environment
- âś“ Stop existing services
- âś“ Build all service containers in the correct order
- âś“ Start all services
- âś“ Display service status and access information
Access the Application
After deployment is complete, open your browser and visit:
http://localhost:4173/Service Endpoints
After successful deployment, the following services will be available:
| Service | Port | Access URL |
|---|---|---|
| Web UI | 4173 | http://localhost:4173Â |
| Guarder API | 8080 | http://localhost:8080Â |
| Tracer API | 8000 | http://localhost:8000Â |
| Analyzer-Monitor API | 5000 | http://localhost:5000Â |
| Analyzer-ProtocolStack API | 19999 | http://localhost:19999Â |
Service Management
View Service Status
sudo docker compose psView Service Logs
View logs for all services:
sudo docker compose logs -fView logs for a specific service:
sudo docker compose logs -f <service-name>Available service names:
web-ui- Frontend interfaceguarder- Security protection moduletracer- Network tracing moduleanalyzer-monitor- Traffic monitoring moduleanalyzer-protocolstack- Protocol stack analysis module
Stop All Services
sudo docker compose downRestart Services
Restart all services:
sudo docker compose restartRestart a specific service:
sudo docker compose restart <service-name>Update Services
If there are code updates, you need to rebuild and redeploy:
# Stop and remove existing containers
sudo docker compose down
# Rebuild and start
sudo bash starter.shOr rebuild only a specific service:
sudo docker compose up -d --build <service-name>Manual Deployment (Optional)
If you need manual deployment or advanced configuration, you can refer to the following steps.
Starting Server Modules
This project contains multiple server-side modules implemented in different languages. Please refer to the README.md file in each module to install dependencies and start services.
modules
├── Analyzer # Python-based protocol stack analysis module
│ ├── Monitor/ # Traffic monitoring submodule
│ └── ProtocolStack/ # Protocol analysis submodule
├── Guarder # Go-based security policy module
└── Tracer # Python-based network path mapping moduleAnalyzer Module
The Analyzer module contains two submodules: Monitor and ProtocolStack.
Enter the Monitor directory:
cd modules/Analyzer/MonitorInstall dependencies and start:
pip install -r requirements.txt
python app.pyEnter the ProtocolStack directory:
cd modules/Analyzer/ProtocolStackInstall dependencies and start:
pip install -r requirements.txt
python app.pyGuarder Module
Enter the Guarder directory:
cd modules/GuarderInstall dependencies and start:
go mod download
go run main.goTracer Module
Enter the Tracer directory:
cd modules/TracerInstall dependencies and start:
pip install -r requirements.txt
python app.pyStarting the Frontend Service
The frontend is built with Node.js . Ensure Node.js (version ≥ 16) is installed.
Install Dependencies
Run the following command in the project root directory:
npm installUsers in mainland China can set up an npm mirror to speed up installation:
npm config set registry http://registry.npmmirror.comStart the Preview Server
npm run previewThe application runs on local port 4173 by default.
Access the Application
Open your browser and visit:
http://127.0.0.1:4173/To run in development mode with hot reload enabled, use the following command:
npm run devTo build for production, use the following command:
npm run buildCommon Issues
Docker Permission Issues
If you encounter Docker permission errors, ensure your user is in the docker group:
sudo usermod -aG docker $USERThen log out and log back in, or run:
newgrp dockerPort Conflicts
If default ports are occupied, you can:
- Check which process is using the port:
sudo lsof -i :4173- Stop the process using the port, or modify the port mapping in
docker-compose.yml
Service Fails to Start
- Check Docker logs to diagnose the issue:
sudo docker compose logs <service-name>-
Ensure all required ports are not occupied
-
Verify that Docker and Docker Compose versions meet the requirements
Build Failures
If errors occur during the build process:
- Clean Docker cache:
sudo docker system prune -a- Rebuild:
sudo bash starter.shNetwork Connection Issues
If the frontend cannot connect to backend services:
- Check if all services are running properly:
sudo docker compose ps-
Verify that service ports are correctly mapped
-
Check if firewall settings are blocking port access
Performance Issues
If services are running slowly:
- Check system resource usage:
sudo docker stats-
Increase available Docker resources (memory, CPU)
-
Check logs for errors or warning messages
Troubleshooting
Complete Reset
If you encounter unresolvable issues, you can completely reset the environment:
# Stop and delete all containers
sudo docker compose down -v
# Delete all related images
sudo docker images | grep packetscope | awk '{print $3}' | xargs sudo docker rmi -f
# Redeploy
sudo bash starter.shGet Help
For additional help, please:
- Check GitHub IssuesÂ
- Review detailed documentation for each module
- Submit a new Issue with detailed error logs
Next Steps
After successfully deploying PacketScope, you can:
- 📊 Explore Analyzer Module - Analyze protocol stack performance
- 🔍 Use Tracer Module - Trace network paths
- 🛡️ Configure Guarder Module - Set up security policies
- 📚 Read User Guide - Learn more features
Enjoy using PacketScope!