1 / 24

ITEC452 Distributed Computing Lecture 2 Models in Distributed Systems

Hwajung Lee. ITEC452 Distributed Computing Lecture 2 Models in Distributed Systems. Why do we need models?.

dyami
Download Presentation

ITEC452 Distributed Computing Lecture 2 Models in Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hwajung Lee ITEC452Distributed ComputingLecture 2Models in Distributed Systems

  2. Why do we need models? • Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the implementation details from observers who view the system at a higher level. • Results derived from an abstract model is applicable to a wide range of platforms.

  3. A message passing model (1) • System topology is a graph G = (V, E), where V = set of nodes (sequential processes) E = set of edges(links or channels, bi/unidirectional) • Four types of actions by a process: • Internal action • Communication action • Input action • Output action

  4. A message passing model (2)A Reliable FIFO channel Axiom 1. Message m sent  message m received Axiom 2. Message propagation delay is arbitrary but finite. Axiom 3. m1 sent before m2m1 received before m2. P Q

  5. A message passing model (3)Synchrony vs. Asynchrony Send & receive can be blocking or non-blocking Postal communication is asynchronous: Telephone communication is synchronous Any restriction defines some form of synchrony …

  6. Shared memory model (1) Address spaces of processes overlap M1 M2 1 3 2 4 Concurrent operations on a shared variable are serialized

  7. Shared memory model (1)Variations of shared memory models 1 State reading model Each process can read the states of its neighbors 0 2 3 Link register model Each process can read from and write to adjacent registers. The entire local state is not shared. 0 1 2 3

  8. Modeling wireless networks • Communication via broadcast • Limited range • Dynamic topology

  9. Modeling Mobile Agents (1) • Mobile agent • a program code that migrates from one process to another • Can interact with the variables of programs running on the host machine, use its resources, and take autonomous routing decisions. • Strong mobility/weak mobility • Ex.: Dartmouth’s D’Agents, IBM’s Aglets

  10. Modeling Mobile Agents (2) • Model: (I, P, and B) • I is the agent identifier and is unique for every agent. • P designates the agent program • B is the briefcase and represent the data variables to be used by the agent

  11. Weak vs. Strong Models One object (or operation) of a strong model = More than one objects (or operations) of a weaker model. Often, weaker models are synonymous with fewer restrictions. One can add layers (additional restrictions) to create a stronger model from weaker one. Examples HLL model is stronger thanassembly language model. Asynchronous is weaker thansynchronous. Bounded delay is stronger thanunbounded delay (channel)

  12. Model transformation Stronger models - simplify reasoning, but - needs extra work to implement Weaker models - are easier to implement. - Have a closer relationship with the real world “Can model X be implemented using model Y?” is an interesting question in computer science. Sample problems Non-FIFO to FIFO channel Message passing to shared memory Non-atomic broadcast to atomic broadcast Complicated Simple

  13. Non-FIFO to FIFO channel (1) m2 m3 m4 m1 P Q buffer

  14. Non-FIFO to FIFO channel (2) {Sender process P} {Receiver process Q} var i : integer {initially 0} var k : integer {initially 0} buffer: buffer[0..∞] of msg {initially  k: buffer [k] = empty repeatrepeat{STORE} send m[i],i to Q; receive m[i],i from P; i := i+1 store m[i] into buffer[i]; forever{DELIVER}while buffer[k] ≠ empty do begin deliver content of buffer [k]; buffer [k] := empty; k := k+1; end forever

  15. Observations (a) Needs Unbounded sequence numbers and (b) Unbounded number of buffer slots  Both are bad Now solve the same problem on a model where (a) The propagation delay has a known upper bound of T. (b) The messages are sent out @r per unit time. (c) The messages are received at a rate faster than r.  The buffer requirement drops to (rxT).Thus, Synchrony pays. Question. How to solve the problem using bounded buffer space if the propagation delay is arbitrarily large?

  16. Message-passing to Shared memory {Read X by process i}: read x[i] {Write X:= v by process i} - x[i] := v; • Atomically broadcastv to every other process j (j ≠ i); • After receiving broadcast, process j (j ≠ i) sets x[j] to v. Understand the significance of atomic operations. It is not trivial, but is very important in distributed systems This is incomplete. There are more pitfalls here.

  17. Non-atomic to atomic broadcast Atomic broadcast = either everybody or nobody receives {process i is the sender} for j = 1 to N-1 (j ≠ i) send message m to neighbor[j] (Easy!) Now include crash failure as a part of our model. What if the sender crashes at the middle? Implement atomic broadcast in presence of crash.

  18. Mobile-agent based communication Communicates via messengers instead of (or in addition to) messages. What is the lowest Price of an iPod in Radford? Carries both program and data

  19. Other classifications of models Reactive vs Transformational systems A reactive system never sleeps (like: a server or servers) A transformational (or non-reactive systems) reaches a fixed point after which no further change occurs in the system (Examples?) Named vs Anonymous systems In named systems, process id is a part of the algorithm. In anonymous systems, it is not so. All are equal. (-) Symmetry breaking is often a challenge. (+) Easy to switch one process by another with no side effect. Saves logN bits.

  20. Model and complexity Consider broadcasting in an n-cube (n=3) Many measures • Space complexity • Time complexity • Message complexity • Bit complexity • Round complexity What do these mean? source

  21. Broadcasting using messages {Process 0} sends m to neighbors {Process i > 0} repeat receive m {m contains the value}; if m is received for the first time thenx[i] := m.value; send x[i] to each neighbor j > I else discard m end if forever What is the (1) message complexity (2) space complexity per process? Each process j has a variable x[j] initially undefined

  22. Broadcasting using shared memory Each process j has a variable x[j] initially undefined {Process 0} x[0] := v {Process i > 0} repeat if  a neighbor j < i : x[i] ≠ x[j] then x[i] := x[j] {this is a step} else skip end if forever What is the time complexity? (i.e. how many steps are needed?) Can be arbitrarily large! WHY?

  23. Broadcasting using shared memory Each process j has a variable x[j] initially undefined Now, use “large atomicity”, where in one step, a process j reads the states of ALL its neighbors of smaller id, and updates x[j] only when these are equal, and different from x[j]. What is the time complexity? How many steps are needed? The time complexity is now O(n2)

  24. Time complexity in rounds Each process j has a variable x[j] initially undefined Rounds are truly defined for synchronoussystems. An asynchronous round consists of a number of steps where every process(including the slowest one) takes at least one step. How many rounds will you needto complete the broadcast using the largeatomicity model?

More Related