NDIS packets are allocated by a protocol driver, filled with data, and passed to the next lower NDIS driver so that the data can be sent on the network. Some lowest level NIC drivers allocate packets to hold received data and pass the packet up to interested higher-layer drivers. Sometimes, a protocol driver allocates a packet and passes it to a NIC driver with a request that the NIC driver copy received data into the provided packet. NDIS provides functions for allocating and manipulating the substructures that make up a packet.
A packet is composed of the following:
A busmaster NIC driver that allocates shared memory for receiving incoming packets or a protocol driver that allocates memory for sending a packet must insure that any buffer used to contain incoming or outgoing data is cache-aligned. This is necessary so that the miniport can flush the buffer to assure coherency before sending a packet and to flush a received buffer before indicating the data to an upper layer.