WEBVTT

00:04.840 --> 00:08.740
So guys, we were going to write Netlink Hello world example.

00:08.950 --> 00:15.670
We shall write a Netlink Hello world userspace and Linux kernel module to demonstrate the netlink based

00:15.670 --> 00:16.720
communication.

00:16.840 --> 00:23.230
We shall design our userspace application which folks a separate thread to receive data from the kernel

00:23.230 --> 00:25.900
space while in the main thread.

00:25.900 --> 00:29.860
Our userspace application will send the data to the kernel space.

00:29.890 --> 00:30.670
Right.

00:30.670 --> 00:34.600
So our user space application would be like two threads.

00:34.630 --> 00:39.790
One is the main thread and another thread is the recipient thread.

00:40.150 --> 00:41.020
Right.

00:42.060 --> 00:49.080
While in the main thread, our userspace application will keep sending data to the kernel space, whereas

00:49.080 --> 00:55.110
in the another thread, our user space application will keep receiving the data from the kernel space.

00:55.140 --> 00:55.860
Right.

00:55.860 --> 00:59.640
So our user space application will be two threaded application.

01:00.480 --> 01:05.520
We will still use the same typical steps involved in socket programming.

01:05.520 --> 01:09.960
That is creating a socket specifying the source and destination address.

01:09.990 --> 01:15.900
Now we will see that in case of communication between user space and kernel space, what will be the

01:15.900 --> 01:17.610
source and destination addresses?

01:17.610 --> 01:18.180
Right.

01:18.180 --> 01:21.210
And what to specify in the bind system call?

01:21.720 --> 01:27.540
We will use the send message and receive message APIs to send and receive message as usual.

01:27.540 --> 01:33.930
And then we will finally close the connection using close so you can see that you must have used all

01:33.930 --> 01:37.520
these APIs while writing a typical socket program.

01:37.530 --> 01:41.400
As we discussed, that socket is a unified interface.

01:41.430 --> 01:46.720
Therefore, for any socket based communication will eventually going to involve the use of the same

01:46.720 --> 01:48.040
set of APIs.

01:48.190 --> 01:53.650
Netlink is no different and we will going to use the same set of APIs, right?

01:53.950 --> 01:59.480
So I will explain the new APIs that we shall encounter right in the code walk.

01:59.500 --> 02:05.890
So in the next section of the course we will begin a new project and incrementally add new code as we

02:05.890 --> 02:07.810
learn more and more new concepts.

02:07.810 --> 02:12.640
So let us start with building our first very basic netlink program.

02:13.620 --> 02:17.550
So in the next section we will going to write our first Netlink program.
