You are on page 1of 39

Network Operating Systems

INT413

Communication
Dr. Atta ur Rehman Khan
a.khan@ajman.ac.ae

Content sources: (i) Introduction to Network Operating Systems by Carol Traver and Richard T. Watson
(ii) Lecture notes of Hsung-Pin Chang, National Chung-Hsing University
Layered Protocols
• Due to the absence of shared memory, all
communication in distributed systems is based on
sending and receiving (low level) messages.
• When process A wants to communicate with process
B, it first builds a message in its own address space.
• Then it executes a system call that causes the
operating system to send the message over the
network to B.
2
Layered Protocols
Two general types of protocols:
1.    Connection oriented protocols
• Before exchanging data the sender and receiver first explicitly establish
a connection, and possibly negotiate the protocol to use.
• When done communicating, the connection is terminated.
• e.g. telephone is a connection-oriented communication system.
2.    Connectionless protocols
• No advance setup.
• The sender transmits the first message when it is ready.
• e.g. Dropping a letter in a mailbox is an example of connectionless
communication.
3
OSI Model
OSI Model
  Data unit Layer   Function

Application 7 Network process to application

Data
Host Layers Presentation 6 Data representation and encryption

Session 5 Interhost communication

Segments Transport 4 End-to-end connections and reliability

Packets Network 3 Path determination and logical addressing (IP)

Media Layers Frames Data link 2 Physical addressing (MAC & LLC)

Bits Physical 1 Media, signal and binary transmission

4
Sending a Message

5
Middleware Protocols
• Middleware is an application that logically lives (mostly) in the
application layer, but contains many general-purpose protocols that
warrant their own layers, independent of other, more specific
applications.
• Middleware communication protocols support high-level
communication services.
• Adapted reference model for communication
• Compared to the OSI model, the session and presentation layer
have been replaced by a single middleware layer that contains
application-independent protocols.

6
Middleware Protocols

7
Types of Communication
• View middleware as an additional service in client-server computing
• Viewing middleware as an intermediate (distributed) service in
application-level communication.

8
Example: An electronic mail system.
• The core of the mail delivery system viewed as a middleware
communication service.
• Each host runs a user agent allowing users to compose, send, and
receive e-mail.
• A sending user agent passes such mail to the mail delivery system,
expecting it, to deliver the mail to the intended recipient.
• The user agent at the receiver's side connects to the mail delivery
system to see whether any mail has arrived.
• If so, the messages are transferred to the user agent so that they can be
displayed and read by the user.
9
Persistent Communication
• An electronic mail system is a typical example of persistent
communication.
• With persistent communication, a message that has been submitted
for transmission is stored by the communication middleware as long
as it takes to deliver it to the receiver.
• The middleware will store the message at one or several of the
storage facilities.
• Not necessary for the sending application to continue execution
after submitting the message.
• The receiving application need not be executing when the
message is submitted.
10
Transient Communication
• A message is stored by the communication system only as long as the
sending and receiving application are executing.
• The middleware cannot deliver a message if there is a transmission
interrupt or the recipient is currently not active -it will discard the
message.
• All transport-level communication services offer only transient
communication.
• The communication system consists of traditional store-and-
forward routers.
• If a router cannot deliver a message to the next one or the
destination host, it will drop the message.
11
Asynchronous Communication
• A sender continues executing immediately after it has submitted its
message for transmission.
• This means that the message is (temporarily) stored by the
middleware immediately upon submission.

12
Synchronous Communication
• A sender is blocked until its request is known to be accepted.
• Three points where synchronization can take place:
1. The sender may be blocked until the middleware notifies
that it will take over transmission of the request.
2. The sender may synchronize until its request has been
delivered to the intended recipient.
3. Synchronization may take place by letting the sender
wait until its request has been fully processed, that is, up
the time that the recipient returns a response.
13
Distributed Communications Classifications
a) Persistent asynchronous communication.
b) Persistent synchronous communication.

14
Distributed Communications Classifications
c) Transient asynchronous communication.
d) Receipt-based transient synchronous communication.

15
Distributed Communications Classifications
e) Delivery-based transient synchronous communication at message
delivery.
f) Response-based transient synchronous communication.

16
RPC
• Remote Procedure Call (RPC) is a form of Inter-Process
Communication (IPC)
• A Remote Procedure Call (RPC) is when a computer program causes a
procedure (subroutine) to execute in a different address space
(commonly on another computer on a shared network), which is
coded as if it was a normal (local) procedure call, without the
programmer explicitly coding the details for the remote interaction.

17
RPC

18
RPC
• Desired
• Transparency
• Appear as similar to local procedure call as possible
• Stubs are used for this purpose

• Challenges
• Different address spaces
• Data representations
• Machine crashes
19
RPC Steps
A remote procedure call occurs in the following steps:
1. The client procedure calls the client stub in the normal way.
2. The client stub acts as a proxy and builds a message and calls the local operating system.
3. The client's OS sends the message to the remote OS (via TCP/UDP).
4. The remote OS gives the message to the server stub.
5. The server stub unpacks the parameters and calls the server.
6. The server does the work and returns the result to the stub.
7. The server stub packs it in a message and calls its local OS.
8. The server's OS sends the message to the client's OS.
9. The client's OS gives the message to the client stub.
10. The client stub unpacks the result and returns to the client.

20
RPC Steps

21
Parameter marshaling

22
Asynchronous RPC

(a) Client -server interaction in traditional RPC. (b) The interaction using asynchronous RPC.

23
Distributed Computing Environment (DCE)
• Developed by Open Software Foundation (OSF) and provides
toolkit for developing client/server applications
• A true middleware executing as an abstraction layer between
NOS and distributed applications
• Microsoft used a derived version of DCE (DCE/RPC or
MSRPC)

24
DCE Services
• Distributed file service - worldwide file system that provides a
transparent way of accessing any file in the system in the same way.
• Directory service - keeps track of the location of all resources in the
system (e.g. machines, printers, servers, data, etc.)
• Security service - provides access restrictions.
• Distributed time service - attempts to keep clocks on the different
machines globally synchronized.

25
DCE Features
• Controls and manages available computing resources
• Increases availability
• Facilitates collaborative work and minimizes storage limitations
• Tracks data and programs that move around
• Accommodates heterogeneous data
• Helps maintain distributed applications
• Helps synchronize events
• Protects distributed resources

26
DCE/RPC
• The fundamental communications mechanism
• Allows direct calls to procedures on remote systems as if they were
local procedure calls
• Simplifies the development of distributed applications by eliminating
the need to explicitly program the network communications between
client and server
• Masks differences in data representations on different hardware
platforms, allowing distributed programs to work transparently across
heterogeneous systems

27
DCE/RPC
• The main goal is to make it possible for a client to access a remote
service by simply calling a local procedure
• Steps in developing a DCE/RPC application
• Writing a client and a server
• Let the developer concentrate on only the client and server-
specific code; let the RPC system do the rest
• Interface Definition Language (IDL) is used to specify the
variables (data) and functions (methods)
• Binding a client to a server
• Performing an RPC
28
Binding a Client to a Server

29
Message-Oriented Communication
• Uses message passing to communicate between processes
• Message passing is a form of communication used in IPC
• Processes or objects can send and receive messages to other
processes

30
Berkeley Sockets
• Developed at the University of California at Berkeley.
• Supports broadcast.
• Built for client/server development.
• Supports two types of communications that sit on top of the TCP
Internet datagrams.
• TCP - connection oriented, stream, reliable.
• UDP - connectionless, record oriented, unreliable.

31
The socket primitives for TCP/IP.
Primitive Meaning

Socket Create a new communication end point

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

Write Send data on the connection

Read Get data that was sent on the connection

32
Connection-oriented communication pattern
using sockets

33
The Message-Passing Interface (MPI)
• The Message Passing Interface (MPI) is a library specification for message
passing
• It is a standard API that can be used to create applications for high-
performance multicomputers
• Hardware independent
• Message-based communication
• Primitives for all 4 forms of transient communication (+ variations)
• Over 100 functions
• Vendors + Open Source
• IBM, Intel, TMC, Meiko, Cray, Convex, Ncube, OpenMPI
34
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 is none

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

35
Message-Oriented Communication
• Known as: “Message-queuing systems” or “Message-Oriented
Middleware (MOM)”.
• Uses message passing to communicate between processes
• Support persistent, asynchronous communications.
• The basic idea: applications communicate by putting messages into
and taking messages out of “message queues”.
• Only guarantee: your message will eventually make it into the
receiver’s message queue.
• This leads to “loosely-coupled” communications

36
Message-Oriented Communication

37
General organization of a message broker in a
message-queuing system

38
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

39

You might also like