We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38
DISTRIBUTED COMPUTING
Iftikhar Hussain Babur
System Analyst Quaid-e-Azam Academy for Educational Development Govt. of the Punjab, Wahdat Road Lahore [email protected]
Superior University, Gold Campus
Today’s Topic
Communication
9/16/2023 Superior University, Gold Campus 2
Communication • fundamental • based on low-level message passing • message passing is harder • unreliable communication. • development of large-scale distributed applications is extremely difficult.
9/16/2023 Superior University, Gold Campus 3
Fundamentals Layered Approach • sending and receiving(low level) messages. • builds a message in its own address space. • system call that causes the operating system to send the message. • Protocols that were developed as part of the OSI model. • useful for understanding computer networks.
9/16/2023 Superior University, Gold Campus 4
Self Reading / Research Task
Fundamentals
OSI Model, Lower-Level Protocols, Transport Protocols,
Higher-Level Protocols and Middleware Protocols (page 117-124)
• Prepare yourself to present in front of the class as a group from
slides 5-14
9/16/2023 Superior University, Gold Campus 5
Fundamentals • Open system • Rules • Protocol agreement. Two general types of protocols: 1. Connection oriented protocols 2. Connectionless protocols
9/16/2023 Superior University, Gold Campus 6
The OSI model • seven levels or layers. • one specific aspect of the communication. • an interface. • The interface consists of a set of operations that together define the service, the layer is prepared to offer its users.
9/16/2023 Superior University, Gold Campus 7
The OSI model
Layer 7: Application Layer
• Provides means for the user. • main interface for the user(s). • Some examples of application layer protocols. Layer 6: Presentation Layer • Transforms data. • MIME encoding, data compression, data encryption and similar manipulation of the presentation. • Examples:.
9/16/2023 Superior University, Gold Campus 8
The OSI model
Layer 5: Session Layer
• Controls the dialogues. • establishes, manages, and terminates the connections. • duplex or half-duplex operation. Layer 4: Transport Layer • Provides transparent transfer of data between end users. • Controls the reliability of a given link. • Some protocols are state and connection oriented. • Best known example of a layer 4 protocol.
9/16/2023 Superior University, Gold Campus 9
The OSI model Layer 3: Network Layer • Provides the functional and procedural means of transferring variable length data sequences. • performs network routing functions. • Routers operate at this • logical addressing scheme • The addressing scheme is hierarchical. • The best known example of a layer 3 protocol
9/16/2023 Superior University, Gold Campus 10
The OSI model Layer 2: Data Link Layer • Provides the functional and procedural means to transfer data between network entities and to detect and possibly correct errors that may occur in the Physical layer. • Best known example of this is Ethernet. • Media Access Control (MAC) layer and the IEEE 802.2 Logical Link Control (LLC) layer. • Frames. • bridges and switches operate.
9/16/2023 Superior University, Gold Campus 11
The OSI model Layer 1: Physical Layer • Defines all the electrical and physical specifications for devices. • This includes the layout of pins, voltages, and cable specifications. Hubs, repeaters, network adapters and Host Bus Adapters (HBAs used in Storage Area Networks) are physical-layer devices. • The major functions and services performed by the physical layer are: • Establishment and termination. • Participation in the process. • Modulation or conversion.
9/16/2023 Superior University, Gold Campus 12
Sending a message When process A on machine 1 wants to communicate with process B on machine 2: 1. builds a message and passes the message to the next layer 2. adds a header to the front of the message and passes the resulting message to the next layer 3. Next layer adds its own header and passes the result down to the next layer, and so on. • Some layers add not only a header to the front, but also a trailer to the end. 4. When it hits the bottom, the physical layer transmits the message) by putting it onto the physical transmission medium.
9/16/2023 Superior University, Gold Campus 13
Sending a message • A typical message as it appears on the network.
5. When the message arrives at machine 2, it is passed upward, with each
layer stripping off and examining its own header. 6. Finally, the message arrives at the receiver, process B, which may reply to it using the reverse path. • The information in the layer n header is used for the layer n protocol.
9/16/2023 Superior University, Gold Campus 14
Middleware Protocols • Middleware • Middleware communication protocols support high-level communication services.
9/16/2023 Superior University, Gold Campus 15
Types of Communication • Viewing middleware as an intermediate (distributed) service in application- level communication.
9/16/2023 Superior University, Gold Campus 16
Types of Communication
Example: An electronic mail system.
• The core of the mail delivery system viewed as a middleware communication service. • Each host runs a user agent allowing users to compose, send, and receive e-mail. • A sending user agent passes such mail to the mail delivery system, expecting it, to deliver the mail to the intended recipient. • The user agent at the receiver's side connects to the mail delivery system to see whether any mail has arrived. • If so, the messages are transferred to the user agent so that they can be displayed and read by the user.
9/16/2023 Superior University, Gold Campus 17
Persistent Communication An electronic mail system is a typical example of communication persistent communication. • With persistent communication, a message that has been submitted for transmission is stored by the communication middleware as long as it takes to deliver it to the receiver. • The middleware will store the message at one or several of the storage facilities (above figure). • Not necessary for the sending application to continue execution after submitting the message. • The receiving application need not be executing when the message is submitted.
9/16/2023 Superior University, Gold Campus 18
Transient Communication A message is stored by the communication system only as long as the sending and receiving application are executing. • The middleware cannot deliver a message if there is a transmission interrupt or the recipient is currently not active • it will discard the message. • All transport-level communication services offer only transient communication. • The communication system consists of traditional store-and-forward routers. • If a router cannot deliver a message to the next one or the destination host, it will drop the message.
9/16/2023 Superior University, Gold Campus 19
Asynchronous & Synchronous Communication Asynchronous Communication A sender continues executing immediately after it has submitted its message for transmission. • This means that the message is (temporarily) stored by the middleware immediately upon submission. Synchronous Communication A sender is blocked until its request is known to be accepted. • Three points where synchronization can take place: 1. The sender may be blocked until the middleware notifies that it will take over transmission of the request. 2. The sender may synchronize until its request has been delivered to the intended recipient. 3. Synchronization may take place by letting the sender wait until its request has been fully processed, that is, up the time that the recipient returns a response.
9/16/2023 Superior University, Gold Campus 20
Types of Communication
• Various combinations of persistence and synchronization
occur in practice. • Popular ones are persistence in combination with synchronization at request submission, which is a common scheme for many message-queuing systems. • Likewise, transient communication with synchronization after the request has been fully processed is also widely used. • This scheme corresponds with remote procedure calls (RPC).
9/16/2023 Superior University, Gold Campus 21
Types of Communication
• Besides persistence and synchronization, we should also
make a distinction between discrete and streaming communication. • The examples so far all fall in the category of discrete communication: • the parties communicate by messages, each message forming a complete unit of information. • In contrast, streaming involves sending multiple messages, one after the other, where: • the messages are related to each other by the order they are sent, or • because there is a temporal relationship.
9/16/2023 Superior University, Gold Campus 22
Remote Procedure Call (RPC) Issue: • Many distributed systems have been based on explicit message exchange between processes. • These procedures do not conceal communication mitigating access transparency in distributed systems. Solution: • allowing programs to call procedures located on other machines. • When a process on machine A calls a procedure on machine B, the calling process on A is suspended, and execution of the called procedure takes place on B. • Information can be transported from the caller to the called procedure in the parameters and be returned in the procedure result.
9/16/2023 Superior University, Gold Campus 23
Basic RPC operation • No message passing is visible to the programmer. • This method is known as Remote Procedure Call, or often just RPC. Conventional Procedure Call • Consider a call in C like count = read(fd, buf, nbytes); where fd is an integer indicating a file buf is an array of characters into which data are read nbytes is another integer telling how many bytes to read
9/16/2023 Superior University, Gold Campus 24
Basic RPC operation
9/16/2023 Superior University, Gold Campus 25
Note
• In C, parameters can be call-by-value or call-by-
reference. • A value parameter, such as fd or nbytes, is simply copied to the stack as shown in Figure(b). • To the called procedure, a value parameter is just an initialized local variable. • The called procedure may modify it, but such changes do not affect the original value at the calling side. • A reference parameter in C is a pointer to a variable (i.e., the address of the variable), rather than the value of the variable.
9/16/2023 Superior University, Gold Campus 26
Message-oriented Communication Message-oriented Transient Communication • Message-oriented model using transport layer - transport-level sockets • Berkeley Sockets • Used for point-to-point communications • Supports broadcast • Built for client/server development
9/16/2023 Superior University, Gold Campus 27
Socket primitives for TCP/IP
9/16/2023 Superior University, Gold Campus 28
Message-oriented Communication The Message-Passing Interface (MPI) • The Message Passing Interface (MPI) is a library specification for message passing. • It is a standard API that can be used to create applications for high- performance multicomputers. • Specific network protocols (not TCP/IP) • Message-based communication • Primitives for all 4 forms of transient communication (+ variations) • Over 100 functions
9/16/2023 Superior University, Gold Campus 29
Some of the message-passing primitives of MPI
• Further Reading http://www-unix.mcs.anl.gov/mpi/
9/16/2023 Superior University, Gold Campus 30
Message-oriented persistent communication • Known as: “Message-queuing systems” or “Message-Oriented Middleware (MOM)”. • They support persistent, asynchronous communications. • Typically, transport can take minutes (hours?) as opposed to seconds/milliseconds. • The basic idea: applications communicate by putting messages into and taking messages out of “message queues”. • Only guarantee: your message will eventually make it into the receiver’s message queue. • This leads to “loosely-coupled” communications.
9/16/2023 Superior University, Gold Campus 31
Basic interface to a queue in a message-queuing system
Primitive Meaning
Put Append a message to a specified queue
Block until the specified queue is nonempty, and Get remove the first message Poll Check a specified queue for messages, and remove the first. Never block Notify Install a handler to be called when a message is put into the specified queue
9/16/2023 Superior University, Gold Campus 32
• Messages are “put into” a source queue. • They are then “taken from” a destination queue. • Queues are managed by queue managers • They move a message from a source queue to a destination queue. • Special queue managers operate as routers or relays: they forward incoming messages to other queue The general organization of a message- managers. queuing system with routers.
9/16/2023 Superior University, Gold Campus 33
Stream-oriented communication • With RPC, RMI and MOM, the effect that time has on correctness is of little consequence. • However, audio and video are time-dependent data streams – if the timing is off, the resulting “output” from the system will be incorrect. • Time-dependent information – known as “continuous media” communications. – Example: voice: PCM: 1/44100 sec intervals on playback. – Example: video: 30 frames per second (30-40 msec per image). • KEY MESSAGE: Timing is crucial!
9/16/2023 Superior University, Gold Campus 34
Transmission Modes • Asynchronous transmission mode – the data stream is transmitted in order, but there’s no timing constraints placed on the actual delivery (e.g., File Transfer). • Synchronous transmission mode – the maximum end-to-end delay is defined (but data can travel faster). • Isochronous transmission mode – data transferred “on time” – there’s a maximum and minimum end-to-end delay(known as “bounded jitter”). • Known as “streams” – isochronous transmission mode is very useful for multimedia systems.
9/16/2023 Superior University, Gold Campus 35
Two Types of Streams
• Simple Streams – one single sequence of data, for
example: voice. • Complex Streams – several sequences of data (substreams) that are “related” by time. • Think of a lip synchronized movie, with sound and pictures, together with sub-titles … • This leads to data synchronization problems … which are not at all easy to deal with.
9/16/2023 Superior University, Gold Campus 36
A general architecture for streaming stored multimedia data over a network