Return to Training Programs


Course-Number: ATR-012

Course-Description: Linux Network Drivers

Duration of course: 2 days

Course Description:

This is a two day program that teaches how to write network device drivers under Linux.

The course begins with an introduction to the TCP/IP protocol stack layering under linux and the overall architecture of network drivers and how these drivers interface with the kernel.

Kernel data structures with respect to the networking layer are then examined in detail. The flow of packets up and down the protocol stack is studied and the interaction between the Transport Layer and the Network Layer as well as the Network Layer and the Physical Layer is examined. Kernel mechanisms such as ksoftirq and the tasklet interface built on top of the ksoftirq mechanism for supporting the networking sub-system is then studied.

The course then looks at how network interfaces are registered / unregistered with the kernel sub-system. The network interface card's probing function is studied and helper routines such as ether_setup(), tr_setup() etc. are examined.

The course then looks at the detailed data sheets of a specific network chipset - the RTL8139C chipset from Realtek. The data sheets and the Application Programming notes are studied and the PCI interface analyzed. The on-chip resources offered and the TX and RX queues and methods of managing the circular ring buffers and descriptors are then studied.

Finally, a complete driver is examined in detail that discusses how the device is initialized, configured and managed.

As a bonus, a completely different driver, the usbnet.o driver, is also examined to show how the networking stack rides on top of a USB device.

Target Audience:

This course would be ideal for linux systems programmers who do not have any exposure to the networking interfaces under linux. The course would also be useful for systems programmers already familiar with the networking code, coming into linux for the first time, in case they are interested in knowing how linux works with the network device interface.


Knowledge of 'C' programming is mandatory for this course. Also, some knowledge of linux internals and kernel programming is deemed necessary since these are not part of the 2-day course.






Introduction to the Networking Susbsystem

1.5 hrs

Overview of networking, interfaces, APIs, implementation strategies.

Inside TCP, IP and the Ethernet Layers

1.5 hrs

Advanced sockets, socket internals, overview of IP layer, Link layer interfaces

Kernel data strucures with respect to networking

1.5 hrs

socket buffers, struct net_device, interface statistics, IRQs and handlers etc.

Kernel algorithms & mechanisms for networking

1.5 hrs

Kernel related support for networking, ksoftirqs, tasklets, device initialization etc.


Anatomy of a network driver

1.5 hrs

Registration/Unregistration, probing, assigning an IRQ handler, device functions.

The RTL-8139 chipset

1.5 hrs

Data sheets, Application Note for the Realtek's RTL-8139C chipset.

Inside the 8139too driver

1.5 hrs

Driver code for the 8139C chipset.

Inside the usbnet.o driver ( the PL-2301 chipset )

1.5 hrs

Network driver built on top of the Prolific chipset PL-2301 Host-to-host USB bridge.

(C) 2005 -   All Rights Reserved.

Return to Training Programs