chap-02

warmersafternoonNetworking and Communications

Oct 23, 2013 (3 years and 5 months ago)

41 views

Communication

Chapter 2

Layered Protocols (1)

Layers, interfaces, and protocols in the OSI model.

2
-
1

Physical:

voltage, transmission rate,
mechanical, functional, and
electrical specs,…e.g. RS
-
232
-
C

Data link:

reliable link
-
level
communication (framing, CRC)

e.g. HDLC

Network:

routing e.g. IP, ATM VC

Transport:

reliable end
-
to
-
end
communication e.g. TCP, UDP

Session:

checkpointing,
synchronization

Presentation:

data formats, codes

Application:

FTP, HTTP, SMTP,
SNMP etc
.


Layered Protocols (2)

A typical message as it appears on the network.

2
-
2

Data Link Layer

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

2
-
3

Client
-
Server TCP

a)
Normal operation of TCP.

b)
Transactional TCP.

2
-
4

Middleware Protocols

An adapted reference model for networked communication.

2
-
5

RPC, ROI, Messages, Streams

Conventional Procedure Call





Call: count = read(fd, buf, bytes);

a)

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

b)

The stack while the called procedure is active

Issues: call
-
by
-
value/reference or copy/restore?

Client and Server Stubs for RPC

Principle of RPC between a client and server program.

Steps of a Remote Procedure Call

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

Passing Value Parameters (1)

Steps involved in doing remote computation through RPC

2
-
8

Passing Value Parameters (2)

The little numbers in boxes indicate the address of each byte

a)

Original message on the Pentium (little endian, left to right)

b)

The message after receipt on the SPARC (big endian)


SPARC would read: 5.10
24

(incorrect) and “JILL” (correct)

c)
The message after being inverted.


SPARC would read: 5 (correct) and “LLIJ” (incorrect)



More information is needed

Passing Reference Parameters

Reference parameters like pointers are more complicated to handle


Solution: Use call
-
by
-
copy/restore instead of call
-
by
-
reference


However: Only useful for simple referenced data


Not useful as a general solution like when using pointers to pointers

or pointers to complex data structures


The server stub may request the data when they are needed


Distinction between input and output parameters can raise performance

Parameter Specification and Stub Generation

RPC protocol agreements include questions like:


How many bytes for each data type? (here 4)


Big or little endian?


Data representation? (e.g. 1’s or 2’s complement, IEEE 754)


Transport service: connectionless or connection
-
oriented?


Stub Generation:


Using and IDL compiler


Doors

The principle of using doors as IPC mechanism.

Asynchronous RPC (1)

a)
The interconnection between client and server in a
traditional RPC

b)
The interaction using asynchronous RPC (useful when
RPC does not have a return value e.g. void functions)

2
-
12

Asynchronous RPC (2)

(deferred synchronous)


A client and server interacting through two asynchronous RPCs






An
other form: client does not wait for acceptance (one
-
way RPC)

2
-
13

Writing a Client and a Server in DCE

The steps in writing a client and a server in
DCE

RPC.

2
-
14

Binding a Client to a Server

Client
-
to
-
server binding in DCE.



RPC semantics:




At
-
most
-
once operation: repetitions are impermissible (e.g. after a crash)




Idempotent operation: repetition allowed (e.g. read)

2
-
15

(Server, Machine Address)

(/video/movie,
123.45.67.01
)



123.45.67.01

1024

(Server, Port)

(/video/movie,
1024
)



Daemon e.g.@ port 110

Distributed Objects

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




Object:

compile
-
time (i.e. language
-
based) or run
-
time (e.g. built using an adaptor/wrapper) object




Distributed object:

state may be also distributed




Remote object:

only interfaces are replicated

2
-
16

Binding a Client to an Object

a)
(a) Example with implicit binding using only global references

b)
(b) Example with explicit binding using global and local references



Binding: a proxy is placed within the address space of the client


Object References: global and unique e.g. based on:


(1) machine address + port + object ID: (
-
) port may change after crashes


(2) machine address + server ID + object ID: (+) survives crashes (
-
) fixed location


(3) machine address of location server + server ID + object ID: (
-
) not scalable

Distr_object* obj_ref; //Declare a systemwide object reference

obj_ref = …; //Initialize the reference to a distributed object

obj_ref


do_something();


// Implicitly bind and invoke a method




(a)

Distr_object obj_ref;


//Declare a systemwide object reference

Local_object* obj_ptr;


//Declare a pointer to local objects

obj_ref = …;



//Initialize the reference to a distributed object

obj_ptr = bind(obj_ref);


//Explicitly bind and obtain a pointer to the local proxy

obj_ptr


do_something();


//Invoke a method on the local proxy




(b)

Static versus Dynamic Remote Method
Invocation

a)

Remote Method Invocation (RMI):


Similar to RPC in marshalling and parameter passing


Global object references (unlike RPC)


Potentially, a developer can design object
-
specific proxies (unlike RPC)


b)

Static RMI:


Using IDL or language
-
based (JAVA can generate stubs automatically)


Interfaces are known prior to development (hardwired in client)


Interface changes mean that client has to be recompiled


c)

Dynamic RMI:


Using IDL


Interfaces may be unknown at development time


Dynamic invocation:


invoke(object, methodName, inputParameters, outputParameters)


Interface changes do not mean a client recompilation (rather run
-
time errors)




Object References: global and unique e.g. based on:


(1) machine address + port + object ID: (
-
) port may change after crashes


(2) machine address + server ID + object ID: (+) survives crashes (
-
) fixed location


(3) machine address of location server + server ID + object ID: (
-
) not scalable

Parameter Passing

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

L1: passed by value (local reference)

R1: passed by reference (remote reference)

2
-
18

The DCE Distributed
-
Object Model

(Distributed objects are an extension in DCE)

a)
Distributed
dynamic

objects in DCE (client creates them
-

via RPC
-

at
run
-
time)

b)
Distributed
named
objects (server publishes them


in a directory
-

for use)

Java RMI

a)
Only remote objects (state not distributed)

b)
Fully integrated in the Java language (stub generation)

c)
Differences between local and remote objects in Java:


Cloning:


Remote objects cannot be cloned by clients. Only the server possessing
the object can clone it, proxies are not cloned.


Synchronization:


Only proxies can be blocked on. The remote object (in the server)
cannot be protected against simultaneous access by the mere use of
synchronized methods.


Parameter passing:


local objects: by value


remote objects: by reference

d)
Object serialization

(marshalling)



Most objects can be serialized except platform
-
dependent ones like file

descriptors, sockets, and so on.


Proxies are also serializable!


can be used as object references and

passed to other clients.

Message
-
oriented Communication

Persistence and Synchronicity in Communication (1)

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



2
-
20

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


Persistent communication:

Message is stored in communication system until submission to
receiver (e.g. Email system). Sender/receiver need not be active during message delivery.

Transient communication:

Message is discarded if receiver is inactive (non
-
persistent)

Synchronous communication:

Sender blocks until message reaches receiver.

Asynchronous communication:

Sender continues (immediately) after submitting its message.


Persistence and Synchronicity in Communication (2)

Persistence and Synchronicity in Communication (3)

a)
Persistent asynchronous communication (e.g. email)

b)
Persistent synchronous communication

2
-
22.1

Persistence and Synchronicity in Communication (4)

c)
Transient asynchronous communication (e.g. UDP datagrams)

d)
Receipt
-
based transient synchronous communication

2
-
22.2

Persistence and Synchronicity in Communication (5)

e)
Delivery
-
based transient synchronous communication at message delivery.
Sender waits until message is delivered to receiver. (e.g. asynchronous RPC)

f)
Response
-
based transient synchronous communication. Sender waits until
the receiver already processed message and delivered the reply (e.g. C/S
interaction, RPC, RMI)

Message
-
oriented Transient Communication

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

Berkeley Sockets (2)

Connection
-
oriented communication pattern using sockets.

The Message
-
Passing Interface (MPI)

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




MPI is designed for multicomputers (parallel systems)




Supports group communication

Primitive

Meaning

MPI_bsend

Append outgoing message to a local send buffer (asynchronous)

MPI_send

Send a message and wait until copied to local or remote buffer (delivery/receipt
-
based)

MPI_ssend

Send a message and wait until receipt starts (delivery
-
based)

MPI_sendrecv

Send a message and wait for reply (response
-
based)

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

Message
-
Queuing Systems (1)

(also called MOM: message
-
oriented middleware)

Four combinations for loosely
-
coupled communications using queues.

(persistent asynchronous communication)

2
-
26

Message
-
Queuing Model (2)

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


Traditional example:

email


However:

MOM does more:


-

is targeted to applications and users (not only users)


-

is more generic (cf. filtering emails)


-

promotes application goals such as fault
-
tolerance, load balancing, guaranteed

delivery, priorities etc.



-

In fact email systems could make use of MOM but MOM supports database,

workflow mgmt, groupware, and batch processing applications as well

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.

General Architecture of a Message
-
Queuing System (1)


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

e.g. 127.23.45.01

General Architecture of a Message
-
Queuing System (2)

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


(routers know the network topology)

2
-
29

Message Brokers

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

Broker:

conversion between different message formats (

interoperability)

2
-
30

Example: IBM MQSeries

General organization of IBM's MQSeries message
-
queuing system.

(used with financial mainframes e.g. banks)


MCA
: message channel agent


Channel
: a (TCP) connection between 2 MCAs


2
-
31

Channels in IBM MQSeries

Some attributes associated with message channel agents.

Attribute

Description

Transport type

Determines the transport protocol to be used

FIFO delivery

Indicates that messages are to be delivered in the order they are sent

Message length

Maximum length of a single message

Setup retry
count

Specifies maximum number of retries to start up the remote MCA

Delivery retries

Maximum times MCA will try to put received message into queue

Message Transfer (1)


IBM MQSeries

The general organization of an MQSeries queuing network using routing tables and
aliases.

(QM: Queue Manager, SQ: Send Queue, LA: Local Alias)

Message Transfer (2)


IBM MQSeries

Basic Primitives available in an IBM MQSeries MQI

Primitive

Description

MQopen

Open a (possibly remote) queue

MQclose

Close a queue

MQput

Put a message into an opened queue

MQget

Get a message from a (local) queue

Data Stream (1)

Setting up a stream between two processes across a network.

Data Stream (2)

Setting up a stream directly between two devices.

2
-
35.2

Data Stream (3)

An example of multicasting a stream to several receivers.

Transmission:


Asynchronous: data units are temporally independent (e.g. text)


Synchronous: there is a max. end
-
to
-
end delay for each data unit


Isochronous: min. and max. delays = jitter (e.g. continuous media)

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

Specifying QoS (2)

The principle of a token bucket algorithm.

Setting Up a Stream

The basic organization of RSVP for resource reservation in a distributed system.


Data link layer: (frame) priorities


ATM: QoS parameters (min./max. rate, max. jitter, ..)

Synchronization Mechanisms (1)

The principle of explicit synchronization on the level data units.

Synchronization Mechanisms (2)

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

2
-
41