All Projects → newtools → Zsocket

newtools / Zsocket

Licence: mit
Zero-copy sockets for Linux in Golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Zsocket

protocol
Easy protocol definitions in Rust
Stars: ✭ 151 (-80.54%)
Mutual labels:  tcp, network-programming
Dnsguide
A guide to writing a DNS Server from scratch in Rust
Stars: ✭ 2,226 (+186.86%)
Mutual labels:  tcp, network-programming
Pypacker
📦 The fastest and simplest packet manipulation lib for Python
Stars: ✭ 216 (-72.16%)
Mutual labels:  tcp, ethernet
dumb
Dumb User Mode Bridge
Stars: ✭ 20 (-97.42%)
Mutual labels:  ethernet, network-programming
packet
📦 Send network packets over a TCP or UDP connection.
Stars: ✭ 68 (-91.24%)
Mutual labels:  tcp, network-programming
Message Io
Event-driven message library for building network applications easy and fast.
Stars: ✭ 321 (-58.63%)
Mutual labels:  tcp, network-programming
Mirage Tcpip
TCP/IP networking stack in pure OCaml, using the Mirage platform libraries. Includes IPv4/6, ICMP, and UDP/TCP support.
Stars: ✭ 277 (-64.3%)
Mutual labels:  tcp, ethernet
Cnp3
Computer Networking : Principles, Protocols and Practice (first and second edition, third edition is being written on https://github.com/cnp3/ebook)
Stars: ✭ 471 (-39.3%)
Mutual labels:  tcp, ethernet
Leaf
A lightweight and fast proxy utility tries to include any useful features.
Stars: ✭ 530 (-31.7%)
Mutual labels:  tcp
Violent Python3
Source code for the book "Violent Python" by TJ O'Connor. The code has been fully converted to Python 3, reformatted to comply with PEP8 standards and refactored to eliminate dependency issues involving the implementation of deprecated libraries.
Stars: ✭ 603 (-22.29%)
Mutual labels:  network-programming
Linkerd Tcp
A TCP/TLS load balancer for Linkerd 1.x.
Stars: ✭ 516 (-33.51%)
Mutual labels:  tcp
Impulse
💣 Impulse Denial-of-service ToolKit
Stars: ✭ 538 (-30.67%)
Mutual labels:  tcp
Learning tools
Go 学习、Go 进阶、Go 实用工具类、Go-kit ,Go-Micro 微服务实践、Go 推送
Stars: ✭ 605 (-22.04%)
Mutual labels:  tcp
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (-31.44%)
Mutual labels:  tcp
Chisel
A fast TCP/UDP tunnel over HTTP
Stars: ✭ 6,557 (+744.97%)
Mutual labels:  tcp
Gsnova
Private proxy solution & network troubleshooting tool.
Stars: ✭ 509 (-34.41%)
Mutual labels:  tcp
Swoole study
一份Swoole入门教程,根据作者的个人理解编写,常见的Swoole入门知识和讲解。
Stars: ✭ 509 (-34.41%)
Mutual labels:  tcp
Sharppcap
Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
Stars: ✭ 665 (-14.3%)
Mutual labels:  network-programming
Elixir Socket
Socket wrapping for Elixir.
Stars: ✭ 642 (-17.27%)
Mutual labels:  tcp
Grain
grain是一个极简的、组件式的RPC框架,灵活且适合渐进学习,可与任何框架整合。同时包含(系统通用多线程模型与消息通讯 || 多对多关系的分布式锁 || 基于Servlet的HTTP框架 || 基于系统通用多线程模型的Websocket框架 || 支持行级锁的多线程锁 )等组件,按需选择组件,不绑架开发者。
Stars: ✭ 577 (-25.64%)
Mutual labels:  tcp

ZSocket

ZSocket is a library that wraps the linux zero-copy socket syscall to create a ring buffer in a memory mapped file. It also contains some utility functions and types to help with a handful of layer 2, 3, and 4 types. It is a lot like libcap, except it has easy to understand facilities for writing (injecting packets) to an interface.

ZSocket doesn't contain or wrap any C/C++, and it is lock free and thread safe.

The following program prints out all know layer types to ZSocket on a given interface:

package main

import (
    "fmt"

    "github.com/newtools/zsocket"
    "github.com/newtools/zsocket/nettypes"
)

func main() {
	// args: interfaceIndex, options, maxFrameSize, and maxTotalFrames

	// inerfaceIndex: the index of the net device you want to open a raw socket to
	// options: RX and TX, or just one or the other?
	// maxFrameSize: must be a power of 2, bigger than zsocket.MinimumFrameSize,
	// 	and smaller than maximum frame size
	// maxTotalFrames: must be at least 16, and be a multiple of 8.
	zs, err := zsocket.NewZSocket(14, zsocket.EnableRX, 2048, 64, nettypes.All)
	// the above will result in a ring buffer of 64 frames at
	// 	(2048 - zsocket.PacketOffset()) *writeable* bytes each
	// 	for a total of 2048*64 bytes of *unswappable* system memory consumed.
	if err != nil {
		panic(err)
	}
	zs.Listen(func(f *nettypes.Frame, frameLen, capturedLen uint16) {
		fmt.Printf(f.String(capturedLen, 0))
	})
}
  1. See the examples folder for more simple programs that do various things with ZSocket.

  2. Learn how to set up a docker container with a custom veth-pair in the utils folder (useful for setting up complex virtual networking scenarios)

  3. Play around with FakeInterface to (and its examples folder) to play around with networking protocols.

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