Inside the Linux Packet Filter, Part II

Gianluca concludes the packet's journey through the kernel, picking up with TCP processing.

Following a packet's journey through the kernel can be an interesting experience. In our trip we encountered typical kernel data structures (such as skbuffs), discovered idiomatic programming techniques (such as the use of structures with function pointers as an efficient alternative to C++ objects) and met some new 2.4 mechanisms (softirqs).

If you are eager to learn more on the subject, arm yourself with kernel sources and a comfortable editor, swallow a good cup of coffee and start peeking here and there. The price is cheap, and fun is guaranteed!

Creation of PF_PACKET Sockets


Gianluca Insolvibile has been a Linux enthusiast since kernel 0.99pl4. He currently deals with networking and digital video research and development. He can be reached at



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Great article... I also found

Anonymous's picture

Great article... I also found the below url interesting

Packet Sniffer at application layer

Anonymous's picture

i have a pacet sniifer at application layer that can sniff ARP through IPv4, TCP, UDP, IPv6


Have to express my appreciation

Jinping Yang's picture

The best walk-through of Linux's PF_PACKET socket implementation and packet reception I've ever seen!

Re: Kernel Korner: Inside the Linux Packet Filter, Part II

Anonymous's picture

Thank you!

Re: Kernel Korner: Inside the Linux Packet Filter, Part II

Anonymous's picture

Thanks alot!

Re: Kernel Korner: Inside the Linux Packet Filter, Part II

Anonymous's picture

Hi all,

by examining the kernel sources (especially the

network modules'), I see that there functions

embedded by the __initfunc(). Can anybody tell

me what is the role of the __initfunc() ? It denotes

a special function needed to be invoked at kernel

initialisation ?

Any answer is appreciated.

Kiss Jozsef,

Re: Kernel Korner: Inside the Linux Packet Filter, Part II

Anonymous's picture

Thanks a lot!

Both chapters have been very useful for me. Im making an analyse of kernel structures and functions to measure network and kernel activity in distributed applications.

Javier Mendiara Ca


Anonymous's picture

Good reading thank you ....

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix