Title: Chapter 2. Communication
1Chapter 2. Communication
2Layered Protocol
Not always 7-layered Protocol But some other
protocols if necessary
3Client-Server Model
Client-Server Model
4Basic Operations of Client-Server Model(Send and
Receive Protocol)
Server While(1) waitMessage(FromAny,rxmsg)
sourcerxmsg.source opcoderxmsg.opcode
paramrxmsg.params resultfunctionsopcode(para
m) txmsg.resultresult txmsg.sourceme
sendMessage(source,txmsg)
Client txmsg.opcodeopcode
txmsg.sourceme txmsg.paramparam
sendMessage(serverID,txmsg) waitMessage(serverI
D,rxmsg) checkAndProcess(rxmsg)
Client
Client
5Steps of RPC
- 1. Client procedure calls client stub in normal
way - 2. Client stub builds message, calls local OS
- 3. Client's OS sends message to remote OS
- 4. Remote OS gives message to server stub
- 5. Server stub unpacks parameters, calls server
- 6. Server does work, returns result to the stub
- 7. Server stub packs it in message, calls local
OS - 8. Server's OS sends message to client's OS
- 9. Client's OS gives message to client stub
- 10. Stub unpacks result, returns to client
6RPC Remote Procedure Call
Server
Client txmsg.opcodeopcode
txmsg.sourceme txmsg.paramparam
sendMessage(serverID,txmsg) waitMessage(serverI
D,rxmsg) checkAndProcess(rxmsg)
resultfuncA(param)
STUB
7Binding a Client to a Server
- Binding in DCE (Distributed Computing Environment)
8Middleware
Client
Server
Stub for Client
Stub for Server
Binding (Dynamic)
Middleware
9Middleware Protocol
10Some Issues Reliable vs. Non-Reliable
Client
Server
Process
Process
OS
OS
If reply message is lost?
1. Blocking
2. Acknowledge
3. Idempotent
11Some Issues Blocking vs. Non-Blocking
- Blocking (No Buffer, Synchronous)
Send
Client
Server
12Some Issues Blocking vs. Non-Blocking
- Non-Blocking (No Buffer, Asynchronous)
Send
Client
Server
13Asynchronous RPC
- If client does not receive return value,
- No reason to be blocked.
- Asynchronous RPC
14Asynchronous RPC
- Even though client does receive return value,
- Two asynchronous RPC
15Some Issues Parameter Passing
16Parameter Passing for Objects
- Two types of Object Parameter Passing
- Object Copy vs. Reference Copy
- Should it be transparent ?
17Remote Object Invocation
- Generalization of RPC to Object Invocation
18Marshalling
System A
System B
Object in Main Memory
Object in Main Memory
Object
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
19Extended RPC Door for Single Machine
- Client and Server are located in a single machine
- RPC for processes on the same machine
20RMI Object Binding
- Implicit Binding
- Distr_object obj_ref //Declare a system-wide
object referenceobj_ref // Initialize the
reference to a distributed objectobj_ref-gt
do_something() // Implicitly bind and invoke a
method -
- Explicit Binding
- Distr_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
-gt do_something() //Invoke a method on the local
proxy
21Stream-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
22Data Streaming
23QoS Quality of Service
- Timeline, Volume and Reliability
24Group Communication
- Send to multiple receivers
Send to a machine
Send to a group
25Group Communication Design Issues
- Closed or Open
- Peer or Hierarchical
- Addressing
- Multi-Casting or Broadcasting
- Uni-casting
- Predicate Addressing
Open to outside
Closed to outside
26Group Communication Design Issues
- Group Membership
- Send/Receive Protocol
- How to distinguish it from single receive
- Atomicity
- Message ordering
- Scalability