Managed Network Protocol vs Simple Network Protocol in UEFI
In the Unified Extensible Firmware Interface (UEFI) networking architecture, the Simple Network Protocol (SNP) and the Managed Network Protocol (MNP) represent two foundational layers of the network driver stack. While both operate near the hardware level, SNP provides a direct, exclusive, low-level interface to the Network Interface Card (NIC), whereas MNP serves as a multiplexing abstraction layer sitting directly above SNP to allow multiple network consumers to share that single physical interface.
The Role of Simple Network Protocol (SNP)
The Simple Network Protocol
(EFI_SIMPLE_NETWORK_PROTOCOL) provides raw access to the
physical network controller. It is the direct driver interface to the
network device, responsible for initializing the hardware, managing link
states, configuring MAC addresses, and transmitting or receiving raw
Ethernet frames.
Because SNP directly interacts with the hardware, it is designed for a single consumer. It does not natively support multi-client access; if an application or driver takes control of an SNP instance, no other network protocol or application in the firmware environment can concurrently send or receive frames on that interface without conflicting. Furthermore, SNP operates largely synchronously or through basic polling mechanisms, leaving buffer queueing and dispatching to higher layers.
The Role of Managed Network Protocol (MNP)
The Managed Network Protocol
(EFI_MANAGED_NETWORK_PROTOCOL and its accompanying service
binding protocol,
EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL) acts as an
intermediate layer between SNP and higher-level protocols such as IPv4,
IPv6, and ARP.
The primary purpose of MNP is multiplexing and demultiplexing. It abstracts the single underlying SNP device by generating multiple virtual "child" handles. Each child instance can be configured independently, allowing different protocol drivers to operate simultaneously over a single network card without interfering with one another.
Key Architectural Differences
- Single vs. Multiple Consumers: SNP supports only one consumer at a time, binding directly to the hardware. MNP utilizes the UEFI Service Binding mechanism to instantiate multiple child handles, enabling concurrent consumers (such as an IPv4 stack, an IPv6 stack, and diagnostic tools) over the same NIC.
- Packet Filtering and Demultiplexing: SNP delivers raw frames to its single caller without protocol-aware routing. MNP actively inspects incoming frames, filtering and routing them to the correct child instance based on configured criteria such as Ethernet frame type, MAC address, promiscuous mode flags, and VLAN tags.
- Asynchronous Token-Based I/O: MNP utilizes an
asynchronous completion-token model
(
EFI_MANAGED_NETWORK_COMPLETION_TOKEN) for packet transmission and reception, allowing non-blocking I/O and event-driven packet delivery. SNP relies on simpler, direct transmit and receive buffer calls. - VLAN and Group Configuration: MNP handles Virtual LAN (VLAN) tagging and untagging transparently for upper-layer protocols and manages multicast filter groups across its various child instances, whereas SNP only supports the hardware-level configuration of the NIC's physical filters.