Presentation is loading. Please wait.

Presentation is loading. Please wait.

Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.

Similar presentations


Presentation on theme: "Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology."— Presentation transcript:

1 Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology

2 Outline Communication organized in layers Communication models – Remote Procedure Call – Remote Method Invocation – Message Oriented Middleware – Streams 22009-2010

3 Communication is critical  “A system in which hardware or software located at networked computers communicate and coordinate their actions only by message passing”. [Coulouris] 32009-2010

4 OSI model application presentation session transport network data link physical 7 6 5 4 3 2 1 application protocol presentation protocol session protocol transport protocol network protocol data link protocol physical protocol Network Practically implemented in Internet

5 Message in layered communication data link layer trailer data link layer header network layer header transport layer header session layer header presentation layer header application layer header Message

6 Application Protocols Session/Presentation Protocols – Rarely used in practice Application Protocols – No clear distinction (in application layer) between Application (ftp program) Application-specific protocol (Internet File Transfer Protocol) General-purpose protocol – HTTP used for Web – HTTP used for JAVA General-purpose protocols (in application layer) can be considered as transport protocols, but are classified as MIDDLEWARE PROTOCOLS

7 Middleware protocols What is it ? – more specific application – support a variety of middleware services Examples – Authentication protocol – Authorization protocol – Multimedia broadcasting protocol They are independent to applications, but can be used in many middleware services

8 Adapted OSI model application transport network data link physical 4 3 2 1 application protocol transport protocol network protocol data link protocol physical protocol 7 presentation session 6 5 presentation protocol session protocol Network middleware 5 middleware protocol 6 Middleware communication services provide message-passing services

9 Remote Procedure Call (RPC) Suggested by Birrell & Nelson (1984) Quite simple – Calling procedures on different machines like conventional procedure calls Procedure A() calls a procedure B() A() transfers parameters, execution of A() suspended B() performed until finish Execution returns to A()

10 How conventional call implemented? read( fd, buf, nbytes ) Main program’s local variables nbytes buf fd return address read’s local variables stack pointer Stack beforeStack after Parameters  Call-by-value  Call-by-reference

11 Principle of RPC Client procedure calls client stub in normal way Client stub builds message and calls local OS Client OS sends message to remote OS Remote OS gives message to server stub Server stub unpack parameters and calls server Server works and returns result to server stub Server stub packs message and calls local OS Server OS sends message to client OS Client OS gives message to client stub Client stub unpacks results and returns to client client server call remote procedure return from call wait for result call local procedure and return results requestreply time

12 RPC example on computation k=add(I,j) proc: “add” int: val(i) int: val(j) Client OS Client process k=add(I,j) proc: “add” int: val(i) int: val(j) ServerOS Server process Client stub Server stub Implementation of add() Client machineServer machine proc: “add” int: val(i) int: val(j) Network

13 Heterogenous architectures Large distributed systems consist of multiple machine types, difference in –data type representation IBM mainframe: EBCDIC character code Personal computer: ASCII character code Intel: little endian Sparc: big endian

14 Passing reference parameters Solutions – Forbid call-by-reference – Call-by-copy/restore – Eliminate copying if not necessary Not easy to make transparent for complex data structures – graph – linked list Let applications do

15 Parameter specification & Stub generation Client & server must agree on representation of simple data structures – float in IEEE standard #754 – charaters in 16-bit unicode – stored in little endian Client & server uses connection-oriented protocol Interface is define by Interface Description Language (IDL), to support stub generation

16 Extended models of RPC Doors: as IPC main() { … fd=open(door_name, …); door_call( fd, … ); … } OS Client process server_door() { … door_return(); } main() { … fd = door_create(…); fattach( fd, door_name, …); … } Server process Invoke registered door at other process register door computer return to calling process

17 Asynchronous RPC (1) client server call remote procedure return from call wait for result call local procedure and return results requestreply time client server call remote procedure return from call wait for acceptance call local procedure requestaccept request time

18 Asynchronous RPC (2) Deferred synchronous RPC: combining 2 asynchronous RPC client server call remote procedure return from call wait for acceptance call local procedure requestaccept request time interrupt client return results acknowledge call client with asynchronous RPC


Download ppt "Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology."

Similar presentations


Ads by Google