Presentation is loading. Please wait.

Presentation is loading. Please wait.

Client-Server Communication

Similar presentations


Presentation on theme: "Client-Server Communication"— Presentation transcript:

1 Client-Server Communication
Sockets Remote Procedure Calls Remote Method Invocation (Java)

2 Sockets A socket is defined as an endpoint for communication
Concatenation of IP address and port The socket :1625 refers to port 1625 on host Communication consists between a pair of sockets Low level: Sends/receives a stream of bytes. Sockets are either connection-oriented (i.e., TCP) or connectionless (i.e., UDP).

3 Socket Communication

4 Remote Procedure Calls
Remote procedure call (RPC) abstracts procedure calls between processes on networked systems. Stubs – client-side proxy for the actual procedure on the server. The client-side stub locates the server and marshalls the parameters. The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server. Returns output of procedure (if applicable).

5 Remote Method Invocation
Remote Method Invocation (RMI) is a Java mechanism similar to RPCs. RMI allows a Java program on one machine to invoke a method on a remote object. Can send objects to remote JVM

6 Single and Multithreaded Processes

7 Benefits Responsiveness (e.g., Web server).
Resource Sharing (several threads of control within a common address space). Economy (threads are often termed lightweight processes). Much cheaper to create and manage. Utilization of MP Architectures

8 User vs Kernel Threads User Threads: Kernel Threads:
Thread management done by user-level threads library. When one thread blocks, the process blocks. Kernel Threads: Supported by the kernel. When one thread blocks the OS can pick another thread within the same process to execute. Allows overlapping of (for example) computation and I/O requests.

9 Kernel Threads Examples Windows XP/2000 Solaris Linux Tru64 UNIX
Mac OS X

10 Multithreading Models
Many-to-One One-to-One Many-to-Many

11 Many-to-One Many user-level threads mapped to single kernel thread.
Possible to overlap I/O computation? Examples: Solaris Green Threads GNU Portable Threads

12 Many-to-One Model

13 One-to-One Each user-level thread maps to kernel thread Examples
Windows NT/XP/2000 Linux Solaris 9 and later

14 One-to-one Model

15 Many-to-Many Model Allows many user level threads to be mapped to many kernel threads Allows the operating system to create a sufficient number of kernel threads Solaris prior to version 9 Windows NT/2000 with the ThreadFiber package

16 Many-to-Many Model

17 Two-level Model Similar to M:M, except that it allows a user thread to be bound to kernel thread Examples IRIX HP-UX Tru64 UNIX Solaris 8 and earlier

18 Two-level Model


Download ppt "Client-Server Communication"

Similar presentations


Ads by Google