Client Server Architecture
Enrique Barra
Contents
Internet origin
The Web
Internet
Evolution
URLs
3 layer architecture
2
Internet origin
Internet starts with Arpanet on January 1983
Internet connects computers to the net using the TCP/IP
protocol stack
TCP/IP supports client-server apps with sockets interface
First Internet apps are:
– telnet (virtual terminal), ftp (file transfer), email, …
The client–server model is a distributed application
structure that partitions tasks or workloads between the
providers of a resource or service, called servers, and
service requesters, called clients
3
The Web
Tim Berners Lee proposes in 1989 a new application: The
World Wide Web or “The Web”
The Web is an information space where documents and other
web resources are identified by Uniform Resource Locators
(URLs) interlinked by hypertext links, and accessible via the
Internet
Client app (Browser) <-> Server app (Static Web Server)
The Web is the content repository that the internet needed
Transforms Internet in a “Content distribution network”
4
The Web
Tim Berners Lee developed/joined three essential technologies:
• a system of globally unique identifiers for resources on the
Web and elsewhere, the universal document identifier (UDI),
later known as uniform resource locator (URL) and uniform
resource identifier (URI)
• the publishing language HyperText Markup Language (HTML)
• the Hypertext Transfer Protocol (HTTP)
5
Internet
Client Server
Socket Socket Socket
interface port interface port interface
TCP UDP TCP/IP Protocol TCP UDP
IP IP
IP Address IP Address
Net / Internet
The Web
Client Server
Web Web Server
Browser HTTP Protocol (static)
Socket
Web page port interface port Web page
repository
TCP UDP TCP/IP Protocol TCP UDP
IP IP
IP Address IP Address
Net / Internet
The initial Web
Static Web Server
– Program that server files requested by clients
Web Client
– Program that requests the web pages to a server and presents them to
the user
– The URL identifies the Web resource.
– For example: http://example.es/dir/cal.html
• http: protocol to access the server (HTTP GET)
• example.es: server address that hosts the page
• /dir/cal.html: file path (web page) in the server directory
HTTP transaction seen by the client
– Stablish the TCP connection with the server (example.es)
– Sends the HTTP request with the path of the Web resource
– Receives through the connection the HTTP answer with he file
– The server closes the TCP connection
8
example.es
server
HTTP request
cal.htm
http://example.es/dir/cal.htm
HTTP response dir
public
9
Evolution of the Web
Decentralized architecture based on the client-server model
– Webapps, desktop apps, smartphones apps, …
– Cloud services
– Intranets
– P2P apps
– Etc.
Distributed computing paradigm
– Programs or apps that cooperate with a common objective through
the Internet
10
URL y URIs
URIs (Uniform Resource Identifiers)
– is a compact sequence of characters that identifies an abstract or physical
resource
– A URI can be further classified as a locator (URL), a name (URN), or both
– Example URIS: tel:+1-816-555-1212 or mailto:John.Doe@example.com
scheme:[//authority]path[?query][#fragment]
authority = [userinfo@]host[:port]
URL (Uniform Resource Locator)
– Address to access any resource or service on the Internet
– URLs are a specific case of URIs
– The part that makes a URI a URL is the inclusion of the “access
mechanism”, or “network location”, e.g. http:// or ftp://
11
Examples
scheme://user:password@host:port/path?query#fragment
1. http://example.es/dir/page.html
– URL that identifies the Web page /dir/page.html in the server example.es
2. http://example.es:8080/dir/page.html
– Similar URL but in this case the server is listening on the port 8080 and not in the
80 (default)
3. http://example.es/dir/page.html#p3
– Similar URL but with a fragment or anchor that identifies the element with id=‘p3’
in page.html
4. http://example.es/registro?id=23&name=Enrique
– URL that sends two params in the query (param id and name)
5. ftp://enrique@example.es/dir/page.html
– URL of a web resource associated with the enrique user at the server example.es
3 layer architecture or 3 tier architecture
Three-tier architecture is a client–server software
architecture pattern developed and maintained as
independent modules, most often on separate platforms
– Presentation tier: visualization layer with the user interface
– Application tier/logic tier: logic layer with the rules to attend
requests, performs detailed processing
– Data tier: data layer to store the data
Apart from the usual advantages of modular software
with well-defined interfaces, the three-tier architecture is
intended to allow any of the three tiers to be upgraded
or replaced independently in response to changes in
requirements or technology
13
3 layer architecture or 3 tier architecture
In Web development:
– Client or FrontEnd: Visualization layer (either dynamic or
static)
– Server or BackEnd: Bussiness logic
– Database: Data
DB
Client
Server
DB
14
Client Server Architecture
Enrique Barra