Back to the Club's homepage

Sockets in the Linux Kernel - Rami Rosen

Abstract

We will focus in this lecture about Linux Kernel sockets. Specifically, we will deal with the implementation the following sockets in the Linux kernel:

We will describe the mechanism of sending and receiveing packets with these types of kernel sockets, demonstrating it with short user space applications. We will also deal with Control Messages (aka "ancillary data") and demonstrate retrieving/setting data with Control Messages. We will also demonstrate and its usage with these sockets. We will discuss socket options and how to set and retrieve kernel socket options from user space, with examples. We will give a short example of UDP socket receiving data in asynchronous mode. We will discuss how raw sockets are used in the familiar "ping" and "traceroute" utils. We will discuss the usage of domain sockets as an IPC (Inter process communication) mechanism. We will discuss netlink sockets as a messaging subsystem between kernel and userspace, and demonstrate this mechanism.

Note: Mesh networking, which is a leftover from the wireless lecture, will not be included in this lecture (it will probably be dealt with a future lecture).

This lecture is the fifth in the Linux Kernel networking lecture series; it a sequel to the following lectures:

Slides (pdf)


Back to the Club's homepage