network-performance-analyzer
Version:
Automated analysis tool for network performance test datasets containing DNS testing results and iperf3 performance measurements
417 lines (304 loc) ⢠16.3 kB
Markdown
# š Network Performance Analyzer
<div align="center">
[](https://badge.fury.io/js/network-performance-analyzer)
[](https://opensource.org/licenses/MIT)
**A comprehensive toolkit for analyzing network performance in Netskope Private Access (NPA) environments**
_Specialized for testing NPA performance with CGNAT validation and multi-configuration analysis_
</div>
---
## šÆ Purpose
This toolkit is specifically designed for **Netskope Private Access (NPA) performance testing**. When NPA is properly configured and steered, it returns Carrier-Grade NAT (CGNAT) addresses from the `100.64.0.0/10` range as defined in RFC 6598. Our DNS validation ensures you're testing the correct NPA-steered traffic path.
## ⨠Key Features
| Feature | Description | Documentation |
| ---------------------------------- | --------------------------------------------------------- | ------------------------------------------------------ |
| š **Automated Dataset Discovery** | Finds and processes network performance test datasets | [User Guide](docs/user-guide.md) |
| š **Comprehensive Analysis** | Analyzes iperf3 and DNS performance across configurations | [API Documentation](docs/api.md) |
| āļø **Configuration Comparison** | Compares MTU sizes, AWS logging, and other parameters | [Configuration Guide](docs/configuration-reference.md) |
| šØ **Anomaly Detection** | Identifies performance outliers and unusual patterns | [Extending Guide](docs/extending-the-analyzer.md) |
| š **Detailed Reporting** | Generates comprehensive markdown reports with insights | [User Guide](docs/user-guide.md) |
| š **Plugin Architecture** | Extensible design for custom analysis capabilities | [Custom Plugins Guide](docs/custom-plugins-guide.md) |
| ā” **Performance Optimized** | Parallel processing and streaming for large datasets | [Performance Guide](docs/extending-the-analyzer.md) |
| š **CGNAT Validation** | Validates NPA traffic steering via CGNAT IP ranges | [DNS Testing Guide](docs/dns-testing-guide.md) |
## š Quick Start
### Prerequisites
| Requirement | Version | Installation |
| ---------------- | -------------- | ------------------------------------------------------------------------------- |
| š¦ **Node.js** | 14.x or higher | [Download](https://nodejs.org/) |
| š¦ **npm** | 6.x or higher | Included with Node.js |
| ļæ½ **\*Python 3** | 3.7 or higher | [Download](https://python.org/) or system package manager |
| ļæ½ **\*pip** | Latest | Included with Python 3 |
| š§ **iperf3** | Latest | [Installation Guide](docs/data-gatherer-guide.md#installation-and-dependencies) |
| š§ **dig** | Latest | [Installation Guide](docs/data-gatherer-guide.md#installation-and-dependencies) |
#### Python Dependencies for Data Gatherer
The data collection tool requires these Python packages:
```bash
# Install Python dependencies for data collection
pip install pandas>=1.0.0 matplotlib>=3.0.0 numpy>=1.18.0
# Or use the requirements file
cd data-gatherer
pip install -r requirements.txt
```
### š„ Installation Options
#### Option 1: Build from source (Recommended)
```bash
# Clone the repository
git clone https://github.com/your-org/network-performance-analyzer.git
cd network-performance-analyzer
# Install dependencies and build
npm install
npm run build
# Link for global usage (makes 'network-performance-analyzer' command available)
npm link
```
#### Option 2: Local development setup
```bash
# Clone and setup for development
git clone https://github.com/your-org/network-performance-analyzer.git
cd network-performance-analyzer
# Install dependencies
npm install
# Run tests
npm test
# Start development mode
npm run dev
```
#### Option 3: Direct usage without global install
```bash
# Clone the repository
git clone https://github.com/your-org/network-performance-analyzer.git
cd network-performance-analyzer
# Install dependencies and build
npm install
npm run build
# Run directly with npx
npx . ./datasets
# Or run the built CLI directly
node dist/cli.js ./datasets
```
### ā” Getting Started in 3 Steps
1. **š Collect Data** - Use our data gatherer tool:
```bash
# Navigate to data gatherer
cd data-gatherer
# Install Python dependencies
pip install -r requirements.txt
# Run performance tests (requires iperf3 servers)
python3 network_performance_tester.py --servers 192.168.1.100
```
š _See [Data Gatherer Guide](docs/data-gatherer-guide.md) for detailed instructions_
2. **š Analyze Results** - Process your datasets:
```bash
# Analyze collected data
network-performance-analyzer ./datasets
```
3. **š Review Reports** - Check generated analysis:
```bash
# View the generated report
cat network-analysis-report.md
```
## š» Usage
### šÆ Basic Analysis
```bash
# Analyze datasets in current directory
network-performance-analyzer ./datasets
# Specify custom output location
network-performance-analyzer ./datasets -o ./reports/npa-analysis.md
```
### š§ Command Line Options
| Option | Description | Example |
| --------------------------------- | ----------------------------- | --------------------------------- |
| `-o, --output <file>` | Output file path | `-o ./reports/analysis.md` |
| `-v, --verbose` | Enable detailed logging | `-v` |
| `-c, --continue-on-error` | Continue on dataset failures | `-c` |
| `-t, --anomaly-thresholds <json>` | Custom anomaly detection | `-t '{"bandwidthVariation":0.2}'` |
| `-p, --parallel <number>` | Max parallel tasks | `-p 8` |
| `-m, --monitor` | Enable performance monitoring | `-m` |
| `-e, --environment <env>` | Environment configuration | `-e production` |
| `-C, --config <file>` | Configuration file path | `-C ./config.json` |
| `-P, --plugins <dirs>` | Plugin directories | `-P ./plugins,./custom` |
| `-T, --template <id>` | Report template | `-T detailed` |
| `-S, --sections <list>` | Report sections | `-S summary,recommendations` |
### š Advanced Examples
```bash
# š Comprehensive analysis with custom settings
network-performance-analyzer ./npa-datasets \
-o ./reports/npa-performance-$(date +%Y%m%d).md \
-v -m \
-t '{"bandwidthVariation":0.15,"dnsResponseTimeVariation":0.4}' \
-e production
# š Using custom plugins for specialized analysis
network-performance-analyzer ./datasets \
-P ./custom-plugins \
-T npa-optimized \
-S executive-summary,npa-validation,performance-comparison
# ā” High-performance analysis for large datasets
network-performance-analyzer ./large-datasets \
-p 16 \
-C ./configs/high-performance.json \
--continue-on-error
```
š **For more usage examples, see [Troubleshooting and Examples Guide](docs/troubleshooting-examples.md)**
## āļø Configuration
The analyzer provides flexible configuration for different testing environments and requirements.
### š§ Quick Configuration
```bash
# Generate default configuration
network-performance-analyzer --init-config
# Use environment-specific settings
network-performance-analyzer ./datasets -e production -C ./npa-config.json
```
### š Configuration Categories
| Category | Purpose | Documentation |
| --------------------------- | ------------------------------- | ---------------------------------------------------------- |
| š **Analysis Settings** | Control processing behavior | [Configuration Reference](docs/configuration-reference.md) |
| šØ **Anomaly Thresholds** | Customize detection sensitivity | [Configuration Reference](docs/configuration-reference.md) |
| š **Reporting Options** | Control report generation | [User Guide](docs/user-guide.md) |
| š **Plugin Configuration** | Manage custom extensions | [Custom Plugins Guide](docs/custom-plugins-guide.md) |
| š **Environment Profiles** | Environment-specific settings | [Configuration Reference](docs/configuration-reference.md) |
š **For complete configuration options, see [Configuration Reference](docs/configuration-reference.md)**
## š Dataset Format & Structure
### šļø Directory Structure
The analyzer expects datasets organized with specific naming patterns for NPA testing:
```
datasets/
āāā coredns-mtu1500-aws-logs_enabled/
ā āāā parameters-results_20250717_120000.json
ā āāā results_20250717_120000.json
āāā coredns-mtu1420-aws-logs_disabled/
ā āāā parameters-results_20250717_130000.json
ā āāā results_20250717_130000.json
āāā stock-mtu8920-aws-logs_disabled/
āāā parameters-results_20250717_140000.json
āāā results_20250717_140000.json
```
### š Naming Convention
```
(coredns|stock)-mtu<size>-aws-logs_(enabled|disabled)
```
| Component | Description | Example |
| ------------------------------ | ------------------ | --------------------------------------- |
| `coredns\|stock` | DNS resolver type | `coredns`, `stock` |
| `mtu<size>` | MTU configuration | `mtu1500`, `mtu1420`, `mtu8920` |
| `aws-logs_(enabled\|disabled)` | AWS logging status | `aws-logs_enabled`, `aws-logs_disabled` |
### š Data Files
#### Parameters File (`parameters-results_*.json`)
```json
{
"backendServer": "192.168.1.100",
"mtu": 1500,
"queryLogging": "enabled",
"timestamp": "2025-07-17T12:00:00Z"
}
```
#### Results File (`results_*.json`)
```json
{
"iperfTests": [
{
"server": "192.168.1.100",
"scenario": "TCP Bandwidth (Parallel 4)",
"success": true,
"bandwidthMbps": 945.2,
"retransmits": 12,
"duration": 15.1
}
],
"dnsResults": [
{
"domain": "example.npa.com",
"dnsServer": "8.8.8.8",
"success": true,
"responseTimeMs": 23.4,
"resolvedIps": ["100.64.1.10"]
}
]
}
```
š **For complete data format specifications, see [Data Gatherer Guide](docs/data-gatherer-guide.md#output-format-and-data-structure)**
## š Extending the Analyzer
The Network Performance Analyzer supports custom plugins for specialized NPA analysis requirements.
### š Quick Plugin Development
```typescript
// Create custom NPA analysis plugin
import { AnalyzerPlugin } from "network-performance-analyzer";
export class NPALatencyPlugin extends AnalyzerPlugin {
analyze(datasets: Dataset[]): AnalysisResult {
// Custom NPA-specific latency analysis
return this.analyzeNPALatencyPatterns(datasets);
}
}
```
### š Plugin Resources
| Resource | Description | Link |
| ------------------------- | ------------------------------ | ---------------------------------------------------- |
| šļø **Plugin Development** | Complete plugin creation guide | [Custom Plugins Guide](docs/custom-plugins-guide.md) |
| š§ **API Reference** | Plugin API documentation | [API Documentation](docs/api.md) |
| šÆ **Extension Examples** | Real-world plugin examples | [Extending Guide](docs/extending-the-analyzer.md) |
## š ļø Troubleshooting
### šØ Quick Fixes
| Issue | Quick Solution | Documentation |
| ------------------------------ | ------------------------------ | ---------------------------------------------------------- |
| š **No datasets found** | Check directory naming pattern | [Data Format Guide](#-dataset-format--structure) |
| š **Parsing errors** | Validate JSON format | [Troubleshooting Guide](docs/troubleshooting-examples.md) |
| š¾ **Memory issues** | Enable streaming parser | [Configuration Reference](docs/configuration-reference.md) |
| š **CGNAT validation fails** | Verify NPA steering | [DNS Testing Guide](docs/dns-testing-guide.md) |
| š§ **iperf3 connection fails** | Check server setup | [Data Gatherer Guide](docs/data-gatherer-guide.md) |
### š Common Error Solutions
```bash
# Fix dataset discovery issues
ls -la datasets/ # Check directory structure
network-performance-analyzer datasets/ -v # Enable verbose logging
# Resolve memory issues
network-performance-analyzer datasets/ -p 2 -C low-memory-config.json
# Debug CGNAT validation
python3 -c "
import ipaddress
ip = '100.64.1.10' # Your resolved IP
cgn = ipaddress.ip_network('100.64.0.0/10')
print(f'IP {ip} in CGNAT range: {ipaddress.ip_address(ip) in cgn}')
"
```
š **For comprehensive troubleshooting, see [Troubleshooting and Examples Guide](docs/troubleshooting-examples.md)**
## š Complete Documentation
### šÆ Core Guides
- š **[User Guide](docs/user-guide.md)** - Complete usage instructions and examples
- š§ **[API Documentation](docs/api.md)** - Detailed API reference and integration guide
- āļø **[Configuration Reference](docs/configuration-reference.md)** - All configuration options and examples
### š Data Collection
- š **[Data Gatherer Guide](docs/data-gatherer-guide.md)** - Complete data collection toolkit
- š **[DNS Testing Guide](docs/dns-testing-guide.md)** - DNS performance and CGNAT validation
- š **[iperf3 Test Scenarios](docs/iperf-test-scenarios.md)** - All 18 test scenarios explained
### š§ Advanced Topics
- š **[Custom Plugins Guide](docs/custom-plugins-guide.md)** - Plugin development and examples
- š **[Extending the Analyzer](docs/extending-the-analyzer.md)** - Advanced customization
- š ļø **[Troubleshooting Examples](docs/troubleshooting-examples.md)** - Solutions and usage examples
## š¤ Contributing
We welcome contributions to improve NPA performance testing capabilities!
### š Quick Contribution
```bash
# Fork and clone the repository
git clone https://github.com/your-username/network-performance-analyzer.git
cd network-performance-analyzer
# Create feature branch
git checkout -b feature/npa-enhancement
# Make changes and test
npm test
npm run lint
# Submit pull request
git push origin feature/npa-enhancement
```
### š Contribution Areas
- š **NPA-specific analysis algorithms**
- š **CGNAT validation improvements**
- š **New visualization types**
- š **Plugin examples and templates**
- š **Documentation improvements**
## š License
MIT License - see [LICENSE](LICENSE) file for details.
---
<div align="center">
**Built for Netskope Private Access Performance Testing**
_Ensuring optimal NPA performance through comprehensive network analysis_
[](https://github.com/your-org/network-performance-analyzer)
[](https://github.com/your-org/network-performance-analyzer/fork)
</div>