NET_BUFFER Data Packaging

Data packaging was redesigned in NDIS 6.0. The send and receive architecture that is based on the NDIS_PACKET structure has been replaced with an architecture that is based on NET_BUFFER and NET_BUFFER_LIST structures. A NET_BUFFER structure is the functional equivalent of an NDIS_PACKET structure. A NET_BUFFER structure specifies a buffer (MDL chain) for network data, as well as reserved space for NDIS, protocol drivers, and miniport drivers. NET_BUFFER structures can be linked together in a list that is described by a NET_BUFFER_LIST structure. A NET_BUFFER_LIST structure also provides storage for out-of-band (OOB) data that applies to all the NET_BUFFER structures in the list.

All components in the Microsoft next generation network driver stack, including the TCP/IP transport and Winsock, use NET_BUFFER data packaging. Uniform data packaging throughout the driver stack eliminates the need to repackage data, simplifies data handling, and reduces the number of function calls.

To accommodate older drivers that use NDIS_PACKET structures, NDIS 6.0 translates NDIS_PACKET structures to NET_BUFFER structures and vice versa. This translation is transparent to NDIS drivers.

NDIS propagates a driver's data backfill requirements to higher-level drivers. When allocating NET_BUFFER and NET_BUFFER_LIST structures for send data, a higher-level driver allocates enough data space to accommodate all lower-level drivers in the stack. As a result, lower-level drivers do not have to allocate additional buffer space to accommodate layer-specific headers. Instead, they can use the preallocated backfill space for this purpose.

For more information about the NET_BUFFER architecture, see NET_BUFFER Architecture.