Presentation is loading. Please wait.

Presentation is loading. Please wait.

CLOCK SYNCHRONIZATION SUSMITHA KOTA 21- SEP-2015.

Similar presentations


Presentation on theme: "CLOCK SYNCHRONIZATION SUSMITHA KOTA 21- SEP-2015."— Presentation transcript:

1 CLOCK SYNCHRONIZATION SUSMITHA KOTA 21- SEP-2015

2 AGENDA 1.Introduction 2.Synchronization 3.Physical Clocks 4.Global Positioning System 5.Algorithms 6.Future Work 7.References

3 Introduction: Real Time System 1. A computer system in which the correctness of the system behavior depends on logical results of the computations time when the results are produced 2. Communicates strongly with the physical environment. The high level steps are: Receiving data Processing data Returning results in right time

4 Introduction: Synchronization 1.Communication is important, but how processes synchronize to communicate is more important. 2.Synchronization is distributed systems is more difficult compared to that in uniprocessor systems. Why Synchronization? 1.To order events produced by concurrent processes. 2.To coordinate between senders and receivers of messages. 3.To serialize the concurrent access of shared objects.

5 Synchronization: Example Printer 1. Multiple processes do not simultaneously access a shared resource. 2. Instead, they cooperate to grant each other temporary exclusive access. 3. Processes need to agree on ordering of events. 4. For instance, whether message ml from process P or message m2 from process Q was sent first.

6 Physical Clocks 1.Computer Timer is a better word. 2.It is usually a precisely machined quartz crystal. 3.Each crystal has two registers Counter Holding Register 4.Each oscillation of the crystal decrements the counter by one. 5.When counter decrements to 0, interrupt is generated and counter is reloaded from holding register. 6.With a single computer and a single clock, it does not matter much if this clock is off by a small amount. What happens in distributed systems?

7 Physical Clocks: Example 1. UNIX Make program’s action when editor and compiler are on two different systems. 2. Timestamp of input.cTimestamp of input.oMake Program’s Action 21512150Re-compiles input.c Timestamp of output.cTimestamp of output.oMake Program’s Action 21432144Does not re-compile output

8 Physical Clocks in Distributed Systems 1.Frequency of each crystal is stable, but crystals in different computers may run at different frequencies. 2.This causes the software clocks to get out of synchronization. 3.The difference in time values is called as Clock Skew. 4.Programs that expect a timestamp along with the file may fail. 5.To increase efficiency and redundancy, having multiple physical clocks is desirable. 6.How to synchronize these clocks with real world clocks? How to synchronize the clocks with each other?

9 Global Positioning System Problem: Determining the geographical position anywhere on the earth. Solution: Global Positioning System, a satellite based distributed system. 1.Mostly used in Military applications, mobile phones. 2.Uses 29 satellites circulating in an orbit. Each satellite has 4 clocks. 3.A satellite continuously broadcasts its position, and timestamps messages with local time. 4.

10 Algorithms: Bully Algorithm 1. Each process has a unique numerical ID 2. Processes know the Ids and address of every other process in that network 3. Communication is assumed reliable 4. The main idea is to select a process with highest ID 5. When the coordinator fails, process initiates 6. There are three message types: election, OK and I won 7. Several processes can initiate an election simultaneously, but wait for response from other processes.

11 Algorithms: Bully Algorithm 1.Any process P can initiate an election based on requirement. 2.P sends Election messages to all process with higher Ids and waits for OK messages in response. 3.If there are no OK messages, P becomes coordinator and sends I won messages to all process with lower Ids. 4.When P receives an OK message, then it drops out and waits for an I won message. 5.When a process receives an Election message, it returns an OK and starts an election. 6.When a process receives a I won message, it treats sender as the coordinator.

12 Algorithms: Bully Algorithm a)Process 4 holds an election. b)Process 5 and 6 respond with an OK message, asking 4 to stop. c)Now 5 and 6 each hold an election to see who wins.

13 Algorithms: Bully Algorithm d)Process 6 tells 5 to stop sending messages. e)Process 6 wins and announces that it’s the coordinator.

14 Algorithm: The Berkeley Algorithm a)The time server is active. It asks the clients for their time. b)The time server, computes the average time. c)Tells all the other machines to advance their clocks to the new time. May also, ask to slow their clocks down until some specified reduction has been achieved.

15 Algorithm: The Berkeley Algorithm 1. This method is suitable for a system in which no machine has a WWV receiver. 2. The time daemon's time must be set manually by the operator periodically. 3. This is sufficient for all machines that agree on the same time. 4. It is not essential that this time also agrees with the real time WWV - United States National Institute of Standards and Technology's (NIST) radio station that continuously transmits official U.S. Government frequency and time signals on 2.5, 5, 10, 15 and 20 MHz.

16 Clock Synchronization in Wireless Networks 1. In traditional distributed systems, time servers can be easily and efficiently deployed. 2. Machines can contact each other, with relatively simple dissemination of information. 3. In sensor networks, nodes are resource constrained. 4. Also, multi-hop routing is expensive. 5. In addition, it is often important to optimize algorithms for energy consumption. 6. These and other observations have led to the design of very different clock synchronization algorithms for wireless networks.

17 Algorithm: H-Mac Protocol 1.TDMA approach for data collection in a Star Network Topology. 2.Using Heartbeat rhythm, H-Mac protocol maintains synchronization required for TDMA approach without using periodic control messages 3.H-Mac uses the peek to peek interval as time slot for data communication 4.Time slots assignment and frame cycles for synchronization are calculated by coordinator.

18 H-Mac Protocol Advantages 1. Using heartbeat rhythm for synchronization minimizes overall energy consumption. 2. H-MAC prolongs network life as compared to other protocols in Wireless Body Area Networks.

19 Future Work 1.Work towards coordination of movement or formation. There are various coordination tasks where clock synchronization mechanisms may be employed: Maybe some robots intend to move in a line, always maintaining identical distance, and passing messages. 2.In wireless sensor networks, the energy required for message transmission is very high. Hence, the clock synchronization algorithms are designed to to optimal and less energy consuming.

20 References 1.A. Rahim, N. Javaid, M. Aslam, Z. Rahman, U. Qasim, Z. A. Khan, "A Comprehensive Survey of MAC Protocols for Wireless Body Area Networks”. In: Seventh International conference on broadband and wireless computing, communications and applications, 2012. 2.Andrew S. Tanenbaum, Maarten Van Steen, “Distributed Systems: Principles and Paradigms”, Prentice-Hall,NJ,USA. 3.Leslie Lamport, “Time, Clocks, and the Ordering of Events in a Distributed System”, In: Communications of the ACM, July 1978, Volume 21, Number 7, pp. 558-565. 4.Mahmood. A, Ring. F, “Clock synchronization for IEEE 802.11 based wired-wireless hybrid networks using PTP”. In: International IEEE Symposium, 2012, pp. 1-6.

21 Thank you!


Download ppt "CLOCK SYNCHRONIZATION SUSMITHA KOTA 21- SEP-2015."

Similar presentations


Ads by Google