ClientServer Interaction - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

ClientServer Interaction

Description:

Error free stream of data. Terminal sessions. Remote login. File Transfer applications ... (String) - to get the names of all hosts registered on a particular domain. ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 19
Provided by: abatt6
Category:

less

Transcript and Presenter's Notes

Title: ClientServer Interaction


1
Client-Server Interaction
  • Chapters 21,22,23,24

2
Client - Server Interaction
3
The client-Server Paradigm
  • A server application waits passively for contact,
    while a client application initiates a contact
    directly.

4
Characteristics of Clients Software
  • is an arbitrary application program which becomes
    a client when remote access is needed.
  • Is invoked directly by a user and executes for
    one session
  • runs locally on a users computer.
  • actively initiates contact with server
  • can access multiple services as needed, but
    actively contacts one remote server at a time.
  • does not require special hardware or a
    sophisticated operating system.

5
Characteristics of Server Software
  • is a special purpose privileged program dedicated
    to providing one service, but can handle multiple
    clients at the same time.
  • is generally invoked automatically when a system
    boots, and continues to execute through many
    sessions.
  • runs on a shared computer.
  • waits passively for contact from arbitrary
    clients.
  • accepts contacts from arbitrary clients, but
    offers a single service.

6
Multiple Services on one computer
Two servers on a single computer accessed by two
other clients.
7
Identifying a service
  • TCP uses 16 bit integers known as protocol port
    numbers to identify services.
  • TCP assigns a unique port number to each
    service.
  • A client specifies the port number of the desired
    service when sending a request.
  • Conceptually TCP software on the servers computer
    uses the port number in an incoming message to
    determine which server should receive the request

8
Concurrent Servers
  • Each copy of the service executes concurrently in
    its own thread.
  • Servers may be created statically or dynamically
  • Transport protocols assign an identifier to each
    client as well as to each service.
  • Protocol software on the servers machine uses the
    combination of client and server identifiers to
    choose the correct server copy.

9
Connection-Oriented Conectionless Transport
  • Connectionless transport used datagrams in
    TCP/IP this is the User Datagram Protocol (UDP).
  • To use Connection oriented transport two
    applications must establish a connection and the
    send data across the connection. When complete
    the connection must be closed.
  • The same service can be made available over two
    or more transport protocols.

10
The Socket interface
  • Stream sockets are the end points of a
    communications link between two processes. The
    streams connecting the two sockets are
    bi-directional perfect error free communication
    streams. The lower level TCP protocol performs
    all error recovery.
  • Sockets are appropriate for applications that
    require guaranteed delivery of information.
  • Terminal sessions
  • Remote login
  • File Transfer applications
  • Mail applications
  • Hypertext applications.

11
Stream Sockets
  • Stream sockets are slower than datagram sockets
    because each packet from the sender must be
    confirmed as arriving at the receiver as error
    free and in the correct sequence, otherwise the
    sender will re-transmit the packet. There is also
    an initiation phase where the connection is
    established so that communication cannot start
    immediately.
  • If two processes wish to communicate they must
    each create a socket. Once created the socket
    must then be bound to a specific network address.
    One process must initiate the connection (This
    process is called the client). The other process
    must wait for a connection request (This process
    is the server). This delegation of
    responsibilities is highlighted in the diagrams
    below.

12
Socket Communication
13
Java Socket API
  • The java socket API is at a slightly higher level
    that the c/C api illustrated in Comer chapter
    22.
  • However the lower level functions such as listen
    etc are present in a Class library called
    java.net.Sockimpl

14
Domain Name System
  • Computers are organised into groups of machines.
    These groups are called domains
  • A computer can belong to more than one domain.
  • Each domain name consists of a sequence of
    alpha-numeric segments separated by periods.
  • doc.ntu.ac.uk
  • domains are organised hierarchically.

15
Computing Domain
16
Domain names
uk - united kingdom ac - academic institution
17
Name servers are hierarchical
18
Resolving a name
  • looking up the actual IP address of a computer
    name is called resolving a name.
  • Socket APIs have functions which call the DNS
    servers. In Java you can use the InetAddress
    class
  • InetAddress.getByName(String) - to look up the IP
    of a host given as text
  • InetAddress.getLocalHost() - to get the IP
    address of the computer on which the process is
    running
  • InetAddress.getAllByName(String) - to get the
    names of all hosts registered on a particular
    domain. This function returns all the machines in
    an array.
Write a Comment
User Comments (0)
About PowerShow.com