A hands-on project showcasing bidirectional greeting message exchanges between Linux kernel and user space via Netlink sockets. Dive into kernel-user communication! ππ§
Welcome to the repository dedicated to understanding and implementing communication between Linux kernel and user space using Netlink sockets.
This repo provides a step-by-step guide to the intricacies involved in establishing, sending, and receiving data via Netlink sockets. It's complemented by a series of markdown files which detail each phase of the implementation.
-
π 1_NetlinkGreetExample.md: An introduction and basic greeting example using Netlink sockets.
-
π 2_NetlinkProtocolNumber.md: Dive into the Netlink protocol numbers, their significance, and how to use them.
-
π 3_NetlinkGreetCodWalk1.md: A code walk-through for the initial greeting implementation using Netlink.
-
π 4_KernelSocketbuffers.md: Detailed exploration of Kernel Socket Buffers, their role, and how they function.
-
π 5_NetlinkGreetCodeWalkReceivingUserSpaceMsg.md: Code walk-through detailing how to receive messages in user space using Netlink.
-
π 6_NetlinkGreetCodWal3SendingReplyUserspace.md: Code walk-through illustrating how to send replies from Kernel to user space.
-
π 7_UserspaceProgramThreadModel.md: Introduction to the userspace program thread model.
-
π 8_APISendmsgtoKernel.md: Detailed look into the API send message to Kernel.
-
π 9_CodeWalksend_netlink_msg_to_kernel().md: A code walk-through for the
send_netlink_msg_to_kernel()
function. -
π 10_Userspace.c flowchart.md: A flowchart explaining the userspace.c file.
-
π 11_Userspace.cSendCodeImplementation.md: Dive into the implementation of the sending code for userspace.c.
-
π 12_Userspace.cRecvCodeImplementation.md: Understand the implementation of the receiving code for userspace.c.
-
π pkg: Contains the source code for this project. Dive in to see the real implementation and get your hands dirty with some coding!
- Inside the
pkg
directory, there's also a dedicatedREADME.md
which provides instructions on how to run the project.
- Inside the
- If you're new to Netlink sockets, begin with 1_NetlinkGreetExample.md for a basic understanding and introduction.
- For those interested in the source code, head to the pkg directory. Make sure to check the
README.md
inside pkg for setup and running instructions. - Navigate through the markdown files in sequence for a comprehensive understanding of Netlink sockets communication.
-
Netlink Sockets - Official Linux Documentation: A comprehensive guide on Netlink sockets straight from the official Linux documentation.
-
Kernel-user space communication using netlink sockets: An in-depth article from Linux Journal detailing the intricacies of Kernel-User communication.
-
Linux Kernel Networking - Netlink sockets in practice: A chapter excerpt from the "Linux Kernel Networking" book, focusing on practical aspects of Netlink sockets.
-
Netlink API for dummies: A beginner-friendly guide to understanding the Netlink API and its application.
-
Communicating between Kernel and User-space in Linux using Netlink Sockets: A blog that provides a hands-on approach to Kernel-User space communication using Netlink.
-
Linux Netlink as an IP Services Protocol: A detailed RFC document which describes Netlink as an IP services protocol.
Feel free to explore these resources to deepen your understanding of Netlink sockets and their application in Linux Kernel-User communication.
Feel free to raise issues, send pull requests, or provide feedback to enhance the repository. All contributions are welcome!
This project is licensed under the MIT License. See the LICENSE
file for more details.
A big shoutout to the Linux community and everyone who made the resources available to make this repo a reality.
Happy coding and learning! π»π