0% found this document useful (0 votes)
12 views7 pages

Unit 1 Part 2 IPC

cloud5

Uploaded by

rohandefence1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Unit 1 Part 2 IPC

cloud5

Uploaded by

rohandefence1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Inter Process Communication Fundamental concepts related to inter process communication inching message-passing mechanism, a case study on [PC ln MACH, concepts of group communication and ease study of group communication CBCAST in ISIS, API for Internet Protocal passing mechani ‘© Agoogle search engine may send an enquiry tall servers to know their current load and queue status, Anew request is sent tothe least loaded node or the request can be putin a queue based on the responses ‘obtained from the receiver 4 -Adistributed system hence naeds to provide an IC mechanism to facilitate such an enquity activity. ‘© Figure 3-1 depts the significance of communication network ina distributed system, Figure 3-1 typist message: paceing operation ‘© The two basic methods for information sharing are: 10 Message-passing approach © Shared memory approach ‘© Inthe message-passing technique the sender and the receiver processes communication with each other using send and recelve primitives 4+ Two processes exchange message by copyingit from the sender's address space to the receivers address space. ‘© Assvon in i 32, the sender kernel manages message-passing between Process A and Process B, Process A Process A 1 [srerea menor} Process & [i Process "| A Pe Kemet fa! Kemel Figure 3-2 Message-passing vs. Shared memory approach ‘+ Inshared memory approach, both the sending and receiving process share a common memory area where the Information is stored and is really accessible to both the process. + Amessage based IPC protocol hides the heterogeneous and complex nature ofthe hardware and the network from the programmer. ‘© Simple ‘send to'and ‘receive primitives are used to enable processes to communicate by exchanging messages. Features of message passing: ‘© The major functions of the message passing system include effi communication progress information, + -The message-passing model advantages are: > Hardware match: The message passing model its wel on parallel super-computers and elusters of ‘workstations, which are composed of separate processors connected by a communication network. Functionality: Message passing offers a full set of functions for expressing parallel algorithms, providing ‘the control which s not found In parallel data and compiler-based models Performance: Effective use of modern CPU's requires management ofthe memory hlerarehy and «especially the cache. Message passing achieves tls by providing programmers the explicit control of data locality, + Thedisadvantage: © Responsibility of message passing Is on programmer © Hehas to implement a data distribution schemes, to include inter-process communication and synchronization callin his code. © He salso responsible for resolving data dependencies, avoiding dead-lock and race conditions. sat message delivery and availability of Uniform semantics: remote processes. Efficiency: An optimization technique for efficient message-passing is to avid repeated costs of setups and {termination of connection for multiple message transfers between the same processes, Reliability: The technique to ensure reliability includes handling lost and duplicate message. Acknowledgement and retransmissions based on the time-out mechanism are used to handle the lost messages. Correctness: Correctness i related to IPC protocols and is often required for the group com ‘ensures thatthe messages are sent to all receivers orto none of them, Flexibility: The message-passing shouldbe flexible enough tocater to the varied requiren in terms of reliability Portability: It should be possible to construct anew IP facility on another system reusing the basic design ofthe existing messoge-passing system. Security: A good message-passing should provide secure ené-to-end communication. Only authenticated users are allowed to aceass the message in transi. form sera are use for both send and receive operations and for local as well as nication, Atom iy nts ofthe application Fig 3-3 shows typical message-passing operation. ‘The application on the sending hosts wants to carry out a message transfer operation, ‘The messaging interface formats the message and passes it tothe local buffer. ‘The operating system sends it across the local network to the communication server where i is queued. ‘The routing program sends the message tothe remote communication server based on the destination address specified inthe message, This server passes the message tothe required destination, where itis stored in the local buffer and later accepted. ‘bythe application, Toe owing || racoensencor crea prema | |Sovrcine see Be = eS Figure 3-3. Messape passing operation Very often, the message transfer operation is not so simple. ‘There are many issues involved along the communication path, IPCmessage format ‘Amessage consists of data and control information, formatted by the sender so that itis meaningfl to receiver. ‘The sender process adls control information to the data block with header and trailers before transmission. Fig. 34 shows the typical components ofa message. ‘The header information ofa message block consists ofthe following elements, as shown in i. 3- (Address: Ie uniguely identifies the sender and receiver processes in the network by specifying the source ‘and destination address. 9 Seaiuence number: It isa message identifier which takes care of duplicate and lst message in ease of| system allure, ‘5 Structural information t comprises of: 1)TYPE part specifies whether the message carries data or only the pointers to data 2) LENGTH part specifies the length ofthe variable sized data in bytes. ae gure 35 Apia! Be maatage uci trcsvuchrontation Message communication techniques are classified hased on whether the sender is aware ofthe message receipt by "Two methods are used to ensure the messageis received atthe buffer as follows: ‘© Baliag: tn this method, the receiver periodically checks ts butfer for recived messages by using atest primitive © Interrupt method: In this method, when the buffer receves the message, sends a software interrupt to otf the receiver process ‘synchronous communications incomplete until the sender ets sn acknowledgement ofthe receipt ofthe te ka © fee Jake fa og ja 4 Figure 3-6 Syncvenous communication operation Faure 38 ASychroncusconmuntaton operation {Atypical synchronous communication in terms of execution and suspension timelines is shown in fig. 3-7 ‘The sending process is blacked until the reply s received after which the sender resumes execution. , [ESS w) ces te spe see ape ture 3-7. Synceonous communion operon Asynchronous send is complete as soon asthe corresponding message is on its way. ‘The sender need not know whether the receiver has received the message oF not Syncaronous communication is simple and easy to implement. Itisaleo reliable because the sender knows thatthe message s accepted, However, the sender will keep on waiting, resulting ina deadlock state, iit does not recsive the acknowledgement. For distributed systems, the message-passing primitive operations are lasified as: ‘© Blocking Type: A blocking type primitive's invocation blocks the execution ofthe invoker, The receiver's blocks itself unt the message arrives blocking operation returns from the subroutine call only whe the operation is completed. ‘on-blockng operations return straight away and allow the sub-program to continue the let eng er Chr ning =~ Gl ning Figure 3 Suckicg an noe-besin peties Message Hulfering Strategies: Synchronous and Asynchronous modes of communication are two extreme buffering techniques that correspond tonull bufferingand infinite capacity buffering respectively. ‘+The other techniques ate singleand multiple bufferingstrateges. Fig 5-10 shows diferent buffering schemes. a] woe) P| Fe] PS] ure 340 tern atom 1) Null buffering. ‘+ Inthis technique the message is sent directly from the sender's address space othe receiver's address space by a single copy operation as shown in fig 3-11 Sti oe cap eros ~ — igre 3-18 sage tant wih no btn ge cp pein # Two cases are consider: LE Mthe receivers not ready to receive the message, the sending process is blocked and the send is delayed. When the receiver executes the receiver primitive, an acknowledgement is sent to the ‘senuder, who can send message. (Fig. 3-12) |. Inother technique, the sender sends the message and walts for acknowledgement. If the sender ‘does not receives the acknowledgement within a tineout period, the sender retranstalt the formation (ig 3-13). The drawback of this method is that the sender transmits the message ultiple times ithe receiver is not ready. Secondly, the receiver has to wait until the message transfor is complete, = on etree] —— mane gem FE | Sag formers | cena cate Sererlepenen | pens i | fiat aon ad [sce ee en 2)_Single¢message bering: For synchronous communica notready copy Copy? torreceive the message, is stored ina baller, + This message-passing technique involves 600 Gopy operations as showin 3-4 rhove | \ Mes +The message ule can be located either inthe : receivers address space or the kernel proces’ a) | eee sadress space. | Tae + Thesdrahac ofthis techniques thatthe butler | Figure 3-14 Single-message butferng ‘overflows ifthere are multiple messages at any point of time, 3) Infnite-capacity butter: ‘+ Inasynchronous communication, the sender need not be aware of whether the receiver is ready for reception or hasalready received the message ‘= _Insuch ease, an infnite-capacity buffer stores all the outstanding messages sent by the sender. 4), Muliple-message buffer: +) Thistechniquesallocates a ber with a capacity of afew messageson the receiver side. —) Hence tse avlds the baer overiow emo | issues. nese] ‘+The sender may not be aware that the receiver butferhas overflowed. + Toovercom tis problems the techniques seen usedare | Unsuccessful Communication Indicationlt sends ‘Asynchronous meazace tracer message transfer fails due to lack of buffer space, Figure 3-18 Mutible-message buffering fi, Flow-controlied technique: The sender is blocced sending process is resumed. ‘Multidatagram messaging: ‘+ The message-passing technique works well,based on the buffering strategy ‘+ Users can write a create buffer’ system call, which creates a ‘buffer/mailbox/" port on the receivers side, ofa size specified by the receiver. ‘+ Thisboufer can be located in the receiver's kernel or the process's address space. ‘+ Inkerne's address space, the number of messages and the buffer size canbe limited to cater to all users and their processes, ‘+ Ifthe busters tocated inthe process's address space the user is responsible for proper memory allocation, security, and other issues. Concept of MTU: ‘© Alletworks have pre-defined MTU(maximum transfer unit) in which the data is transmitted as a singe packet. ‘+ Messages greater than the MTU are broken into chunks or datagrams and transmitted indepenctenty (Nig. 3-16). Figure 3-16 mutism message Message sequencing and reassembly: + Amessage-passing system handles the (wo Important functions of message sequencing and reassembly. ‘Message contents: ‘+ During message transfer integer or float daa is copied directly What copy operation should take place, ifthe nessage contains only 2 pointer tothe data while the acual data is stored at some other loca ‘© One solution isto transfer these objects by fattening them on the sender side, receiver side(fig. 3-17) Sy cum | see gure 317 encoarg/aecng messape oa ‘Tagged representation: ‘© Inthis technique, the program object and its type information is encoded in the message. ‘© This method is simple because the receiving process can know the type of the program object from the message tse. Untagged representation: In untagged representato seco ‘©The message does not carry information about the type of data along with the value, sending and recelving processes decide how the data will be encoded and ‘= Alexible message-passing system supports two process addressing tel A. Explicit addressing: © _Inexplict addressing scheme, the primitive directly names the process with which t communicates © _ Thecommunication primitives used are send{(process..D, message) and recelve(process ID, message). 2, Implicit addressing: ‘> Ivimplicitadressing (aso called as functional addressing) scheme, the primitive specifies the process ‘with which thas to communicate but not the process ID. Client server communication uses this addressing scheme, ©The primitives used are send any(process 1D, message) and recelve any(process 1D, message). After selecting ether explicit or implicit process addressing, the next step isto know addressing methods: 1. Two-level addressing: ‘© Thesimplest method isthe two-level addressing scheme whose syntax is machine ID@local ID (receiver ‘machine name). ‘© The machine. 1D i the address ofthe receiving machine so that the sending machine's kernel can Kent the receiving machine, © veal I isthe process 1D of the receiver machine, which forwards the message to the corresponding process 2. Three-level addressing: 1 Rsupports process migration, 1S This technique is also called the link-based process addressing, © Thesyntax ofthis address is machine 1D@local 1D@machine 1D(node where the process was created © generated by the first machine® last known location of the machine). ‘9. Therfrst wo IDs remain fixed during the hie eycle ofthe process, but the third ID specifies the last known location ofthe process,fig 3-18} motte maine nen ee a |e ege/ Sear ‘+ Both process-addressing mechanisms do not provide transparency, because the user decide the process address based on the knowledge ofthe location, ‘© Hence, this technique is non-transparent to the user and do not align with the gal of the distributed system, ‘+ The following two techniques are used to maintain transparency: © Acentralised process 1D allocator maintains a counter, which is incremented by 1 when 2 new request is made for an ID. (©The other technique is to use a two-level naming scheme, which consists ofa high level machine ASCII string name and a low-level machine dependent name. ©The syntax used is machine [D@local ID. ©The centralised name server maintains a mapping table for both level names. ee ee SO C=S down can lead to either loss of the request message or the vd response message. (emcee cy 1+ The receiver node may crash during the processing of a (ose Jean request, leading to an unsuccessful execution of request. ‘© -Thevarious IPC problems are shown in fig. 3-19: etc ‘+ Areliable1P¢ protocols designed based on the sage ater timeout ‘+ The timeout period isalitle more than a round-trip message traversal time and the time required to execute the request Based on the number of messages required to complete the message transfer, the IPC protocol are classified as: A. -message reliable IPC protocol: ‘+ Asshown in fig 3-20, the communication between two processes commences when lient sends a request message tothe server. ‘+ Theserver kernel sendsan acknowledgement tothe dient. ‘+ Suppose the elient does not receive the acknowledgement inthe specific timeout period, itretransmits the message. © Once the server kernel oo along withthe result ‘+ Client sends an acknowledgement message to the server. tes the execution ofthe request, tends the reply message tothe client euest a ‘Figure 3-20. message rtabe FC prtoca Figura 3-21 Smessige 2. S-message IPC protocol: ‘+ Inthe 3:message IPC protocol shown in ig, 3-21, the cient senda request to the server that processes ‘the request and sends the reply to the client. ‘+ Theclient blocks itself until the reply is received or the timeout period is con message ‘+ Now the kernel ofthe client machine send’ an acknowledgement tothe server, “© due t any failare, the server do not receives an acknowledgement within the timeout period it retransmit the reply message. |B. _Zamessage IPC protocol: ‘+ This protocol prevents unnecessary retransmission of requests. ‘The client sends a request tothe server and remains blocked until the server sends a reply. ‘+The server processes the request andi returns the reply message tothe client. ‘+ Ifthe reply isnot receive inthe timeout period, the client retransmits the request as shown in i, 3-22 ete else itretransimits the ‘+ Based on the 2-message IPC protocol, fault tolerance communication between the client and the server Is shown in fig. 323: ‘+ Suppose the client sends.a request tothe server(1). Ome Severe) ‘+ And this request gets lst, Within a predefined timeout Sean ae | B period, the client does not receive the reply, soit retransmits the request (2). ‘+The server receives the request and stats executing it Sedna ‘But unfortunately it crashes and thus is unable to send the reply tothe client So after a defined timeout period, the eientretransmits the request(3). ‘+ Meanwhile, the server has restarted, Is able to execute the request, and sends the reply tothe client. However, the response slot in transit After another timeout, the client retransmits the request (4). ‘This is successfully received by the server, executed, and the response ‘This is worst case scenario. Failure oceurs at each and every point, but carry out IPC. a ‘+ Thisisalso termed as last-one semantics. Fire fare hrdy eai

You might also like