communication

110
1 Communication Chapter 2 Layered Protocol Remote Procedure Call(RPC)

Upload: agrata

Post on 15-Jan-2016

47 views

Category:

Documents


0 download

DESCRIPTION

Communication. Chapter 2 Layered Protocol Remote Procedure Call(RPC). Communication. Communication Process Protocol Form of layers Four widely used models RPC RMI MOM Stream. Layered Protocols (1). Layers, interfaces, and protocols in the OSI model. 2-1. Layered Protocols (2). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Communication

1

Communication

Chapter 2

Layered Protocol

Remote Procedure Call(RPC)

Page 2: Communication

2

Communication

1. Communication Process1. Protocol

2. Form of layers

2. Four widely used models1. RPC

2. RMI

3. MOM

4. Stream

Page 3: Communication

3

Layered Protocols (1)

Layers, interfaces, and protocols in the OSI model.

2-1

Page 4: Communication

4

Layered Protocols (2)

A typical message as it appears on the network.

2-2

Page 5: Communication

5

Layered Protocol

Lower-Level ProtocolsPhysical LayerData Link LayerNetwork Layer

Transport ProtocolHigh Level Protocol

Session and Presentation ProtocolsApplication ProtocolsMiddleware Protocols=>Application Layer

Page 6: Communication

6

Physical Layer

• Transmitting 0s and 1s.

• Standardizing the electrical, mechanical, and signaling interface.

Page 7: Communication

7

Data Link Layer

Discussion between a receiver and a sender in the data link layer.

2-3

Consider that, A wants to send 0 and 1 to B

Page 8: Communication

8

Network Layer

• WAN consists of large number of machine

• Message have to make a number of hops besides choosing an outgoing line to use.

• Primary task of network layer is to decide the best path – routing– IP– ATM

• Virtual channel and virtual path

Page 9: Communication

9

Transport Protocols

• To ensure the reliable transport connection- without data loss

• Transport layer- breaks the information from appn layer into pieces, assign a sequence number, then send them all

• Connection less and connection oriented

• Transmission Control Protocol – de facto standard for network communication

Page 10: Communication

10

Client-Server TCP

a) Normal operation of TCP.

b) Transactional TCP.2-4

Page 11: Communication

11

Higher Level Protocol

1. Session and Presentation Protocols

2. Application Protocols

3. Middleware Protocols

Page 12: Communication

12

Session and Presentation Protocols

1. Session - Provides the dialogs control1. Keeps track of which party is currently talking

2. Provide synchronous facility

3. Insert checkpoint to long transfer

2. Presentation – concern on the meaning of the bits send

1. Record containing fields

2. Names, addresses, amount of money etc.

Page 13: Communication

13

Application Protocols

• Collection of standard network application– Electronic mail– File transfer– Terminal emulation application

Page 14: Communication

14

Middleware Protocols•The application that logically live in appn layer

•Contains many general purpose protocols that warrant their own layers, independent of others, more specific application

•Security

•RPC,RMI, Message Queuing Service and Streaming

Page 15: Communication

15

Middleware Protocols

An adapted reference model for networked communication.

Page 16: Communication

16

Conventional Procedure Call

a) Parameter passing in a local procedure call: the stack before the call to read

b) The stack while the called procedure is active

count = read(fd, buf, nbytes) // a call in C in a //single machine

When a procedure is called, it usually makes use of the stack, pushing parameters onto the stack and reserving space for local variables:

Page 17: Communication

17

Client and Server Stubs

Principle of RPC between a client and server program.

Page 18: Communication

18

Steps of a Remote Procedure Call1. Client procedure calls client stub in normal way, The stub

packages up the parameters into a network message. This is called marshalling.

2. Client stub builds message, calls local OS3. Client's OS sends message to remote OS, This may be

connection-oriented or connectionless. 4. 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 19: Communication

19

Passing Value Parameters (1)

Steps involved in doing remote computation through RPCParameter marshaling: packing parameters into a message

2-8

Page 20: Communication

20

Without RPC

Consider how you would implement a procedure to find the time on a remote machine as a string, using the IP socket calls:

int remote_time(char *machine, char *time_buf) { struct sockaddr_in serv_addr;

int sockfd; int nread;

if (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1; serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr(machine); serv_addr.sin_port = htons(13); if (connect(sockfd, &serv_addr, sizeof(serv_addr)) < 0) return 2; nread = read(sockfd, time_buf, sizeof(time_buf)); time_buf[nread] = '\0'; close(sockfd); return 0; }

This very obviously uses the network.

Page 21: Communication

21

With RPCWhat RPC should look like? The network needs to be made invisible, so that everything

looks just like ordinary procedure calls. The calling process would execute remote_time(machine, time_buf); All networking should be done by the RPC implementation, such as connecting to the remote machine. On the remote machine this simple function gets executed:

int remote_time(char *time_buf) { struct tm *time; time_t t; time(&t); time = localtime(&t); strcpy(time_buf, asctime(time)); return 0; }

Page 22: Communication

22

StubsWhen the calling process calls a procedure, the action performed by that procedure will not be the actual code as written, but code that begins network communication. It has to connect to the remote machine, send all the parameters down to it, wait for replies, do the right thing to the stack and return. This is the client side stub. The server side stub has to wait for messages asking for a procedure to run. It has to read the parameters, and present them in a suitable form to execute the procedure locally. After execution,it has to send the results back

to the calling process.

Page 23: Communication

23

stub

A stub is a small program routine that substitutes for a longer program, possibly to be loaded later or that is located remotely. For example, a program that uses Remote Procedure Calls (RPC) is compiled with stubs that substitute for the program that provides a requested procedure. The stub accepts the request and then forwards it (through another program) to the remote procedure. When that procedure has completed its service, it returns the results or other status to the stub which passes it back to the program that made the request.

Page 24: Communication

24

Client Stub:

Function that mimics the remote procedure in client’s address space (on client-node)

Server Stub:

Function that mimics a local caller (on behalf of the client) in the server’s address space(on server-side)

Page 25: Communication

25

Page 26: Communication

26

Exampleimport java.net.*;

import java.io.*;

public class Server {

public static void main(String[] args) throws IOException {

Socket client = null;

PrintWriter pout = null;

ServerSocket sock = null;

try{ sock = new ServerSocket(5155);

// now listen for connections

while (true) {

client = sock.accept(); // we have a connection

pout = new PrintWriter(client.getOutputStream(), true);

// write the Date to the socket

pout.println(new java.util.Date().toString());

pout.close();client.close();

}

}

catch (IOException ioe) {

System.err.println(ioe);

}

finally {

if (client != null)

client.close();

if (sock != null)

sock.close();

}

}

}

Page 27: Communication

27

import java.net.*;

import java.io.*;

public class Client {

public static void main(String[] args) throws IOException {

InputStream in = null;

BufferedReader bin = null;

Socket sock = null;

try{ //make connection to the socket

sock = new Socket("127.0.0.1",5155);

in = sock.getInputStream();

bin = new BufferedReader(new InputStreamReader(in));

String line;

while ((line = bin.readLine()) != null)

System.out.println(line);}

catch (IOException ioe) {

System.err.println(ioe);

}

finally {

if (sock != null)

sock.close();

}

}

}

Page 28: Communication

28

Page 29: Communication

29

Passing Value Parameters (2)

a) Original message on the Pentium (5, JILL)b) The message after receipt on the SPARC (5224, JILL)c) The message after being inverted (5, LLIJ)

The little numbers in boxes indicate the address of each byte.

Page 30: Communication

30

Passing Reference Parameters

• count = read(fd, buf, nbytes)

– If the address of the buffer of second parameter is 1000 on the client

– Cannot just pass the reference number to the server

– Address 1000 on the server might be on the middle of program text.

client server

Program text

Call-by-reference is not possible in parameter passing.

Page 31: Communication

31

Passing Reference Parameters

Solution• client stub knows that the buf is in an array

of characters.• also knows how big the array is.• so copy the array to the message and sent it

to the server• The server stub then call the server with the

pointer to this array- process and send back to the client.

copy-restore.

–A copy of the referenced data structure is sent to the server, and upon return to the client stub the client’s copy of the structure is replaced with the structure modified by the server.

Page 32: Communication

32

Passing Reference Parameters(1)

• Hiding the remote procedure call require the caller and the callee agree on the format of the message.

• Use the same format

• Define in RPC

• interface-IDL– Consist of collection of procedures that can be called

by a client and implemented in the server

Page 33: Communication

33

Parameter Specification and Stub Generation(2)

a) A procedureb) The corresponding message

The caller and the callee must agreeon the format of the message theyexchange, and they must follow the samesteps when it comes to passing complexdata structures (use same protocol).

Page 34: Communication

34

Extended RPC Models:Doors

The principle of using doors as IPC mechanism.

• A Door is a generic name for a procedure in the address space of a server process that can be called by processes co-located with the server.

• Doors require local OS support.

• Client pass the integer value; server retun the squere value -See Unix Network Programming: Steven page 357

Page 35: Communication

35

Extended RPC Models :Asynchronous RPC (1)

a) The interconnection between client and server in a traditional RPCb) The interaction using asynchronous RPC

2-12

Page 36: Communication

36

Extended RPC Models:Asynchronous RPC (2)

A client and server interacting through two asynchronous RPCs

2-13

Page 37: Communication

37

Example: DCE RPC• Distributed Computing Environment

• Open Software Foundation

• Middleware between existing network operating system and distributed application.

• Initially design for unix – Win NT

Page 38: Communication

38

Services

• Distributed file service

• Directory service– Keep track of resources in the system

• Security service

• Distributed time service– Clocks on the different machines globally

synchronize

Page 39: Communication

39

Page 40: Communication

40

Page 41: Communication

41

Page 42: Communication

42DCE stands for "Distributed Computing Environment / Remote Procedure Calls".

Page 43: Communication

43

Page 44: Communication

44

Page 45: Communication

45

Page 46: Communication

46

Page 47: Communication

47

Writing a Client and a Server

The steps in writing a client and a server in DCE RPC.

2-14

Page 48: Communication

48

Binding a Client to a Server

Client-to-server binding in DCE

2-15

In order client to communicate with server – server must be registered and to accept the incoming call

Client must know the server endpoint (port)to which it can send message.

Port can be used by the server to distinguish between different process.

Maintains by DCE daemon.

Client want to bind to a video server.

Pass the name to directory server

Directory server then return the network address of video server.

Client goes to the DCE daemon – end point of the video server.

RPC take place

Set up the communication between client and server

software

Page 49: Communication

49

RPC SUMMARY

• RPC is well-suited for client-server interaction where the flow of control alternates.

• User does not open connection, read, write, then close connection – client may not even know they are using the network.

• RPC may use TCP or UDP as the transport protocol• Parameter/results marshaling issues• Extended RPC models• Example: SunRPC

Page 50: Communication

50

Distributed object eg. CORBA & DCOM

• State- encapsulate data-distributed across multiple machine.• Method –operation on those data• Method are made available through interface• Proxy at the client acting as stub in RPC• The actual object reside in server machine• Incoming invocation request a first pass to a server stub –

skeleton• Remote object – object on the other machine.

The Common Object Requesting Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) that enables software components written in multiple computer languages and running on multiple computers to work together.

Page 51: Communication

51

DCOMDCOM (Distributed Component Object Model) is a set of Microsoft concepts and program interfaces in which

client program object s can request services from server program objects on other computers in a network.

DCOM is based on the Component Object Model (COM), which provides a set of interfaces allowing clients

and servers to communicate within the same computer (that is running Windows 95 or a later version).

For example, you can create a page for a Web site that contains a script or program that can be processed (before

being sent to a requesting user) not on the Web site server but on another, more specialized server in the

network. Using DCOM interfaces, the Web server site program (now acting as a client object ) can forward a

Remote Procedure Call ( RPC ) to the specialized server object, which provides the necessary processing and

returns the result to the Web server site. It passes the result on to the Web page viewer.

DCOM can also work on a network within an enterprise or on other networks besides the public Internet. It uses

TCP/IP and Hypertext Transfer Protocol . DCOM comes as part of the Windows operating systems. DCOM

is or soon will be available on all major UNIX platforms and on IBM's large server products. DCOM

replaces OLE Remote Automation.

DCOM is generally equivalent to the Common Object Request Broker Architecture ( CORBA ) in terms of

providing a set of distributed services. DCOM is Microsoft's approach to a network-wide environment for

program and data objects. CORBA is sponsored by the rest of the information technology industry under the

auspices of the Object Management Group ( OMG ).

Page 52: Communication

52

Distributed Objects

Common organization of a remote object with client-side proxy.

2-16

In computer networks, a proxy server is a server (a computer system or an application program) that acts as a go-between for requests from clients seeking resources from other servers. A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource, available from a different server. The proxy server evaluates the request according to its filtering rules. For example, it may filter traffic by IP address or protocol. If the request is validated by the filter, the proxy provides the resource by connecting to the relevant server and requesting the service on behalf of the client. A proxy server may optionally alter the client's request or the server's response, and sometimes it may serve the request without contacting the specified server. In this case, it 'caches' responses from the remote server, and returns subsequent requests for the same content directly.

Page 53: Communication

53

Binding a Client to an Object

a) (a) Example with implicit binding using only global referencesb) (b) Example with explicit binding using global and local references

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

(a)

Distr_object objPref; //Declare a systemwide 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

(b)

Page 54: Communication

54

Implementation of Object References• Simple object reference – network add of the

machine where the object resides with the endpoint

• Drawback – If the server crash- server define another endpoint

after recovery –all object references become invalid.

– Solve using local daemon in DCE located in each machine. Always keep track of the server to endpoint= endpoint table.

Page 55: Communication

55

Static versus Dynamic Remote Method Invocation

• RMI is very similar to RPC.• static invocation

– Use predefine interface definition such as in java

– If interface change- the client application must be recompiled.

• Dynamic invocation– Compose method at runtime

– Application select at runtime which method it will invoke at a remote object.

RMI - Remote Method Invocation, a set of protocols being developed by Sun's JavaSoft division that enables Java objects to communicate remotely with other Java objects. RMI is a relatively simple protocol, but unlike more complex protocols such as CORBA and DCOM, it works only with Java objects. CORBA and DCOM are designed to support objects created in any language.

Page 56: Communication

56

Parameter Passing(1)

• All object in the system can be accessed by remote machine.

• Use references as parameter in method invocation.

• References are passed by reference, copied from one machine to another.

• If in local machine, the reference parameters is copied as a whole and pass along with the invocation= pass by value.

Page 57: Communication

57

Parameter Passing(2)

The situation when passing an object by reference or by value.

2-18

Page 58: Communication

58

Message-Oriented Communication

Message-oriented communication is a way of communicating between processes.

Messages, which correspond to events, are the basic units of data delivered.

Tanenbaum and Steen classified message-oriented communication according to two

factors---synchronous or asynchronous communication, and transient or persistent

communication. In synchronous communication, the sender blocks waiting for the

receiver to engage in the exchange. Asynchronous communication does not require

both the sender and the receiver to execute simultaneously. So, the sender and

recipient are loosely-coupled. The amount of time messages are stored determines

whether the communication is transient or persistent. Transient communication stores

the message only while both partners in the communication are executing. If the next

router or receiver is not available, then the message is discarded. Persistent

communication, on the other hand, stores the message until the recipient receives it.

From Jungkee Kim's dissertation

Page 59: Communication

59

continuedA typical example of asynchronous persistent communication is Message-Oriented

Middleware (MOM). Message-oriented middleware is also called a message-queuing

system, a message framework, or just a messaging system. MOM can form an

important middleware layer for enterprise applications on the Internet. In the publish

and subscribe model, a client can register as a publisher or a subscriber of messages.

Messages are delivered only to the relevant destinations and only once, with various

communication methods including one-to-many or many-to-many communication.

The data source and destination can be decoupled under such a model.

The Java Message Service (JMS) from Sun Microsystems provides a common interface

for Java applications to MOM implementations. Since JMS was integrated with the

recent version of the Java 2 Enterprise Edition (J2EE) platform, Enterprise Java

Beans (EJB)---the component architecture of J2EE---has a new type of bean, the

message-driven bean. The JMS integration simplifies the enterprise development,

allowing a decoupling between components.

Page 60: Communication

60

Message Oriented Communication1. Persistence and Synchronicity in

Communication1. Persistence

2. Transient

3. Asynchronous

4. Synchronous

2. Message-Oriented Transient Communication

3. Message-Oriented Persistence Communication

Page 61: Communication

61

Message + Network

•Communication system is organized as a computer network•Application are always executed on hosts, •each host offer an interface to the communication system•Each host are connected through a network of communication servers •Which responsible for passing message between hosts

Page 62: Communication

62

Persistence Communication

Message that has been submitted is stored by the communication system as long as it takes to deliver it to receiver.

Example: Mail

Page 63: Communication

63

Persistence and Synchronicity in Communication (1)

General organization of a communication system in which hosts are connected through a network

2-20

Page 64: Communication

64

Persistence and Synchronicity in Communication (2)

Persistent communication of letters back in the days of the Pony Express.

Page 65: Communication

65

Transient Communication

A message is stored by the communication system as long as the sending and receiving application is running.

The message will be discarded if the communication server cannot delivery the message to destination server.

Example: Router.

Page 66: Communication

66

Asynchronous Communication

Sender continuous immediately after it has transmitted the message.

The message is either stored in local buffer or at the first communication server

Example: asynchronous - the answering machine

Page 67: Communication

67

Asynchronous Send

??????

Page 68: Communication

68

Synchronous

The sender is blocked until its message is stored in local buffer at the receiver end or the message has been delivered.

The strongest form of Syn Comm is when the sender can only continue executing after the receiver process the message.

Page 69: Communication

69

Synchronous Send

Provide information about the relative execution points of sender and receiver - causes synchronization of the two.

Page 70: Communication

70

Persistence and Synchronicity in Communication (3)

a) Persistent asynchronous communication

b) Persistent synchronous communication

2-22.1

Persistence Asynchronous Comm Persistence synchronous Comm

Page 71: Communication

71

Persistence and Synchronicity in Communication (4)

c) Transient asynchronous communication

2-22.2

Page 72: Communication

72

Transient Synchronous Communications

d) Receipt-based transient synchronous communication

Weakest form, based on message receipt.

The sender is blocked until the message is stored in receiver’s local buffer.

The sender receive an acknowledge(receipt) and continue.

Page 73: Communication

73

Persistence and Synchronicity in Communication (5)

e) Delivery-based transient synchronous communication at message delivery –client idle until its request has been accepted for further processing

f) Response-based transient synchronous communication-client waits until receives a reply from the server. Ie- client-server.

Page 74: Communication

74

Berkeley Sockets (1)Socket primitives for TCP/IP.

Primitive Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket

ListenAnnounce willingness to accept connections

AcceptBlock caller until a connection request arrives

Connect Actively attempt to establish a connection

Send Send some data over the connection

Receive Receive some data over the connection

Close Release the connection

Page 75: Communication

75

Examples#include <sys/types.h> #include <sys/socket.h>

int socket(int domain, int type, int protocol)domain is either AF_UNIX or AF_INET. This parameter specifies whether the socket is to be used for communicating between Unix file system like objects or

Internet objects. type specifies the communications semantics. There are a number of possible values. SOCK_STREAM-stream based full-duplex communication SOCK_DGRAM-datagram based communication SOCK_RAW-use raw IP sockets (must be super-user) SOCK_SEQPACKET-sequenced reliable datagrams SOCK_RDM-reliably delivered messages

protocol is normally set to zero.

/* create socket */ sd = socket(AF_INET, SOCK_STREAM, 0); if(sd<0) { perror("cannot open socket "); return ERROR; }

Page 76: Communication

76

bind()

int bind(int s, struct sockaddr *name, int namelen)

The final value simply means that connections will be accepted from any remote host./* bind server port */

servAddr.sin_family = AF_INET; servAddr.sin_addr.s_addr = htonl(INADDR_ANY); servAddr.sin_port = htons(SERVER_PORT);

if(bind(sd, (struct sockaddr *) &servAddr, sizeof(servAddr))<0) { perror("cannot bind port "); return ERROR;

}

Page 77: Communication

77

Incoming Connections listen()

Once an address has been bound to a socket it is then necessary to indicate the socket is to be listened to for incoming connection requests. This is done using the listen() function. Its prototype is

int listen(int s, int backlog)

s specifies the socket.

backlog specifies the maximum number of outstanding connection requests in listen()'s input queue. listen() can only be associated with SOCK_STREAM or SOCK_SEQPACKET type sockets.

listen(sd,5);

Page 78: Communication

78

send()

send() may be used in the same way as write().

The prototype is

#include<sys/types.h> #include<sys/socket.h>

int send(int s, char *msg, int len, int flags)

Simple Socket program can be found athttp://www.scit.wlv.ac.uk/~jphb/comms/

sockets.example.html

Page 79: Communication

79

Berkeley Sockets (2)

Connection-oriented communication pattern using sockets.

Page 80: Communication

80

Socket

• Based on send and receive primitive

• Design to communicate across network using general purpose protocol stack-tcp/ip

• NOT considered for high-speed interconnection network

• MPI?

Page 81: Communication

81

The Message-Passing Interface (MPI)

Some of the most intuitive message-passing primitives of MPI.

Primitive Meaning

MPI_bsend Append outgoing message to a local send buffer

MPI_sendSend a message and wait until copied to local or remote buffer

MPI_ssend Send a message and wait until receipt starts

MPI_sendrecv Send a message and wait for reply

MPI_isend Pass reference to outgoing message, and continue

MPI_issendPass reference to outgoing message, and wait until receipt starts

MPI_recv Receive a message; block if there are none

MPI_irecv Check if there is an incoming message, but do not block

Designed for parallel application – transient communicationNo concept such as the communication serverAssume communication take place within a known group of process with id (groupID, processID)

Page 82: Communication

82

MPI_bsend

1. Sender submit msg for transmission.

2. Copy to local buffer.

3. Sender continue to send.

4. Receiver call receive.

5. Local MPI runtime system at sender will remove the message from local buffer and transmit the message.

12

3

4

5

Page 83: Communication

83

MPI_send&MPI_ssend primitive

Blocking Send Operation

the caller will be blocked until the message has been copied to MPI runtime system at the sender’s side

Blocking Send Operation

the caller will be blocked until the receiver initiated a receive operation

Page 84: Communication

84

MPI_sendrecv

Send a request and wait till return the reply

= normal RPC

Page 85: Communication

85

Message-Oriented Persistence Communication

Message queuing system/Message Oriented Middleware

Offer intermediate-term storage capacity for message- without requiring sender & receiver to active

Support longer time message transfer

Page 86: Communication

86

Message Queuing Model

– App’n communicate by inserting message in its own private queue

– Also possible the queue being shared by other App’n

– Message are guaranteed to be inserted in queue but not to receive by receiver

– Message is forwarded over a series of communication servers

– Receiver and sender is independent.

Page 87: Communication

87

Message-Queuing Model (1)

Four combinations for loosely-coupled communications using queues.

2-26

Page 88: Communication

88

Message-Queuing Model (2)

Basic interface to a queue in a message-queuing system.

Primitive Meaning

Put Append a message to a specified queue

GetBlock until the specified queue is nonempty, and remove the first message

PollCheck a specified queue for messages, and remove the first. Never block.

NotifyInstall a handler to be called when a message is put into the specified queue.

Page 89: Communication

89

General Architecture of a Message-Queuing System (1)

The relationship between queue-level addressing and network-level addressing.

Page 90: Communication

90

General Architecture of a Message Queuing System

• Message can only be put to local queues• Called as source queue• And also- message can be read from local queues• Message put in the queue will contain the destination

queues to which it should be transferred.• Message queuing system maintain a database of queue

names to network location(DNS)• Queues are manage by queue managers• Special queue managers that operate as routers or relay

– Forward the incoming messages to other queue managers

Page 91: Communication

91

General Architecture of a Message-Queuing System (2)

The general organization of a message-queuing system with routers.

2-29

Use few router with the knowledge of topologyOnly the router need to be updated when queues are added/deletedQueue manager has to know only the nearest router

Page 92: Communication

92

Message Broker(1)Each time the new application is added- different message format will introduce.Require the sender and receiver have the same message format.- agree with common message format.

Conversion are handled by special node in a queuing networkKnown as MESSAGE BROKER.Purpose – to convert the incoming message to a format that can be understood by destination application.Message reformatter

Message broker is an intermediary program that translates a message from the formal messaging protocol of the sender to the formal messaging protocol of the receiver in a telecommunication network where programs communicate by exchanging formally-defined messages.

Page 93: Communication

93

Message Brokers(2)

The general organization of a message broker in a message-queuing

system.2-30

Page 94: Communication

94

Data Stream• Support for continuous media• Sequence of data unit• Isochronous Transmission mode

– Distributed multimedia system– Refers as stream

• Stream /2– Simple stream – consist of only single sequence of data– Complex stream – several related simple streams(sub streams)

In telecommunications and computing, a data stream is a sequence of digitally encoded coherent signals (packets of data or datapackets) used to transmit or receive information that is in transmission.

In electronics and computer architecture, a data stream determines for which time which data item is scheduled to enter or leave which port of a systolic array, a Reconfigurable Data Path Array or similar pipe network, or other processing unit or block.

Page 95: Communication

95

Data Stream (1)

Setting up a stream between two processes across a network.

Source and sink

Source could be a process

Reading an audio file from a disk – transmit byte by byte

Sink – fetching the byte as they come in – passing them to local audio device

Page 96: Communication

96

Data Stream (2)

Setting up a stream directly between two devices.

2-35.2

Page 97: Communication

97

Data Stream (3)

An example of multicasting a stream to several receivers.

Data stream is multicast to many receiversFilters are use to adjust the quality of incoming stream

Page 98: Communication

98

The VideoLAN project targets multimedia streaming of MPEG-1, MPEG-2, MPEG-4 and DivX files, DVDs, digital satellite channels, digital terrestial television channels and live videos on a high-bandwidth IPv4 or IPv6 network in unicast or multicast under many OSes. VideoLAN also features a cross-platform multimedia player, VLC, which can be used to read the stream from the network or display video read locally on the computer under all GNU/Linux flavours, all BSD flavours, Windows, Mac OS X, BeOS, Solaris, QNX, Familiar Linux

VLC is a portable multimedia player, encoder, and streamer supporting many audio and video codecs and file formats as well as DVDs, VCDs, and various streaming protocols. It is able to stream over networks and to transcode multimedia files and save them into various formats.

Page 99: Communication

99

Overview of the VideoLAN streaming solution

                  

  

Page 100: Communication

100

Specifying QoS (1)

A flow specification.

Characteristics of the Input Service Required

•maximum data unit size (bytes)•Token bucket rate (bytes/sec)•Toke bucket size (bytes)•Maximum transmission rate (bytes/sec)

•Loss sensitivity (bytes)•Loss interval (sec)•Burst loss sensitivity (data units)•Minimum delay noticed (sec)•Maximum delay variation (sec)•Quality of guarantee

Page 101: Communication

101

Specifying QoS (2)

The principle of a token bucket algorithm.

Page 102: Communication

102

Flow Spec1. Loss sensitivity – acceptable loss rate• Loss interval (sec)• Burst loss sensitivity (data units) – how many

consecutive data unit may be lost• Minimum delay noticed (sec)- how long the tolerable

delay before noticed by receiver• Maximum delay variation (sec)- maximum tolerate jitter

for video and audio• Quality of guarantee- how serious the service

requirement should be taken

Page 103: Communication

103

Setting up Stream

• Sender in RSVP provide flow specification– Bandwidth, delay, jitter etc.

• The specification is handed over to RSVP process that is colocated at the same machine as the sender

• RSVP is receiver-initiated QoS protocol(receiver are required to send reservation requests along the same path to the sender)

• Receiver may set a new parameter value(flow specification) to the sender.

Page 104: Communication

104

Setting Up a Stream

Page 105: Communication

105

RSVP

                                                                                                                  

QoS (Quality of Service) refers to a broad collection of networking technologies and techniques. The goal of QoS is to provide guarantees on the ability of a network to deliver predictable results. Elements of network performance within the scope of QoS often include availability (uptime), bandwidth (throughput), latency (delay), and error rate.

QoS involves prioritization of network traffic. QoS can be targeted at a network interface, toward a given server or router's performance, or in terms of specific applications.

Page 106: Communication

106

Stream SynchronizationDiscrete Data Stream

•Slide show on the web+Audio

•Each slide transferred on the discrete data stream form

•Synchronization – slide+audio

Continuous Data Stream

•Playing Movie

•Video stream need to be synchronized with the audio

•Lip synchronization

Page 107: Communication

107

Synchronization Mechanisms (1)

The principle of explicit synchronization on the level data units.

Page 108: Communication

108

Synchronization Mechanisms (2)

The principle of synchronization as supported by high-level interfaces.

2-41

Page 109: Communication

109

Summary• COMMUNICATION

– Layered Protocol• Lower level protocol(PL, DLL,NL)• Transport Protocol

– Client-Server TCP

• Higher Level Protocol– Session& Presentation– Application Protocol– Middleware Protocol

– RPC• Client & server Stub

– Remote Object Invocation• Distributed Object

– Message-Oriented Communication• Connection-oriented communication – Berkeley Socket• Message Broker

– Stream-Oriented Communication

Page 110: Communication

110

PROBLEMSDiscuss in groups of 3-4

In many layered protocols, each layer has its own header. Surely it would be efficient to have a single header at the front for each message with all control in it than all these separate headers. Why is this not done