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 ....

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState