All Projects → asavie → Xdp

asavie / Xdp

Licence: bsd-3-clause
Package xdp allows one to use XDP sockets from the Go programming language.

Programming Languages

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

Projects that are alternatives of or similar to Xdp

Pynms
A vendor-agnostic NMS for carrier-grade network simulation and automation
Stars: ✭ 73 (+102.78%)
Mutual labels:  network, networking, network-programming
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (+355.56%)
Mutual labels:  network, networking, packets
Game Networking Resources
A Curated List of Game Network Programming Resources
Stars: ✭ 4,208 (+11588.89%)
Mutual labels:  network, networking, network-programming
Zerotierone
A Smart Ethernet Switch for Earth
Stars: ✭ 7,839 (+21675%)
Mutual labels:  networking, sdn
Scapy
Scapy: the Python-based interactive packet manipulation program & library. Supports Python 2 & Python 3.
Stars: ✭ 6,932 (+19155.56%)
Mutual labels:  network, packet-capture
Bmon
bandwidth monitor and rate estimator
Stars: ✭ 787 (+2086.11%)
Mutual labels:  network, networking
Fast Android Networking
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀
Stars: ✭ 5,346 (+14750%)
Mutual labels:  network, networking
Diffios
Cisco IOS diff tool
Stars: ✭ 23 (-36.11%)
Mutual labels:  network, networking
Nexer
Content based network multiplexer or redirector made with love and Go
Stars: ✭ 7 (-80.56%)
Mutual labels:  network, networking
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+2158.33%)
Mutual labels:  network, networking
Metta
An information security preparedness tool to do adversarial simulation.
Stars: ✭ 867 (+2308.33%)
Mutual labels:  network, networking
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (+1836.11%)
Mutual labels:  network, packets
Sharppcap
Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
Stars: ✭ 665 (+1747.22%)
Mutual labels:  network-programming, packets
Kube Ovn
A Kubernetes Network Fabric for Enterprises that is Rich in Functions and Easy in Operations
Stars: ✭ 798 (+2116.67%)
Mutual labels:  networking, sdn
Grassmarlin
Provides situational awareness of Industrial Control Systems (ICS) and Supervisory Control and Data Acquisition (SCADA) networks in support of network security assessments. #nsacyber
Stars: ✭ 621 (+1625%)
Mutual labels:  network, networking
P2p
Practice project to demonstrate p2p file sharing.
Stars: ✭ 16 (-55.56%)
Mutual labels:  network, networking
Sdn Handbook
SDN网络指南(SDN Handbook)
Stars: ✭ 856 (+2277.78%)
Mutual labels:  networking, sdn
Bash Toolkit
Este proyecto esá destinado a ayudar a los sysadmin
Stars: ✭ 13 (-63.89%)
Mutual labels:  network, networking
Netsniff Ng
A Swiss army knife for your daily Linux network plumbing.
Stars: ✭ 915 (+2441.67%)
Mutual labels:  networking, packet-capture
Gns3 Server
GNS3 server
Stars: ✭ 477 (+1225%)
Mutual labels:  network, networking

xdp

Go Reference

Package github.com/asavie/xdp allows one to use XDP sockets from the Go programming language.

For usage examples, see the documentation or the examples/ directory.

Performance

examples/sendudp

With the default UDP payload size of 1400 bytes, running on Linux kernel 5.1.20, on a tg3 (so no native XDP support) gigabit NIC, sendudp.go does around 980 Mb/s, so practically line rate.

examples/senddnsqueries

TL;DR: in the same environment, sending a pre-generated DNS query using an ordinary UDP socket yields around 30 MiB/s whereas sending it using the senddnsqueries.go example program yields around 77 MiB/s.

Connecting a PC with Intel Core i7-7700 CPU running Linux kernel 5.0.17 and igb driver to a laptop with Intel Core i7-5600U CPU running Linux kernel 5.0.9 with e1000e with a cat 5E gigabit ethernet cable and using the following program

package main

import (
	"net"

	"github.com/miekg/dns"
)

func main() {
	query := new(dns.Msg)
	query.SetQuestion(dns.Fqdn("asavie.com"), dns.TypeA)
	payload, err := query.Pack()
	if err != nil {
		panic(err)
	}

	conn, err := net.ListenPacket("udp", ":0")
	if err != nil {
		panic(err)
	}
	defer conn.Close()

	dst, err := net.ResolveUDPAddr("udp", "192.168.111.10:53")
	if err != nil {
		panic(err)
	}

	for {
		_, err = conn.WriteTo(payload, dst)
		if err != nil {
			panic(err)
		}
	}
}

which uses an ordinary UDP socket to send a pre-generated DNS query from PC to laptop as quickly as possible - I get about 30 MiB/s at laptop side.

Using the senddnsqueries.go example program - I get about 77 MiB/s at laptop side.

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