
Introduction to RAW-sockets [pdf] - lainon
http://tuprints.ulb.tu-darmstadt.de/6243/1/TR-18.pdf
======
d215
Nice manual. Good to see that they show the raw sockets api and libraries
using them side by side. Skimming through it though, it a eems a bit thin on
ipv6 details, e.g. recvmsg is not mentioned, but is indispensable for
receiving ancillary data from ipv6 icmp packets.

~~~
emcrazyone
Skimming it, unless I missed it, under Linux there is no mention of epoll,
edge vs level triggering. Things you should familiarize yourself with if you
care about performance.

------
jwbensley
A good introduction but through my personal journey to learn about raw socket
programming in Linux, I can't recommend just diving in and reading the kernel
source code enough.

I feared this as C is a hobby for me so I assumed it would be too difficult
but for me it turned out to be the best way to understand how everything works
and I was able to understand the Kernel source, I wish I had done this
earlier.

E.g. AF_PACKET is mentioned in this tutorial as one of the potential socket
families, I wanted to learn more about the PACKET_MMAP feature AF_PACKET
provides however the kernel documentation and examples weren't clear to me. I
ended up reading the kernel source last because I was intimidated and should
have done that first.

If anyone is going to do this I recommend you take notes. Note that features
change between kernel versions. I started making notes on how v2 and v3
transmition of PACKET_MMAP works here:
[https://github.com/jwbensley/EtherateMT/wiki/Linux-Kernel-
tr...](https://github.com/jwbensley/EtherateMT/wiki/Linux-Kernel-tracing-for-
sendto\(\)-using-AF_PACKET,-PACKET_MMAP-and-PACKET_FANOUT)

I actually need to upload the receive notes. But before I've had time to do
that, v4 has been written and is about to drop in the latest kernel version.
So making notes in relation to kernel version I have found to be very helpful.
Also this site is super helpful for reading and searching the kernel source:
[http://elixir.free-electrons.com/linux/latest/source](http://elixir.free-
electrons.com/linux/latest/source)

------
rurban
Up to page 26 three typos already...

~~~
hmottestad
Looks like the manual was written by germans from a german university. Only 3
typos/spelling mistakes in 26 pages is pretty decent to be honest.

~~~
rurban
Typos in the API names is a severe mistake. They were talking about the ipv6
interface but wrote the ipv4 name.

