Understanding IIS 7.0 Architecture
02月 27th, 2009Understanding IIS 7.0 Architecture
>Overview of IIS 7.0 Architecture
@HTTP protocol stack(HTTP.sys):kernel mode protocol listener that listens for HTTP and HTTPS requests
@World Wide Web Service Publishing Service(W3SVC): HTTP listener adapter
@Windows Process Activation Service(WAS, also known as WPAS) : provides management of worker processes.
@Configuration store: a distributed XML-based file hierarchy that stores both IIS and ASP.NET settings.
@Worker process w3wp.exe: a long-running process that processes requests and generates responses.

Screen clipping taken: 2/16/2009, 3:24 PM

Screen clipping taken: 2/16/2009, 3:32 PM
>IIS 7.0 Core Components
>>HTTP.sys
@performs tasks
#intercepting and returning HTTP requests
#Preprocessing and security filtering of the incoming HTTP requests
#Queuing of HTTP requests for the application pools
#Caching of the outgoing HTTP responses

Screen clipping taken: 2/16/2009, 3:42 PM
@Routing table: used to determine which application pool responds to requests from what parts of the namespace.
>>World Wide Web Publishing Service
@Functionality is split between two services: W3SVC and WAS

Screen clipping taken: 2/16/2009, 3:54 PM
#W3SVC: acts as listener adapter for the HTTP listener, HTTP.sys.
>>Windows Process Activation Service
@WAS includes the following components
#Configuration manager, which reads application and application pool configuration from configuration store
#Process manager, which maps application pools to existing worker processes and is responsible for starting new instances of W3wp.exe to host new application pools in response to activation requests.
#Listener adapter interface, which defines how external listeners communicate activation requests they receive to WAS.
@configuration manager in WAS reads following information:
#Global configuration information
#Protocol configuration information
#Application pool configuration, such as the process account information
#Site configuration, such as bindings and applications
#Application configuration, such as the enabled protocols and the application pools to which the application belongs.
>>Configuration Store
@The distributed configuration hierarchy includes:
#global : applicationHost.config
#computer-wide
#.NET Framework configuration files machine.config
#root web.config configuration files located within the Web sites, applications, and directories.
@xcopy deployment of configuration alongside application code and content.
@distributed configuration store

Screen clipping taken: 2/16/2009, 4:53 PM
@administration stack

Screen clipping taken: 2/16/2009, 4:55 PM
>>Worker Process
@The role of a worker process is to process requests.

Screen clipping taken: 2/16/2009, 5:09 PM
>Request Processing in Application Pool
>>Classic Mode
@ASPNET ISAPI extension is responsible for processing the content types that are registered to it.

Screen clipping taken: 2/16/2009, 5:41 PM
@limitations:
#Services provided by ASP.NET modules are not available to non-AP.NET requests
#Some processing steps are duplicated, such as authentication.
#Some settings must be managed in two locations, such as authorization, tracing, and output caching.
#ASP.NET applications are unable to affect certain parts of IIS request processing that occur before and after the ASP.NET execution path due to the placement of the ASP.NET ISAPI extension in the server pipeline
>>.NET Integrated Mode

Screen clipping taken: 2/16/2009, 5:50 PM
@Stages and corresponding events in the request processing pipeline
#Begin Request stage: This stage starts request processing. The BeginRequest event is raised.
#Authenticate Request stage : This stage authenticates the requesting user. The AuthenticateRequest event is raised.
#Authorize Request stage : At this stage, the AuthorizeRequest event is raised.
#Resolve Cache stage : At this stage, ResolveRequestCache event is raised. This stage checks to see if the response to the request can be retrieved from a cache.
#Map Handler stage : At this stage, the MapRequestHandler event is raised. This stage determines the handler for the request.
#Acquire State stage : At this stage, the AcquireRequestState event is raised. This stage retrieves the required state for the request.
#Pre-execute Handler stage : At this stage, the PreExecuteRequestHandler event is raised. This stage signals that the handler is about to be executed and performs the preprocessing tasks if needed.
#Execute Handler stage : At this stage, the ExecuteRequestHandler event is raised. The handler executes and generates the response.
#Release State stage : At this stage, the ReleaseRequestState event is raised. This stage releases the request state.
#Update Cache stage : This stage updates the cache. The UpdateRequestCache event is raised.
#Log Request stage : At this stage, the request is logged. The LogRequest event is raised.
#End Request stage : At this stage, the EndRequest event is raised, which signals that the request processing is about to complete.
>>How ASP.NET Integration Is Implemented
@Managed Engine
>>Module Scope
>>Module Ordering
>Non-HTTP Request Processing

