Skip to content

Mowenhao13/FluteGo

Repository files navigation

FluteGo - File Delivery over Unidirectional Transport in Go implementation

Unicast File Transfer Solution for Small-Scale Scalable Deployments

简介

FluteGo 是一个基于 UDP 的单向文件传输系统,支持高性能的文件传输。提供独立的发送端和接收端程序。

快速开始

第一步:启动接收端

  1. 运行 flute_receiver_v1.0.6.exe
  2. 浏览器会自动打开 http://localhost:8080
  3. 点击"浏览"设置文件保存目录
  4. 等待接收文件

第二步:启动发送端

  1. 运行 flute_sender_v1.0.6.exe
  2. 浏览器会自动打开 http://localhost:8081
  3. 目标 IP 默认为 127.0.0.1(本地测试),如需发送到其他机器请输入接收端的 IP 地址
  4. 点击"设置"保存目标 IP
  5. 点击"选择文件"添加要发送的文件
  6. 选择 FEC 编码方式(NoCode 或 RaptorQ)
  7. 文件会自动开始传输

安装程序

  1. 运行 setup.exe
  2. 按照提示选择安装目录
  3. 程序会自动创建配置文件到 ~/.flutego/config/
  4. 在安装目录运行相应的程序

配置文件

配置文件位于 ~/.flutego/config/ 目录:

发送端配置 (config_sender.json):

{
  "destIP": "127.0.0.1",
  "rateLimitMbps": 500,
  "server": {
    "port": 8081,
    "enabled": true
  },
  "network": {
    "baseFilePort": 3400,
    "numPorts": 1
  }
}

接收端配置 (config_receiver.json):

{
  "saveFileDir": "C:\\Downloads",
  "server": {
    "port": 8080,
    "enabled": true
  },
  "network": {
    "baseFilePort": 3400,
    "numPorts": 1
  }
}

FEC 编码方式

编码方式 说明 适用场景
NoCode 无前向纠错,性能最高 网络质量好,追求最高速度
RaptorQ 高效的 FEC 编码,可恢复丢包 网络有丢包风险

性能

在 10Gbps 网络环境下测试的性能数据:

NoCode 模式:

  • 吞吐量:~1400 Mbps
  • CPU 占用低,适合高速网络

RaptorQ 模式:

  • 吞吐量:~700-1100 Mbps
  • 可容忍一定程度的丢包

系统要求

  • Windows 10/11 或 Linux
  • Go 1.21+ (编译需要)
  • 网络环境:发送端和接收端需要 UDP 可达

架构说明

sequenceDiagram
    participant MS as Meta Sender
    participant MR as Meta Receiver
    participant FS as File Sender
    participant FR as File Receiver

    Note over MS,MR: Step 1: Metadata Transfer
    MS->>MR: Send File Metadata<br/>(OTI, File Size, File Name, Type)

    Note over MR,FR: Step 2: Receiver Preparation
    MR->>FR: Start File Receiver<br/>Open Corresponding Port

    Note over MS,FS: Step 3: Data Transmission
    MS->>FS: Start File Sender
    FS->>FR: Asynchronously Send File Data

    Note over FR: Step 4: Resource Cleanup
    FR->>FR: Data Receiving Completed<br/>Close Port
Loading

致谢

  • 协议灵感来源:ypo/flute - Rust 语言的 FLUTE 实现

RFC

本库实现了以下 RFC 标准:

RFC 标题 链接
RFC 6726 FLUTE - File Delivery over Unidirectional Transport https://www.rfc-editor.org/rfc/rfc6726.html
RFC 5052 Forward Error Correction (FEC) Building Block https://www.rfc-editor.org/rfc/rfc5052
RFC 5510 Reed-Solomon Forward Error Correction (FEC) Schemes https://www.rfc-editor.org/rfc/rfc5510.html

项目结构

FluteGo/
├── cmd/
│   ├── flute_sender/      # 独立发送端
│   ├── flute_receiver/    # 独立接收端
│   └── setup/             # 安装程序
├── pkg/
│   ├── apiserver/         # HTTP/WebSocket API 服务
│   ├── config/            # 配置文件加载
│   ├── iocp/              # Windows IOCP 实现
│   ├── io/                # 平台相关 IO 接口
│   ├── meta/              # 元数据协议
│   ├── oti/               # OTI (Object Transmission Information)
│   ├── pool/              # 连接池管理
│   ├── receiver/          # 文件接收器
│   ├── sender/            # 文件发送器
│   ├── sock/              # UDP Socket 封装
│   ├── system/            # 系统集成
│   └── web/               # Web 前端静态资源
├── dist/                  # 编译输出目录
└── pkg/web/static/        # 前端静态资源

版本历史

  • v1.0.6: 分离发送端和接收端 Web UI,优化界面布局,添加默认目标 IP 127.0.0.1,移除 CSV 性能日志
  • v1.0.5: 添加统一版本 flutego,支持 Web UI 文件选择,优化配置文件路径
  • v1.0.4: 添加性能统计功能,支持 CSV 导出

性能测试数据

NoCode 模式

发送端:

fdtID(1): send finished, duration=14.89s
fdtID(1): bytes sent=2623265565, throughput=1409.36 Mbps
fdtID(1): file size=2607984405, goodput=1401.15 Mbps

接收端:

File transfer completed (fdtID=1): 79590/79590 chunks, duration=14.89s
fdtID(1): bytes received=2607841280, throughput=1400.98 Mbps

RaptorQ 模式

发送端:

fdtID(1): send finished, duration=31.57s
fdtID(1): bytes sent=2913608192, throughput=738.27 Mbps
fdtID(1): file size=2607984405, goodput=660.83 Mbps

接收端:

File transfer completed (fdtID=1): 79590/79590 chunks, duration=31.57s
fdtID(1): bytes received=2607656725, throughput=660.75 Mbps

详细性能数据

完整的性能测试数据请参考 sender_performance.csvreceiver_performance.csv

About

File Delivery over Unidirectional Transport in Go implementation

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages