Extending Windows Vista Native Wi-Fi Capabilities

Download Report

Transcript Extending Windows Vista Native Wi-Fi Capabilities

Extending Windows Vista
Native Wi-Fi Capabilities
Thomas Kuehnel
Program Manager
Networking Group
Microsoft Corporation
Yi Lu
Software Development Engineer
Networking Group
Microsoft Corporation
Agenda
Native Wi-Fi in Windows Vista
Extensibility
AutoConfig Service APIs
Code Sample and Demo: Site Survey
Proximity service Discovery
Native Wi-Fi In Windows Vista
The driver architecture for 802.11
802.11 frame format is exposed to
Operating System
NDIS 6-based (Legacy NDIS 5.1 drivers
will work)
Wireless Service (AutoConfig)
Only activated when Wireless NIC is installed
Optional component in Server SKU
Provides public APIs
Native Wi-Fi In Windows Vista
Added and improved features
Improved security
WPA2 (infrastructure and ad hoc), hidden network handling, all
user/per-user profile (ACling)
Better management
Diagnostic, command line (netshell), group policy
Easier to use
New User Interface simplifies configuration
Performance improvements
4-way handshake in kernel
Better ad-hoc network integration
File-sharing, “People Near Me”
Native Wi-Fi Architecture
Overview
Diagnostics
MS-EAP
User
Interface
Native Wi-Fi Driver and NIC
Public APIs
Auto
Configuration
Service
EAP
HOST
802.1x
802.11
NWF Miniport
Driver & NIC
LWF Filter driver (nwifi.sys)
Emulates 802.3
Enforces security policy
Configures upper MAC, 4-way handshake
Auto Configuration Service
Connection control, discovery
Profile management
Provides Public APIs
User Interface
View Available Network UI (VAN-UI)
Wizards: get connected, create profile
Preferred network list, profile UI
802.3
LWF Driver
802.11 PHY and MAC layer
Roaming, encryption / decryption
FAT
(legacy)
Miniport
Driver & NIC
Wireless diagnostics
Helper classes
Microsoft EAP Methods
MSCHAPv2, EAP TLS, PEAP
Public APIs
Service
Extension
Auto
Configuration
Service
3rd Party
EAP
Monitoring Filter Driver
MS-EAP
3rd Party
Application
Diagnostics
User
Interface
Helper
UI
extension
Native Wi-Fi Extensibility
EAP HOST
Framework
Traffic monitor
User mode driver extension
Key management
Proprietary authentication
Power control
Configuration and prompting
Interactive UI
Advanced UI extension
802.1x
Win32 application, scripts
802.3
LWF Driver
802.11
Filter
NWF
Miniport
Driver & NIC
FAT
(legacy)
802.11
Miniport
Driver &
NIC
Provided by:
Connection manager
Site survey
Easy connect
Microsoft
ISV
IHV
Custom Helper Classes
Custom EAP methods
e.g., EAPFAST, LEAP
IHV Connection Process
First time connect using 802.1X
1. User selects network
UI
2. AC creates temporary profiles and
passes beacon to IHV service
1
Configuration
23
11
EAP
Method
Service (AC)
7
12
2
9
6
IHV
Service
5
8
Auto
Profile
Store
4
10
IM Driver
Miniport
Driver & NIC
802.1x
Data
NDIS Port
3. “IHV data” added to temporary profile
4. AC tries to connect with temp profile
5. NIC connects and notifies IHV Service
6. IHV service invokes Microsoft 802.1X
7. 802.1X handshake (security packets)
8. 802.1X UI interaction
9. 802.1X success, keys to IHV service
10. IHV performs key handshake
11. IHV indicates success to AC
12. AC opens the port
and saves the profile
AutoConfig Service APIs
Overview
Win32 APIs for
Managing of wireless profiles (set, retrieve)
All user/per user profiles, ACling of APIs
Managing of wireless connections and scanning
Adapter enumeration and settings
Concurrency
Simultaneous use of APIs
Unifies Interfaces
Native Wi-Fi and legacy drivers
Subset will be back-ported to Windows XP
Connection and profile management
Code Sample
Site survey
GUI application
Show all visible networks
Provide details (BSSIDs, signal quality, …)
Select network and connect
Radio on/off
Demonstrates the following functionality
Register and receive notifications
Perform scan
Get network information
Issue connect
Program Sequence
Initialization
Callback thread starts
Register notifications
Enumerate interfaces
Notification callback
Scan
Connect
Get available
networks
Update connection
status
Notification callback thread
Deregister notifications
De-initialization
Callback thread ends
Open And Close Handle
WlanOpenHandle/WlanCloseHandle
// WLAN Site Management Initialization
...
WlanOpenHandle(
WLAN_API_VERSION,
// current API version
NULL,
// reserved, must be NULL
&dwServiceVersion,
// version of the WLAN service
&hClientHandle
// returned handle
);
...
// WLAN Site Management De-initialization
...
WlanCloseHandle(
hClientHandle,
// opened handle
NULL
// reserved, must be NULL
);
...
Enumerate Interfaces
WlanEnumInterface
// Enumerate WLAN interfaces
PWLAN_INTERFACE_INFO_LIST pInterfaceList = NULL;
WlanEnumInterface(
hClientHandle,
// opened handle
NULL,
// reserved, must be NULL
&pInterfaceList
// returned interface info list
);
// Process interface information, obtain interface GUID
...
WlanFreeMemory(pInterfaceList);
Set Interface Properties
WlanSetInterface
/* Set interface property, e.g. turn off radio */
WLAN_PHY_RADIO_STATE wlanPhyRadioState;
wlanPhyRadioState.dwPhyIndex = 0; // turn off the radio on 1st PHY
wlanPhyRadioState.dot11SoftwareRadioState = dot11_radio_state_off;
WlanSetInterface(
hClientHandle,
pInterfaceGuid,
wlan_intf_opcode_radio_state,
sizeof(WLAN_PHY_RADIO_STATE),
(PBYTE)&wlanPhyRadioState,
NULL
);
//
//
//
//
// opened handle
// interface GUID
opcode to set radio state
data size
pointer to the data
reserved, must be NULL
Register Notifications
WlanRegisterNotification
// Register notifications
WlanRegisterNotification(
hClientHandle,
WLAN_NOTIFICATION_SOURCE_ALL,
FALSE,
NotificationCallBack,
pContext,
NULL,
NULL
);
// opened handle
// register all notifications
// don’t ignore duplicate
// callback function
// context data
// reserved, must be NULL,
// don’t return previous
// Callback function will be called in another thread when
// a notification is available
...
Notification Callback Function
// Application defined callback function
VOID NotificationCallback(
PWLAN_NOTIFICATION_DATA pNotifData,
PVOID pContext
)
{
...
if (pNotifData->NotificationSource == WLAN_NOTIFICATION_SOURCE_ACM)
{
switch(pNotifData->NotificationCode)
{
case wlan_notification_acm_connection_attempt_fail:
OnConnectionAttemptFail(
(PWLAN_CONNECTION_NOTIFICATION_DATA)pNotifData->pData
);
break;
// other cases
...
}
}
...
}
Issue Scan Request
WlanScan
Asynchronous call
Notification upon completion
Get networks using
WlanGetAvailableNetworks
// Perform a scan on a specific interfaces
WlanScan(
hClientHandle,
// opened handle
&pInterfaceGuid,
// interface GUID
NULL,
// don’t probe
NULL,
// don’t probe
NULL
// reserved, must be NULL
);
Get Available Networks
WlanGetAvailableNetworks
// Query available networks. This is usually done when the scan
// complete notification is received.
PWLAN_AVAILABLE_NETWORK_LIST pNetworkList = NULL;
WlanGetAvailableNetworkList(
hClientHandle, // opened handle
pInterfaceGuid, // interface GUID
0,
// don’t include hidden/adhoc profiles
NULL,
// reserved, must be NULL
&pNetworkList
// pointer to the returned network list
);
// Process available networks
...
WlanFreeMemory(pNetworkList);
Get BSSIDs
WlanGetNetworkBssList
// Query the BSS list of a particular network or all networks.
PWLAN_BSS_LIST pBssList = NULL;
WlanGetNetworkBssList(
hClientHandle, // opened handle
pInterfaceGuid, // interface GUID
pSsid,
// SSID, pass in NULL for all networks
dot11_BSS_type_infrastructure,
// BSS type
TRUE,
// security enabled
NULL,
// reserved, must be NULL
&pNetworkList
// pointer to the returned BSS list
);
// Process BSS entries
PWLAN_BSS_ENTRY pBssEntry = &pNetworkList->wlanBssEntries[i];
...
// Process raw IE if needed
...
WlanFreeMemory(pBssList);
Connect To Network
WlanConnect
Asynchronous call
Notification upon completion
// Connect to a secure network without a profile
// Prepare connection parameters
WLAN_CONNECTION_PARAMETERS ConnPara;
ConnPara.pDot11Ssid = pDot11Ssid;
// SSID
ConnPara.dot11BssType = dot11_BSS_type_infrastructure; // BSS type
ConnPara.pDesiredBssidList = NULL; // no desired BSSID
ConnPara.strProfile = NULL;
// no profile
ConnPara.wlanConnectionMode = wlan_connection_mode_discovery_secure;
ConnPara.dwFlags = 0;
// no connection flag
WlanConnect(
hClientHandle,
pInterfaceGuid,
&ConnPara,
NULL
);
// opened handle
// interface GUID
// connection parameters
// reserved, must be NULL
Update Connection Status
Status update in notification call back function
// Update connection status upon receiving connection attempt fail
// notification
VOID OnConnectionAttemptFail(
PWLAN_CONNECTION_NOTIFICATION_DATA pConnNotifData
)
{
...
// get the reason for the attempt failure
WCHAR strReason[256];
// string buffer
WlanReasonCodeToString(
pConnNotifData->wlanReasonCode, // reason code failure
256,
// size of the string buffer
strReason,
// string buffer
NULL
// reserved, must be NULL
);
// print out the string
...
}
Future Wireless Technology
Future Wireless Technology
“Services Near Me”
“Hello”
“Hello”
Proximity Service Discovery
Discover before connect
Advertise and discover services in range
Integrates with Function Discovery and PnP-X
Uses IBSS
Places proprietary IE (221) in Beacon
OUI = 00:50:f2
Format string to be registered at tx and rx
Payload carries service information
Hooks (APIs) in Windows Vista
Transmission: WlanSetPsdIEDataList
Reception: WlanExtractPsdIEDataList
WS-Discovery In 802.11
“Hello” over 802.11
Application
AutoConfig
802.11 Beacon IE
Field
Value
Element ID
Length
OUI
OUI-Type
Format
Type
UUID
Sequence
Security
Friendly
name
Base address
221
…253
00:50:f2
6
4 Octets
4 Octets
16 Octets
Word
Word
32 Char
WS-Discovery “Hello”
xmlns:d="http://schemas.xmlsoap.org
/ws/2004/10/discovery"
<d:Types>i:PrintBasic </d:Types>
<a:EndpointReference> <a:Address>
uuid:98190dc2-0890-4ef8-ac9a5940995e6119
</a:Address> </a:EndpointReference>
<d:AppSequence InstanceId="1077004"
MessageNumber="1" />
<d:XAddrs>http://prn3/Base</d:XAddr
s>
Max 802.11 IE: 255 Bytes
URL
Call To Action
Develop 802.11 drivers based on the
Native Wi-Fi architecture for existing and
new hardware
Make your applications Windows Vista
ready by using the AutoConfig APIs
Support WPA 2 for ad hoc to enable
new scenarios
Additional Resources
Web Resources
API: http://msdn.microsoft.com/library/enus/nativewifi/nwifi/portal.asp
EAP: http://www.microsoft.com/eap
Diagnostics:
http://msdn.microsoft.com/library/default.asp?url=/library/enus/ndf/ndf/about_ndf.asp
WDK: http://msdn.microsoft.com
Related Sessions
Link Layer Discovery and Enabling Wi-Fi Diagnostics for Network
Performance Tuning
SoftAP Test Infrastructure for Obtaining Logo for Wireless
LAN drivers
E-mail to: 802.11_fb @ microsoft.com
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.