Chapter 1. Understanding the Linux operating system 27
Draft Document for Review May 4, 2007 11:35 am 4285ch01.fm
7. The frame is moved into the network interface card buffer if the MAC address matches the
MAC address of the interface card.
8. The network interface card eventually moves the packet into a socket buffer and issues a
hard interrupt at the CPU.
9. The CPU then processes the packet and moves it up through the layers until it arrives at
(for example) a TCP port of an application such as Apache.
Socket buffer
As we stated before, the kernel uses buffers to send and receive data. Figure1-24 shows
configurable buffers which can be used for networking. They can be tuned through files in
/proc/sys/net.
/proc/sys/net/core/rmem_max
/proc/sys/net/core/rmem_default
/proc/sys/net/core/wmem_max
/proc/sys/net/core/wmem_default
/proc/sys/net/ipv4/tcp_mem
/proc/sys/net/ipv4/tcp_rmem
/proc/sys/net/ipv4/tcp_wmem
Sometimes it may have an effect on the network performance. We’ll cover the details in 4.7.4,
“Increasing network buffers” on page127.
Figure 1-24 socket buffer memory allocation
tcp_mem
tcp_mem
tcp_mem
socket
tcp_wmem
receive
buffer
send
buffer
socket
socket
socket
tcp_rmem
r s
rs
socket
r s
send
buffer
receive
buffer
rmem_max wmem_max

IPX

Appletalk

TCP/IP