BASIC SK_BUFF GEOMETRY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ Basic sk_buff geometry(9) πŸ¦‹

okay so bestie, this page is from the Kernel API Manual, and it's all about the shape of an sk_buff β€” yes, the geometry, the layout, the whole vibe. πŸ’…

struct sk_buff itself is a metadata structure and does not hold any packet data. Like, literally none. All the data is held in associated buffers. 🫢

sk_buff.head points to the main "head" buffer. That head buffer is divided into two parts, and it's giving very structured:

  • the data buffer, containing headers and sometimes payload; this is the part of the skb operated on by the common helpers such as skb_put or skb_pull;
  • the shared info (struct skb_shared_info), which holds an array of pointers to read-only data in the (page, offset, length) format.

Optionally, skb_shared_info.frag_list may point to another skb. πŸ‘€

The basic diagram may look like this:

                                        ---------------
                                       | sk_buff       |
                                        ---------------
           ,---------------------------  + head
          /          ,-----------------  + data
         /          /      ,-----------  + tail
        |          |      |            , + end
        |          |      |           |
        v          v      v           v
         -----------------------------------------------
        | headroom | data |  tailroom | skb_shared_info |
         -----------------------------------------------
                                       + [page frag]
                                       + [page frag]
                                       + [page frag]
                                       + [page frag]       ---------
                                       + frag_list    --> | sk_buff |
                                                           ---------

✨ SEE ALSO ✨

Kernel file: ./include/linux/skbuff.h 🫢 and the whole reference squad is:


Source/version: ./include/linux Β· date: October 2026 Β· page: Basic sk_buff geometry(9) β€” mwah, go read the kernel bestie πŸ’‹βœ¨

πŸ“¦ where this page comes from