Lecture - 08 - Tcpip Stack in The Linux Kernel
Lecture - 08 - Tcpip Stack in The Linux Kernel
Sys_socket()
Sock_create() Sock_map_fd()
Inet_create() Fd_install()
Lower layer initialization
Socket layer functions
are elided.
struct sk_buff
Defined in <include/linux/skbuff.h>
_ _u32 qlen;
spinlock_t lock;/* atomicity in accessing a sk_buff list. */
};
Layout
struct sock * sk
sock data structure of the socket that owns this buffer
unsigned int len
includes both the data in the main buffer (i.e., the one pointed to by head)
and the data in the fragments
unsigned int data_len
unlike len, data_len accounts only for the size of the data in the fragments.
unsigned int truesize
skb->truesize = size + sizeof(struct sk_buff);
atomic_t users
reference count, or the number of entities using this sk_buff buffer
atomic_inc and atomic_dec
sk_buf->dev
struct net_device *dev
represents the receiving interface or the to be transmitted device(or
interface) corresponding to the packet.
usually represents the virtual device’s(representation of all devices
grouped) net_device structure.