DOC PREVIEW
U of I CS 241 - Distributed Computing

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Distributed ComputingAdvent of Distributed ComputingMain Issue in Designing Communication AbstractionsParadigms for Distributed ComputingInter-Process Communication (UNIX Socket IPC)Remote Procedure CallsImplementing RPCDistributed Objects (CORBA)Distributed Objects (CORBA)Distributed Shared Memory (Not widely used)Group CommunicationImportant ObservationClient-Server ModelPeer-to-PeerThe Socket AbstractionA Simple Client-Server ProgramThe socket() CallThe bind() CallThe listen() callServer InitializationThe connect() CallConnecting to the ServerBusy Server OperationThe accept() CallDistributed ComputingA Programmer’s PerspectiveAdvent of Distributed ComputingEarly programming models were designed for a single computer – there was no notion of communication between multiple machinesWith the advent of computer networks, an important question arose – how should communication be presented to the programmer? what communication abstractions make more sense? Different paradigms presented different communication abstractionsMain Issue in Designing Communication Abstractions Should the programmer write communication explicitly or should communication be hidden from the programmer? I see one machinerunning one programWhat should I run where?Communicationis transparentCommunicationis explicitParadigms for Distributed ComputingUNIX IPC (Inter-Process Communication)RPC (Remote Procedure Calls)Distributed Shared MemoryObject-Oriented ModelInter-Process Communication(UNIX Socket IPC)Simplest approach – programmer does it all.World consists of multiple machines and dataData is sent from one machine to another using send(m achine,port,data)Machine AMachine BMachine CSend()Remote Procedure CallsCommunication is completely hiddenWorld is a single machine running a single sequential programThe compiler distributes different program functions to different machines to improve performanceProgrammer does not have to know that multiple machines are involvedImplementing RPCMaking remote function calls look like local onesmain() { … function() …}Machine AOSfunction() { send message wait for reply return} Machine BOSparent() { wait for call call function() send reply}function() { …}Distributed Objects (CORBA) World is made of objectsProgrammer invokes methods on objects without having to know where the objects areObjects reside on multiple machines. System delivers method calls to objects across network (CORBA)Distributed Objects (CORBA)ORB handles remote object invocationsmain () { … obj.method() …}Object RequestBrokerDistributedObjectsFindobjectDistributed Shared Memory(Not widely used)Program has big virtual address spaceAddress space is distributed among multiple machinesCode segmentData segmentMachine AMachine BMachine CMachine DMachine EProgramGroup CommunicationWorld consists of multicast groupsEach group may span multiple machinesProgrammer knows about groups but does not have to worry about their physical locationsA message sent to a group is received by all membersImportant ObservationAll distributed communication paradigms can be built on top of IPC.Models of distributed computing using IPC:Client-serverPeer-to-peerClient-Server ModelWorld is made of:Servers: machine who provide services to a population of clients (e.g., web servers, pop mail servers, audio servers, etc)Clients: those who connect to servers (e.g., browsers, mail clients, etc)Servers are “well known”Peer-to-PeerAll machines are equal – there is no separation into servers and clientsMachines collectively perform a service to their peersAdvantages:No central point of failurePotentially more scalableDisadvantages:More difficult to programThe Socket AbstractionClientClient plugs into a server portConnection creates a bi-directional pipeServerPortA Simple Client-Server Programbind()Well-known portlisten()accept()read()write()close()eof()?write()read()connect()socket()socket()close()ClientServerThe socket() CallCreates a socket of a particular typeint socket (int family, int type, int protocol)FamilyAF_INET: IPv4 protocolsAF_INET6: IPv6 protocolsAF_LOCAL: UNIX socketAF_ROUTE: Routing socket TypeSOCK_STREAM: Stream (TCP) socketSOCK_DGARM: Datagram (UDP) socketSOCK_RAW: Raw (IP) socketThe bind() CallExecuted on the server to assign a (well-known) port address to the socketint bind (int sockfd , const struct sockaddr *myaddr , socklen_t addrlen)IP AddressPort AddressThe listen() callMoves the socket from the CLOSED to the LISTEN state in the TCP state diagram – socket is now ready to accept connectionsint listen (int sockfd, int bac k log)Server InitializationOS1. socket()Web Server2. bind(80)3. listen()80ListenqueueThe connect() CallEstablishes a connection with a serverint connect (int sockfd , const struct sockaddr *servaddr, socklen_t addrlen)Connecting to the ServerOS1. socket()Web Server2. bind(80)3. listen()80ListenqueueClientconnect()Requestfrom (IP, port)Busy Server OperationOSWeb Server80ListenqueueClient 1 Client 3Client 2Client requests get queued-up in the listen queue First-come first-servedThe accept() CallOSWeb Server80ListenqueueClient 1 Client 3Client 2Client requests get queued-up in the listen queue First-come


View Full Document

U of I CS 241 - Distributed Computing

Documents in this Course
Process

Process

28 pages

Files

Files

37 pages

File I/O

File I/O

52 pages

C Basics

C Basics

69 pages

Memory

Memory

23 pages

Threads

Threads

14 pages

Lecture

Lecture

55 pages

C Basics

C Basics

24 pages

Signals

Signals

27 pages

Memory

Memory

45 pages

Threads

Threads

47 pages

Threads

Threads

28 pages

LECTURE

LECTURE

45 pages

Threads

Threads

30 pages

Threads

Threads

55 pages

Files

Files

37 pages

SIGNALS

SIGNALS

22 pages

Files

Files

37 pages

Threads

Threads

14 pages

Threads

Threads

13 pages

Load more
Download Distributed Computing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Distributed Computing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Distributed Computing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?