Hacker News new | past | comments | ask | show | jobs | submit login
Introduction to RAW-sockets [pdf] (tu-darmstadt.de)
145 points by lainon on Dec 31, 2017 | hide | past | favorite | 8 comments



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.


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.


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

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


Up to page 26 three typos already...


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.


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


It's called German precision.


Its funny that your own one line comment contains three grammatical errors.

I guess it only matters when it's someone else?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: