Communication in Distributed Systems
Communication in Distributed Systems
Communication in Distributed Systems
Stream-oriented Communication
Computer Science
CS677: Distributed OS
Lecture 6, page 1
Unstructured communication
Use shared memory or shared data structures
Structured communication
Use explicit messages (IPCs)
Communication Protocols
Protocols are agreements/rules on communication Protocols could be connection-oriented or connectionless
2-1
Computer Science
CS677: Distributed OS
Lecture 6, page 3
Layered Protocols
A typical message as it appears on the network.
2-2
Computer Science
CS677: Distributed OS
Lecture 6, page 4
Client-Server TCP
a) b)
Computer Science
CS677: Distributed OS
Lecture 6, page 5
Middleware Protocols
Middleware: layer that resides between an OS and an application
May implement general-purpose protocols that warrant their own layers Example: distributed commit
2-5
Computer Science
CS677: Distributed OS
Lecture 6, page 6
client kernel
file server
process server
terminal server
kernel
kernel
kernel
Computer Science
CS677: Distributed OS
Lecture 6, page 7
Computer Science
CS677: Distributed OS
Lecture 6, page 8
Addressing Issues
Question: how is the server located? Hard-wired address
Machine address and process address are known a priori
user
server
Broadcast-based
Server chooses address from a sparse address space Client broadcasts request Can cache response for future
user
server
NS
user
server
Examples:
Computer Science
CS677: Distributed OS
Lecture 6, page 10
Buffering Issues
Unbuffered communication
Server must call receive before client can call send
user server
Buffered communication
Client send to a mailbox Server receives from a mailbox
user
server
Computer Science
CS677: Distributed OS
Lecture 6, page 11
Reliability
Need acknowledgements (ACKs) Applications handle ACKs ACKs for both request and reply
reply ACK
User
reply
CS677: Distributed OS
Server
Lecture 6, page 12
Reliable channel
request
Server
Unreliable channel
User
request ACK
Server Architecture
Sequential
Serve one request at a time Can service multiple requests by employing events and asynchronous communication
Concurrent
Server spawns a process or thread to service each request Can also use a pre-spawned pool of threads/processes (apache)
Scalability
Question:How can you scale the server capacity? Buy bigger machine! Replicate Distribute data and/or algorithms Ship code instead of data Cache
Computer Science
CS677: Distributed OS
Lecture 6, page 14
To Push or Pull ?
Client-pull architecture
Clients pull data from servers (by sending requests) Example: HTTP Pro: stateless servers, failures are each to handle Con: limited scalability
Server-push architecture
Servers push data to client Example: video streaming, stock tickers Pro: more scalable, Con: stateful servers, less resilient to failure
Group Communication
One-to-many communication: useful for distributed applications Issues:
Group characteristics: Static/dynamic, open/closed Group addressing Multicast, broadcast, application-level multicast (unicast) Atomicity Message ordering Scalability
Computer Science
CS677: Distributed OS Lecture 6, page 16
Computer Science
CS677: Distributed OS
Lecture 6, page 17