Upload
tanek-buck
View
24
Download
0
Tags:
Embed Size (px)
DESCRIPTION
CGS 3763 Operating Systems Concepts Spring 2013. Dan C. Marinescu Office: HEC 304 Office hours: M- Wd 11:30 - 12:30 A M. Last time: Solutions to HW1 Student questions for week 4 More network concepts Today: Sockets Client-server systems - PowerPoint PPT Presentation
Citation preview
CGS 3763 Operating Systems Concepts Spring 2013
Dan C. Marinescu
Office: HEC 304
Office hours: M-Wd 11:30 - 12:30 AM
Last time: Solutions to HW1 Student questions for week 4 More network concepts
Today: Sockets Client-server systems Intermediaries, trusted intermediaries Examples of client-server systems: event service, email, X-windows, Web
Next time Heterogeneity and impact on client server-systems Remote Procedure Calls (RPCs)
Reading assignments Chapters 3 and 4 of the textbook Chapters 3 and 4 textbook slides
Lecture 15 – Monday, February 11, 2013
2Lecture 15
Multiplexing and de-multiplexing
Lecture 15 3
Application Layer
Transport Layer
Network Layer
HTTP FTP TELNET
TCP UDP
IP
NFS RPC DNS SNTP
Data Link Layer
Ethernet WirelessSatellite
Ports and socket
Lecture 15 4
Host
Process
Socket
Input message queue
Output message queue
Port Internet
5
Host
Process
Network Network
RouterNetwork interface
Port
IP address = (NetworkId, HostId)
Message delivery to processes
Host
Process
Socket
Input message queue
Output message queue
PortInternet
Sockets and portsLecture 15
Communications in Client-Server Systems
Sockets Remote Procedure Calls Remote Method Invocation (Java)
Lecture 15 6
Sockets A socket is defined as an endpoint for communication Concatenation of IP address and port The socket 161.25.19.8:1625 refers to port 1625 on host
161.25.19.8 Communication takes place between a pair of sockets
Lecture 15 7
Socket Communication
Lecture 15 8
Client -server systems
Lecture 15 9
10
Client/service organization
Not only separates functions but also enforces this separation!! No globally-shared state (e.g., through the stack) Errors can only propagate from client to service and vice-versa
only if the messages are not properly checked. A client can use time-outs to detect a non-responsive service
and take another course of action. The separation of abstraction from implementation is clearer; the
client needs only to know the format of the message, the implementation of the service may change.
Lecture 15
Lecture 15 11
Three-wayhandshake
Client Process
Client socket
Main Thread of
Server Process
Data
Server socket
Newsocket
New Thread of
Server Process
Internet
Examples of client-server systems
Event service – the publish-subscribe paradigm. Events are named The process/thread generating events publishes them – sends
them to the server which queues the events The clients subscribe to different events
X-windows Electronic mail as a trusted intermediary Files systems as trusted intermediaries The Word Wide Web The Domain Name System
Lecture 15 12
Lecture 15 13
1414
Intermediaries
What if the sender and the receiver of a message are not active at the same time?
Intermediaries support buffered communication and allow more flexibility the intermediary may decide how to sort messages
The sender and the receiver may: Push a message Pull a message
Example: the mail service: The sender pushes a message into his/her outbox The outbox pushes it to the inbox of the recipient The recipient pulls it whenever s(he) wants
The publish/subscribe paradigm the sender notifies an event service when it produced a message. Recipients subscribe to the events and when the events occur the messages are delivered
Lecture 15
Lecture 15 15
16
Trusted intermediary
Trusted service acting as an intermediary among multiple clients. Enforces modularity a fault of one client does not affect other
clients. Examples:
File systems Mail systems
Thin-clients a significant part of client functionality is transferred to the intermediary.
Lecture 15
Thin clients In a thin client/server system, the only software installed on the thin
client is the user interface, certain frequently used applications, and a networked operating system. By simplifying the load on the thin client, it can be a very small, low-powered device giving lower costs to purchase and to operate per seat.
The server, or a cluster of servers has the full weight of all the applications, services, and data. By keeping a few servers busy and many thin clients lightly loaded, users can expect easier system management and lower costs, as well as all the advantages of networked computing: central storage/backup and easier security.
Because the thin client is relatively passive and low-maintenance, but numerous, the entire system is simpler and easier to install and to operate.
As the cost of hardware plunges and the cost of employing a technician, buying energy, and disposing of waste rises, the advantages of thin clients grow. From the user's perspective, the interaction with monitor, keyboard, and cursor changes little from using a thick client.
Lecture 15 17
18
Example: the X-windows (X11)
X11 software system and network protocol that provides a GUI for networked computer. Developed as part of Project Athena at MIT in 1984.
Separates the service program manipulates the display from the client program uses the display.
An application running on one machine can access the display on a different computer.
Clients operate asynchronously, multiple requests can be sent the display rate could be much higher than the rate between the client and the server.
Lecture 15
19
Editor is a client of File service which is a client of Block-storage serviceFile service is a trusted intermediary.
Lecture 15
20
A client-service system the World Wide Web
The information in each page is encoded and formatted according to some standard, e.g. images: GIF, JPEG, video: MPEG audio: MP3
The web is based upon a “pull” paradigm. The server has the resources and the client pulls it from the server.
The Web server also called an HTTP server listens at a well known port, port 80 for connections from clients.
The HTTP protocol uses TCP to establish a connection between the client and the server.
Some pages are created on the “fly” other have to be fetched from the disk.
Lecture 15
21
D ata
S erver residence tim e.W eb page is created onthe fly
U ser's H TTP request S YN
S YN
A C K
A C K + H TTP request
TC P connectionestab lishm ent
R TT
U ser's H TTP requestfor an im age
S erver residence tim e.Im age is re trived fromdisk
D ata
H TTP request
A C K
A C K
Browser W eb Server
Lecture 15
22
Threadhandlingan HTTPrequest
W eb Server
H T T P request
R esourceR eposito ry
Loca l cache
Threadhandlingan HTTPrequest
H T T Presponse
W ebBrowser
C lient
P ersisten t/N onP ersistent
H TTPconnection
C lien t
TC Pport
H T T P request
H T T P response
A n H TTP requst con ta ins one o f the fo llow ing m ethods:G E T - ge t a resourceH E A D - verify the link and cond itions o f a resourceP O S T - input to a resource , usua lly a C G I scrip tP U T - s to re a resource a t the serverD E LE TE - de le te a resourceTR AC E - inc lude a ll headers in a response
W eb Cache
S am ple H TTP sta tus code in a response100 - C ontinue200 - O K205 - R eset C onnection301 - M oved P erm anently402 - Paym ent R equried404 - N ot Found405 - M ethod N ot A llowed407 - P roxy A uthentica tion R equ ired415 - U nsupported M ed ia Type500 - In terna l S erver E rro r504 - G ateway T im eout505 - H TTP version N ot S upported
Lecture 15
Client server interactions in HTTP
Lecture 15 23
HTTP clientWeb Browser
HTTPserver
TCPport80
request
response
HTTP clientWeb Browser
HTTPserver
Proxy
request to proxy
response to proxy
response to client
HTTP clientWeb Browser
HTTPserver
Tunnel
request to server
request to server
response to client
response to client
request to server