Windows API Reference

Network Driver Interface Specification (NDIS)

The Network Driver Interface Specification (NDIS) is a Microsoft-defined interface that provides a protocol-independent abstraction for network drivers. NDIS allows network adapter drivers and protocol drivers to interoperate without requiring specific knowledge of each other's implementation details.

NDIS acts as a bridge between the network protocol stacks (like TCP/IP, IPX, NetBEUI) and the network adapter drivers. This separation enables developers to write protocol drivers that can run on any network adapter for which an NDIS-compliant driver exists, and vice versa.

Key Concepts

NDIS Drivers

  • Protocol Drivers: These drivers implement network protocols (e.g., TCP/IP, UDP) and send and receive network data.
  • Miniport Drivers: These drivers interface directly with network hardware (network adapters) and perform the low-level functions of sending and receiving data packets.
  • Filter Drivers: Optional drivers that can intercept, examine, and potentially modify or drop network packets passing through the system. They can be used for services like firewalls, packet sniffers, or quality-of-service mechanisms.

NDIS Protocol

NDIS defines a set of functions, structures, and notification mechanisms that enable communication between different driver types. Key aspects include:

  • Binding: The process by which a protocol driver is logically attached to one or more miniport drivers.
  • OIDs (Object Identifiers): Standardized identifiers used to query and set parameters on network drivers (e.g., adapter statistics, configuration settings).
  • Packets: NDIS defines data structures (NET_BUFFER and NET_BUFFER_LIST) for representing network packets.

Common NDIS Functions

Developers working with NDIS often interact with the following types of functions:

Function Description
NdisOpenAdapterEx Opens a connection to a network adapter.
NdisSendNetBufferLists Sends network packets over an adapter.
NdisReceiveNetBufferLists Receives incoming network packets.
NdisOidRequest Sends an OID request to query or set information on a miniport driver.
NdisMRegisterMiniportEx Registers a miniport driver with NDIS.
NdisPnPEventNotify Handles Plug and Play events for network devices.

Learning Resources

Note: NDIS is a core component of Windows networking for kernel-mode drivers. For user-mode networking, consider using Winsock APIs.