8000 GitHub - daxtens/gso: Explore the inner workings of Generic Segmentation Offload in Linux with me!
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

daxtens/gso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GSO - Generic Segmentation Offload - is magic sauce that makes Linux
networking go faster.

Usually it works automatically at the kernel level, without user
intervention.

However, for testing, it can be helpful to be able to construct your
own GSO packets. The AF_PACKET socket type allows you to insert GSO
packets from userspace using infrastructure from virtio_net. However,
I was unable to find any example code on the internet that showed how
to use this. So after reading a lot of kernel source, this is my
attempt to provide a complete, working example of getting GSO packets
into the kernel and out to the network.

This repository contains:

 - ufo.c: code to insert a UDP GSO (UFO) packet.

          Edit the constants at the top of the file to provide your
	  own interface and destination MAC/IP, then set a listener
	  on the destination on UDP port 23452.

          Requires CAP_NET_ADMIN, so run as root.

 - probe_segmentation.py: example python+eBPF C code to show the 
                          process of segmentation using eBPF kprobes.
                          Needs https://github.com/iovisor/bcc

TODO
----
 * include more eBPF examples
 * (eventually, maybe) TSO sample code

About

Explore the inner workings of Generic Segmentation Offload in Linux with me!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0