CII3D4
SISTEM PARALEL DAN TERDISTRIBUSI
Materi 4:
Interprocess
Communication
Outline Today
• Overview Network
– Networking Issue for DS
– Types of Network
– Network Principles
– Internet Protocols
• Interprocess Communication
– Socket
– UDP
– TCP
2 CSH3J3 – Sistem Paralel dan Terdistribusi
OVERVIEW NETWORK
3 CSH3J3 – Sistem Paralel dan Terdistribusi
DS feat Internet
• Distributed Systems (DS) are built from a variety of
transmission media; hardware devices; and software
components.
• The collection of hardware and software components
that provide the communication facilities for a DS as a
communication subsystem.
• The Internet is a single communication subsystem
providing communication between all of the hosts
that are connected to it.
DS feat Internet
• Interprocess communication is at the heart of
all DS. [TAN’07]
• With the flourishing of the Internet and the
current quick development of ecommerce, it
is very important in designing distributed
systems to consider not only traditional
applications but also the requirements of
distributed computing based on the Internet.
[JIA’05]
Networking Issues
Message transmission time = latency + length
Performance : / data transfer rate
Scalability : infrastructure
Reliability : failure models
Mobility : mobile devices and Wireless networks
Quality of service : transmitting and processing streams
Multicasting : one-to-many communication
6 CSH3J3 – Sistem Paralel dan Terdistribusi
Types of Network
Personal area networks (PANs)
Local area networks (LANs)
Wide area networks (WANs) Wired Net.
Metropolitan area networks (MANs)
Internetworks
Wireless local area networks (WLANs)
Wireless wide area networks (WWANs) Wireless Net.
Wireless metropolitan area networks (WMANs)
Types of Network
Network Principles : Switching
Here we define the four types of switching that are used in computer
networking :
1) Broadcast : no switching
2) Circuit Switching : Telecommunication Networks
3) Packet Switching : Computer Network
4) Frame Relay : CS become PS
Network Principles : Protocols
Protocols used to refer to a well-known set of rules and formats to be used for
communication between processes in order to perform a given task.
Network Principles : OSI
Message sent Message rec eived
Layers
Applicat
ion
Presentation
Session
Transp or
t
Network
Data link
Physical
Se nder Communic Recipient
ation
medium
11 CSH3J3 – Sistem Paralel dan Terdistribusi
Network Principles : OSI
Network Principles : OSI
INTERPROCESS COMMUNICATION
14 CSH3J3 – Sistem Paralel dan Terdistribusi
Middleware layers
15 CSH3J3 – Sistem Paralel dan Terdistribusi
Interprocess Communication
• Message passing between a pair of processes
can be supported by two message
communication operations, send and receive,
defined in terms of destinations and
messages.
16 CSH3J3 – Sistem Paralel dan Terdistribusi
IPC
• Destination = <Network address, Port>
– Port: destination within a host that identifies a
receiving process
– Ports are uniquely identified by port number
• Operations: Send and Receive
• Message = <Destination, Content>
17 CSH3J3 – Sistem Paralel dan Terdistribusi
Socket
• Endpoint for IPC
• Message passing between sockets
• A socket is associated with either UDP or TCP
• One process can use many port
• Process does not share socket (unless IP
multicast)
18 CSH3J3 – Sistem Paralel dan Terdistribusi
Sockets
• Socket = IP + port number (example: 192.168.1.23:22)
• Only one receiver but many senders per port
19 CSH3J3 – Sistem Paralel dan Terdistribusi
Communication
• Send
– Send a message to a socket
– Can be blocking or non-blocking
• Receive
– Receive a message on socket
– Can be blocking or non-blocking
• Broadcast/Multicast
– Send to all processes/all processes in a group
20 CSH3J3 – Sistem Paralel dan Terdistribusi
Synchronous Communication
• Send is blocking
– Sender is suspended (not sending message/does nothing)
until message receive
• Receive is blocking
– Destination process blocked until message arrives
• Easier to understand
• Problems: failure and indefinite delay causes
indefinite blocking (solution: use time out),
multicast/broadcast not supported, complex
21 CSH3J3 – Sistem Paralel dan Terdistribusi
Asynchronous Communication
• Send is non-blocking
– Process continues after the message sent out,
message has been copied to a local buffer
• Receive can be blocking or non-blocking (most
common case is blocking)
– Non-blocking: process proceeds with its program
after issuing receive operation
– Blocking: process block until message arrives
22 CSH3J3 – Sistem Paralel dan Terdistribusi
Summary communication
• Aysnch: sender is non-blocking (continues
after submission)
• Synch: sender is blocked until:
– Message stored at receiver’s host
– Message is received
– Reply is received
• Receiver is usually block
23 CSH3J3 – Sistem Paralel dan Terdistribusi
UDP Datagram Comm.
a sending process to a receiving process without
acknowledgement or retries
Failure model for UDP datagrams : checksum error or because
no buffer space
Use of UDP : DNS and VoIP
24 CSH3J3 – Sistem Paralel dan Terdistribusi
TCP Stream Comm.
Stream communication assumes that when a pair of processes
are establishing a connection, one of them plays the client role
and the other plays the server role, but thereafter they could be
peers.
Failure model : use checksums to detect and reject corrupt
packets and sequence numbers to detect and reject duplicate
packets.
Use of TCP : HTTP, FTP, and SSH
Java API for TCP streams
25 CSH3J3 – Sistem Paralel dan Terdistribusi
THANK YOU