Interprocess Communication

Topics: Multicast, User Datagram Protocol, Transmission Control Protocol Pages: 16 (2687 words) Published: February 25, 2013
Distributed Systems 3. Interprocess Communication

Werner Nutt


Interprocess Communication
3.1 Principles

1. 2. 3. 4. 5.

Principles APIs for UDP and TCP External Data Representation Client Server Communication Group Communication 2

Middleware offers an infrastructure that enables application processes to communicate with each other Processes issue requests to the transportation layer (i.e., the application takes the initiative, not the middleware)

Applications access the middleware via APIs, e.g., – creation and manipulation of sockets Integration into programming languages – remote procedure call (RPC) – remote method invocation (RMI) For higher level APIs, data has to be transformed before it can be shipped (“data marshalling”) Protocols for Client/Server Interaction (“Request/Reply”) 3

Middleware Layers
Applications, services RMI and RPC
This This chapter chapter


request-reply protocol marshalling and external data representation UDP and TCP

Middleware layers




Characteristics of IPC
Message Passing Primitives: Send, Receive Message = Destination = – Port = destination within a host that identifies a receiving process – Ports are uniquely identified by their port number – Hosts are uniquely identified ... (or not?)


Assigned Port Numbers
FTP Data FTP Control SSH Telnet SMTP Domain Name Server Whois HTTP POP3 IMAP4 BGP HTTPS IMAP4 over SSL 20 21 22 23 25 42 43 80 110 143 179 443 993 Assigned by IANA (= Internet Assigned Numbers Authority) Numbers between 0 and 1023 are “well-known” ports — opening a port for such numbers requires privileges

can be found - on the Web - in “/etc/services” under Linux and MAC/OS 6

Characteristics – Endpoint for inter-process communication – Message transmission between sockets – A socket is associated with either UDP or TCP – Sockets are bound to ports – One process can use many ports – Processes don’t share sockets (unless for IP multicast) Implementations – originally BSD Unix, but available in Linux, Windows,… – APIs in programming languages (e.g., ) 7

Sockets and Ports


any port

agreed port socket

message client other ports Internet address = Internet address = server

Socket = Internet address + port number Only one receiver but many senders per port Advantage: several points of entry to process Disadvantage: location dependence


Communication Primitives
Send – send a message to a socket associated to a process – can be blocking or non-blocking Receive – receive a message on a socket – can be blocking or non-blocking Broadcast/Multicast – send to all processes/all processes in a group 9

Receive is usually blocking – destination process blocked until message arrives – most common case Variations – conditional receive (continue until receiving indication that message arrived or finding out by polling)

– timeout – selective receive
(wait for message from one of a number of ports)

Send in Asynchronous Communication
Characteristics – non-blocking (process continues after the message sent out) – buffering needed (at receive end) – mostly used with blocking receive – efficient implementation Problems – buffer overflow – error reporting (difficult to match error with message) Maps closely onto connectionless service 11

Send in Synchronous Communication
Characteristics – blocking (sender suspended until message received) – synchronisation point for sender & receiver – easier to understand Problems – failure and indefinite delay causes indefinite blocking (use timeout)

– multicasting/broadcasting not supported – implementation more complex Maps closely onto connection-oriented service 12

Interprocess Communication
3.2 APIs for UDP and TCP

1. 2. 3. 4. 5.

Principles APIs for UDP and TCP External Data Representation Client Server Communication Group Communication 13

Java API for...

References: In preparing the lectures I have used several sources. The main ones are the following: Books: Coulouris, Dollimore, Kindberg. Distributed Systems – Concepts and Design (CDK) Slides: Marco Aiello, course on Distributed Systems at the Free University of Bozen-Bolzano Andrew Tanenbaum, Slides from his website CDK Website Marta Kwiatkowska, U Birmingham, slides of course on DS
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Electronic Communication Essay
  • Types of communication Essay
  • interpersonal communication Essay
  • Communication Essay
  • Communication Essay
  • communication Essay
  • culture and communication Essay
  • Communications Essay

Become a StudyMode Member

Sign Up - It's Free