2. Importance of
Communication Network
Performance of a distributed system
deeply depends upon underlying
interprocess communication done
through communication network
2
3. Networks
• Definitions
A set of Machines (computers, phones, routers, switches,
gateways, etc.) connected by communications links in a
way that they could pass information between each
other
• Why Networks?
Sharing resources
Increasing proximity between people/machines
4. Requirements
• Performance
Transmission delay is arbitrary but finite
Transmission time
Latency + message size / data transfer rate
• Reliability
Hardware medium does not support replication
Error recovery
Message lost
Message duplication
Message out-of-order
Message corruption
5. History of Networking
• Initially circuit switching (PSTN)
• 1960’s: Packet Switching
– ARPAnet (1969)
• 1970’s: LAN
– Ethernet
• 1980’s: Workstations & PCs
– Proliferation of LANs & WANs
• 1990’s: WWW
– Explosion of Internet nodes
– Mobile networks
6. Network Basics
• Topologies
star, bus, mesh, ring, etc.
• Switching
circuit, packet, and virtual circuit switching
• Transmission technology
point-to-point vs. broadcasting
• Types of networks
LAN, MAN, and WAN
• Internetworking devices
Router
Gateway
bridge
7. Protocols
• A protocol specifies
rules and formats used for interactions between
two parties
specification of the sequences of messages
specification of the format of the data in the message
8. Layered Architecture
• Motivation
reducing complexity by modularizing tasks vertically
Each layer use and provide services
layer N provides a service to layer N+1
layer N extends the service of layer N-1
independence of each layer allows various
implementations across layers
10. Services in Layered
Protocols
• Data Transport Service types
Connection-oriented vs. connectionless
Virtual circuit vs. datagram
Depends on data and QoS requirements of layer above
• Packet assembly
message at layer N+1 is fragmented into multiple PDUs at layer N
(MTU at layer N+1 > MTU at layer N)
layer N at peer: responsible for assembly
• Addressing
identification of the peer at layer N
conversion into layer N-1 address
11. Protocol Design Issues
• Quality of service
reliable vs. unreliable transmission
messages vs. stream
error-free vs. error-durable
• Error recovery
data errors
causes: network error, malicious attacks, etc.
detection and correction: CRC
transmission errors
causes: network failure, overflow, receiver busy, etc.
detection and correction: sequence number and retransmission
• Flow control
sliding window
13. Low Level Layers
• Physical layer: contains the specification and
implementation of bits, and their transmission
between sender and receiver
• Data link layer: prescribes the transmission of a
series of bits into a frame to allow for error and
flow control
• Network layer: describes how packets in a
network of computers are to be routed.
14. Transport Layer
• The transport layer provides the actual
communication facilities for most distributed
systems.
• Many application protocols are directly
implemented on top of transport protocols, doing a
lot of application-independent work.
• Standard Internet protocols:
TCP: connection-oriented, reliable, stream-oriented
communication
UDP: unreliable (best-effort) datagram communication
15. Session and Presentation
Session
Dialog control
Synchronization
Presentation
Concerned with meaning of bits
How data is presented so that both parties can
understand it
Inter-conversion (ASCII, EBCDIC, Unicode etc)
Compression/encoding/encryption
15
16. Application Protocols
The protocols that do not fit into one
of the underlying layers
All distributed systems are just
application (from OSI perspective)
16
17. Middleware
An application that logically lives in the
application layer but contains general
purpose protocols that warrant their own
layers, independent of others
Authentication and authorization protocols
Naming Protocols
Not closely tied to any application
Can be integrated as a general service
Application independent nature
17
18. Inter-Process
Communication
Communication between two
processes
Required for distributed application
operation
Message Passing – the simplest form
Sending process to send a single
message (datagram) to a receiving
process asking for services
18
19. Inter-Process
Communication
Allows communication between
components (processes)
Shields one process from failure of
another
Provides modularity by a well defined
interface mechanism
Hides distinction between local and
remote communications
19
21. Data Representation
• Due to heterogeneity property of distributed
systems
• Things to consider
Representation of floating point number in different
architectures
byte ordering: may be big endian or little endian
word boundary: ASCII take 1 byte per character, Unicode
take 2 bytes
• Policy
conversion to the common data type agreed by both a
sender and a receiver while passing parameters in a
function call from sending to receiving process and same in
return value
21
22. Data Representation
Examples
22
Standard What it does
Sun XDR (External Data
Representation)
Used in Remote Procedure Calls
(RPC); converts data into a
standard binary format.
ISO ASN.1 (Abstract Syntax
Notation One)
Common in telecommunications
and networking; allows structured
data exchange.
Xerox Courier
Early protocol for data exchange;
used by Xerox’s networked
systems.
23. Marshalling
Process of taking a collection of data items and assembling them
into a form suitable for transmission in a message
Translation of structured data items and primitive values into an
External Data Representation (XDR)
Unmarshalling is process of disassembling them on arrival to
produce an equivalent collection of data items at the destination
Both are intended to be carried out by a middleware layer
without any involvement on part of the application programmer
CORBA’s common data representation
Java’s Object Serialization
Marshalling into binary/ASCII form
Used by HTTP
23
24. Calling Semantics
• Remote operation invocation may need a different
behavior than a local one
sender may not need a result either at all or immediately
sender may want to do other operations in parallel (e.g.
multithreading)
• Semantics
synchronous: same as local operation invocation
(blocked)
timeout is used to avoid indefinite wait
delayed synchronous: the sender may get a reply later
asynchronous: the sender does not need a reply
RPC Exchange Protocol
R(Request)/RR(Request;Reply)/RRA(Request;Reply;ACK)
24
25. Addressing
Identification of communication peers
Location independent identifiers are
required
Globally unique identifier: UUID in Network
Computing Architecture
UUID is Universally Unique Identifier
A URI
Examples of Identifiers
Ports
Mailbox
25
26. Reliable Delivery
Reliable Delivery
End-to-end argument
error recovery in lower levels of protocols is only useful for
purpose of increasing efficiency
protocols for application-level end-to-end checking are always
required
Possible causes for retransmission (client -> server)
server still working on it
server crashes
request gets lost
IPC should provide some level of failure transparent but
also failure visibility (accurate report of failures)
26
27. Reliable Delivery
Retransmission mechanisms
reply can be considered an acknowledgement
selective retransmission: sequence number
explicit acknowledgement (server/client)
retransmission timer
27
28. Versatility
Types of IPC
remote operation
bulk data transfer
group communication
continuous media
Flow control
stop-and-wait
sliding window
QoS
real-time with no error tolerance
stream-oriented: steady and low delay but packet lost is ok
28
29. Group Communication
Pair wise communication is not best in all
cases
A process speaking to group of processes
May be replicas
A multicast operation is more appropriate
A single message from a process is propagated
to all the members of the group
Group membership is usually transparent to user
29
30. Group Communication
Usage
Fault tolerance based on replicated services
Finding discovery services in spontaneous
networking
Router solicitations and advertisements
Better performance through replicated data
Propagation of event notification
A new news message
Example
IP multicast
30
31. Case Study: IPC in UNIX
Implemented as system calls in a layer over TCP and
UDP
Uses sockets
Messages are queued at receiver socket until
receiver process makes an appropriate system call
Socket creation
Any process can do this by invoking socket system call
Primitive Arguments
Type: datagram/stream
Protocol: TCP/UDP
Socket call return a descriptor
31
32. Case Study: IPC in UNIX
Datagram communication
Socket pair is identified each time a
communication is made
Stream Communication
A connection is established between
peer pair of sockets prior to any
communication
32
#10:PDU = Protocol Data Unit
MTU = Max Transmission Unit
#11:Sliding Window allows a sender to send multiple packets before needing an acknowledgment, increasing efficiency.
Benefits: Improves efficiency by allowing continuous data flow. Avoids congestion by controlling how much data is in transit.
Helps with error control by retransmitting only unacknowledged packets
Let’s say the window size is 4:
Sender sends packets 1, 2, 3, 4.
Waits for ACKs.
If ACK 1 and 2 are received, the window slides → now send 5 and 6.
If packet 3 is lost, only 3 is retransmitted.
#17:HTTP is application layer protocol but uses general purpose protocols like TLS/SSL that acts as security layer which is not fully part of OSI layers. These may be used by browser, email, file transfer, VPN etc