

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am reading Kernel Networking In linux. I found this article helpful. After reading this I have a doubt that If I create any software in Linux platform.. Lets say, some chat Program.. Do I have to make use of all those API`s(sk_buff and all) available to connect to the another network? Please help me with it.

share|improve this question

sk_buff is a kernel structure that is part of the kernel's TCP/IP stack. You shouldn't need to touch this directly and will in actuality find it difficult to do so.

What you need instead is to learn the user-space API's for network communication. For quickly learning the basics of network communication on Unix, it's tough to beat Beej's Guide.

share|improve this answer
Thanks a lot for your answer. Please tell me in what circumstances we have to use sk_buff or other networking kernel classes.. That`ll make me understand the concept well.. – Ashwin Apr 4 '13 at 13:14
@Ashwin If you're doing kernel-level work on the TCP/IP stack, then you'll need to use this. That's the simplest way I can think of to explain it, as it encompasses an awful lot. I'd say that the vast, vast, VAST majority of network code written for Linux by programmers has no need of this. You should be coding to the POSIX standard, not what's in the kernel. – San Jacinto Apr 4 '13 at 14:08
@Ashwin Do you understand the difference between user-space and kernel-space? – San Jacinto Apr 4 '13 at 14:09
Sorry.. I am really new to Linux Kernal. Now understanding the difference those two. But If i have one example where we have to use Networking Kernel(existing one too)..It helps me in understanding the concept.. :( – Ashwin Apr 4 '13 at 15:19

If you want to create a chat software I would recommend to you to checkout the BSD Sockets or any TCP/IP Network Guide for Linux. You don't need to understand what's going on within the Kernel in order to Program a chat software.

The sk_buff is relevant if you would like to create a new device driver but you seem to be above the protocol level.

If you want to create a chat you would create a Server Socket (Listener) and Clients which connect to the address where your Server is listening and exchange information through TCP/IP.

share|improve this answer

sk_buff is a kernel data structure for socket buffer. You do not have to touch it for your chat server. If you have taken an OS class you must have noticed there is a process structure(struct proc in Linux) but does it mean you have to use it when you write a program ? No. sk_buff is a similar case, Linux kernel uses it to buffer certain data. You don't have to be concerned with it.

For your chat server have a look at Beej's guide, it has an implementation of Chat Server if I am not wrong and its the best guide that I know to get started with Network Programming on Linux, and is filled with humour. For a deeper understanding of Network Programming look at Richard Stevens Unix Network Programming, Volume 1 and Volume 2. It is considered the bible of Network Programming.

share|improve this answer

Your Answer


