Transcript chap-DS-02

Communication
Chapter 2
Layered Protocol
Remote Procedure Call(RPC)
1
Communication
1. Communication Process
1. Protocol
2. Form of layers
2. Four widely used models
1.
2.
3.
4.
RPC
RMI
MOM
Stream
2
Layered Protocols (1)
Layers, interfaces, and protocols in the OSI model.
2-1
3
Layered Protocols (2)
A typical message as it appears on the network.
2-2
4
Layered Protocol
Lower-Level Protocols
Physical Layer
Data Link Layer
Network Layer
Transport Protocol
High Level Protocol
Session and Presentation Protocols
Application Protocols
Middleware Protocols=>Application Layer
5
Physical Layer
• Transmitting 0s and 1s.
• Standardizing the electrical, mechanical,
and signaling interface.
6
Data Link Layer
Consider that, A wants to send 0 and 1 to B
2-3
Discussion between a receiver
and a sender in the
data link layer.
7
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
8
Transport Protocols
• To ensure the reliable transport connectionwithout 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
9
Client-Server TCP
a) Normal
operation of TCP.
2-4
b) Transactional TCP.
10
Higher Level Protocol
1. Session and Presentation Protocols
2. Application Protocols
3. Middleware Protocols
11
Session and Presentation Protocols
1. Session - Provides the dialogs control
1. 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.
12
Application Protocols
• Collection of standard network application
– Electronic mail
– File transfer
– Terminal emulation application
13
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
14
Middleware Protocols
An adapted reference model for networked communication.
15
Conventional Procedure Call
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:
a)
b)
Parameter passing in a local procedure call: the stack
before the call to read
The stack while the called procedure is active
16
Client and Server Stubs
Principle of RPC between a client and server program.
17
Steps of a Remote Procedure Call
1.
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 OS
3. Client's OS sends message to remote OS, This may be
connection-oriented or connectionless.
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
18
Passing Value Parameters (1)
2-8
Steps involved in doing remote computation through RPC
Parameter marshaling: packing parameters into a message
19
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.
20
With RPC
What 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; }
21
Stubs
When 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
.
22
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.
23
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)
24
25
Example
import 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);
26
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);
}
27
28
Passing Value Parameters (2)
The little numbers in boxes indicate the address
of each byte.
a)
b)
c)
Original message on the Pentium (5, JILL)
The message after receipt on the SPARC (5224, JILL)
The message after being inverted (5, LLIJ)
29
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.
server
client
Call-by-reference
is not possible in
parameter passing.
Program
text
30
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.
31
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
32
Parameter Specification and Stub Generation(2)
The caller and the callee must agree
on the format of the message they
exchange, and they must follow the same
steps when it comes to passing complex
data structures (use same protocol).
a) A procedure
b) The corresponding message
33
Extended RPC Models:Doors
• 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
The principle of using doors as IPC
mechanism.
34
Extended RPC Models :Asynchronous
RPC (1)
2-12
a)
b)
The interconnection between client and server in a
traditional RPC
35
The interaction using asynchronous RPC
Extended RPC Models:Asynchronous
RPC (2)
A client and server interacting through two asynchronous
RPCs
2-13
36
Example: DCE RPC
• Distributed Computing Environment
• Open Software Foundation
• Middleware between existing network
operating system and distributed application.
• Initially design for unix – Win NT
37
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
38
39
40
41
DCE stands for "Distributed Computing Environment / Remote Procedure Calls".
42
43
44
45
46
Writing a Client and a Server
2-14
The steps in writing a client and a server in DCE RPC.
47
Binding a Client to a Server
Set up the communication
between client and server
software
In order client to
communicate with server –
server must be registered and to
accept the incoming call
2-15
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.
Client-to-server binding in DCE
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
48
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
49
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.
50
DCOM
DCOM (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 ).
51
Distributed Objects
Common organization2-16
of a remote object with client-side
proxy.
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.
52
Binding a Client to an Object
Distr_object* obj_ref;
obj_ref = …;
obj_ref-> do_something();
//Declare a systemwide object reference
// Initialize the reference to a distributed object
// Implicitly bind and invoke a method
(a)
Distr_object objPref;
Local_object* obj_ptr;
obj_ref = …;
obj_ptr = bind(obj_ref);
obj_ptr -> do_something();
//Declare a systemwide object reference
//Declare a pointer to local objects
//Initialize the reference to a distributed object
//Explicitly bind and obtain a pointer to the local proxy
//Invoke a method on the local proxy
(b)
a)
b)
(a) Example with implicit binding using only global references
(b) Example with explicit binding using global and local references
53
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.
54
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.
55
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.
56
Parameter Passing(2)
The situation when passing an object by reference or by value.
2-18
57
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
58
continued
A 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.
59
Message Oriented Communication
1. Persistence and Synchronicity in
Communication
1.
2.
3.
4.
Persistence
Transient
Asynchronous
Synchronous
2. Message-Oriented Transient Communication
3. Message-Oriented Persistence Communication
60
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
61
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
62
Persistence and Synchronicity in Communication (1)
General organization of a communication system in which hosts
are connected through a network
2-20
63
Persistence and Synchronicity in Communication (2)
Persistent communication of letters back in the days of
the Pony Express.
64
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.
65
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
66
Asynchronous Send
??????
67
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.
68
Synchronous Send
Provide information
about the relative
execution points of
sender and receiver causes synchronization
of the two.
69
Persistence and Synchronicity in Communication (3)
a) Persistent asynchronous communication
b) Persistent synchronous communication
2-22.1
Persistence Asynchronous Comm
Persistence synchronous Comm
70
Persistence and Synchronicity in Communication (4)
2-22.2
c)
Transient asynchronous
communication
71
Transient Synchronous
Communications
Weakest form, based on
message receipt.
The sender is blocked
until the message is
stored in receiver’s local
buffer.
d)
Receipt-based transient synchronous
communication
The sender receive an
acknowledge(receipt) and
continue.
72
Persistence and Synchronicity in Communication (5)
e)
f)
Delivery-based transient synchronous communication at
message delivery –client idle until its request has been accepted
for further processing
Response-based transient synchronous communication-client
waits until receives a reply from the server. Ie- client-server.
73
Berkeley Sockets (1)
Socket primitives for TCP/IP.
Primitive
Meaning
Socket
Create a new communication endpoint
Bind
Attach a local address to a socket
Listen
Announce willingness to accept connections
Accept
Block 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
74
#include <sys/types.h>
#include <sys/socket.h>
Examples
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; }
75
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;
76
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);
77
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 at
http://www.scit.wlv.ac.uk/~jphb/comms/sockets.exa
mple.html
78
Berkeley Sockets (2)
Connection-oriented communication pattern using sockets.
79
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?
80
The Message-Passing Interface (MPI)
Designed for parallel application – transient
communication
No concept such as the communication server
Assume communication take place within a known
group of process with id (groupID, processID)
Some of the most intuitive message-passing primitives of MPI.
Primitive
Meaning
MPI_bsend
Append outgoing message to a local send buffer
MPI_send
Send 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_issend
Pass 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
81
MPI_bsend
1
2
3
5
4
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.
82
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
83
MPI_sendrecv
Send a request
and wait till
return the
reply
= normal RPC
84
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
85
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.
86
Message-Queuing Model (1)
2-26
Four combinations for loosely-coupled
communications using queues.
87
Message-Queuing Model (2)
Basic interface to a queue in a message-queuing system.
Primitive
Meaning
Put
Append a message to a specified queue
Get
Block until the specified queue is nonempty, and remove the first message
Poll
Check a specified queue for messages, and remove the first. Never block.
Notify
Install a handler to be called when a message is put into the specified
queue.
88
General Architecture of a Message-Queuing System (1)
The relationship between queue-level addressing and
network-level addressing.
89
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
90
General Architecture of a Message-Queuing System (2)
Use few router with the knowledge of topology
Only the router need to be updated when queues are added/deleted
Queue manager has to know only the nearest router
2-29
The general organization of a message-queuing system with routers.
91
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
network
Known 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.
92
Message Brokers(2)
The general organization of a message broker in a
message-queuing
2-30
system.
93
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
94
Array or similar pipe network, or other processing unit or block.
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
95
Data Stream (2)
Setting up a stream directly between two devices.
2-35.2
96
Data Stream (3)
An example of multicasting a stream to several receivers.
Data stream is multicast to many receivers
Filters are use to adjust the quality of incoming stream
97
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.
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
98
Overview of the VideoLAN streaming solution
99
Specifying QoS (1)
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
A flow specification.
100
Specifying QoS (2)
The principle of a token bucket algorithm.
101
Flow Spec
1. 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
102
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.
103
Setting Up a Stream
104
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.
105
Stream Synchronization
Discrete 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
106
Synchronization Mechanisms (1)
The principle of explicit synchronization on the level data units
.
107
Synchronization Mechanisms (2)
The principle of synchronization as supported by highlevel interfaces.
2-41
108
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
109
PROBLEMS
Discuss 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
110