A real-time dashboard for monitoring internet connectivity in countries known for internet restrictions and control. The system aggregates data from multiple authoritative sources to provide visibility into network outages, government-imposed shutdowns, and censorship patterns.
- Interactive World Map: Visual overview of connectivity status across monitored countries using Leaflet.js
- Real-time Data Aggregation: Combines data from IODA, Cloudflare Radar, and OONI
- Historical Tracking: Stores and visualizes connectivity history with Chart.js
- Outage Detection: Tracks both government-imposed shutdowns and technical outages
- Multi-source Scoring: Weighted connectivity scores from BGP routing, active probing, traffic analysis, and censorship measurements
- BGP routing visibility from RouteViews and RIPE RIS
- Active probing from CAIDA Ark nodes
- Internet Background Radiation (darknet traffic)
- Traffic anomaly detection
- Outage tracking from Cloudflare's global network
- Real-time traffic patterns
- Censorship measurements
- Website blocking detection
- Messaging app accessibility
The system monitors countries known for internet control:
| Country | Code | Notes |
|---|---|---|
| Iran | IR | Frequent shutdowns, heavy censorship |
| Russia | RU | Increasing restrictions, VPN blocks |
| China | CN | Great Firewall, heavy censorship |
| North Korea | KP | Extremely limited access |
| Syria | SY | Conflict-related outages |
| Turkmenistan | TM | Heavy censorship |
| Belarus | BY | Shutdown during protests |
| Myanmar | MM | Military-imposed restrictions |
| Saudi Arabia | SA | Selective blocking |
| Cuba | CU | Limited infrastructure |
| Venezuela | VE | Political restrictions |
| Ethiopia | ET | Regional shutdowns |
| Pakistan | PK | Periodic blocking |
- Python 3.8+
- pip
- Clone the repository:
git clone https://github.com/yourusername/can-i-ping.git
cd can-i-ping- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- (Optional) Seed sample data for testing:
python seed_data.py- Run the application:
python run.pyThe dashboard will be available at http://localhost:5000
| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Flask secret key | dev-secret-key |
CLOUDFLARE_RADAR_TOKEN |
Cloudflare API token (optional) | None |
Edit app/config.py to:
- Add/remove monitored countries
- Adjust collection intervals
- Modify status thresholds
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main dashboard |
/api/countries |
GET | List monitored countries |
/api/connectivity/current |
GET | Current connectivity for all countries |
/api/connectivity/<code> |
GET | Detailed data for a specific country |
/api/connectivity/<code>/history |
GET | Historical data (query: ?days=7) |
/api/outages |
GET | Recent outages (query: ?days=7&country=IR) |
/api/outages/refresh |
GET | Trigger outage data refresh |
/api/sources/health |
GET | Check data source health |
/api/stats/global |
GET | Global statistics |
can-i-ping/
├── app/
│ ├── __init__.py
│ ├── app.py # Flask application
│ ├── config.py # Configuration
│ ├── models.py # SQLAlchemy models
│ ├── scheduler.py # Background data collection
│ ├── data_sources/
│ │ ├── __init__.py
│ │ ├── aggregator.py # Data aggregation logic
│ │ ├── ioda.py # IODA API client
│ │ ├── cloudflare.py # Cloudflare Radar client
│ │ └── ooni.py # OONI API client
│ ├── static/
│ │ ├── css/style.css
│ │ └── js/app.js
│ └── templates/
│ └── index.html
├── run.py # Application entry point
├── seed_data.py # Sample data generator
├── requirements.txt
└── README.md
The overall connectivity score is calculated as a weighted average:
| Component | Weight | Source |
|---|---|---|
| BGP Routing Visibility | 25% | IODA |
| Active Probing | 15% | IODA |
| Traffic Levels | 30% | Cloudflare Radar |
| Openness (inverse censorship) | 30% | OONI |
| Status | Score Range | Description |
|---|---|---|
| Normal | 80-100% | No significant issues |
| Degraded | 50-80% | Some connectivity issues |
| Disrupted | 20-50% | Significant problems |
| Down | 0-20% | Severe outage |
python run.py --debugpython run.py --no-schedulerThe application uses SQLite by default. The database file (connectivity.db) is created automatically in the project root.
To reset the database:
rm connectivity.db
python run.py # Will recreate tables
python seed_data.py # Optional: add sample dataContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
- IODA/CAIDA for BGP and active probing data
- Cloudflare Radar for traffic anomaly data
- OONI for censorship measurement data
- Leaflet.js for mapping
- Chart.js for visualizations