A Reference Architecture for Web Servers A E

A Reference Architecture for Web Servers A. E. Hassan and R. C. Holt © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 1

What is a Reference Architecture A Reference Architecture for a domain is an architecture template for all of the software systems in the domain The Reference Architecture defines the fundamental components of the domain and the relations between the components The architecture for a specific implementation in the domain is an instance of the reference architecture © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 2

Domains classify a family of products that perform a similar function Its argued that individual products within a domain should share a reference architecture Examples: Compilers and Operating Systems This paper proposes a reference architecture for web servers and examines 3 open source web server instances – Apache (“C”), Jigsaw (Java), AOLServer (“C” and TCL) © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 3

The Value of Reference Architectures Valuable for design and program understanding n n A template to be used for new designs A template to support mapping from a reverse engineering perspective Provides common terminology for similar things that are described differently in specific implementations of a product family Supports objective comparisons of different product implementations © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 4

The Web Domain Browser url Internet Web Server Operating System Resources Programs: Servlet, CGI, etc. Files: HTML, etc. © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 5

Deriving A Web Server Reference Architecture Goal: Reverse Engineer the Reference Architecture for the Web Server domain using 3 different web server products Authors were not domain experts Authors did not interview system implementers Reference architecture derived from the source code © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 6

Process: Deriving A Web Server Reference Architecture Develop a set of usage scenarios Execute the scenarios and trace the implementation Individual scenarios help uncover parts of the reference architecture Quality of the reference architecture is based on the quality and quantity of the chosen scenarios © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 7

Process: Deriving A Web Server Reference Architecture Step 1: Derive the conceptual (as-designed) architecture: n n n Propose a conceptual architecture using domain knowledge Refine the conceptual architecture using reverse engineering techniques Continue until the conceptual architecture is “reasonable” Step 2: Derive the reference architecture using the conceptual architectures n n Propose a reference architecture based on domain knowledge and the common structures between the conceptual architectures Refine and continue until the reference architecture is “reasonable” © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 8

Web Server Reference Architecture For Web Servers Conceptual Architecture Concrete Architecture Apache AOL Server Jigsaw © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 9

Starting the Web Server Reference Architecture Recovery Process Start: What is the architecture style? n Domain knowledge suggests a pipe-and-filter style Use the architecture style to guide the creation of the reference architecture n Since intuition suggests a pipe-and-filter architectural style, the reference architecture should capture the significant subsystems and the data flow between the subsystems © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 10

Web Server Reference Architecture Reception Request Analysis Record Transaction Access Control Resource Handler Utilities OS Abstraction Layer LEGEND Reference Subsystem All Subsystems Use Control Flow Operating System © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 11

Reference Architecture Flexibility A reference architecture must be flexible to encompass many product architectures n n n Resource Mapping Flexibility – A web server must map resources managed by the operating system to the web Security Flexibility – A web server must support security but the implementation can be specific to a product and/or operating system. Concurrency Flexibility – A web server must support concurrent access but the concurrency model can be different. Apache uses process pools, AOL Server and Jigsaw use threads. © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 12

Web Servers Examined Apache n n Written in “C” 80 K Lines of Code AOL Server n n Written in “C” and TCL 164 K Lines of Code – 160 K in “C”, 4 K in TCL Jigsaw n n Written in Java 106 K Lines of Code © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 13

Request_rec Apache Architecture Common structure passed between the subsystems Core Assign a request to a Process Translation Logging Response Determine local location of the resource Log the Transaction Generate the response Authentication Authorization MIME Type Authenticate the client (if needed) Util Determine if the client is authorized Utilities: string manipulation, regexp, etc What is being requested OS Layer Used to abstract – porting to different OS © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 14

Mapped Apache Architecture Reception Core Utilities Util Request Analysis Translation Record Transaction Logging Access Control Resource Handler Authentication MIME Type Authorization Response © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu OS Abstraction Layer OS Layer 15

AOL Server Architecture Communication Driver Abstract Communication Protocol – SSL, HTTP, Sockets, etc. Conn Common structure passed between the subsystems Daemon Core Translate request into a common data structure - Conn NSPerm Handles Authorization and Authentication Timer Util URLHandle Execute Request and Generate the Response NSLog the Transaction Database TCL NSThread Interface Services © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 16

Mapped AOL Server Architecture Reception/Request Analysis Communication Driver Access Control Daemon Core Resource Handler NSPerm URLHandle Utilities Timer Util Database TCL Interface Services © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu Record Transaction NSLog OS Abstraction Layer NSThread 17

Jigsaw Architecture Daemon Protocol and Thread Pool Manager Protocol. Frame in. Filter Resource in. Filter Util Common Services Resource Handle Request and Generate Response Protocol. Frame out. Filter Resource out. Filter OS Layer Nothing Here – Jigsaw Written in Java © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 18

Mapped Jigsaw Architecture Reception/Request Analysis Daemon Access Control Resource Handler Protocol. Frame in. Filter Request Resource in. Filter Utilities Util Record Transact. Protocol. Frame out. Filter Resource out. Filter OS Abstraction Layer © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 19

Summary: Creating a Reference Architecture for a Web Server Reference Architectures are good for system understanding n Enables implementations within an application domain to be compared to each other Facilitates both forward and reverse engineering of products within a domain The paper illustrated a reverse engineering approach towards recovering a reference architecture, and examined 3 different opensource web servers n A reasonable reference architecture for a Web Server was produced © Drexel University Software Engineering Research Group (SERG) http: //serg. cs. drexel. edu 20
- Slides: 20