Home › Forums › FABRIC General Questions and Discussion › clock synchronization in FABRIC VMs in a slice
- This topic has 8 replies, 3 voices, and was last updated 1 month, 2 weeks ago by Nirmala Shenoy.
-
AuthorPosts
-
October 24, 2024 at 4:01 pm #7681
hello,
we are conducting experiments that measure times to track related activity in VMs configured in a network. we are recording times in microseconds. when we checked the recorded times we noticed a shift in the timings that resulted in errors in our calculations. a check on chronyc showed +/-27 ms offset between VM clock and source clock. attached is the screenshot. Is there a way to improve the accuracy of our timing calculations?
October 24, 2024 at 6:29 pm #7684Hello,
What are you using for the time synchroization source ?
October 29, 2024 at 11:54 am #7729we did not specify any source. when we checked for the sources using the command chronyc sources, it gave us the screen shot that we attached.
do you recommend synchronizing to any specific source?
thanks
Nirmala
October 29, 2024 at 12:06 pm #7731okay . So since nothing is being used, all you are doing is running NTP against the default timeservers that chrony picks up. So even if your second VM may be on the same rack, you will achive the accuracy that NTP provides.
Network Time Protocol (NTP) can achieve accuracy <mark class=”QVRyCf”>within tens of milliseconds over the internet, and within one millisecond in local area networks (LANs) under ideal conditions</mark>. However, accuracy can be affected by several factors, including:- Network congestion and asymmetric routes: These can cause errors of 100 milliseconds or more.
- Stratum: The higher the stratum number, the lower the accuracy. Stratum 0 devices, such as atomic and GPS clocks, are the most accurate, but they can’t be connected to via a network connection.
- Physical distance: The further the synchronizing server is from the client, the lower the accuracy
If you would like more achive more accurate measurements you can use PTP. We do have a notebook that you can use to setup PTP in your slice which would allow you to synchronize the system clocks on your VMs.
Just make sure the sites you use have the PTP capability as not all FABRIC sites use PTP.
This notbeook show how to setup PTP synchronization on your VMs. https://github.com/fabric-testbed/jupyter-examples/blob/main/fabric_examples/public_demos/KNIT7/Tutorial1_Precision_Time_Measurements_in_FABRIC/knit7_install_PTP.ipynb
Once setup, all the system clocks on all the VMs in the slice should be in sync to the order of 10s of microseconds or better
October 29, 2024 at 12:10 pm #7732I would also like to mention that we do not use chrony in our PTP setup. We instead use a utility called phc2sys . There are other utilities in the linuxptp package that let you ask for timestamps and report accuracy.
If you like to use chrony for this purpose, let me know and i can provide you instructions to disable the phc2sys and use chrony with the PTP device as a syncronization source.
October 29, 2024 at 12:26 pm #7733Hello Hussam, we will test out PTP in the slices that support it and also check out your notebook. we will get back when we are familiar with it
thanks
November 1, 2024 at 10:17 am #7757hello Hussam, I went through the tutorial. How to find out if a site supports PTP?
thanks
Nirmala
November 1, 2024 at 10:20 am #7758I have a anotehr notebook in the same foler that show creating a site. The notebooks picks random sites using a filter that asks for PTP capable only. Here’s the relevant line
sites = fablib.get_random_sites(count=4,filter_function=lambda x:x['ptp_capable'] is True, avoid=(avoid_sites)) https://github.com/fabric-testbed/jupyter-examples/blob/main/fabric_examples/public_demos/KNIT7/Tutorial1_Precision_Time_Measurements_in_FABRIC/knit7_create_topology.ipynb
November 1, 2024 at 3:13 pm #7767thanks Hussam, that worked. I was able to set up my slice and all the nodes are PTP enabled.
I notice a few notebooks – under the section on precision_time_measurements. I will check them out.
I am Ok with using phc2sys – will give it a try
thanks
- Network congestion and asymmetric routes: These can cause errors of 100 milliseconds or more.
-
AuthorPosts
- You must be logged in to reply to this topic.