A comprehensive network traffic generation and device management system with support for various protocols including BGP, OSPF, IS-IS, and advanced traffic patterns.
- Installation
- Build Scripts
- Deployment Scripts
- Quick Start
- Architecture
- Client-Server Communication
- Device Management
- Traffic Generation API
- Protocol Configuration
- Monitoring and Troubleshooting
- Examples
For a complete installation with Docker + FRR support:
# Clone the repository
git clone <repository-url>
cd OSTG
# Build the wheel package
./rebuild_quick.sh
# Install locally to /opt/OSTG
sudo python3 install_ostg_complete.py
# Or install remotely to a server
python3 install_ostg_complete.py -H server.com -u root -p passwordFor development work with the GUI client:
# Use the automated installation script
./install_ostg_client_env.sh
# Or manual setup
python3 -m venv ostg_client_env
source ostg_client_env/bin/activate
pip install --find-links https://download.qt.io/snapshots/ci/pyqt5/5.15/wheels/ PyQt5
pip install -r requirements.txt
pip install -e .Note: The GUI client automatically handles Qt platform plugin issues on macOS. If you encounter "Could not find the Qt platform plugin 'cocoa'" errors, ensure PyQt5 is installed from Qt's official wheels (not from source).
OSTG provides a comprehensive set of scripts for building, deploying, and installing the traffic generator:
rebuild_quick.sh- Fast wheel package build for developmentrebuild_wheel.sh- Comprehensive wheel package build for productionbuild_dmg.sh- Simple macOS DMG installer (apps only)build_macos_installer.sh- Complete macOS DMG installer (full package)
deploy.sh- Flexible deployment to remote serversdeploy_quick.sh- Interactive deployment wrapper
install_ostg_complete.py- Complete system installation with all dependencies
Source Code Changes
↓
Platform Choice?
↙ ↘
Linux/Remote macOS
↓ ↓
rebuild_quick build_dmg.sh
rebuild_wheel build_macos_installer.sh
↓ ↓
deploy.sh DMG Distribution
↓
install_ostg_complete.py
This will install:
- OSTG Traffic Generator (complete server and client)
- Python 3.9+ with all build dependencies
- Docker Engine with networking support
- FRR Docker containers for BGP/OSPF routing
- PyQt5 GUI framework for client interface
- Network analysis tools (nmap, netcat, socat, bridge-utils, vlan)
- System monitoring tools (iotop, nethogs, iftop, htop)
- Development tools (vim, nano, git, jq, yq)
- Systemd services for automatic startup
- All Python dependencies and build tools
- Network utilities (traceroute, mtr)
- Security tools (SSH client/server)
- Archive tools (zip, unzip, tar, gzip)
# Install to default directory /opt/OSTG
sudo python3 install_ostg_complete.py
# Install to custom directory
sudo python3 install_ostg_complete.py -d /custom/path
# Use custom wheel source directory
python3 install_ostg_complete.py -w /path/to/wheels# Install to remote server
python3 install_ostg_complete.py -H server.com -u admin -p password
# Install to specific IP with custom directory
python3 install_ostg_complete.py -H 192.168.1.100 -u root -p secret -d /opt/OSTGexport SERVER_HOST="server.com"
export SERVER_USER="admin"
export SERVER_PASS="password"
export INSTALL_DIR="/opt/OSTG"
export WHEEL_SOURCE_DIR="dist"
python3 install_ostg_complete.py- Ubuntu/Debian (18.04+, 20.04+, 22.04+)
- CentOS/RHEL (7+, 8+, 9+)
- Alpine Linux (3.15+)
- openSUSE (Leap 15+, Tumbleweed)
- Fedora (35+)
- CPU: 2 cores, 2.0 GHz
- RAM: 4 GB (8 GB recommended for production)
- Storage: 10 GB free space
- Network: Ethernet interface(s) for traffic generation
- Root privileges for Docker and network configuration
- Python 3.9+ (installed if not present)
- Docker Engine (installed and configured)
- PyQt5 GUI Framework (for client interface)
- Network Analysis Tools (nmap, netcat, socat, etc.)
- System Monitoring Tools (iotop, nethogs, iftop, htop)
- Development Tools (vim, nano, git, jq, yq)
- Build Dependencies (gcc, g++, make, pkg-config)
- Python Build Tools (cython, numpy, cffi)
- Internet connectivity for package downloads
- Network interfaces for traffic generation
- Port 5051 available for OSTG server
- Docker networking support
For detailed manual installation steps, see INSTALLATION.md.
OSTG provides two build scripts for different use cases:
Fast rebuild script for development cycles:
# Quick rebuild for development
./rebuild_quick.shFeatures:
- Fast execution (~5-10 seconds)
- Basic cleanup (build/, dist/, *.egg-info/)
- Simple wheel build
- Copy to root directory
- Minimal output
Use Cases:
- Development iterations
- Quick testing
- Fast feedback cycles
Thorough rebuild script for production builds:
# Comprehensive rebuild with validation
./rebuild_wheel.shFeatures:
- Extensive cleanup (including .pyc files, pycache)
- BGP timer fix verification
- Dependency installation and updates
- Project structure validation
- Build verification and testing
- Installation testing
- Command line tool verification
- Backup creation
- Deployment information generation
- Comprehensive logging
Use Cases:
- Production builds
- Release preparation
- CI/CD pipelines
- Thorough validation
| Feature | rebuild_quick.sh |
rebuild_wheel.sh |
install_ostg_complete.py |
|---|---|---|---|
| Purpose | 🏗️ Build wheel (fast) | 🏗️ Build wheel (thorough) | 🚀 Install system |
| Speed | Fast (~5-10s) | Thorough (~30-60s) | Complete (~5-15min) |
| Input | Source code | Source code | Wheel file + system |
| Output | .whl file |
.whl file |
Installed OSTG |
| Validation | Basic | Extensive | System verification |
| Testing | None | Full installation test | Service verification |
| BGP Verification | None | Yes | Runtime testing |
| Dependencies | Python, pip, build tools | Python, pip, build tools | System packages, Docker |
| Target Machine | Development | Development | Production server |
| Frequency | After code changes | Before releases | First-time setup |
| Use Case | Development cycles | Production builds | System installation |
| File Size | ~585KB wheel | ~585KB wheel | Full system install |
| Cleanup | Basic | Extensive | None |
# 1. Make code changes
# 2. Quick rebuild for testing
./rebuild_quick.sh
# 3. Quick deployment to dev server
./deploy.sh -t wheel-only# 1. Comprehensive rebuild with validation
./rebuild_wheel.sh
# 2. Full deployment to production
./deploy.sh -t full# 1. Build the wheel package (if not done)
./rebuild_wheel.sh
# 2. Install on target system
python3 install_ostg_complete.pyOSTG provides two macOS build scripts for creating standalone applications:
Creates a lightweight DMG installer with just the applications:
# Build simple DMG installer
./build_dmg.shFeatures:
- ✅ Fast build (~2-3 minutes)
- ✅ Lightweight (~55MB DMG)
- ✅ Self-contained apps
- ✅ No dependencies required
Creates a comprehensive DMG installer with full documentation and scripts:
# Build complete installer
./build_macos_installer.shFeatures:
- ✅ Complete package (~100MB+ DMG)
- ✅ Installation scripts included
- ✅ Uninstaller included
- ✅ Documentation bundled
- ✅ Wheel package included
| Feature | build_dmg.sh |
build_macos_installer.sh |
|---|---|---|
| Purpose | 📦 Simple DMG | 📦 Complete installer |
| Build Time | Fast (~2-3min) | Thorough (~5-10min) |
| DMG Size | ~55MB | ~100MB+ |
| Contents | Apps only | Apps + scripts + docs |
| Installation | Drag & drop | Automated installer |
| Dependencies | None | None (all embedded) |
| Use Case | Quick distribution | Professional release |
| Target | End users | Enterprise deployment |
# 1. Build simple DMG
./build_dmg.sh
# 2. Distribute OSTG-TrafficGenerator-0.1.52.dmg
# Users drag apps to Applications folder# 1. Build complete installer
./build_macos_installer.sh
# 2. Distribute comprehensive package
# Includes installation scripts and documentationOSTG provides flexible deployment options for different scenarios:
Comprehensive deployment script with full control:
# Full deployment with all features
./deploy.sh
# Deploy only wheel package (fastest)
./deploy.sh -t wheel-only
# Deploy to custom server
./deploy.sh -H server.com -u admin -p password -t full
# Deploy without backup (faster)
./deploy.sh -t source-only -n -vOptions:
-t, --type TYPE- Deployment type (full, wheel-only, source-only, config-only)-H, --host HOST- Target server hostname or IP address-u, --user USER- SSH username-p, --pass PASS- SSH password-P, --path PATH- Remote installation path-n, --no-backup- Skip creating backup-v, --no-verify- Skip installation verification-s, --no-start- Don't start server after deployment-f, --force-rebuild- Force rebuild even if no changes detected
User-friendly interactive wrapper:
# Interactive deployment menu
./deploy_quick.shMenu Options:
- Full Deployment (rebuild + deploy everything)
- Source Code Only (deploy code changes)
- Wheel Package Only (deploy built package)
- Configuration Only (deploy config files)
- Force Rebuild & Deploy (rebuild even if no changes)
- Deploy Without Backup (faster deployment)
- Custom deployment with options
- Deploy to different server
- Rebuilds the project if needed
- Deploys wheel package
- Updates source files
- Creates backup
- Verifies installation
- Starts server
- Deploys only the wheel package
- Faster than full deployment
- No source file updates
- Reinstalls the wheel package (since source files are included)
- Useful for code changes without rebuilding
- Faster than full deployment
- Deploys only configuration files
- Fastest deployment option
- For config changes only
# Quick development cycle
./rebuild_quick.sh
./deploy.sh -t wheel-only# Thorough build and deployment
./rebuild_wheel.sh
./deploy.sh -H production-server.com -u root -p secret -t full# Deploy to multiple servers
./deploy.sh -H server1.com -u admin -p pass -t wheel-only
./deploy.sh -H server2.com -u admin -p pass -t wheel-onlyexport SERVER_HOST="server.com"
export SERVER_USER="admin"
export SERVER_PASS="password"
export SERVER_PATH="/opt/OSTG"
./deploy.sh -t fullComprehensive first-time installation script:
# Local installation to /opt/OSTG
sudo python3 install_ostg_complete.py
# Remote installation
python3 install_ostg_complete.py -H server.com -u root -p password
# Custom installation directory
python3 install_ostg_complete.py -d /custom/pathFeatures:
- Complete OSTG installation with all dependencies
- Python 3.9+ installation and configuration
- PyQt5 GUI framework and dependencies
- Docker Engine installation and configuration
- FRR Docker containers setup
- Systemd services configuration
- Virtual environment creation with build tools
- Comprehensive system dependencies installation
- Network analysis tools (nmap, netcat, socat, etc.)
- System monitoring tools (iotop, nethogs, iftop, htop)
- Development tools (vim, nano, git, jq, yq)
- Archive and compression tools (zip, unzip, tar, gzip)
- Network utilities (traceroute, mtr, bridge-utils, vlan)
- Security tools (SSH client/server)
- Multi-distribution support (Ubuntu/Debian, CentOS/RHEL, Alpine, openSUSE)
- Remote installation support
- Build dependencies for compiled Python packages
- Development tools for testing and code quality
Options:
-H, --host HOST- Remote server hostname or IP-u, --user USER- SSH username for remote installation-p, --pass PASS- SSH password for remote installation-d, --dir DIR- Installation directory (default: /opt/OSTG)-w, --wheel-dir DIR- Wheel source directory (default: dist)-h, --help- Show help information
Installation Steps:
-
System Dependencies Installation
- Python 3.9+ with build tools
- PyQt5 GUI framework and Qt5 dependencies
- Network analysis and monitoring tools
- Development and system utilities
- Multi-distribution package management
-
Additional Tools Installation
- Network utilities (nmap, netcat, socat, bridge-utils, vlan)
- System monitoring (iotop, nethogs, iftop, htop)
- Development tools (vim, nano, git, jq, yq)
- Archive tools (zip, unzip, tar, gzip)
- Network diagnostics (traceroute, mtr)
- Security tools (SSH client/server)
-
Docker Installation
- Docker Engine installation and configuration
- Docker service startup and verification
- User permissions configuration
-
Python Environment Setup
- Python 3.9+ installation (if not present)
- Virtual environment creation
- Build dependencies installation (cython, numpy, cffi)
- pip, setuptools, wheel upgrade
-
OSTG Package Installation
- OSTG wheel package installation
- Additional Python dependencies (psutil, requests, PyYAML, ipaddress)
- Development tools (pytest, black, flake8, mypy) - optional
-
FRR Docker Container Setup
- FRR container creation and configuration
- Network bridge setup
- BGP and routing daemon configuration
-
Systemd Services Configuration
- OSTG server service creation
- OSTG client service creation
- Service enablement and startup configuration
-
Verification and Testing
- Installation verification
- FRR functionality testing
- Service startup and health checks
- Network connectivity testing
Main deployment configuration file:
# Server Configuration
SERVER_HOST=server.com
SERVER_USER=admin
SERVER_PASS=password
SERVER_PATH=/opt/OSTG
TEMP_PATH=/tmp
# Deployment Options
DEPLOY_TYPE=full
BACKUP_ENABLED=true
VERIFY_INSTALL=true
START_SERVER=true
CLEAN_TEMP=trueExample configuration file with all options:
# Example deployment configuration
# Copy to deploy_config.conf and modify as needed
# Server Configuration
SERVER_HOST=your-server.com
SERVER_USER=root
SERVER_PASS=your-password
SERVER_PATH=/opt/OSTG
TEMP_PATH=/tmp
# Deployment Options
DEPLOY_TYPE=full
BACKUP_ENABLED=true
VERIFY_INSTALL=true
START_SERVER=true
CLEAN_TEMP=trueAll scripts support environment variables for configuration:
# Server configuration
export SERVER_HOST="server.com"
export SERVER_USER="admin"
export SERVER_PASS="password"
export SERVER_PATH="/opt/OSTG"
export TEMP_PATH="/tmp"
# Installation configuration
export INSTALL_DIR="/opt/OSTG"
export WHEEL_SOURCE_DIR="dist"
# Deployment configuration
export DEPLOY_TYPE="full"
export BACKUP_ENABLED="true"
export VERIFY_INSTALL="true"
export START_SERVER="true"
export CLEAN_TEMP="true"- Make changes to source code
- Quick rebuild:
./rebuild_quick.sh - Quick deployment:
./deploy.sh -t wheel-only - Test changes on development server
- Comprehensive rebuild:
./rebuild_wheel.sh - Full deployment:
./deploy.sh -t full - Verify installation and test
- Monitor logs:
journalctl -u ostg-server -f
# Deploy to multiple servers
for server in server1.com server2.com server3.com; do
./deploy.sh -H $server -u admin -p password -t wheel-only
done- Always enable backups for production deployments
- Use
-nflag only for development/testing - Backup files are created with timestamps
- Use environment variables instead of hardcoded passwords
- Consider using SSH keys instead of passwords
- Limit server access to necessary users only
- Regularly update dependencies
Issue: rebuild_quick.sh fails with "python3 not found"
# Solution: Install Python 3
sudo apt-get update
sudo apt-get install python3 python3-pip python3-venvIssue: rebuild_wheel.sh fails during BGP verification
# Solution: Check if BGP timer fixes are present
grep -n "timers.*keepalive.*hold_time" utils/frr_docker.py
grep -n "bgp_keepalive.*bgp_hold_time" run_tgen_server.pyIssue: Wheel build fails with "No module named 'build'"
# Solution: Install build dependencies
pip3 install --upgrade pip setuptools wheel buildIssue: SSH connection fails during deployment
# Solution: Test SSH connection manually
ssh -o ConnectTimeout=10 $SERVER_USER@$SERVER_HOST
# Check if sshpass is installed
sudo apt-get install sshpassIssue: Server path doesn't exist
# Solution: Create directory on remote server
ssh $SERVER_USER@$SERVER_HOST "mkdir -p $SERVER_PATH"Issue: Wheel installation fails on remote server
# Solution: Check Python version and pip on remote server
ssh $SERVER_USER@$SERVER_HOST "python3 --version && pip3 --version"
# Install pip if missing
ssh $SERVER_USER@$SERVER_HOST "sudo apt-get install python3-pip"Issue: Docker installation fails
# Solution: Install Docker manually
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USERIssue: Systemd service fails to start
# Solution: Check service status and logs
sudo systemctl status ostg-server
sudo journalctl -u ostg-server -f
# Reload systemd and restart
sudo systemctl daemon-reload
sudo systemctl restart ostg-serverIssue: Virtual environment creation fails
# Solution: Install python3-venv
sudo apt-get install python3-venv
# Or use alternative method
python3 -m virtualenv ostg_envEnable debug mode for detailed output:
# Enable bash debug mode
set -x
# Run scripts with debug output
./deploy.sh -t full 2>&1 | tee deployment.log
# Disable debug mode
set +xCheck these log files for troubleshooting:
# Deployment logs
tail -f deployment.log
# Server logs
journalctl -u ostg-server -f
# Docker logs
docker logs ostg_frr_container
# Build logs
cat rebuild_info.txtVerify installation and deployment:
# Check if OSTG is installed
python3 -c "import ostg; print('OSTG installed successfully')"
# Check if commands are available
which ostg-server
which ostg-client
# Check server status
systemctl is-active ostg-server
# Check if server is listening
netstat -tlnp | grep :5051# Create virtual environment
python3 -m venv ostg-env
source ostg-env/bin/activate
# Install Python dependencies
pip install flask flask-cors psutil scapy requests pyqt5# Test Python imports
python3 -c "
from flask import Flask
from scapy.all import Ether, Dot1Q, MPLS
import psutil
print('✅ All dependencies installed successfully')
"# Start the server (after installation)
ostg-server
# Or using systemd service
sudo systemctl start ostg-server# Start the client GUI
ostg-client
# Or using systemd service
sudo systemctl start ostg-client- Add Server: In the client, go to "Server" tab and add your server
- Configure Devices: Go to "Devices" tab and add network devices
- Generate Traffic: Go to "Streams" tab and create traffic streams
- Configure Protocols: Use BGP, OSPF, or IS-IS tabs for protocol configuration
OSTG now includes integrated Docker + FRR support:
- Automatic Container Management: FRR containers are created automatically when devices are added
- BGP/OSPF/IS-IS Support: Full routing protocol support in isolated containers
- Network Isolation: Each device gets its own FRR container with isolated networking
- Easy Management: Use
ostg-docker-installcommand to manage Docker setup
# Check Docker + FRR status
ostg-docker-install --verify-only
# Rebuild FRR containers
ostg-docker-install --skip-docker┌─────────────────┐ HTTP/API ┌─────────────────┐
│ OSTG Client │◄──────────────►│ OSTG Server │
│ (PyQt5 GUI) │ │ (Flask API) │
└─────────────────┘ └─────────────────┘
│ │
│ │
┌────▼────┐ ┌────▼────┐
│ Session │ │ Network │
│ Storage │ │ Config │
└─────────┘ └─────────┘
- Client: PyQt5-based GUI for configuration and monitoring
- Server: Flask-based API server for network operations
- Protocols: FRR integration for BGP, OSPF, IS-IS
- Traffic: Scapy-based packet generation
- Monitoring: Real-time statistics and status tracking
| Endpoint | Method | Description |
|---|---|---|
/api/frr/status |
GET | Check FRR daemon status |
/api/device/add |
POST | Add network device |
/api/device/remove |
POST | Remove network device |
/api/device/apply |
POST | Apply device configuration |
/api/device/arp/check |
POST | Check ARP resolution |
/api/device/arp/request |
POST | Send ARP request |
/api/device/ping |
POST | Ping device |
/api/device/bgp/configure |
POST | Configure BGP |
/api/traffic/start |
POST | Start traffic stream |
/api/traffic/stop |
POST | Stop traffic stream |
/api/streams/stats |
GET | Get stream statistics |
curl -X POST http://localhost:5050/api/device/add \
-H "Content-Type: application/json" \
-d '{
"device_id": "device-001",
"device_name": "Router-1",
"interface": "enp180s0np0",
"mac_address": "00:11:22:33:44:55",
"ipv4": "192.168.1.10",
"ipv4_mask": "24",
"ipv6": "2001:db8::1",
"ipv6_mask": "64",
"vlan": "100",
"gateway": "192.168.1.1"
}'curl -X POST http://localhost:5050/api/device/arp/check \
-H "Content-Type: application/json" \
-d '{
"device_id": "device-001",
"interface": "enp180s0np0",
"ipv4": "192.168.1.10",
"gateway": "192.168.1.1"
}'curl -X POST http://localhost:5050/api/device/ping \
-H "Content-Type: application/json" \
-d '{
"device_id": "device-001",
"interface": "enp180s0np0",
"ipv4": "192.168.1.10",
"target": "192.168.1.1"
}'curl -X POST http://localhost:5050/api/traffic/start \
-H "Content-Type: application/json" \
-d '{
"streams": {
"Port:enp180s0np0": [
{
"name": "IPv4_Stream",
"enabled": true,
"frame_size": 512,
"mac_source_address": "00:11:22:33:44:55",
"mac_destination_address": "66:77:88:99:aa:bb",
"ipv4_source": "192.168.1.10",
"ipv4_destination": "192.168.1.20",
"udp_source_port": 12345,
"udp_destination_port": 54321,
"vlan_id": "100",
"stream_rate_type": "Packets Per Second (PPS)",
"stream_pps_rate": 1000,
"stream_duration_mode": "Continuous",
"flow_tracking_enabled": true,
"stream_id": "stream-001"
}
]
}
}'curl -X POST http://localhost:5050/api/traffic/start \
-H "Content-Type: application/json" \
-d '{
"streams": {
"Port:enp180s0np0": [
{
"name": "IPv6_Stream",
"enabled": true,
"frame_size": 512,
"mac_source_address": "00:aa:bb:cc:dd:ee",
"mac_destination_address": "11:22:33:44:55:66",
"L3": "IPv6",
"L4": "UDP",
"ipv6_source": "2001:db8::1",
"ipv6_destination": "2001:db8::2",
"udp_source_port": 1220,
"udp_destination_port": 5678,
"stream_rate_type": "Packets Per Second (PPS)",
"stream_pps_rate": 500,
"stream_duration_mode": "Continuous",
"stream_id": "stream-002"
}
]
}
}'curl -X POST http://localhost:5050/api/traffic/start \
-H "Content-Type: application/json" \
-d '{
"streams": {
"Port:enp180s0np0": [
{
"name": "RoCEv2_Stream",
"enabled": true,
"frame_size": 256,
"mac_source_address": "00:aa:bb:cc:dd:ee",
"mac_destination_address": "00:11:22:33:44:55",
"ipv6_source": "::1",
"ipv6_destination": "::2",
"L4": "RoCEv2",
"rocev2": {
"rocev2_source_gid": "0:0:0:0:0:ffff:10.1.1.1",
"rocev2_destination_gid": "0:0:0:0:0:ffff:10.1.1.2",
"rocev2_source_qp": "100",
"rocev2_destination_qp": "200",
"rocev2_opcode": "SendOnly",
"rocev2_flow_label": "55555",
"rocev2_traffic_class": "2"
},
"stream_rate_type": "Packets Per Second (PPS)",
"stream_pps_rate": 100,
"stream_duration_mode": "Continuous",
"stream_id": "stream-003"
}
]
}
}'curl -X POST http://localhost:5050/api/traffic/stop \
-H "Content-Type: application/json" \
-d '{
"streams": [
{
"interface": "enp180s0np0",
"stream_id": "stream-001"
}
]
}'curl -G http://localhost:5050/api/streams/stats \
--data-urlencode "interface=enp180s0np0"curl -X POST http://localhost:5050/api/device/bgp/configure \
-H "Content-Type: application/json" \
-d '{
"device_id": "device-001",
"device_name": "Router-1",
"interface": "enp180s0np0",
"vlan": "100",
"ipv4": "192.168.1.10",
"bgp": {
"bgp_mode": "eBGP",
"bgp_asn": "65000",
"bgp_remote_asn": "65001",
"bgp_neighbor_ipv4": "192.168.1.20",
"bgp_update_source_ipv4": "192.168.1.10"
}
}'curl -G http://localhost:5050/api/frr/status# Monitor VLAN traffic
tcpdump -i enp180s0np0 -n -e vlan
# Monitor specific traffic patterns
tcpdump -i enp180s0np0 -n -e vlan -s 0 -XX
# Monitor ICMP traffic
tcpdump -i enp180s0np0 -n icmp
# Monitor TCP traffic on specific ports
tcpdump -i enp180s0np0 tcp src port 22 and dst port 33# View server logs in real-time
tail -f /tmp/server.log
# Check server status
ps aux | grep run_tgen_server
# Check FRR daemon status
systemctl status frr-
Port Already in Use: Kill existing server processes
pkill -f 'run_tgen_server' -
FRR Not Running: Start FRR service
sudo systemctl start frr
-
Permission Denied: Ensure running with appropriate privileges
sudo python run_tgen_server.py --host 0.0.0.0 --port 5050
-
Start Server:
python run_tgen_server.py --host 0.0.0.0 --port 5050
-
Add Device:
curl -X POST http://localhost:5050/api/device/add \ -H "Content-Type: application/json" \ -d '{ "device_id": "router-1", "device_name": "Core Router", "interface": "enp180s0np0", "mac_address": "00:11:22:33:44:55", "ipv4": "10.0.1.1", "ipv4_mask": "24", "vlan": "100", "gateway": "10.0.1.254" }'
-
Configure BGP:
curl -X POST http://localhost:5050/api/device/bgp/configure \ -H "Content-Type: application/json" \ -d '{ "device_id": "router-1", "device_name": "Core Router", "interface": "enp180s0np0", "vlan": "100", "ipv4": "10.0.1.1", "bgp": { "bgp_mode": "eBGP", "bgp_asn": "65000", "bgp_remote_asn": "65001", "bgp_neighbor_ipv4": "10.0.1.2", "bgp_update_source_ipv4": "10.0.1.1" } }'
-
Start Traffic Stream:
curl -X POST http://localhost:5050/api/traffic/start \ -H "Content-Type: application/json" \ -d '{ "streams": { "Port:enp180s0np0": [ { "name": "Test_Stream", "enabled": true, "frame_size": 512, "mac_source_address": "00:11:22:33:44:55", "mac_destination_address": "66:77:88:99:aa:bb", "ipv4_source": "10.0.1.1", "ipv4_destination": "10.0.1.2", "udp_source_port": 12345, "udp_destination_port": 54321, "vlan_id": "100", "stream_rate_type": "Packets Per Second (PPS)", "stream_pps_rate": 1000, "stream_duration_mode": "Continuous", "flow_tracking_enabled": true, "stream_id": "test-stream-001" } ] } }'
-
Monitor Statistics:
curl -G http://localhost:5050/api/streams/stats \ --data-urlencode "interface=enp180s0np0" -
Stop Stream:
curl -X POST http://localhost:5050/api/traffic/stop \ -H "Content-Type: application/json" \ -d '{ "streams": [ { "interface": "enp180s0np0", "stream_id": "test-stream-001" } ] }'
curl -X POST http://localhost:5050/api/traffic/start \
-H "Content-Type: application/json" \
-d '{
"streams": {
"Port:enp180s0np0": [
{
"name": "ICMP_Stream",
"enabled": true,
"frame_size": 64,
"L3": "IPv4",
"L4": "ICMP",
"mac_source_address": "00:00:00:00:00:02",
"mac_destination_address": "00:00:00:00:00:01",
"ipv4_source": "192.168.1.10",
"ipv4_destination": "192.168.1.20",
"vlan_id": 100,
"stream_rate_type": "Packets Per Second (PPS)",
"stream_pps_rate": 1,
"stream_duration_mode": "Continuous",
"stream_id": "icmp-001"
},
{
"name": "UDP_Stream",
"enabled": true,
"frame_size": 64,
"L3": "IPv4",
"L4": "UDP",
"mac_source_address": "00:00:00:00:00:02",
"mac_destination_address": "00:00:00:00:00:01",
"ipv4_source": "192.168.1.10",
"ipv4_destination": "192.168.1.20",
"udp_source_port": 12345,
"udp_destination_port": 54321,
"vlan_id": 100,
"stream_rate_type": "Packets Per Second (PPS)",
"stream_pps_rate": 1,
"stream_duration_mode": "Continuous",
"stream_id": "udp-001"
}
]
}
}'For issues and questions:
- Check server logs:
tail -f /tmp/server.log - Verify FRR status:
systemctl status frr - Test network connectivity:
ping <target_ip> - Monitor traffic:
tcpdump -i <interface> -n
This project is open source. Please refer to the license file for details.