Difference between revisions of "KTCPVS CHTTP"

From LVSKB
Jump to: navigation, search
(Scenarios)
Line 7: Line 7:
 
== Architecture ==
 
== Architecture ==
  
The following diagram depicts the functional model for CHTTP.
+
The following diagram depicts the function modules for CHTTP.
 +
 
 +
[[Image:KTCPVS-CHTTP-Module.jpg]]
  
 
HTTP transfer engine is responsible to read http lines from client socket and relay http data between HTTP client and backend server.
 
HTTP transfer engine is responsible to read http lines from client socket and relay http data between HTTP client and backend server.
Line 22: Line 24:
  
 
=== HTTP request without session information ===
 
=== HTTP request without session information ===
 +
 +
[[Image:KTCPVS-CHTTP-Workflow-Without-Session.jpg]]
  
 
When a client accesses KTCPVS without a session cookie in http request line, CHTTP will select a server with the least load, and redirect the http request to this selected server.
 
When a client accesses KTCPVS without a session cookie in http request line, CHTTP will select a server with the least load, and redirect the http request to this selected server.
  
 
=== Server starting a session ===
 
=== Server starting a session ===
 +
 +
[[Image:KTCPVS-CHTTP-Workflow-Server-Session.jpg]]
  
 
When the server initializes a session by sending cookie back to KTCPVS, CHTTP will inject a session cookie to client, record this session in session table and save all the cookies related to this session in cookie table. Therefore, the following http requests from the same client will contain a session cookie, then CHTTP will direct this request to the original server that starts the session.  
 
When the server initializes a session by sending cookie back to KTCPVS, CHTTP will inject a session cookie to client, record this session in session table and save all the cookies related to this session in cookie table. Therefore, the following http requests from the same client will contain a session cookie, then CHTTP will direct this request to the original server that starts the session.  
  
 
=== HTTP request with session information ===
 
=== HTTP request with session information ===
 +
 +
[[Image:KTCPVS-CHTTP-Workflow-With-Session.jpg]]
  
 
After the HTTP client receives response with a session, it will send http request with the session cookie. CHTTP will search the session table to find the destination server. Only if search is failed or no session cookie is found, CHTTP will lookup server with the least load. When CHTTP processes http response header, if there is cookie in http response header, it will update the session table and cookie table.
 
After the HTTP client receives response with a session, it will send http request with the session cookie. CHTTP will search the session table to find the destination server. Only if search is failed or no session cookie is found, CHTTP will lookup server with the least load. When CHTTP processes http response header, if there is cookie in http response header, it will update the session table and cookie table.

Revision as of 02:24, 4 June 2005

Introduction

CHTTP is a KTCPVS content-based scheduling module for cookie-based HTTP service. It supports both persistent HTTP and HTTP State Management Mechanism.

CHTTP scheduler will parse header of every http request received and extract session information in it, then select the right backend server with session information, and redirect the http message to the server. If there is no such a session, CHTTP will direct request to a backend server according to content-based scheduling rules. When the backend server starts a session, CHTTP will inject a session cookie in the response to the client, so that any further requests from the client will be sent to the backend server for this session.

Architecture

The following diagram depicts the function modules for CHTTP.

KTCPVS-CHTTP-Module.jpg

HTTP transfer engine is responsible to read http lines from client socket and relay http data between HTTP client and backend server.

HTTP parser engine implements a simple HTTP parser. It parses http request lines, http status lines, http mime headers, and store parsed information in http requests or http responses.

Session manager is used to support HTTP state management mechanism. It stores the cookies received from backend servers and maintains session table and cookie table for HTTP clients and backend servers.

Scheduler is the core component of CHTTP. It coordinates other components. Scheduler reads http request header through HTTP transfer engine, parses it by HTTP parser engine, and gets session information from session manager. Finally, it directs the http request to a backend server. After processing http request, Scheduler reads http response from the backend server, and returns http response to the original client.

Scenarios

The section describes how CHTTP works in the different scenarios.

HTTP request without session information

KTCPVS-CHTTP-Workflow-Without-Session.jpg

When a client accesses KTCPVS without a session cookie in http request line, CHTTP will select a server with the least load, and redirect the http request to this selected server.

Server starting a session

KTCPVS-CHTTP-Workflow-Server-Session.jpg

When the server initializes a session by sending cookie back to KTCPVS, CHTTP will inject a session cookie to client, record this session in session table and save all the cookies related to this session in cookie table. Therefore, the following http requests from the same client will contain a session cookie, then CHTTP will direct this request to the original server that starts the session.

HTTP request with session information

KTCPVS-CHTTP-Workflow-With-Session.jpg

After the HTTP client receives response with a session, it will send http request with the session cookie. CHTTP will search the session table to find the destination server. Only if search is failed or no session cookie is found, CHTTP will lookup server with the least load. When CHTTP processes http response header, if there is cookie in http response header, it will update the session table and cookie table.