









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various aspects of distributed computing, including distributed shared memory, remote procedure calls, process migration, parallelizing compilers, distributed file systems, and the internet. It explains how to make multiple computers appear as a single system and provides examples of protocols such as nfs, http, e-mail, ssh, rpc, udp, tcp, ip, and ethernet.
Typology: Exams
1 / 15
This page cannot be seen from the preview
Don't miss anything!










EECS 482
1
Hardware reality
cation?
Distributed computing (not covered much in EECS 482): mak-
ing multiple computers look more like a single computer• distributed shared memory: make multiple memories
look like 1 memory
compilers: make multiple CPUs look like one CPU
ers look like one file system
EECS 482
2
Why build up abstractions in layers?
Hardware interface: deliver to neighbor computer on LANApplication interface: deliver to final destination through sev-
eral hops Provided by the IP (Internet Protocol) layerMessages on LAN (e.g. Ethernet) are sent via the physical ID
of the network interface card (e.g. 0:a0:c9:95:f5:58)
ssh
Ethernet
ppp
computer 1
computer 2
Ethernet switchcomputer 3
EECS 482
4
Translation from hostname to IP address is provided by DNS
(domain name system) Used to be done with one central server
stores part of the database). Hierarchy allows local man-agement (so everybody doesn’t notify one central serverwhenever their hostname changes), and spreads the lookupwork across multiple servers Example: translating www.eecs.umich.edu
server (A.ROOT-SERVERS.NET, 198.41.0.4)
server (also A.ROOT-SERVERS.NET, 198.41.0.4)
name server (dns.itd.umich.edu, 141.211.144.15)
eecs.umich.edu name server (zip.eecs.umich.edu,141.213.4.4)
www.eecs.umich.edu: 141.213.4.
Hardware interface: physical network type limits size of a
message (e.g. Ethernet maximum packet size is 1500bytes) Application interface: can send larger message (e.g. IP maxi-
mum packet size is 64 KB) IP layer can fragment a packet when it’s larger than the next
hop’s MTU (maximum transmission unit), then re-assem-ble it at the destination
EECS 482
5
Hardware interface: machine-to-machine communication (one
network endpoint per machine) Application interface: process-to-process communication (one
or more network endpoints per process) A process can ask the OS to create a “socket”, which will be
one endpoint of a network connection• thread is like a virtual processor• address space is like a virtual memory• an endpoint (socket) is like a virtual network interface
card
Each socket on a computer has a unique “port” number
socket using the
bind
call
included in each message. This allows the destinationmachine to know which process (and which socket inthat process) should receive the message.
The OS to multiplex several network connections onto a single
physical card UDP (user datagram protocol) provides this process-to-process
abstraction on top of IP TCP (transmission control protocol) is also built on IP
reliable, byte streams
process A
process B socket 3
socket 2
socket 1
Operating System
Network InterfaceCard
EECS 482
7
Duplicate messages are easy to detect (look at the sequence #)
and fix (just drop the duplicate) To detect corrupted messages, add some redundant informa-
tion, e.g. checksum• if message is corrupted, simply drop it. This transforms
the problem of a corrupted message into the problem ofa dropped message, and we already know how to handlethat).
Hardware interface: send information over network in distinct
messages Application interface: send data in a continuous stream (simi-
lar to reading/writing a file) TCP provides byte streams instead of distinct messagesSender sends messages of arbitrary size that are combined into
a single stream TCP layer breaks up the stream into fragments, sends them as
distinct messages, then reassembles them at the destinationinto a byte stream for the receiver. In contrast, UDP pre-serves the message boundary between sender and receiver. E.g.
loop around the receive call How to know # of bytes to receive?
EECS 482
8
Performance: aggregate performance of many machines can be
higher than the performance of a single fast machine Co-location: locate different computers near local resources
puter is down
Send/receive as communication primitive
single computer?
computers (distributed applications)
chronize between threads on a single machine?
machines
us to synchronize distributed applications
EECS 482
10
client_produce() {
send
produce request message to server wait
for
response
} client_consume() {
send
consume message to server wait
for
response
} server()
{
receive
request (from any producer or any client) if
(request is from a producer) {put
coke in machine
}^
else
{ take
coke out of machine
} send
response
} Problems with this code?How to fix the code?
server() {
receive request
(from
any
producer
or
any
client) if (request is
from
a
producer)
{
fork a thread
that
calls
server_produce()
} else {
fork a thread
that
calls
server_consume()
} } server_produce()
{
lockwhile (machine
is
full)
{
wait } put coke in machinesend response
to
producer
client
unlock } server_consume()
{
lockwhile (machine
is
empty)
{
wait } take coke out
of
machine
send response
to
consumer
client
unlock }
EECS 482
11
This creates a new thread for each request. How to lower the
overhead of creating threads? There are other ways of solving the problem (but threads are
the cleanest, because each thread just has to keep track ofone thing at a time (and it can be blocking, as long as itdoesn’t hold a lock)• polling (using select())• signals (using SIGIO)
We’ve been using send/receive. E.g. client sends request to
server, server receives request, then sends response mes-sage to client• this exposes the distributed nature of the system to the
programmer
similar as possible to building a centralized application
What else in programming is like making a request to a server
and getting a response?
EECS 482
13
Peter M. Chen
Client stub Server stub Note that client makes a normal function call, server function
is called like a normal function RPC is the mechanism behind CORBA and COM
This uses datagrams (like UDP) and assumes messages are
reliable Client stub is named produce()
int produce(int
n){
int status;send(sock,
&n,
sizeof(n));
recv(sock,
&status,
sizeof(status));
return(status); } Server stub can be named anything
produce_stub()
{
int n;int status;recv(sock,
&n,
sizeof(n));
status =
produce(n);
/*
call
“produce”
function
on
server
*/
send(sock,
&status,
sizeof(status));
} Client and server stubs can be generated automatically. What
information do you need to generate the stub?
EECS 482
14
RPC tries to make request/response to remote server look like
a function call, but some differences remain Hard to pass pointers and global variables
and the server de-references it?
to, then change the pointers on the server to point to theremote copy of the data, then copy the data back to theclient when the server is finished
Data might have different representations on different
machines• solve by agreeing to some conventional format Different failure modes can occur in RPC than a normal func-
tion call• e.g. server fails but client stays up
1 multi-threaded process on 1 computer 1 multi-threaded process on each of several computers
send receive