Ethernet and Go

By Matt Layher

Elevator Pitch

Most Gophers are familiar with writing high level network services in Go, but there are many interesting problems to be solved at lower levels in the network stack! This talk will demonstrate creation and manipulation of Ethernet frames in Go, enabling new and exciting network applications.

Description

Modern network applications are typically built on top of the TCP/IP stack. TCP and UDP are often a great fit for building higher level protocols, but at times, it can be useful to exert full control over the network traffic produced by an application. By directly manipulating Ethernet frames in a user application, this level of control can be obtained.

This talk will demonstrate creation and manipulation of Ethernet frames in Go, enabling new and exciting network applications. Two packages will be introduced that enable working directly with Ethernet frames in Go applications.

During this talk, attendees will learn about:

  • the structure of Ethernet frames
  • the use of VLAN tags to logically divide a physical network segment
  • how to craft Ethernet frames[1] in Go
  • how to send and receive Ethernet frames in Go using a network interface[2]

[1] https://github.com/mdlayher/ethernet [2] https://github.com/mdlayher/raw

Notes

This talk will be geared toward intermediate to advanced Go users, and in particular, those who use Go on UNIX-like operating systems. At this time, my raw sockets package only works on Linux and *BSD (including macOS), but there’s no technical reason that Windows support couldn’t be added. Ethernet frames are applicable to all modern operating systems.

I believe I’m a great candidate to speak on this topic because of my experience working with Ethernet frames and raw sockets in Go. I’m the author of two packages for working with these primitives, and I’ve implemented several protocol packages with them, including: ARP, ATA over Ethernet, LLDP, VXLAN, and Wake-on-LAN.

Finally, I’ve also authored an in-depth post which explains much of the material I intend to cover in a lightning talk:

https://medium.com/@mdlayher/network-protocol-breakdown-ethernet-and-go-de985d726cc1

If you have any questions, concerns, or suggestions regarding this proposal, please do not hesitate to reach out. I happily welcome your feedback.

Thank you for your time, and for your consideration. GopherCon has been incredible for the past three years, and I’m very excited about the possibility of speaking at GopherCon for the first time, this year.