All Projects → ggrandes → jrinetd

ggrandes / jrinetd

Licence: Apache-2.0 License
Jrinetd is a network TCP port redirector/forward proxy (like rinetd) with extra features like connection Failover, LoadBalancing and Clustering. In pure Java (NIO)

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to jrinetd

Linkerd Tcp
A TCP/TLS load balancer for Linkerd 1.x.
Stars: ✭ 516 (+2480%)
Mutual labels:  tcp, load-balancer
Haproxy
HAProxy Load Balancer's development branch (mirror of git.haproxy.org)
Stars: ✭ 2,463 (+12215%)
Mutual labels:  load-balancer, proxy-protocol
Convey
Layer 4 load balancer with dynamic configuration loading
Stars: ✭ 168 (+740%)
Mutual labels:  tcp, load-balancer
Lazy Balancer
nginx for balancer web ui
Stars: ✭ 499 (+2395%)
Mutual labels:  tcp, load-balancer
Inlets Operator
Add public LoadBalancers to your local Kubernetes clusters
Stars: ✭ 795 (+3875%)
Mutual labels:  tcp, load-balancer
Gobetween
☁️ Modern & minimalistic load balancer for the Сloud era
Stars: ✭ 1,631 (+8055%)
Mutual labels:  tcp, load-balancer
HAProxy-2-RPM-builder
Build latest HAProxy binary with prometheus metrics support
Stars: ✭ 28 (+40%)
Mutual labels:  load-balancer, proxy-protocol
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+350%)
Mutual labels:  tcp
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (+415%)
Mutual labels:  tcp
cs
开箱即用的基于命令的消息处理框架,让 websocket 和 tcp 开发就像 http 那样简单
Stars: ✭ 19 (-5%)
Mutual labels:  tcp
PsNetTools
PsNetTools is a cross platform PowerShell module to test network features on Windows, Linux and Mac.
Stars: ✭ 13 (-35%)
Mutual labels:  tcp
Python-Botnet
This is a simple DDoS python botnet script with remote monitoring & management for education purposes.
Stars: ✭ 119 (+495%)
Mutual labels:  tcp
escper
Ruby gem for printing of images and text on one or many thermal printers
Stars: ✭ 67 (+235%)
Mutual labels:  tcp
messenger
TCP 即时通讯 WPF 界面.
Stars: ✭ 18 (-10%)
Mutual labels:  tcp
tcp-proxy
A TCP proxy in 30 lines of Rust
Stars: ✭ 30 (+50%)
Mutual labels:  tcp
ustcp
Pure Rust TCP stack in user-space running on TUN/TAP
Stars: ✭ 31 (+55%)
Mutual labels:  tcp
cheshuo
🎃A lightweight game server framework. Based on Springboot and Netty. Using ProtoBuf as communication between client and server.
Stars: ✭ 23 (+15%)
Mutual labels:  tcp
XTCP
一个便捷的TCP消息包拼装和解析框架
Stars: ✭ 20 (+0%)
Mutual labels:  tcp
riemannx
A riemann client for elixir (TCP/UDP/TLS supported)
Stars: ✭ 23 (+15%)
Mutual labels:  tcp
ddos
Simple dos attack utility
Stars: ✭ 36 (+80%)
Mutual labels:  tcp

jrinetd

jrinetd is an open source (Apache License, Version 2.0) Java TCP port redirector proxy. Do not require any external lib.

Current Stable Version is 1.1.2


DOC

Schema about Forward / Port Redirector:

Forward / Port Redirector

  1. Machine-A (Client) init connection to Machine-B (jrinetd)
  2. Machine-B init connection to Machine-C (Server)
  3. Done: Machine-A is able to speak with Machine-C
Notes about security:
  • Machine-A (Client) may be in Internal network.
  • Machine-B (jrinetd) may be in DMZ.
  • Machine-C (Server) may be in External network.

System Properties (optional)

# To redir stdout/stderr to (auto-daily-rotated) files you can use:
-Dlog.stdOutFile=/var/log/jrinetd.out -Dlog.stdErrFile=/var/log/jrinetd.err
# To log to stdout too:
-Dlog.stdToo=true 
Filenames are a base-pattern, output files they will be: jrinetd.xxx.YEAR-MONTH-DAY (jrinetd.xxx.2015-08-01)

Config (jrinetd.conf)

Config file must be in class-path ${JRINETD_HOME}/conf/, general format is:

#### Forward / Port Redirector
## forward <listen-addr>:<listen-port> <endpoint-list> [opts]

# Note: <endpoint-list> can be a coma separated list of addresses, like "srv1:80,srv2:80,10.0.0.3:8080"
Options are comma separated:
  • Options for outgoing connections
    • Loadbalancing (only one option can be used)
      • LB=NONE: disable LoadBalancing
      • LB=ORDER: active LoadBalancing in order (DNS resolved IP address are sorted, lower first { 10.0.0.1, 10.0.0.2, 192.168.0.1 })
      • LB=RR: active LoadBalancing in round-robin (DNS order)
      • LB=RAND: activate LoadBalancing in random order
      • LB=RANDRR: activate LoadBalancing in random order and round-robin
    • Failover (default disabled)
      • FAILOVER: enable FailOver (if connect fail, try next address)
    • Sticky Session
      • STICKY=MEM:bitmask:elements:ttl:sticky-name[:cluster-name]: activate Sticky session based on IP Source Address. Sessions are stored in MEMory, bitmask is a CIDR to apply in source-ip-address (16=Class B, 24=Class C, 32=Unique host), elements for LRU cache, ttl is time to live of elements in cache (seconds), sticky-name and cluster-name in cluster environment is cluster identifier and replication identifier respectively.
  • Options for inbound connections
    • PROXY=SEND: use PROXY protocol (v1), generate header for remote server
Example config of Forward / Port Redirector:
# <listen-addr>:<listen-port> <endpoint-list> [opts]
forward 0.0.0.0:80 10.0.0.1:8080,10.0.0.2:8080
forward 127.0.0.1:443 www.acme.com:443 LB=RR,STICKY=MEM:24:128:300:sticky1

Running (Linux)

./bin/jrinetd.sh <start|stop|restart|reload|status>

TODOs

  • Use Log4J
  • Limit number of connections
  • Limit absolute timeout/TTL of a connection
  • Configurable retry-sleeps
  • Thread pool/control
  • Custom timeout by binding
  • Audit threads / connections
  • Statistics/Accounting
  • JMX

DONEs

  • NIO (v1.0.0)
  • BufferPool for reduce GC pressure (v1.0.0)
  • Reload config (v1.0.0)
  • Allow alternative config names (v1.0.0)
  • Zip Packaging (Maven Assembly) (v1.0.0)
  • Allow redir stdout/stderr to File, with auto daily-rotate (v1.0.0)
  • PROXY protocol (v1) for Outgoing connections (v1.0.0)
  • Multiple endpoint-list (not only DNS multi A-record) (v1.0.0)
  • Sticky sessions in LoadBalancing (v1.0.0)
  • Use multiple thread for multi-core machines (v1.0.0)
  • Replicate Sticky Sessions over multiple jrinetd (HA) (v1.0.0)
  • Improved support for embed -a little- (v1.1.0)

MISC

Current harcoded values:

  • Buffer Pool size: 8192buffers (per thread)
  • Buffer-Length for I/O: 2048bytes
  • DNS cache: 3seconds
  • Reload config check time interval: 10seconds
  • Shutdown/Reload timeout: 30seconds
  • Cluster Connection timeout: 10seconds

Latency Benchmark

microsecs Direct Forward
min ? ?
max ? ?
avg ? ?

Throughput Benchmark

(transfers) Direct (x2) Forward (x4)
Mbytes ? ?
Mbits ? ?
All test run on localhost on a Laptop. Values are not accurate, but orientative. Latency { EchoServer, 1 byte write/read (end-to-end, round-trip), 100K iterations } Lower Better. Throughput { Chargen, 1024bytes read & write (full-duplex), total 512MBytes } Higher better.

Inspired in rinetd, this is a Java-minimalistic version.

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].