by nathan@nathan.io:

It would be useful if Go supported raw ethernet sockets. It is indicated that this was
planned in a TODO on net.go: 
// TODO(rsc):
//  support for raw ethernet sockets

Is this still planned? 

Thanks!

Comment From: ianlancetaylor

Comment 1:

Might be something for the go.net repository if it is not already there.

Labels changed: added repo-main, release-none.

Comment From: gopherbot

Comment 2 by nathan@nathan.io:

It is not currently in go.net, do they have a separate issue tracker?

Comment From: adg

Comment 3:

Nope, it's the same issue tracker.

Comment From: r-medina

hey what's the deal with this?

i have a relatively shallow knowledge of the issue, but i've been reading through net stuff and have a few questions: 1. how different should the design of raw ethernet sockets be from stuff in net like UnixConn (since there would be no netFD, for example)? 2. what type of api/functionality do we want to expose for this?

Comment From: mikioh

I think it would be nice if this package provides well-cooked APIs that wrap various platform-dependent stuff such as BPF/eBPF, Netmap, PF_RING, AF_PACKET, DPDK, blah blah appropriately. Also it's nice if the package can work together with runtime-integrated network poller seamleslly. I have no clue on the API surface, it might not be so differnet from net.Conn/PacketConn, perhaps, not sure.

Comment From: mdlayher

In lieu of an official package that provides this functionality, I hacked together something that works decently on Linux for the time being: https://github.com/mdlayher/raw. My use case is building ethernet frames and ARP packets to send and receive ARP data in a fashion similar to net/http.

I would love to team up with others who are more familiar with system calls and facilities of other platforms to create a solid x/net/ether package or similar. Here's hoping that https://github.com/golang/go/issues/10565 is resolved for Go 1.6 so we can also take advantage of the runtime network poller.

Comment From: amaitra

What kind of help do you need? I am new to go but extensive expertise in C and routing software.

Comment From: ayum

I've also tried to add some link layer sockets functionality to standard library. Disclaimer: not an expert neither in go, nor in sockets programming. May be someone searching for raw ethernet packets functionality in go and landed here finds it interesting: https://bitbucket.org/almikhayl/go/commits/f49276912194858b9741a905e5ab7a44e40e394f .

Comment From: seankhliao

https://go.dev/doc/faq#x_in_std