So, what is a netlink socket? We shall keep it simple – a netlink socket is a "special" socket family that exists only on the Linux OS since version 2.2. Using it, you can set up Inter-Process Communication (IPC) between a user mode process (or thread) and a component within the kernel; in our case, a kernel module, which is typically a driver.
It is similar to a UNIX domain datagram socket in many ways; it's meant for communication on the localhost only and not across systems. While UNIX domain sockets use a pathname as their namespace (a special "socket" file), netlink sockets use a PID. Pedantically, this is a port ID and not a process ID, although realistically, process IDs are very often used as the namespace. The modern kernel core (besides drivers) uses netlink sockets in many cases – as one example, the iproute2 networking utilities use it to configure wireless drivers. As another interesting...