Git Product home page Git Product logo

netcode.io's Introduction

Travis Build Status

netcode.io

netcode.io is a simple protocol for creating secure client/server connections over UDP.

It’s designed for games like agar.io that shunt players from a main website or web backend to a number of dedicated server instances, with each dedicated server having some maximum number of players.

It has the following features:

  1. Connection oriented
  2. Encrypts and sign packets
  3. All packets are delivered over UDP
  4. Only authenticated clients can connect to dedicated servers

What are the benefits?

Simplicity

netcode.io is a simple protocol that can easily be incorporated into a client, dedicated server or web backend.

It has no external dependencies except libsodium, which is widely used and well tested.

Full bidirectional transfer of data

Once a netcode.io connection is established, data can be exchanged between client and server at any rate, bidirectionally.

No head of line blocking

Data sent across netcode.io is sent over UDP so it's not subject to head of line blocking. No head of line blocking means games play better, as time series data like player inputs and object positions are transmitted as quickly as possible, without being artificially delayed waiting for dropped packets to be resent.

Connection rate limiting can be performed on the web backend

Because netcode.io servers only accept connections from clients with short-lived connect tokens, traditional web rate limiting can be applied to the REST calls that generate connect tokens for authenticated users, instead of rate limit incoming connections at the UDP protocol level for each dedicated server instance.

How does it work?

Please refer to the second half of this whitepaper: Why can't I send UDP packets from a browser?

How can I help?

This is an open source project and we welcome contributions. Please join us!

Here are some things that we think would be helpful:

  • Provide feedback on the reference implementation
  • Study the code, and look for flaws and weaknesses
  • Implement additional tests. Find ways to break the code!
  • We welcome anybody who would like to volunteer to perform a security audit of the code
  • Port netcode.io to your favorite language (eg. C#, Rust, Golang).
  • Create bindings for netcode.io for your favorite language
  • Help me finish writing the spec and provide feedback on the spec!
  • Develop a testing framework to guarantee that different languages implementations confirm to the spec.

Please let me know if you have any more ideas, and feel free to ask questions and get involved by logging issues.

Author

The author of this library is Glenn Fiedler, a recognized expert in the field of game network programming with over 15 years experience in the game industry.

Glenn is currently writing an article series about the development of this library called Building a Game Network Protocol.

You can support Glenn's work writing articles and open source code via Patreon.

Sponsors

netcode.io is generously sponsored by:

  • Gold Sponsors
  • Silver Sponsors
  • Bronze Sponsors

And by individual supporters on Patreon. Thank you. You make this possible!

License

BSD 3-Clause license.

netcode.io's People

Contributors

derekargueta avatar gafferongames avatar ryan-scott-dev avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.