Hybrid Forwarding

Starting with NDIS 6.40 (Windows Server 2012 R2, the Hyper-V extensible switch architecture supports hybrid forwarding by the Hyper-V Network Virtualization (HNV) component of the extensible switch and by forwarding extensions.

Note  This page assumes that you are familiar with Network Virtualization using Generic Routing Encapsulation (NVGRE) Task Offload and Overview of the Hyper-V Extensible Switch.

NVGRE and non-NVGRE packets

In a hybrid forwarding environment, there are two types of packets that enter and leave the Hyper-V extensible switch: NVGRE packets and non-NVGRE packets:

  • NVGRE packets have the encapsulated format that is specified in the NVGRE: Network Virtualization using Generic Routing Encapsulation Internet Draft. NVGRE packets are forwarded by the HNV component of the Hyper-V extensible switch.
  • Non-NVGRE packets are just normal network packets. Non-NVGRE packets are forwarded by the forwarding extension (or, in the absence of a forwarding extension, the extensible switch itself).

Flow of NVGRE and non-NVGRE packets through the switch

In the ingress data path, after the capturing and filtering extensions but before the forwarding extension, if a packet is an NVGRE packet, the extensible switch sets the NativeForwardingRequired flag in the NDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO structure for the packet. This structure is contained in the NetBufferListInfo member of the packet's NET_BUFFER_LIST structure.

Note  The NetBufferListInfo member of the NET_BUFFER_LIST is often referred to as the packet's "out-of-band (OOB) data."

If the NativeForwardingRequired flag is set in the packet's OOB data, the packet is an NVGRE packet. If it is not set, the packet is a non-NVGRE packet.

Extensions should use the NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL macro to check the value of the NativeForwardingRequired flag.

NVGRE and non-NVGRE packets are treated as follows:

  • The HNV component of the Hyper-V extensible switch forwards (i.e., determines the destination table for) all NVGRE packets
  • The HNV component performs NVGRE encapsulation and decapsulation as needed.
  • The forwarding extension forwards all non-NVGRE packets.
  • The forwarding extension cannot forward NVGRE packets, but it can perform the same filtering actions as a filtering extension, including adding or excluding destination ports or even dropping packets.
  • If there is no forwarding extension, the Hyper-V extensible switch forwards all packets.

For more information, see Packet Flow through the Extensible Switch Data Path.

Support for third-party network virtualization

A VirtualSubnetId can be configured on a VM network adapter port as an external virtual subnet. This feature was added to enable forwarding extensions to provide third-party network virtualization solutions. On ingress, the Hyper-V extensible switch will not set the NativeForwardingRequired flag in the NET_BUFFER_LIST structures for these packets. A forwarding extension may then modify the packet headers, as required, during forwarding. Packets that are being modified must be cloned and their ParentNetBufferList pointers set to the original NET_BUFFER_LIST. (See Cloning Packet Traffic.)

Adding Extensible Switch Destination Port Data to a Packet

Cloning Packet Traffic

Forwarding Extensions

Packet Flow through the Extensible Switch Data Path

NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL

NDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO