DC Module2
DC Module2
Inter-process communication :-
• Applications,Services
• RMI,RPC
• Request-Reply protocol
• Marshalling and External Data
Representation
• UDP and TCP
Discussion Focus
– Representation of objects
• providing a common interface for object references
– Protocol construction
• Two communication patterns for distributed programming: C-S using
RMI/RPC and Group communication using ‘broadcasting’
Characteristics of IPC
• Message destinations.
• Reliability.
• Ordering.
Characteristics of IPC
synchronous and asynchronous communication.
• Synchronous
• Asynchronous communication
– Send from client is non-blocking and proceeds in parallel with local
operations
– Receive could be non-blocking (requiring a background buffer for when
message finally arrives, with notification – using interrupts or polling)
AND if blocking, perhaps, remote process needs the message, then the
process must wait on it
– Having both sync/async is advantageous, e.g., one thread of a process
can do blocked-receive while other thread of same process perform non-
block receive or are active – simplifies synchronization. In general non-
blocking-receive is simple but complex to implement due to messages
arriving out-of-order in the background buffer
Characteristics of IPC
Message destinations
– Possibility: receiving process can have many ports for different message
types
– Server processes usually publish their service-ports for clients
Reliability
Ordering
Sockets
– Provide an abstraction of endpoints for both TCP and UDP communication
– Each computer has 216 possible ports available to local processes for
receiving messages
– Many processes in the same computer can deliver to the same port
(many-to-one), however
Sockets
– Provide an abstraction of endpoints for both TCP and UDP communication
– Each computer has 216 possible ports available to local processes for
receiving messages
– Many processes in the same computer can deliver to the same port
(many-to-one), however
• No acknowledgements/retries.
• Message size:The receiving process
specifies an array of bytes,messages
are truncated on arrival.
• IP allows packets lengths of 2^16.
• Larger messages are truncated
• Non-blocking sends but blocking
receives
• Setting Time-outs on receives.
UDP Datagram communication..Failure
Model
•Blocking
•Threads
Issues related to stream communication
• Failure Model
•HTTP ,80
•FTP,20,21
•Telnet 23
•SMTP,25
A list of all TCP/UDP well known
services.
TCP and UDP comparison
TCP protocol
•It is fast and used mostly for audio and video streaming
R- Request protocol