Operating Systems


Linux Kernel Programming - IPC b/w Userspace and KernelSpace

System Programming - Learn Netlink Sockets, Operating Systems, Loadable Kernel Modules, C programming From Scratch

4.60 (63 reviews)

Linux Kernel Programming - IPC b/w Userspace and KernelSpace


3 hours


Mar 2021

Last Update
Regular Price

Exclusive  Offer
Unlimited access to 30 000 Premium SkillShare courses

What you will learn

Linux Kernel Modules (LKM)

Netlink Sockets

Concept of TLVs (Type Length Value)

User-space and Kernel Space Communication

Linux Kernel Programming

Multicast from Kernel Space to User Space

Event based notification from Kernel Space to User-space


Welcome to the Linux Kernel Programming world! This is the course on Netlink Sockets in which I have covered Netlink Sockets in Detail which is a kernel facility provided to userspace applications to carry out bidirectional IPC with kernel space. In this course, We shall learn how Netlink Sockets can be used to exchange Netlink Messages between Kernel and Userspace.

This Course could also be your first step towards entering the kernel programming world !! This is a good starting point for those who will be writing kernel code for the first time. We shall be writing lots of lots of kernel and userspace code to understand Netlink Based communication. Need-less to say you should be good with C programming.

Table Of Contents :


  • Section 1: Setting Up Development Environment

    • Agenda, Pre-requiste, Assumption

    • How to do Kernel Programming based Courses ?

    • Setting up Development Environment

    • Installing Linux Kernel Headers

  • Section 2: Writing Linux Kernel Modules

    • What are LKMs ?

    • Hellow-World LKM

  • Section 3: Understanding Netlink Sockets

    • Communication Mediums in the System

    • Sockets - As a unified interface

    • Netlink Communication Use-Cases

    • The Netlink Project for the Course

  • Section 4: Netlink Communication - Theory before Coding

    • Netlink Msg formats

    • Netlink Msg types

    • Netlink Msg flags                                              

    • Netlink Communication Model

    • Netlink Sequence Number

    • Netlink Port ID                                           

  • Section 5 & 6: Writing a First Netlink Program

    • Greet Kernel from Userspace                                         

    • Receive Reply from Kernel to Userspace                   

  • Section 7: The Netlink Attributes - The Concept of TLVs

    • The Concept of TLVs

    • Parsing of TLV Buffer

  • Section 6: Getting Started with Netlink Project

    • Problem Statement

    • Sending CREATE Netlink Msg to Kernel

    • Getting Feedback/Reply from Kernel to Userspace

    • Sending UPDATE Netlink Msg to Kernel

    • Netlink DELETE Netlink Msg to Kernel

    • Netlink READ operation Reading Data from Kernel Space into USer space

  • Section 7: Netlink Group Subscription

    • Sending Kernel Data to Multiple Userspace processes

    • Multicast Group Subscription

    • Multicast Group unsubscription

  • Section 8: Selective Event-based Notification

    • (Un)Subscribing for the event in Kernel Space

    • Where to go from here?


Getting Started - Setting up the Development Enviironment

Agenda, Pre-Requisute, Assumptions

How to do Kernel Programming based Courses ?

Setting up the Development Environment

Installing Linux Kernel Headers

Writing your first Linux Kernel Module

What are LKMs ?

Writing a Hello-World LKM

Understanding - Netlink Sockets

Communication Mediums in the System

Sockets - As a Unified Interface

Netlink Communication UseCases

The Netlink Project for this Course

Netlink Msg format Specification - Theory Before Coding

Netlink Msg Format

Netlink Standard Msg Types

Netlink Msg Flags

Netlink Communication Model

Netlink Sequence Number

Netlink Port ID

Closing Netlink Theory

NetLink Greet Example - Kernel Space

The Netlink Greet Example

Netlink Protocol Number

Netlink Greet LKM Code Walk - Part1

Kernel Socket buffers

Netlink Greet LKM Code Walk - Part2 - Receiving User Space Msg

Netlink Greet LKM Code Walk - Part3 - Sending reply to Userspace

NetLink Greet Example Continued - User Space

Userspace Program Thread Model

API to Send msg to Kernel

Code Walk - send_netlink_msg_to_kernel()

Userspace.c flowchart

Userspace.c - Send Code Implementation

Userspace.c - Recv Code Implementation

Final Demo !

Netlink Attributes - The Concept of TLVs

The Concept of TLVs

Parsing of TLV Buffer

Netlink Attributes


shivashankar7 June 2021

well expected, i expected all the 4 way of communication but the course has only one way from USA to Kernel.

Sunil14 March 2021

Great experience... Awaiting project and rest of the remaining lessons from Abhishek... He is a true champion guy !!

Dragutin22 November 2020

Not happy with few things: - Instructor's mic is oversensitive, really need to reduce volume and sometimes voice is distorted - Message is not pronounced like "massage" - "AND" made me almost deaf - Not clear English, so reducing volume to prevent mic oversensitivity and "AND" risk of not hearing instructor - Kernel part is good, except i didn't catch any info on how to find which kernel function you need to use, instructor simply pass already written lines and explain what they do. - User part is a good practice (to separate another receive thread in blocking mode) except maybe to implement or mention possibility to not receiving response from kernel as it's possible. This however is harder to implement. - Not any information how to debug, instructor use vi which have limited capabilities and it's ok since it's user choice what to use, but someone may wonder how to do this.

Harsha23 July 2020

Awesome tutorial. Good refresher for me, since i had been working on kernel space programming some time back. Wanted to get my hands dirty again.. Found this great course on Udemy,,. I must admit it was very Crisp and focused @ 1.25X speed. Got me back to speed again!. Good Job Abhishek Highly recommend this course!

Hardik11 February 2020

Amazing explanation, course content, practical demo!! Up to the mark! Kindly check if possible to add some concept, technics for kernal debug also. To learn from you such technics is far better than to refer Youtube or any other tutorials. Thanks.

Vidyadher24 January 2020

The concepts thought in this course about Netlink sockets are very clear and solid, looking forward to remaining lectures.


Udemy ID


Course created date


Course Indexed date
Course Submitted by