Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yankeguo-deprecated/sptp-alt

UDP protocol for arbitrary large data
https://github.com/yankeguo-deprecated/sptp-alt

go golang golang-library protocol udp

Last synced: about 16 hours ago
JSON representation

UDP protocol for arbitrary large data

Awesome Lists containing this project

README

        

# SPTP

[![Build Status](https://travis-ci.org/go-guoyk/sptp.svg?branch=master)](https://travis-ci.org/go-guoyk/sptp)
[![Go Report Card](https://goreportcard.com/badge/go.guoyk.net/sptp)](https://goreportcard.com/report/go.guoyk.net/sptp)
![GitHub](https://img.shields.io/github/license/go-guoyk/sptp.svg)

Simple Payload Transmission Protocol

We assume protocol is handled via internal networking, thus UDP can be considered as a reliable transport.

The only problem is UDP packet size limitation, we solve this by chunk reassembling with unique message id.

## Packet Format

binary format, little-endian

* 1 byte, magic number, `0xAF`
* 1 byte, mode
* bit 0, 1 = chunked message, 0 = simple message
* bit 1, 1 = gzipped, 0 = plain
* (for chunked message only), 10 bytes, chunks info
* 8 byte (uint64), unique message id, random generated
* 1 byte, total chunk count
* 1 byte, current chunk index
* n bytes, (segmented) payload

## Credit

Guo Y.K., MIT License