NDIS LBFO Miniports

Download Report

Transcript NDIS LBFO Miniports

NDIS LBFO Miniports
(Load Balancing
And Failover)
Larry Cleeton
Program Manager
Windows Networking And Communications
Microsoft Corporation
Agenda



Overview of NDIS LBFO Miniports
How to write LBFO miniports
How to install LBFO miniports
Typical LBFO Scenario



Server machine attached to
network with multiple links
More total bandwidth
Continue to work on failed NIC
or cable cut
Overview

An NDIS LBFO miniport is a normal
NDIS miniport driver plus:


Code to use multiple NICs together for
load balancing network traffic
Code to manage a primary NIC and
secondary NICs and manage a failover upon the failure of the primary
Overview


NDIS gives the miniport driver control
over the designation of primary and
secondary NICs, exposing only a single
binding to protocols
Two key NDIS API calls:


NdisMSetMiniportSecondary
NdisMPromoteMiniport
Normal Binding
TCP/IP
Interface 1
Interface 2
Miniport
Adapter 1
Adapter 2
LBFO Binding
TCP/IP
Interface 1
Second binding not established if
Miniport calls NdisMSetSecondary
in Adapter 2 MiniportInitialize
Miniport
Adapter 1
Adapter 2
LBFO Data Flow
(Normal)
TCP/IP
Interface 1
Miniport
Adapter 1
Adapter 2
LBFO Data Flow
(Failure)
TCP/IP
Interface 1
Miniport
Adapter 1
Adapter 2
How To Implement LBFO



Design your LBFO strategy
Modify your miniport code
Modify your INF file
Design Your LBFO Strategy



Just failover or load balancing too?
How to run multiple ports as one
load-sharing bundle? (Network issues)
Coordination with attached
switch/router?
Modify Your Miniport Code




MiniportInitialize
MiniportSend/SendPackets
NdisMIndicateReceivePacket
Miniport(Query,Set)Information
MiniportInitialize




Read “BundleId” keyword using
NdisReadConfiguraton
Search for other adapters that have the
same BundleId value
If no match, do nothing, adapter
defaults to primary
If match, set self to secondary using
NdisMSetMiniportSecondary
MiniportSend/SendPackets



MiniportAdapterContext is always the
primary NIC
Miniport code can redirect send to
other NICs with it’s own logic
Always complete Send with original
primary MiniportAdapterContext
NdisMIndicateReceivePacket

Regardless of adapter on which
received, indicate with primary
MiniportAdapterHandle
MiniportQuery/SetInformation


Process Query or Set OID for
specific adapter referenced by
MiniportAdapterContext
No change from normal behavior
MiniportHalt

Secondary Adapter


Normal halt handling
Primary Adapter

Promote secondary with
NdisMPromoteMiniport
Sample


Pass-through sample in DDK
implements failover
Although intermediate driver
it shows the basic
implementation requirements
Installing LBFO Miniports




Create net class INF for miniport
Add additional advanced property
key “BundleId”
BundleId property’s existence is
the trigger to the miniport to
enable LBFO support and the
string is the Bundle identifier
BundleId property can be optional
BundleId INF Example
AddReg = example.advprop.reg
[example.advprop.reg]
; BundleId for support of
HKR, Ndi\params\BundleId,
HKR, Ndi\params\BundleId,
HKR, Ndi\params\BundleId,
HKR, Ndi\params\BundleId,
HKR, Ndi\params\BundleId,
HKR, Ndi\params\BundleId,
LBFO
ParamDesc,
type,
LimitText,
UpperCase,
default,
optional,
0,
0,
0,
0,
0,
0,
"LBFO Bundle ID"
"edit"
"15"
"1"
"Bundle1"
"1"
Demonstration
Limitations


Configuration is spread across
multiple network connections
If a primary adapter is halted the
new primary will have a new
interface to IP with a potentially
different IP configuration
Call To Action

Implement LBFO in your miniport



Simple, no config code necessary
Valuable feature without high cost
Test your LBFO scenarios with
appropriate network devices
Discussion