All Projects → bparli → Convey

bparli / Convey

Licence: mit
Layer 4 load balancer with dynamic configuration loading

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Convey

Linkerd Tcp
A TCP/TLS load balancer for Linkerd 1.x.
Stars: ✭ 516 (+207.14%)
Mutual labels:  tokio, tcp, load-balancer
jrinetd
Jrinetd is a network TCP port redirector/forward proxy (like rinetd) with extra features like connection Failover, LoadBalancing and Clustering. In pure Java (NIO)
Stars: ✭ 20 (-88.1%)
Mutual labels:  tcp, load-balancer
Inlets Operator
Add public LoadBalancers to your local Kubernetes clusters
Stars: ✭ 795 (+373.21%)
Mutual labels:  tcp, load-balancer
Tk Listen
A library that allows to listen network sockets with proper resource limits and error handling
Stars: ✭ 27 (-83.93%)
Mutual labels:  tokio, tcp
Lazy Balancer
nginx for balancer web ui
Stars: ✭ 499 (+197.02%)
Mutual labels:  tcp, load-balancer
Gobetween
☁️ Modern & minimalistic load balancer for the Сloud era
Stars: ✭ 1,631 (+870.83%)
Mutual labels:  tcp, load-balancer
Ti Rpc
基于swoole封装的一个简易的JSON协议的RPC框架,思路是借鉴的,代码是自己写的。小修小改的,目前服务于前公司(注意是前公司)生产环境,每日支撑大约8000万次调用。
Stars: ✭ 144 (-14.29%)
Mutual labels:  tcp
Kalm.js
The socket manager
Stars: ✭ 155 (-7.74%)
Mutual labels:  tcp
Docker X11 Bridge
Simple Xpra X11 bridge to enable GUI with any docker image
Stars: ✭ 143 (-14.88%)
Mutual labels:  tcp
Tcpgoon
tcpgoon, maximum TCP connections tester
Stars: ✭ 141 (-16.07%)
Mutual labels:  tcp
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (-2.38%)
Mutual labels:  tcp
Simpletcp
A minimal non-blocking TCP server written for Python 3.
Stars: ✭ 162 (-3.57%)
Mutual labels:  tcp
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+1077.98%)
Mutual labels:  tcp
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+986.31%)
Mutual labels:  load-balancer
Ofxgpio
Library C++ for raspberrypi and orangepi, GPIO interfaces compatible with openframeworks.
Stars: ✭ 155 (-7.74%)
Mutual labels:  tcp
Gap Proxy
gap-proxy 是一个加速网络的 SOCKS5 安全代理工具。
Stars: ✭ 144 (-14.29%)
Mutual labels:  tcp
Shackle
High-Performance Erlang Network Client Framework
Stars: ✭ 163 (-2.98%)
Mutual labels:  tcp
Tokio Rustls
Asynchronous TLS/SSL streams for Tokio using Rustls.
Stars: ✭ 143 (-14.88%)
Mutual labels:  tokio
Lstf
The aggregated TCP flows printer in Linux
Stars: ✭ 147 (-12.5%)
Mutual labels:  tcp
Gff
GFF is a imitation QQ communication project, based on high IOCP. GFF是模仿QQ通讯项目,通信基于SAEA.MessageSocket、SAEA.Http、SAEA.MVC实现
Stars: ✭ 162 (-3.57%)
Mutual labels:  tcp

Convey

Layer 4 load balancer with dynamic configuration loading featuring proxy, passthrough and disrect server return modes

Features

  • Stats page (at /stats) with basic connection/bytes counters and backend server pool statuses
  • Dynamic configuration re-loading of backend servers and associated weights. Configuration is loaded via a .toml file (see sample.toml for a full example).
  • Tcp-based health checking of backend servers at a configured interval. If a server fails its health check it will be automatically removed from selection and added back once its health checks are successful.

Proxy Features

  • Event-driven TCP load balancer built on tokio.
  • Weighted round-robin load balancing. For uniform round robin simply leave out the weights or set them to be equal.
  • TCP connection termination

Passthrough and Direct Server Return (DSR) Features

  • Packet forwarding (no TCP termination)
  • Minimal internal connection tracking
  • NAT

Usage

Convey 0.3.5

Usage:
  convey
  convey --config=<config_file>
  convey (-p | --passthrough) --config=<config_file>
  convey (-d | --dsr) --config=<config_file>
  convey (-p | --passthrough)
  convey (-d | --dsr)
  convey (-h | --help)
  convey (-v | --version)

Options:
  -h, --help               Show this screen.s
  -p, --passthrough        Run load balancer in passthrough mode (instead of default proxy mode)
  -d, --dsr                Run load balancer in direct server mode (instead of default proxy mode)
  --config=<config_file>   Config file location [default config.toml].
  -v, --version            Show version.

Passthrough mode

For passthrough mode we need a couple iptables rules on the convey load balancer to handle ingress packets from the client and responses from the backend load balanced servers. Since TCP is not terminating we need to ensure the OS does not send a RST in response to any packets destined for a port that does not have a process bound to it. We need to do the same for any packets came back through from a backend server. Convey internally assigns ephemeral ports 32768-61000 to map connections to clients.

passthrough

For passthrough mode on the convey load balancer

sudo iptables -t raw -A PREROUTING -p tcp --dport <LOAD_BALANCER_PORT> -j DROP
sudo iptables -t raw -A PREROUTING -p tcp --sport <BACKEND_SERVER_PORT> --dport 33768:61000 -j DROP

To run

sudo ./target/release/convey --passthrough --config=sample-passthrough.toml

DSR Mode

For dsr mode we need the same iptables rule for ingress packets. Responses from the backend load balanced servers will be going directly to the clients. The "listening" port on the convey load balancer must match the backend load balanced servers listening ports in this mode.

dsr

For dsr mode on the convey load balancer

sudo iptables -t raw -A PREROUTING -p tcp --dport <LOAD_BALANCER_PORT> -j DROP

In dsr mode the backend servers "participate" in that their response packets must be sent directly to the client. Convey does not do any encapsulation so, for example, a gre tunnel is not an option. Instead, Traffic Control can be used as an egress nat.

For dsr mode on backend servers

sudo tc qdisc add dev <LOCAL_INTERFACE> root handle 10: htb

sudo tc filter add dev <LOCAL_INTERFACE> parent 10: protocol ip prio 1 u32 match ip src <LOCAL_SERVER_IP> match ip sport <LISTEN_PORT> 0xffff match ip dst <LOAD_BALANCER_IP> action ok

sudo tc filter add dev <LOCAL_INTERFACE> parent 10: protocol ip prio 10 u32 match ip src <LOCAL_SERVER_IP> match ip sport <LISTEN_PORT> 0xffff action nat egress <LOAD_BALANCER_IP>

To run

sudo ./target/release/convey --dsr --config=sample-passthrough.toml

Proxy

No special setup neccessary

proxy

To run

sudo ./target/release/convey --config=sample-proxy.toml

Tests

The easiest way to run tests is to run them as superuser. This is because some of the tests spin up test servers as well as a convey load balancer instance.

sudo ~/.cargo/bin/cargo test

Build

cargo build --release

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].