Check out the new USENIX Web site. next up previous
Next: Cache Architecture Up: TCP/IP Integration Previous: Linux TCP/IP Integration

Windows 2000 TCP/IP Integration

On Windows, AFPA interacts with the TCP stack using the Transport Driver Interface (TDI) [25]. TDI is an interface, defined by Microsoft, by which kernel-mode ``clients'' interact with protocol drivers such as TCP/IP. TDI defines a set of client requests, including accept, connect, disconnect, send, and receive. It also defines a set of callback routines, each associated with a network event such as connection establishment, disconnection, and reception. TDI allows but does not require a client to register a callback routine for any event per connection end point. TDI uses an asynchronous model. Each request has an associated client-specified completion routine that is invoked when the request completes (whether synchronously or asynchronously). Client-registered callback routines are invoked asynchronously as well.

When a TCP SYN packet arrives on a port to which AFPA is bound, TDI invokes AFPA's connect event handler. This routine allocates an AFPA connection structure, in which application-specific information associated with the connection is stored, then builds and returns an accept request. The completion routine for the accept request simply cleans up in case of error. Arrival of request data from the client causes AFPA's receive event handler to be invoked.

On Windows 2000, AFPA reads cache objects from the file system, pins them in memory, and passes them to the TCP stack in 64 KB chunks. Each chunk is represented by an entry in the cache object's pin array. When AFPA creates a cache object, it opens the corresponding file. AFPA initializes each entry in the pin array to indicate that the corresponding chunk has not yet been read or pinned. When it sends a cache object, AFPA sequentially traverses the object's pin array. If a chunk is currently pinned, its pin count is incremented, and it is sent immediately in the context of a software interrupt. If the chunk is not pinned, the request must be queued to a pool of worker threads because the Windows 2000 memory architecture does not permit access to unpinned memory from software interrupts. The send completion routine decrements the pin count (which acts as a reference count) for the current chunk and repeats the process for the next chunk.


next up previous
Next: Cache Architecture Up: TCP/IP Integration Previous: Linux TCP/IP Integration
Philippe Joubert 2001-05-01