ClientServer Interaction - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

ClientServer Interaction

Description:

Started either at boot or when requested. Typically runs on shared machine. Waits for contact ... memory and CPU plus a good multi-processing OS. 9/16/09. Beaty ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 17
Provided by: elliot8
Category:

less

Transcript and Presenter's Notes

Title: ClientServer Interaction


1
Client-Server Interaction
2
Applications
  • Provide high-level services that users interact
    with
  • Provide users with a view of the underlying
    network
  • The only network view users have
  • Good dont have to know any details of
    underlying networks
  • Provides naming of resources computers,
    services, files, etc. dont have to know
    addresses, port numbers, etc.
  • Key Question how can two application programs on
    different machines across the internet
    communicate with one another

3
Internet
  • Provides communication but says nothing about
    what services will be provided
  • Services left to applications
  • Much like telephone system
  • Telephone system does not specify voice, data,
    FAX, language, etc.

4
Internet Continued
  • Phone system also does not initiate
    communication, users do
  • Network cannot know when communication needs to
    be initiated, when it needs to be accepted
  • One end waiting for call, other initiates
  • More than one can be waiting on a machine
  • For a pair of application programs to
    communicate, one must initiate and the other must
    accept the request to communicate

5
But, Internet Unlike Phone System in some respects
  • There is no general alerting mechanism for all
    applications
  • Instead of waiting for an arbitrary message to
    arrive, an application program must interact with
    protocol software (PS) and tell it specifically
    what type of message it is waiting for, and then
    it must wait
  • Later, if a message of that type arrives, the PS
    tells the waiting application passing it the
    message
  • So, one end waits (once registered with its PS),
    the other end sends and the sender assumes
    receiver (server) is waiting

6
Client/Server
  • Server waits, client initiates
  • Client is an application software program
  • Actively initiates contact temporarily, also
    performs computations locally
  • Only a single session/user
  • Can contact multiple servers
  • Usually runs locally on a PC

7
Client/Server Continued
  • Server is an application software program
  • Started either at boot or when requested
  • Typically runs on shared machine
  • Waits for contact
  • Special purpose code that can talk to multiple
    clients, but is dedicated to providing a single
    service
  • Is not a type of hardware system but usually
    runs on a computer with enough resource capacity
  • Is a piece of software

8
Client/Server Picture
9
Extra Points About Client-Server
  • Must distinguish between server and server-class
    computer (server machine)
  • C-S allows for bi-directional communication
  • One client-to-server request can stimulate
    multiple server-to-client responses (think of
    file servers)
  • C-S can use either connection oriented or
    connectionless transport level (layer 4) service
  • Typically TCP or UDP
  • Regardless client needs to pinpoint server
    machine IP address and service identifier to
    initiate request

10
Multiple
  • Can have multiple servers on single server
    machine
  • Server machine can also have multiple clients
  • Usually one server program for each service
    offered
  • Need sufficient memory and CPU plus a good
    multi-processing OS

11
Services
  • With multiple services, how are each identified?
  • TCP uses 16-bit numbers call port numbers
  • Each has associated protocol and server
  • Server program tells PS which port it is waiting
    on then waits
  • Client specifies which remote port and IP address
    to connect to

12
Concurrency
  • Example How File Server needs multiple threads
  • One thread to handle requests for service and
    multiple threads to carry out individual service
    work top one client
  • Server typically has more than one thread of
    execution like multiple independently running
    subprograms all inside one big program
  • One to answer call and create new thread to
    service request
  • One thread per client request typical
  • New clients dont wait for others to finish

13
Concurrency Continued
  • Each client differentiated by source address and
    port

14
Server Machine
Server Application Program
S - Server main Thread Answering calls
Port 25
Client C2 Machine
Client C1 Machine
S1 Server Thread to Talk to C1
Source port 4000
Source port 5000
S2 Server Thread to Talk to C2
Client C2
Client C1
IP Address 120.83.6.4
IP Address 185.12.14.2
IP Address 140.23.8.64
Internet
15
Steps of Two-client Interaction
  • C1 first asks to set up TCP connection to port 25
    on machine 140.23.8.64
  • 25 Server S responds and C1-S now has a
    connection
  • S starts a child thread S1 to talk to C1 and S
    passes the connection to C1 off to S1. Now C1-S1
    connected.
  • S1 and C1 talk over connection to service C1s
    request
  • S is now free to talk to other clients (while S1
    talks to C1)
  • Now C2 asks to set up a connection to port 25 on
    machine 140.23.8.64
  • 25 Server S responds and C2-S now has a
    connection
  • S starts a child thread S2 to talk to C2 and S
    passes the connection to C2 off to S2. Now C2-S2
    connected.
  • S2 and C2 talk over connection to service C2s
    request

16
Steps of Two-client Interaction - continued
  • When S1 sends messages to C1 it sends to IP
    address 185.12.14.2 and port 4000
  • When S2 sends messages to C2 it sends to IP
    address 120.83.6.2 and port 5000
Write a Comment
User Comments (0)
About PowerShow.com