intermediate

Winsock, AFD, and kernel boundaries

How user-mode sockets relate to kernel-mode transport, and why AFD.sys matters.

Related labs

Hands-on exercises for this area — in the browser or on a Windows machine.

View all labs

Guided paths in this branch

Follow a short sequence step by step. Each path links to the first topic; use Read next on each page to continue.

Official Microsoft docs

Closest official references related to this topic on Microsoft Learn.

Why it matters

This is the bridge between app-level sockets and the kernel networking stack. It helps learners understand where overhead and security boundaries sit.

Mental model

Apps speak Winsock in user mode. Kernel components speak a kernel socket interface, and system drivers like AFD.sys sit in the middle to provide efficient transport access.

How it works

  1. 1Applications create sockets via Winsock, which routes requests to the kernel networking stack.
  2. 2Kernel-mode components can use Winsock Kernel (WSK) interfaces for network I/O without user/kernel switching overhead.
  3. 3System drivers (including AFD.sys) participate in socket plumbing and transport exposure to higher layers.

Key terms

Winsock
The primary Windows sockets API used by applications.
WSK
Winsock Kernel, a kernel-mode socket interface for system components.
AFD
Ancillary Function Driver for Winsock, a kernel-mode driver involved in sockets.

High-throughput networking

Scalable servers depend on understanding where buffering happens and where boundaries introduce overhead in the networking path.

Common misconception

People treat 'TCP/IP stack' as one box. In practice, there are layers and interfaces that separate app APIs, system drivers, and transport implementation.

You should read next

Ranked from your current topic, related links, branch depth, and any active guided path.

Related topics