• Stars
    star
    940
  • Rank 46,750 (Top 1.0 %)
  • Language
    C
  • License
    BSD 3-Clause "New...
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

QUIC support for Go

goquic, QUIC support for Go

Docker Repository on Quay

This is a work-in-progress QUIC implementation for Go. This is based on libquic library, which is in turn based on original QUIC implementation on Chromium.

QUIC is an experimental protocol aimed at reducing web latency over that of TCP. On the surface, QUIC is very similar to TCP+TLS+SPDY implemented on UDP. Because TCP is implement in operating system kernels, and middlebox firmware, making significant changes to TCP is next to impossible. However, since QUIC is built on top of UDP, it suffers from no such limitations.

Key features of QUIC over existing TCP+TLS+SPDY include

  • Dramatically reduced connection establishment time
  • Improved congestion control
  • Multiplexing without head of line blocking
  • Forward error correction
  • Connection migration

Project Status

This library is highly experimental. Although libquic sources are from Chromium (which are tested), the Go bindings are still highly pre-alpha state.

Known issues:

  • No support for read streaming. All request must fit in memory.
  • Secure QUIC not fully tested. May not support ECDSA certificates.

Things to do:

  • Read streaming support

Preliminary Benchmarks

A very primitive benchmark testing have been done. Testing environments below:

Items Description
Optimization libquic built with -O3 parameters
CPU Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz
Server Code https://github.com/devsisters/goquic/blob/master/example/server.go
Server Parms GOMAXPROCS=12 ./server -port 9090 -n 12
Client Code https://github.com/devsisters/quicbench/blob/master/quicbench.go
Client Parms ./quicbench -u="https://example.com:9090/" -c 200 -r 1000

The server code is modified to create 30B, 1kB, 5kB, 10kB HTTP body payload. Concurrency is 200 and each thread requests 1,000 requests. It is designed to measure ideal throughput of the server. Naturally the throughput goes down when concurrency increases.

Benchmark results:

Payload Size Requests per Second
30B Payload 12131.25 RPS
1kB Payload 11835.13 RPS
5kB Payload 7816.21 RPS
10kB Payload 5599.73 RPS

On 10kB case, calculating the total network throughput is 458Mbps.

How many connections per second can this server process?

./gobench -u="https://example.com:9090/" -c 200 -r 100 -qk=false

Turning off keepalive using qk option results in a pure new QUIC connection per request. The benchmark results are 2905.58 CPS.

Getting Started

Get source files

go get -u -d github.com/devsisters/goquic

-u option is needed, because building (or downloading) static libraries is necessary for building and installing goquic library.

Build static library files

Although prebuilt static library files already exists in the repository for convenience, it is always good practice to build library files from source. You should not trust any unverifiable third-party binaries.

To build the library files for your architecture and OS:

./build_libs.sh (for debug build)
GOQUIC_BUILD=Release ./build_libs.sh (for release build)

This will fetch libquic master and build all the binaries from source. The C/C++ files for Go bindings will be all built too.

To build static library files, you should have cmake, C/C++ compiler, and ninja-build system (or GNU make).

Currently Linux, Mac OS X and FreeBSD is supported.

How to build

If you are using Go >= 1.5, you can build goquic binaries without any extra work.

go build $GOPATH/src/github.com/devsisters/goquic/example/server.go

If you are using Go 1.4, you should open goquic.go and manually edit ${SRCDIR} with your real path (maybe /YOUR/GOPATH/src/github.com/devsisters/goquic).

SPDY/QUIC support

We have a experimental SPDY/QUIC implementation as a library. You can use this library to add SPDY/QUIC support for your existing Go HTTP server.

See our SPDY-QUIC server/client implementation here.

How to use server

When running a HTTP server, do:

goquic.ListenAndServe(":8080", 1, nil)

instead of

http.ListenAndServe(":8080", nil)

How to use client

You need to create http.Client with Transport changed, do:

client := &http.Client{
	Transport: goquic.NewRoundTripper(false),
}
resp, err := client.Get("http://example.com/")

instead of

resp, err := http.Get("http://example.com/")

More Repositories

1

DQN-tensorflow

Tensorflow implementation of Human-Level Control through Deep Reinforcement Learning
Python
2,430
star
2

libquic

QUIC, a multiplexed stream transport over UDP
C++
1,714
star
3

pointer-network-tensorflow

TensorFlow implementation of "Pointer Networks"
Python
465
star
4

shardcake

Sharding and location transparency for Scala
Scala
358
star
5

eclair

Simple ssh tool for Amazon EC2
Ruby
121
star
6

neural-combinatorial-rl-tensorflow

in progress
Python
106
star
7

TCML-tensorflow

Tensorflow implementation of Meta-Learning with Temporal Convolutions
Python
98
star
8

checkpoint

Kubernetes policy checker
Rust
45
star
9

gospdyquic

SPDY/QUIC support for Go
38
star
10

quicbench

HTTP/QUIC load test and benchmark tool
Go
33
star
11

cine

Actor model for golang
Go
29
star
12

UnitySettings

Runtime debugging menu (like setting on Android) for Unity.
C#
28
star
13

UnityCLI

Unity TCP CLI communication for debugging
C#
24
star
14

go-caplit

Go caplit message deserializer
Go
17
star
15

king-openvpn

king-openvpn: The one VPN that connects to any network
HCL
11
star
16

ck-domain-logic-example

์Šค์นผ๋ผ ๊ฐœ๋ฐœ์ž MEET-UP! "์ˆœ์ˆ˜ํžˆ ์•„๋ฆ„๋‹ค์šด ์ฟ ํ‚ค๋Ÿฐ ํ‚น๋ค ๋„๋ฉ”์ธ ๋กœ์ง" ์„ธ์…˜ ๋ฐœํ‘œ ์ž๋ฃŒ์˜ ์˜ˆ์‹œ ์ฝ”๋“œ
Scala
10
star
17

web-packages

devsisters internal npm packages
TypeScript
7
star
18

UnityLuaREPL

C#
7
star
19

zio-agones

Lightweight Scala client for Agones SDK using ZIO
Scala
6
star
20

multi-speaker-tacotron-tensorflow

5
star
21

go-applereceipt

Apple-issued receipts parser & verifier, without any external API call
Go
4
star
22

XLSXasJSON.jl

Julia package that converts excel data to json
Julia
4
star
23

mars-addressables

https://packages.unity.com/com.unity.addressables/
C#
3
star
24

tarballize

Make tarballs of given git repository including its submodules.
Shell
3
star
25

docker-distccd

Dockerized distccd for easy distribution.
Makefile
3
star
26

gatsby-starter-typescript-workspace

A minimal GatsbyJS starter with TypeScript & pnpm workspace
CSS
3
star
27

confluence-to-notion-converter

Confluence to Notion Archive Converter
C#
3
star
28

JSONPointer.jl

implementation of JSONPointer on Julia
Julia
2
star
29

go-dyncapnp

Dynamic Cap'n'proto parsing & generating in Go
Go
2
star
30

docker-nginx-sslproxy

Dockerized nginx proxy w/ SSL suppport
Shell
1
star
31

mars-entities

https://packages.unity.com/com.unity.entities
C#
1
star
32

actions-runner-devsisters

Customized image for actions-runner-controller/actions-runner-controller
Dockerfile
1
star