+ All Categories
Home > Documents > 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern...

1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern...

Date post: 29-Dec-2015
Category:
Upload: abraham-butler
View: 215 times
Download: 1 times
Share this document with a friend
Popular Tags:
26
1 Chapter 2. Communication
Transcript
Page 1: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

1

Chapter 2. Communication

Page 2: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU2

Layered Protocol

TCP/IP : de facto standard

Our Major Concern

Not always 7-layered Protocol

But some other protocols if necessary

Page 3: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU3

Client-Server Model

TCP/IP

Client-Server Model

Page 4: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU4

Basic Operations of Client-Server Model(Send and Receive Protocol)

Client … txmsg.opcode=opcode; txmsg.source=me; txmsg.param=param; sendMessage(serverID,&txmsg); waitMessage(serverID,&rxmsg); checkAndProcess(rxmsg);

Client

Client

Server

While(1) { waitMessage(FromAny,&rxmsg); source=rxmsg.source; opcode=rxmsg.opcode; param=rxmsg.params; result=functions[opcode](param); txmsg.result=result; txmsg.source=me; sendMessage(source,&txmsg);}

Page 5: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU5

Steps of RPC

1. Client procedure calls client stub in normal way

2. Client stub builds message, calls local OS3. Client's OS sends message to remote OS4. Remote OS gives message to server stub5. Server stub unpacks parameters, calls server6. Server does work, returns result to the stub7. Server stub packs it in message, calls local OS8. Server's OS sends message to client's OS9. Client's OS gives message to client stub10. Stub unpacks result, returns to client

Page 6: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU6

RPC : Remote Procedure Call

Client … txmsg.opcode=opcode; txmsg.source=me; txmsg.param=param; sendMessage(serverID,&txmsg); waitMessage(serverID,&rxmsg); checkAndProcess(rxmsg);

Server

result=funcA(param);

txmsg.opcode=opcode;txmsg.source=me;txmsg.param=param;sendMessage(serverID,&txmsg);

waitMessage(FromAny,&rxmsg);source=rxmsg.source;opcode=rxmsg.opcode;param=rxmsg.params;

result=functions[opcode](param);

funcA

STUB

Page 7: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU7

Binding a Client to a Server

Binding in DCE (Distributed Computing Environment)

Page 8: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU8

Middleware

Client

Stub for Client

Server

Stub for Server

Binding (Dynamic)

Middleware

Page 9: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU9

Middleware Protocol

Page 10: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU10

OS

Some Issues : Reliable vs. Non-Reliable

Client Server

Process Process

OS

1. Request

2. Reply

If reply message is lost?

1. Blocking2. Acknowledge3. Idempotent

Page 11: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU11

Some Issues : Blocking vs. Non-Blocking

Blocking (No Buffer, Synchronous)

Client

Server

Send

KernelTrap

ServerProcessing

Send

ReceiveBlocked

Page 12: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU12

Some Issues : Blocking vs. Non-Blocking

Non-Blocking (No Buffer, Asynchronous)

Client

Server

Send

Copy tosystembuffer

Processother task

ServerProcessing

Send

Receive

Receive

Blocked

Page 13: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU13

Asynchronous RPC

If client does not receive return value, No reason to be blocked. Asynchronous RPC

Page 14: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU14

Asynchronous RPC

Even though client does receive return value, Two asynchronous RPC

Page 15: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU15

Some Issues : Parameter Passing

Page 16: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU16

Parameter Passing for Objects

Two types of Object Parameter Passing Object Copy vs. Reference Copy Should it be transparent ?

Page 17: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU17

Remote Object Invocation

Generalization of RPC to Object Invocation

Implementation of object interface

like client stub in RPC

Page 18: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU18

Marshalling

System A

Object inMain Memory

System B

Object

Object inMain Memory

Marshalling Demarshalling

When objects in memory are to be passed across a network to another host or persisted to storage, their in-memory representation must be converted to a suitable out-of-memory format. This process is called marshalling, and converting back to an in memory representation is called demarshalling

Page 19: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU19

Extended RPC : Door for Single Machine

Client and Server are located in a single machine

RPC for processes on the same machine

12

3

Page 20: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU20

RMI : Object Binding

Implicit BindingDistr_object* obj_ref; //Declare a system-wide object referenceobj_ref = …; // Initialize the reference to a distributed objectobj_ref-> do_something(); // Implicitly bind and invoke a method

Explicit BindingDistr_object objPref; //Declare a system-wide object referenceLocal_object* obj_ptr; //Declare a pointer to local objectsobj_ref = …; //Initialize the reference to a distributed objectobj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local proxyobj_ptr -> do_something(); //Invoke a method on the local proxy

Page 21: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU21

Stream-Oriented Communication

In distributed environment Continuous Media : e.g. video Discrete Media : e.g. Simple File Transfer

Temporal Aspects of Data Stream Asynchronous Transmission Synchronous Transmission Isochronous Transmission

Composition of Stream Simple Stream Complex Stream : composed of simple or complex

streams Synchronization is very important

Page 22: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU22

Data Streaming

Page 23: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU23

QoS : Quality of Service

Timeline, Volume and Reliability

Page 24: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU24

Group Communication

Send to a group

Send to a machine

Send to multiple receivers

Page 25: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU25

Group Communication : Design Issues

Closed or Open

Peer or Hierarchical Addressing

Multi-Casting or Broadcasting Uni-casting Predicate Addressing

Open to outsideClosed to outside

Page 26: 1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.

STEM-

PNU26

Group Communication : Design Issues

Group Membership Send/Receive Protocol

How to distinguish it from single receive Atomicity Message ordering Scalability


Recommended