• Stars
    star
    1,384
  • Rank 32,610 (Top 0.7 %)
  • Language
    C++
  • License
    MIT License
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

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

Repository Details

An implementation of the QUIC transport protocol.

alt text

Linux Build Status macOS Build Status Windows Build Status

Introduction

mvfst (Pronounced move fast) is a client and server implementation of IETF QUIC protocol in C++ by Facebook. QUIC is a UDP based reliable, multiplexed transport protocol that will become an internet standard. The goal of mvfst is to build a performant implementation of the QUIC transport protocol that applications could adapt for use cases on both the internet and the data-center. mvfst has been tested at scale on android, iOS apps, as well as servers and has several features to support large scale deployments.

Features

Server features:

  • Multi-threaded UDP socket server with a thread local architecture to be able to scale to multi-core servers
  • Customizable Connection-Id routing. The default Connection-Id routing implementation integrates seamlessly with katran
  • APIs to enable zero-downtime restarts of servers, so that applications do not have to drop connections when restarting.
  • APIs to expose transport and server statistics for debuggability
  • Zero-Rtt connection establishment and customizable zero rtt path validation
  • Support for UDP Generic segmentation offloading (GSO) for faster UDP writes.

Client features:

  • Native happy eyeballs support between ipv4 and ipv6 so that applications do not need to implement it themselves
  • Pluggable congestion control and support for turning off congestion control to plug in application specific control algorithms

Source Layout

  • quic/api: Defines API that applications can use to interact with the QUIC transport layer.
  • quic/client: Client transport implementation
  • quic/codec: Read and write codec implementation for the protocol
  • quic/common: Implementation of common utility functions
  • quic/congestion_control: Implementation of different congestion control algorithms such as Cubic and Copa
  • quic/flowcontrol: Implementations of flow control functions
  • quic/handshake: Implementations cryptographic handshake layer
  • quic/happyeyeballs: Implementation of mechanism to race IPV4 and IPV6 connection and pick a winner
  • quic/logging: Implementation of logging framework
  • quic/loss: Implementations of different loss recovery algorithms
  • quic/samples: Example client and server
  • quic/server: Server transport implementation
  • quic/state: Defines and implements both connection and stream level state artifacts and state machines

Dependencies

mvfst largely depends on two libraries: folly and fizz.

Building mvfst

Method 1 [Recommended]: Using Getdeps.py

This script is used by many of Meta's OSS tools. It will download and build all of the necessary dependencies first, and will then invoke cmake, etc. to build mvfst. This will help ensure that you build with relevant versions of all of the dependent libraries, taking into account what versions are installed locally on your system.

It's written in python so you'll need python3.6 or later on your PATH. It works on Linux, macOS and Windows.

The settings for mvfst's cmake build are held in its getdeps manifest build/fbcode_builder/manifests/mvfst, which you can edit locally if desired.

Dependencies

If on Linux or MacOS (with homebrew installed) you can install system dependencies to save building them:

# Clone the repo
git clone https://github.com/facebookincubator/mvfst.git
# Install dependencies
cd mvfst
sudo ./build/fbcode_builder/getdeps.py install-system-deps --recursive --install-prefix=$(pwd)/_build mvfst

If you'd like to see the packages before installing them:

./build/fbcode_builder/getdeps.py install-system-deps --dry-run --recursive

On other platforms or if on Linux and without system dependencies getdeps.py will mostly download and build them for you during the build step.

Build

For a simplified build, you can use the getdeps.sh wrapper script. This will download and build all the required dependencies, then build mvfst. It will use the default scratch path for building and install the result in _build.

# Clone the repo
git clone https://github.com/facebookincubator/mvfst.git
# Build using the wrapper script
cd mvfst
./getdeps.sh

At the end of the build, mvfst binaries will be installed at _build/mvfst. You can find the scratch path from the logs or by running python3 ./build/fbcode_builder/getdeps.py show-build-dir mvfst.

For more control over getdeps.py, you can run the tool directly.

# Show help
python3 ./build/fbcode_builder/getdeps.py build mvfst -h
# Build mvfst, using system packages for dependencies if available
python3 ./build/fbcode_builder/getdeps.py --allow-system-packages build mvfst --install-prefix=$(pwd)/_build

Run tests

By default getdeps.py will build the tests for mvfst. You can use it to run them too:

python3 ./build/fbcode_builder/getdeps.py test mvfst --install-prefix=$(pwd)/_build

Method 2 [Deprecated]: Using build.sh script

This method can be used on Ubuntu 18+ and macOS.

To begin, you should install the dependencies we need for build. This largely consists of dependencies from folly as well as fizz.

sudo apt-get install         \
    g++                      \
    cmake                    \
    libboost-all-dev         \
    libevent-dev             \
    libdouble-conversion-dev \
    libgoogle-glog-dev       \
    libgflags-dev            \
    libiberty-dev            \
    liblz4-dev               \
    liblzma-dev              \
    libsnappy-dev            \
    make                     \
    zlib1g-dev               \
    binutils-dev             \
    libjemalloc-dev          \
    libssl-dev               \
    pkg-config               \
    libsodium-dev

Then, build and install folly and fizz

Alternatively, run the helper script build_helper.sh in this subdirectory. It will install and link the required dependencies and also build folly and fizz. This may take several minutes the first time.

./build_helper.sh

After building, the directory _build/ will contain the dependencies (under _build/deps) whereas _build/build will contain all the built libraries and binaries for mvfst.

You can also install mvfst as well as its dependencies folly and fizz to a custom directory using the build script, by supplying an INSTALL_PREFIX env var.

./build_helper.sh -i /usr/local

See ./build_helper.sh --help for more options

You might need to run the script as root to install to certain directories.

By default the build script build_helper.sh enables the building of test target (i.e. runs with -DBUILD_TEST=ON option). Since some of tests in mvfst require some test artifacts of Fizz, it is necessary to supply the path of the Fizz src directory (via option DFIZZ_PROJECT) to correctly build all test targets in mvfst.

Run a sample client and server

Building the test targets of mvfst should automatically build the sample client and server binaries into the build directory.

For getdeps.py build, you can find the echo binary at:

cd $(python3 ./build/fbcode_builder/getdeps.py show-build-dir mvfst)/quic/samples/echo

For the deprecated build.sh script, it will be at the following location if you used the default build path.

cd ./_build/build/quic/samples/echo

The server will automatically bind to ::1 by default if no host is used, but you can then spin a simple echo server by running:

./echo -mode=server -host=<host> -port=<port>

and to run a client:

./echo -mode=client -host=<host> -port=<port>

For more options, see

./echo --help

HTTP/3

This repo implements the QUIC transport. For an HTTP/3 implementation that uses Mvfst, please check out Proxygen.

Contributing

We'd love to have your help in making mvfst better. If you're interested, please read our guide to guide to contributing

Please also join our slack to ask questions or start discussions.

License

mvfst is MIT licensed, as found in the LICENSE file.

API

The API should be considered in alpha. We can't predict all the use cases that people will have, so we're waiting some time before declaring a more stable API. We are open to have several different APIs for different constraints.

Reporting and Fixing Security Issues

Please do not open GitHub issues or pull requests - this makes the problem immediately visible to everyone, including malicious actors. Security issues in mvfst can be safely reported via Facebook's Whitehat Bug Bounty program:

https://www.facebook.com/whitehat

Facebook's security team will triage your report and determine whether or not is it eligible for a bounty under our program.

More Repositories

1

react

The library for web and native user interfaces.
JavaScript
221,340
star
2

react-native

A framework for building native applications using React
C++
115,640
star
3

create-react-app

Set up a modern web app by running one command.
JavaScript
101,534
star
4

docusaurus

Easy to maintain open source documentation websites.
TypeScript
52,724
star
5

jest

Delightful JavaScript Testing.
TypeScript
41,554
star
6

rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
C++
27,271
star
7

folly

An open-source C++ library developed and used at Facebook.
C++
26,731
star
8

flow

Adds static typing to JavaScript to improve developer productivity and code quality.
OCaml
22,040
star
9

zstd

Zstandard - Fast real-time compression algorithm
C
21,685
star
10

relay

Relay is a JavaScript framework for building data-driven React applications.
Rust
18,099
star
11

hhvm

A virtual machine for executing programs written in Hack.
C++
17,960
star
12

prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
Python
17,624
star
13

lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
TypeScript
17,322
star
14

fresco

An Android library for managing images and the memory they use.
Java
17,026
star
15

yoga

Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates.
C++
16,729
star
16

infer

A static analyzer for Java, C, C++, and Objective-C
OCaml
14,599
star
17

flipper

A desktop debugging platform for mobile developers.
TypeScript
13,124
star
18

watchman

Watches files and records, or triggers actions, when they change.
C++
12,124
star
19

react-devtools

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.
11,024
star
20

hermes

A JavaScript engine optimized for running React Native.
C++
9,167
star
21

chisel

Chisel is a collection of LLDB commands to assist debugging iOS apps.
Python
9,072
star
22

jscodeshift

A JavaScript codemod toolkit.
JavaScript
8,850
star
23

buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
Java
8,568
star
24

stylex

StyleX is the styling system for ambitious user interfaces.
JavaScript
7,988
star
25

proxygen

A collection of C++ HTTP libraries including an easy to use HTTP server.
C++
7,978
star
26

facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
Swift
7,644
star
27

litho

A declarative framework for building efficient UIs on Android.
Java
7,633
star
28

pyre-check

Performant type-checking for python.
OCaml
6,620
star
29

facebook-android-sdk

Used to integrate Android apps with Facebook Platform.
Kotlin
6,020
star
30

redex

A bytecode optimizer for Android apps
C++
5,951
star
31

componentkit

A React-inspired view framework for iOS.
Objective-C++
5,740
star
32

sapling

A Scalable, User-Friendly Source Control System.
Rust
5,635
star
33

fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
C
5,061
star
34

PathPicker

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything. After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.
Python
5,033
star
35

metro

πŸš‡ The JavaScript bundler for React Native
JavaScript
4,996
star
36

prop-types

Runtime type checking for React props and similar objects
JavaScript
4,427
star
37

idb

idb is a flexible command line interface for automating iOS simulators and devices
Objective-C
4,356
star
38

Haxl

A Haskell library that simplifies access to remote data, such as databases or web-based services.
Haskell
4,220
star
39

FBRetainCycleDetector

iOS library to help detecting retain cycles in runtime.
Objective-C++
4,178
star
40

memlab

A framework for finding JavaScript memory leaks and analyzing heap snapshots
TypeScript
4,088
star
41

duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Haskell
3,995
star
42

fbt

A JavaScript Internationalization Framework
JavaScript
3,836
star
43

regenerator

Source transformer enabling ECMAScript 6 generator functions in JavaScript-of-today.
JavaScript
3,795
star
44

mcrouter

Mcrouter is a memcached protocol router for scaling memcached deployments.
C++
3,186
star
45

buck2

Build system, successor to Buck
Rust
3,177
star
46

wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
C++
3,016
star
47

wdt

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.
C++
2,827
star
48

igl

Intermediate Graphics Library (IGL) is a cross-platform library that commands the GPU. It provides a single low-level cross-platform interface on top of various graphics APIs (e.g. OpenGL, Metal and Vulkan).
C++
2,674
star
49

fbthrift

Facebook's branch of Apache Thrift, including a new C++ server.
C++
2,513
star
50

mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
C++
2,423
star
51

Ax

Adaptive Experimentation Platform
Python
2,226
star
52

jsx

The JSX specification is a XML-like syntax extension to ECMAScript.
HTML
1,941
star
53

fbjs

A collection of utility libraries used by other Meta JS projects.
JavaScript
1,939
star
54

react-native-website

The React Native website and docs
JavaScript
1,875
star
55

screenshot-tests-for-android

Generate fast deterministic screenshots during Android instrumentation tests
Java
1,727
star
56

idx

Library for accessing arbitrarily nested, possibly nullable properties on a JavaScript object.
JavaScript
1,687
star
57

TextLayoutBuilder

An Android library that allows you to build text layouts more easily.
Java
1,464
star
58

SoLoader

Native code loader for Android
Java
1,269
star
59

facebook-python-business-sdk

Python SDK for Meta Marketing APIs
Python
1,211
star
60

ThreatExchange

Trust & Safety tools for working together to fight digital harms.
C++
1,092
star
61

mariana-trench

A security focused static analysis tool for Android and Java applications.
C++
1,022
star
62

CacheLib

Pluggable in-process caching engine to build and scale high performance services
C++
1,018
star
63

fatal

Fatal is a library for fast prototyping software in modern C++. It provides facilities to enhance the expressive power of C++. The library is heavily based on template meta-programming, while keeping the complexity under-the-hood.
C++
993
star
64

transform360

Transform360 is an equirectangular to cubemap transform for 360 video.
C
991
star
65

openr

Distributed platform for building autonomic network functions.
C++
879
star
66

fboss

Facebook Open Switching System Software for controlling network switches.
C++
842
star
67

facebook-php-business-sdk

PHP SDK for Meta Marketing API
PHP
787
star
68

ktfmt

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
Kotlin
776
star
69

winterfell

A STARK prover and verifier for arbitrary computations
Rust
691
star
70

pyre2

Python wrapper for RE2
C++
629
star
71

openbmc

OpenBMC is an open software framework to build a complete Linux image for a Board Management Controller (BMC).
C
607
star
72

SPARTA

SPARTA is a library of software components specially designed for building high-performance static analyzers based on the theory of Abstract Interpretation.
C++
604
star
73

chef-cookbooks

Open source chef cookbooks.
Ruby
561
star
74

IT-CPE

Meta's Client Platform Engineering tools. Some of the tools we have written to help manage our fleet of client systems.
Ruby
553
star
75

time

Meta's Time libraries
Go
471
star
76

facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
JavaScript
464
star
77

facebook-sdk-for-unity

The facebook sdk for unity.
C#
461
star
78

lexical-ios

Lexical iOS is an extensible text editor framework that integrates the APIs and philosophies from Lexical Web with a Swift API built on top of TextKit.
Swift
446
star
79

Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
JavaScript
425
star
80

FAI-PEP

Facebook AI Performance Evaluation Platform
Python
379
star
81

facebook-java-business-sdk

Java SDK for Meta Marketing APIs
Java
374
star
82

chef-utils

Utilities related to Chef
Ruby
287
star
83

opaque-ke

An implementation of the OPAQUE password-authenticated key exchange protocol
Rust
262
star
84

dns

Collection of Meta's DNS Libraries
Go
251
star
85

facebook360_dep

Facebook360 Depth Estimation Pipeline - https://facebook.github.io/facebook360_dep
HTML
238
star
86

akd

An implementation of an auditable key directory
Rust
207
star
87

tac_plus

A Tacacs+ Daemon tested on Linux (CentOS) to run AAA via TACACS+ Protocol via IPv4 and IPv6.
C
205
star
88

facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
Ruby
200
star
89

dotslash

Simplified executable deployment
Rust
165
star
90

usort

Safe, minimal import sorting for Python projects.
Python
161
star
91

grocery-delivery

The Grocery Delivery utility for managing cookbook uploads to distributed Chef backends.
Ruby
151
star
92

taste-tester

Software to manage a chef-zero instance and use it to test changes on production servers.
Ruby
144
star
93

TestSlide

A Python test framework
Python
139
star
94

homebrew-fb

OS X Homebrew formulas to install Meta open source software
Ruby
122
star
95

sapp

Post Processor for Facebook Static Analysis Tools.
Python
122
star
96

squangle

SQuangLe is a C++ API for accessing MySQL servers
C++
119
star
97

threat-research

Welcome to the Meta Threat Research Indicator Repository, a dedicated resource for the sharing of Indicators of Compromise (IOCs) and other threat indicators with the external research community
Python
115
star
98

ocamlrep

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust
Rust
97
star
99

bpfilter

BPF-based packet filtering framework
C
79
star
100

facebook-business-sdk-codegen

Codegen project for our business SDKs
PHP
74
star