# HighFlowNTRIP Server
## Project Introduction
**HighFlowNTRIP** is a high-availability, high-concurrency NTRIP (Networked Transport of RTCM via Internet Protocol) server developed based on Java + Spring Boot + Netty, specifically designed for CORS (Continuously Operating Reference Stations) systems.
The server features high-performance network processing capabilities, supporting 400+ concurrent connections, providing complete NTRIP protocol implementation and RTCM differential data push functionality, making it an ideal choice for building professional CORS station systems.
## Core Features
- **High Concurrency Processing**: Based on Netty non-blocking IO model, supporting 400+ concurrent connections
- **Complete Protocol Support**: Full implementation of NTRIP 1.0/2.0 protocols, including SOURCETABLE, GET/POST requests, ICY handshake
- **Flexible Data Sources**: Support for multiple RTCM data sources such as file, serial port, network, etc.
- **Multi-satellite System Support**: Support for GPS, BDS, GLO, GAL, QZS, SBAS and other satellite systems
- **Intelligent Data Generation**: Automatically generate RTCM data with corresponding coordinate system and satellite system based on mount point name
- **Secure Authentication**: Built-in HTTP Basic authentication system, supporting user management and access control
- **SSL/TLS Support**: Built-in SSL channel, supporting encrypted transmission for data security
- **Real-time Monitoring**: Web management interface and Actuator monitoring endpoints for real-time viewing of connection status and server performance
- **Enhanced Web API**: Rich RESTful API supporting dynamic management of users, mount points and configurations
- **Distributed Configuration**: Support for multi-instance deployment and configuration synchronization to improve system reliability
- **High Reliability**: Comprehensive exception handling, connection timeout management and fault recovery mechanisms
- **Easy to Extend**: Modular design supporting multi-data source, high-availability deployment and other extended functions
## Technology Stack
| Technology | Version | Purpose |
|------------|---------|--------|
| Spring Boot | 2.7.15 | Application Framework |
| Spring Boot Actuator | 2.7.15 | Monitoring and Management |
| Netty | 4.1.94.Final | Network Communication |
| H2/MySQL | 2.1.214/8.0.30 | Data Storage |
| Java | 17+ | Development Language |
| Maven | 3.8+ | Build Tool |
## Development Language & Environment
### Language Standards
- **Java Development Language**: Adopts Java 17 LTS version, following JSR 384 specification
- **Code Standards**: Follows Google Java Style Guide coding standards
- **Dependency Management**: Uses Maven 3.8+ for dependency management and build
### Development Environment Requirements
- **JDK**: Oracle JDK 17 LTS or OpenJDK 17 LTS and above
- **IDE**: IntelliJ IDEA 2021.3+ or Eclipse 2021-12+ recommended
- **Operating System**: Windows 10/11, Linux CentOS 7/8, Ubuntu 20.04+, macOS 10.15+
- **Memory**: 8GB+ RAM recommended for development environment
- **Disk**: 50GB+ available space recommended
## Quick Start
### Environment Requirements
- JDK 17 or higher
- Maven 3.8 or higher
### Build and Run
1. **Clone Project**
```bash
git clone https://gitee.com/guleng2005/high-flow-ntrip.git
cd highflow-ntrip
```
2. **Build Project**
```bash
mvn clean package -DskipTests
```
3. **Run Server**
```bash
# Use startup script
./run.bat
# Or run jar package directly
java -jar target/highflow-ntrip-1.0-SNAPSHOT.jar
```
**Expected Result:**
```
NTRIP服务器启动成功,端口:2101,最大并发:400
Tomcat started on port(s): 8080 (http)
HighFlowNTRIP服务器启动成功!
```
4. **Access Management Interface**
```
http://localhost:8080
```
## Test Tools
The project provides a complete test tool suite located in the `test-tools/` directory:
```
test-tools/
├── 基站模拟器/
│ ├── BaseStationSimulator.java # Simulate GNSS base station sending RTCM data
│ └── README.md
├── 移动站模拟器/
│ ├── MobileClientSimulator.java # Simulate mobile station client receiving data
│ └── README.md
├── 通用测试工具/
│ ├── NtripTestClient.java # Test mount point list query
│ └── README.md
└── NTRIP服务测试操作手册.md # Complete test process documentation
```
### Quick Test Process
**Step 1: Start NTRIP Server**
```bash
java -jar target/highflow-ntrip-1.0-SNAPSHOT.jar
```
**Step 2: Add Test Mount Point**
```bash
curl -X POST "http://localhost:8080/api/ntrip/mountpoint/add" -d "mountName=BDS-ONLY-RTCM33&rtcmType=RTCM3.3&dataSource=file&coordinateSystem=CGCS2000&satelliteSystems=BDS&desc=BeiDou-only centimeter-level mount point"
```
**Step 3: Start Base Station Simulator (New Terminal)**
```bash
java test-tools/基站模拟器/BaseStationSimulator.java
```
**Step 4: Start Mobile Station Simulator (New Terminal)**
```bash
java test-tools/移动站模拟器/MobileClientSimulator.java
```
For detailed test instructions, please refer to [NTRIP Service Test Operation Manual](test-tools/NTRIP服务测试操作手册.md).
## Key Configuration
Main configuration file: `src/main/resources/application.yml`
Core configuration items:
- `ntrip.port`: NTRIP service port (default 2101)
- `ntrip.ssl.port`: SSL service port (default 2102)
- `ntrip.ssl.enabled`: Whether to enable SSL (default false)
- `ntrip.max-connections`: Maximum concurrent connections (default 400)
- `ntrip.max-connections-per-ip`: Maximum connections per IP (default 5)
- `ntrip.idle-timeout-seconds`: Idle timeout (default 30 seconds)
- `ntrip.compression.enabled`: Whether to enable compression (default false)
- `ntrip.tcp.so-backlog`: TCP connection queue size (default 512)
- `ntrip.tcp.tcp-no-delay`: Whether to enable TCP_NODELAY (default true)
- `ntrip.tcp.so-keep-alive`: Whether to enable TCP keep-alive (default true)
- `netty.boss-threads`: Netty boss threads count (default 2)
- `netty.worker-threads`: Netty worker threads count (recommended: CPU cores * 4)
- `netty.send-buffer-size`: Send buffer size (default 16384)
- `netty.receive-buffer-size`: Receive buffer size (default 16384)
- `auth.enabled`: Whether to enable authentication (default true)
- `auth.default-user`: Default user (format: username:password, default admin:123456)
- `rtcm.data-source`: RTCM data source type (file/serial/network)
- `rtcm.file-path`: RTCM data file path
- `rtcm.default-mount-point`: Default mount point (default RTK-LITE-RTCM33)
### Mount Point Naming Convention
Mount point names support the following formats, and the system will automatically parse and generate RTCM data with corresponding configurations:
**Satellite System Identifiers**:
- `BDS`: BeiDou Navigation Satellite System
- `GPS`: GPS satellite system
- `GLO`: GLONASS satellite system
- `GAL`: Galileo satellite system
- `QZS`: Quasi-Zenith Satellite System
- `SBAS`: Satellite-Based Augmentation System
**Accuracy Levels**:
- `DGPS`: Meter-level accuracy
- `RTK`: Centimeter-level accuracy
**RTCM Versions**:
- `RTCM32`: RTCM version 3.2
- `RTCM33`: RTCM version 3.3
**Coordinate Systems**:
- `WGS84`: WGS84 coordinate system
- `CGCS2000`: China Geodetic Coordinate System 2000
**Satellite Count Limitation**:
- `12SAT`: 12 satellites
**Region Information**:
- `NORTH`/`SOUTH`/`EAST`/`WEST`: Region identifiers
**Example Mount Points**:
- `BDS-GPS-RTK`: BeiDou+GPS dual system, RTK accuracy
- `FULL-CONST-RTCM33`: Full constellation, RTCM 3.3 version
- `BDS-GPS-GLO-GAL`: Multi-constellation combination
- `BDS-ONLY-RTCM33`: BeiDou-only system, RTCM 3.3 version
## Project Structure
```
├── src/
│ ├── main/java/com/ntrip/ # Core code
│ │ ├── server/ # Netty server core
│ │ ├── handler/ # NTRIP protocol processing
│ │ ├── manager/ # Connection management
│ │ ├── auth/ # User authentication
│ │ ├── rtcm/ # RTCM data source
│ │ ├── protocol/ # Protocol parsing
│ │ ├── entity/ # Data entities
│ │ ├── repository/ # Data access
│ │ ├── web/ # Web management interface
│ │ ├── config/ # Configuration management
│ │ └── monitoring/ # Monitoring management
│ └── resources/ # Resource files
│ ├── application.yml # Main configuration file
│ └── static/ # Static resources
├── target/ # Build output
├── test-tools/ # Test tools
│ ├── 基站模拟器/ # Base station simulator
│ ├── 移动站模拟器/ # Mobile station simulator
│ ├── 通用测试工具/ # General test tools
│ └── NTRIP服务测试操作手册.md # Test documentation
├── run.bat # Startup script
└── pom.xml # Maven configuration
```
## Production Environment Deployment
- **Hardware Recommendations**: 4-core CPU, 4GB+ RAM, 10Mbps+ bandwidth
- **System Configuration**: Linux CentOS 7/8 or Ubuntu 20.04+
- **Database**: MySQL recommended for production environment instead of H2 in-memory database
- **Security Measures**: Configure firewall, SSL certificates, password encryption
- **SSL Configuration**: Enable SSL with valid certificates in production environment
- **Monitoring Configuration**: Integrate Prometheus + Grafana monitoring system
- **High Availability Deployment**: Support for multi-instance deployment and load balancing
- **Network Optimization**: Adjust TCP parameters to optimize network performance
## Extended Features
- **Multi-data Source Support**: Serial port, network and other RTCM data sources
- **SSL/TLS Encryption**: Support for secure encrypted transmission
- **Advanced Monitoring**: Prometheus + Grafana integration, Spring Boot Actuator monitoring endpoints
- **Enhanced Web API**: Rich RESTful API supporting dynamic management of users, mount points and configurations
- **Intelligent Mount Point Management**: Built-in recommended mount point initialization, supporting multiple scenario configurations
- **High Availability Deployment**: Multi-instance load balancing
- **Data Synchronization**: Multi-server data consistency guarantee
- **Network Optimization**: Support for TCP parameter tuning and connection management
## Legal Compliance
### Intellectual Property Rights
- This project is open source under the MIT License, see LICENSE file for details
- Third-party libraries used in the project follow their respective open source licenses
- Unauthorized use of this project for any commercial purpose is prohibited
### Data Compliance
- **Data Collection Compliance**: When using this system, ensure that RTCM data collection complies with relevant laws and regulations
- **Data Transmission Security**: SSL/TLS encrypted transmission is recommended in production environment
- **User Privacy Protection**: The system only collects necessary connection information and does not store user sensitive data
### Network Compliance
- **Port Usage**: Uses standard NTRIP port 2101, ensure the network environment allows access to this port
- **Firewall Configuration**: Configure firewall rules according to network security best practices
- **Bandwidth Compliance**: Ensure network bandwidth usage complies with the regulations of relevant service providers
### Industry Standard Compliance
- **NTRIP Protocol**: Follows NTRIP protocol specifications in RTCM 10403.2 standard
- **RTCM Data Format**: Supports RTCM 3.0/3.1/3.2/3.3 standard formats
- **CORS Station System**: Complies with relevant technical specifications for CORS station systems
## License
This project is licensed under the MIT License, see the LICENSE file for details.
## Contact
- **Project Maintainer**: Xi Zhihao
- **Technical Support**: 37735973@qq.com
- **Gitee**: https://gitee.com/guleng2005/high-flow-ntrip.git
---
**Note**: This project has been deployed and used in actual CORS station systems, running stably in production environments.
# HighFlowNTRIP 서버
## 프로젝트 소개
**HighFlowNTRIP**는 Java + Spring Boot + Netty를 기반으로 개발된 고가용성, 고병렬 NTRIP (Networked Transport of RTCM via Internet Protocol) 서버로, CORS (Continuously Operating Reference Stations) 스테이션 시스템을 위해 특별히 설계되었습니다.
이 서버는 고성능 네트워크 처리 능력을 가지고 있으며, 400개 이상의 동시 연결을 지원하고 완전한 NTRIP 프로토콜 구현과 RTCM 차분 데이터 푸시 기능을 제공하여 전문 CORS 스테이션 시스템을 구축하는 데 이상적인 선택입니다.
## 주요 기능
- **고병렬 처리**: Netty 논블로킹 IO 모델 기반, 400개 이상의 동시 연결 지원
- **완벽한 프로토콜 지원**: SOURCETABLE, GET/POST 요청, ICY 핸드셰이크를 포함한 NTRIP 1.0/2.0 프로토콜 완전 구현
- **유연한 데이터 소스**: 파일, 시리얼 포트, 네트워크 등 다중 RTCM 데이터 소스 지원
- **다중 위성 시스템 지원**: GPS, BDS, GLO, GAL, QZS, SBAS 등 다양한 위성 시스템 지원
- **지능형 데이터 생성**: 마운트 포인트 이름을 기반으로 해당 좌표계와 위성 시스템의 RTCM 데이터를 자동 생성
- **안전한 인증**: HTTP Basic 인증 시스템 내장, 사용자 관리 및 접근 제어 지원
- **SSL/TLS 지원**: SSL 채널 내장, 암호화 전송을 지원하여 데이터 보안 보장
- **실시간 모니터링**: 웹 관리 인터페이스 및 Actuator 모니터링 엔드포인트를 통한 연결 상태 및 서버 성능 실시간 확인
- **향상된 웹 API**: 풍부한 RESTful API를 제공하여 사용자, 마운트 포인트 및 구성을 동적으로 관리 지원
- **분산 구성**: 다중 인스턴스 배포 및 구성 동기화를 지원하여 시스템 신뢰성 향상
- **높은 신뢰성**: 포괄적인 예외 처리, 연결 시간 초과 관리 및 장애 복구 메커니즘
- **확장 용이**: 다중 데이터 소스, 고가용성 배포 등 확장 기능을 지원하는 모듈식 설계
## 기술 스택
| 기술 | 버전 | 용도 |
|------|------|------|
| Spring Boot | 2.7.15 | 애플리케이션 프레임워크 |
| Spring Boot Actuator | 2.7.15 | 모니터링 및 관리 |
| Netty | 4.1.94.Final | 네트워크 통신 |
| H2/MySQL | 2.1.214/8.0.30 | 데이터 스토리지 |
| Java | 17+ | 개발 언어 |
| Maven | 3.8+ | 빌드 도구 |
## 개발 언어 및 환경
### 언어 표준
- **Java 개발 언어**: Java 17 LTS 버전 채용, JSR 384 사양 준수
- **코드 규범**: Google Java Style Guide 코딩 규범 준수
- **의존성 관리**: Maven 3.8+를 사용하여 의존성 관리 및 빌드 수행
### 개발 환경 요구 사항
- **JDK**: Oracle JDK 17 LTS 또는 OpenJDK 17 LTS 이상
- **IDE**: IntelliJ IDEA 2021.3+ 또는 Eclipse 2021-12+ 권장
- **운영 체제**: Windows 10/11, Linux CentOS 7/8, Ubuntu 20.04+, macOS 10.15+
- **메모리**: 개발 환경에서 8GB+ RAM 권장
- **디스크**: 50GB+ 사용 가능한 공간 권장
## 빠른 시작
### 환경 요구 사항
- JDK 17 이상
- Maven 3.8 이상
### 빌드 및 실행
1. **프로젝트 클론**
```bash
git clone https://gitee.com/guleng2005/high-flow-ntrip.git
cd highflow-ntrip
```
2. **프로젝트 빌드**
```bash
mvn clean package -DskipTests
```
3. **서버 실행**
```bash
# 시작 스크립트 사용
./run.bat
# 또는 직접 jar 패키지 실행
java -jar target/highflow-ntrip-1.0-SNAPSHOT.jar
```
**예상 결과:**
```
NTRIP服务器启动成功,端口:2101,最大并发:400
Tomcat started on port(s): 8080 (http)
HighFlowNTRIP服务器启动成功!
```
4. **관리 인터페이스 접근**
```
http://localhost:8080
```
## 테스트 도구
프로젝트는 `test-tools/` 디렉토리에 완전한 테스트 도구 모음을 제공합니다:
```
test-tools/
├── 基站模拟器/
│ ├── BaseStationSimulator.java # GNSS 기지국을 시뮬레이션하여 RTCM 데이터 전송
│ └── README.md
├── 移动站模拟器/
│ ├── MobileClientSimulator.java # 모바일 스테이션 클라이언트를 시뮬레이션하여 데이터 수신
│ └── README.md
├── 通用测试工具/
│ ├── NtripTestClient.java # 마운트 포인트 목록 쿼리 테스트
│ └── README.md
└── NTRIP服务测试操作手册.md # 완전한 테스트 프로세스 문서
```
### 빠른 테스트 프로세스
**단계 1: NTRIP 서버 시작**
```bash
java -jar target/highflow-ntrip-1.0-SNAPSHOT.jar
```
**단계 2: 테스트 마운트 포인트 추가**
```bash
curl -X POST "http://localhost:8080/api/ntrip/mountpoint/add" -d "mountName=BDS-ONLY-RTCM33&rtcmType=RTCM3.3&dataSource=file&coordinateSystem=CGCS2000&satelliteSystems=BDS&desc=BeiDou 전용 센티미터급 마운트 포인트"
```
**단계 3: 기지국 시뮬레이터 시작 (새 터미널)**
```bash
java test-tools/基站模拟器/BaseStationSimulator.java
```
**단계 4: 모바일 스테이션 시뮬레이터 시작 (새 터미널)**
```bash
java test-tools/移动站模拟器/MobileClientSimulator.java
```
자세한 테스트 지침은 [NTRIP 서비스 테스트 운영 매뉴얼](test-tools/NTRIP服务测试操作手册.md)을 참조하십시오.
## 주요 구성
주요 구성 파일: `src/main/resources/application.yml`
핵심 구성 항목:
- `ntrip.port`: NTRIP 서비스 포트 (기본값 2101)
- `ntrip.ssl.port`: SSL 서비스 포트 (기본값 2102)
- `ntrip.ssl.enabled`: SSL 활성화 여부 (기본값 false)
- `ntrip.max-connections`: 최대 동시 연결 수 (기본값 400)
- `ntrip.max-connections-per-ip`: IP당 최대 연결 수 (기본값 5)
- `ntrip.idle-timeout-seconds`: 유휴 타임아웃 (기본값 30초)
- `ntrip.compression.enabled`: 압축 활성화 여부 (기본값 false)
- `ntrip.tcp.so-backlog`: TCP 연결 대기열 크기 (기본값 512)
- `ntrip.tcp.tcp-no-delay`: TCP_NODELAY 활성화 여부 (기본값 true)
- `ntrip.tcp.so-keep-alive`: TCP keep-alive 활성화 여부 (기본값 true)
- `netty.boss-threads`: Netty boss 스레드 수 (기본값 2)
- `netty.worker-threads`: Netty 작업 스레드 수 (권장: CPU 코어 수 * 4)
- `netty.send-buffer-size`: 전송 버퍼 크기 (기본값 16384)
- `netty.receive-buffer-size`: 수신 버퍼 크기 (기본값 16384)
- `auth.enabled`: 인증 활성화 여부 (기본값 true)
- `auth.default-user`: 기본 사용자 (형식: 사용자명:비밀번호, 기본값 admin:123456)
- `rtcm.data-source`: RTCM 데이터 소스 유형 (file/serial/network)
- `rtcm.file-path`: RTCM 데이터 파일 경로
- `rtcm.default-mount-point`: 기본 마운트 포인트 (기본값 RTK-LITE-RTCM33)
### 마운트 포인트 명명 규칙
마운트 포인트 이름은 다음 형식을 지원하며, 시스템은 자동으로 해당 구성의 RTCM 데이터를 구문 분석하고 생성합니다:
**위성 시스템 식별자**:
- `BDS`: 북두 위성 시스템
- `GPS`: GPS 위성 시스템
- `GLO`: GLONASS 위성 시스템
- `GAL`: 갈릴레오 위성 시스템
- `QZS`: 준천정 위성 시스템
- `SBAS`: 위성 기반 증강 시스템
**정밀도 수준**:
- `DGPS`: 미터급 정밀도
- `RTK`: 센티미터급 정밀도
**RTCM 버전**:
- `RTCM32`: RTCM 버전 3.2
- `RTCM33`: RTCM 버전 3.3
**좌표계**:
- `WGS84`: WGS84 좌표계
- `CGCS2000`: 중국 측지 좌표계 2000
**위성 수 제한**:
- `12SAT`: 12개 위성
**지역 정보**:
- `NORTH`/`SOUTH`/`EAST`/`WEST`: 지역 식별자
**마운트 포인트 예**:
- `BDS-GPS-RTK`: 북두+GPS 듀얼 시스템, RTK 정밀도
- `FULL-CONST-RTCM33`: 전체 성좌, RTCM 3.3 버전
- `BDS-GPS-GLO-GAL`: 다중 성좌 조합
- `BDS-ONLY-RTCM33`: 북두 전용 시스템, RTCM 3.3 버전
## 프로젝트 구조
```
├── src/
│ ├── main/java/com/ntrip/ # 핵심 코드
│ │ ├── server/ # Netty 서버 코어
│ │ ├── handler/ # NTRIP 프로토콜 처리
│ │ ├── manager/ # 연결 관리
│ │ ├── auth/ # 사용자 인증
│ │ ├── rtcm/ # RTCM 데이터 소스
│ │ ├── protocol/ # 프로토콜 파싱
│ │ ├── entity/ # 데이터 엔티티
│ │ ├── repository/ # 데이터 접근
│ │ ├── web/ # 웹 관리 인터페이스
│ │ ├── config/ # 구성 관리
│ │ └── monitoring/ # 모니터링 관리
│ └── resources/ # 리소스 파일
│ ├── application.yml # 주요 구성 파일
│ └── static/ # 정적 리소스
├── target/ # 빌드 출력
├── test-tools/ # 테스트 도구
│ ├── 基站模拟器/ # 기지국 시뮬레이터
│ ├── 移动站模拟器/ # 모바일 스테이션 시뮬레이터
│ ├── 通用测试工具/ # 일반 테스트 도구
│ └── NTRIP服务测试操作手册.md # 테스트 문서
├── run.bat # 시작 스크립트
└── pom.xml # Maven 구성
```
## 생산 환경 배포
- **하드웨어 권장 사항**: 4코어 CPU, 4GB+ RAM, 10Mbps+ 대역폭
- **시스템 구성**: Linux CentOS 7/8 또는 Ubuntu 20.04+
- **데이터베이스**: 생산 환경에서는 H2 인메모리 데이터베이스 대신 MySQL 사용 권장
- **보안 조치**: 방화벽, SSL 인증서, 비밀번호 암호화 구성
- **SSL 구성**: 생산 환경에서는 SSL을 활성화하고 유효한 인증서를 구성하는 것이 좋습니다
- **모니터링 구성**: Prometheus + Grafana 모니터링 시스템 통합
- **고가용성 배포**: 다중 인스턴스 배포 및 로드 밸런싱 지원
- **네트워크 최적화**: TCP 매개변수를 조정하여 네트워크 성능 최적화
## 확장 기능
- **다중 데이터 소스 지원**: 시리얼 포트, 네트워크 등 다중 RTCM 데이터 소스
- **SSL/TLS 암호화**: 안전한 암호화 전송 지원
- **고급 모니터링**: Prometheus + Grafana 통합, Spring Boot Actuator 모니터링 엔드포인트
- **향상된 웹 API**: 풍부한 RESTful API를 제공하여 사용자, 마운트 포인트 및 구성을 동적으로 관리 지원
- **지능형 마운트 포인트 관리**: 내장된 권장 마운트 포인트 초기화, 다중 시나리오 구성 지원
- **고가용성 배포**: 다중 인스턴스 로드 밸런싱
- **데이터 동기화**: 다중 서버 데이터 일관성 보장
- **네트워크 최적화**: TCP 매개변수 조정 및 연결 관리 지원
## 라이선스
이 프로젝트는 MIT 라이선스에 따라 오픈 소스로 제공됩니다. 자세한 내용은 LICENSE 파일을 참조하십시오.
## 연락처
- **프로젝트 관리자**: 시즈하오 (Xi Zhihao)
- **기술 지원**: 37735973@qq.com
- **Gitee**: https://gitee.com/guleng2005/high-flow-ntrip.git
---
**참고**: 이 프로젝트는 실제 CORS 스테이션 시스템에 배포되어 사용되고 있으며, 생산 환경에서 안정적으로 운영되고 있습니다.