2

I had a query in Clock Synchronization in a LAN.. If we already have clock synchronization in a network with the help of preamble field in an Ethernet frame.

Why should we need still protocols such as NTP/PTP?

Is this just for to get milli/micro/nano second range synchronization?

Any help is appreciated.. Thanks in Advance..

3
  • 2
    Please detail clock synchronization in a network with the help of preamble field in an Ethernet frame - Ethernet's preamble just synchronizes the receiver's bit and word clock.
    – Zac67
    Nov 10, 2019 at 11:19
  • It was confusing when i see the basic definition of PTP in wiki as "Synchronize clocks" "The Precision Time Protocol (PTP) is a protocol used to synchronize clocks throughout a computer network. On a local area network, it achieves clock accuracy in the sub-microsecond range, making it suitable for measurement and control systems" en.wikipedia.org/wiki/Precision_Time_Protocol Hence, an assumption to resemble the PTP with a preamble bit of an Ethernet frame.
    – user60007
    Nov 16, 2019 at 11:59
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 15, 2019 at 20:09

2 Answers 2

4

I had a query in Clock Synchronization in a LAN.. If we already have clock synchronization in a network with the help of preamble field in an Ethernet frame.

You're confusing clock and time.

The preamble of an Ethernet packet consists of a 56-bit (seven-byte) pattern of alternating 1 and 0 bits, allowing devices on the network to easily synchronize their receiver clocks, which is followed by the SFD to mark a new incoming frame.

The point of the preamble is to make sure all receivers receive clock is synchronized, so that they have the correct length of bits in the transmission. This is achieved by sending a defined pattern. The receiving device knows what it is supposed to look like, and can adjust it internal timers to match the senders timer.

By sending a 0-1-0-1... pattern, the receiver can adjust their clock rate to read symbols correctly. This means that if the sender or receivers clock are not running at exactly the same frequency, they can still communicate, because they can determine the difference.

However, this is not the system clock. It's not date and time. It's the length of the periods of a fast timer running in the networking hardware. It doesn't care about date or time. It cares about how long one bit is supposed to be on the wire.

NTP, on the other hand, synchronizes time and date on hosts. It is a protocol for transmitting time between systems, and keeping the synchronized.

So in short, you're confusing what clock means in different contexts. When talking about operating system level, or user level, clock is usually the time and date. When talking about electronics, clock is some internal, regular timing signal, often running at high frequency. It carries no information. It's simply meant to synchronize events.

3
  • Thanks vidarlo for the reply.. when you say "NTP, on the other hand, synchronizes time and date on hosts", each device in a network had different date & time, as soon as it is up? (wherein NTP/PTP comes into the picture)
    – user60007
    Nov 10, 2019 at 11:13
  • NTP is a protocol that transmits time and date, and aims to eliminate errors in these, to ensure that all hosts has as accurate time as possible.
    – vidarlo
    Nov 10, 2019 at 11:15
  • 1
    @ThulasiVeggalam, many devices connected to a network will have a real-time clock (I'm old enough to remember when that was an expensive add-on, but it is now almost universal) that maintains the current date and time. These real-time clocks can drift by seconds or minutes over a long period of time (do you ever need to adjust a watch, car, or other clock because it drifts?). NTP has strata of accuracy, and you use it to adjust the real-time clock in a device to a higher stratum of accuracy. This is important for things like error logging that need an accurate, coordinated date and time.
    – Ron Maupin
    Nov 10, 2019 at 20:53
0

Clock information transmitted on the physical layer or the data link layer is only available at the device/operating system level and not to applications. If the hardware or operating system cannot handle the information it is lost.

NTP or PTP can be handled on the operating system level or the application level. Usually clock synchronization is handled by the operating system but it might not be able to handle SyncE or similar.

5
  • The preamble clock sync does not aim to set time and date. It aims to ensure that the hardware clocks are synchronized. If it transmitted time and date (it doesn't) it could trivially be made available to the OS by the hardware and/or drivers.
    – vidarlo
    Nov 10, 2019 at 11:02
  • @vidarlo There's a number of different protocols in use - how should we know which one you're using and how? Your downvote is rude, I'm trying to help.
    – Zac67
    Nov 10, 2019 at 11:10
  • He mentions preamble, which indicates that he's talking about the transceiver clock cycle, not time and date. Nor is there any time and date concept in Ethernet. I do not find it rude to downvote your answer based on this. You answer simply doesn't answer the question in my opinion.
    – vidarlo
    Nov 10, 2019 at 11:14
  • @vidarlo I was not taking that literally because it doesn't make sense. Ethernet's syncword preamble just synchronize data transmitters, that's right. There are some concepts to synchronize time over Ethernet but we don't know which one the OP is referring to or if he mixes it all up.
    – Zac67
    Nov 10, 2019 at 11:17
  • It is a clock synchronization, but a different clock than what NTP aims to synchronize... I agree that the question is in no way perfect. However, I'd suggest to use the Network Engineering Chat to discuss this further, if you want. I don't think we disagree very much :)
    – vidarlo
    Nov 10, 2019 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.