NTP Explained | Network Time Protocol | Cisco CCNA 200-301

CertBros
15 Dec 202010:13

Summary

TLDRThis video from 'Cert Bros' delves into the Network Time Protocol (NTP), emphasizing its critical role in synchronizing network clocks for accurate timekeeping. Inconsistencies in time can lead to issues with log correlation, SSL certificates, and software. The video explains NTP's hierarchical structure, from reference clocks like atomic and GPS devices to primary time servers, and how devices sync to maintain accuracy. It also provides a step-by-step guide on configuring NTP on routers, illustrating the setup with an example using an internet NTP server and showcasing commands to verify synchronization and time accuracy.

Takeaways

  • πŸ•’ NTP, the Network Time Protocol, is essential for synchronizing clocks across a network to ensure accurate timekeeping.
  • ⏰ Inconsistent timekeeping can cause issues with log correlation, SSL certificates, and software, even if the discrepancy is just a few minutes.
  • πŸ”’ Every device on a network has an internal clock that tracks both time and date, and it's crucial to keep these clocks accurate.
  • πŸ“ˆ NTP uses a hierarchy system with stratum values ranging from 0 (most accurate) to 15 (least accurate) to identify the accuracy of a clock.
  • πŸ”­ Stratum zero devices, such as atomic clocks or GPS, are the most accurate time sources and do not connect over a network.
  • 🌐 Primary time servers, which are directly connected to stratum zero devices, have a stratum value of 1 and are the first layer in the NTP hierarchy.
  • πŸ”„ NTP operates by incrementing the stratum value by 1 at each layer, reflecting the distance from the reference clock and the decreasing accuracy.
  • πŸ“Ά NTP uses UDP port 123 for communication, making it easy to remember and configure.
  • 🌐 For smaller networks, an NTP Internet server can be used as a time source, while larger networks may opt for an internal GPS clock for security.
  • πŸ› οΈ NTP configuration involves setting up the time zone, summer time adjustments, DNS server, and specifying the NTP server to sync with.
  • πŸ” Two useful NTP show commands are 'show ntp status' and 'show ntp associations', providing information about synchronization status and server details.

Q & A

  • What is the primary function of NTP?

    -The primary function of NTP (Network Time Protocol) is to synchronize clocks over a network, ensuring that all devices have accurate and consistent time and date information.

  • Why is it important to have synchronized time across a network?

    -Synchronized time is crucial for correlating logs, managing SSL certificates, and avoiding issues that can arise from inconsistencies, such as problems with software or network operations.

  • What issues can arise if network devices have inconsistent internal clock times?

    -Inconsistent internal clock times can make it difficult to correlate logs, which can lead to confusion in troubleshooting and could result in looking in the wrong place for issues, especially when dealing with extensive log information.

  • What is a stratum in the context of NTP?

    -In NTP, a stratum value identifies the accuracy of a clock, ranging from 0 (most accurate, such as reference clocks like atomic clocks or GPS) to 15 (least accurate), with anything above 15 considered untrustworthy.

  • How does the stratum hierarchy work in NTP?

    -The stratum hierarchy in NTP adds a 1 to the stratum value at each layer, with stratum zero clocks being the most accurate and not connecting over a network. As you go down the hierarchy, the stratum values increase, indicating a decrease in time accuracy.

  • Which UDP port number does NTP use?

    -NTP uses UDP port number 123 for its operations, making it easy to remember.

  • What is the role of a reference clock in NTP?

    -A reference clock, such as an atomic clock, GPS, or radio clock, is a highly accurate timekeeping device that provides the time source for primary time servers in the NTP hierarchy.

  • How can a network administrator set up NTP on a router?

    -A network administrator can set up NTP on a router by configuring the time zone, setting up daylight saving time if applicable, assigning a DNS server for domain name resolution, and specifying the NTP server address, which could be an internet NTP server or another internal device.

  • What are the two useful 'show' commands for checking NTP status and associations?

    -The two useful 'show' commands are 'show ntp status', which shows if the device has synchronized and the stratum value, and 'show ntp associations', which provides details about the NTP server, including its IP address, reference clock, and stratum value.

  • How can a router become a stratum 3 device in an NTP setup?

    -A router becomes a stratum 3 device when it synchronizes its time with an NTP server that is a stratum 2 device, such as an internet NTP server, thus becoming one hop further away from the time source.

  • What is the significance of stratum values increasing as you go down the NTP hierarchy?

    -The increasing stratum values indicate that the devices are further away from the primary time source, resulting in less accurate timekeeping. This is important for understanding the reliability of the time information on each device in the network.

Outlines

00:00

πŸ•’ Introduction to NTP and Its Importance

The video introduces the Network Time Protocol (NTP), emphasizing its critical role in synchronizing time across a network. It explains that time inconsistency can lead to issues with log correlation, SSL certificates, and software. The script uses an example of two routers with desynchronized logs to illustrate the potential confusion that can arise without NTP. It then explains the hierarchy of NTP, starting with stratum 0 reference clocks like atomic clocks and GPS, and how stratum values increase as accuracy decreases. The video outlines the setup of an NTP system, including the use of an NTP server and the significance of stratum values in maintaining time accuracy.

05:01

πŸ›  Configuring NTP on Network Devices

This paragraph delves into the practical setup of NTP on network devices, starting with the configuration of time zones and daylight saving settings to ensure accurate timekeeping. It demonstrates how to set up a router to synchronize with an NTP server, including the use of DNS for domain name resolution and the selection of an NTP server like pool.ntp.org. The script clarifies that NTP does not immediately adjust the clock but gradually aligns it with the server's time. It also introduces two useful commands, 'show ntp status' and 'show ntp associations', which provide information about the synchronization status and the details of the NTP server in use. The paragraph concludes with the configuration of a second router to synchronize with the first, illustrating the cascading effect of NTP synchronization across a network.

Mindmap

Keywords

πŸ’‘Network Time Protocol (NTP)

NTP is a protocol used for synchronizing the clocks of computers over a network. It is crucial for maintaining accurate timekeeping across devices, which is essential for correlating logs, managing SSL certificates, and ensuring the proper functioning of network services. In the video, NTP is highlighted as the solution to the problem of inconsistent time across network devices, which can lead to issues in log correlation and network management.

πŸ’‘Stratum

In the context of NTP, stratum refers to a level in the hierarchy of time sources, ranging from 0 (the most accurate, such as atomic clocks) to 15 (least accurate). Stratum values are used to identify the accuracy of a clock, with lower values indicating a more direct connection to a reliable time source. The video explains the concept of stratum and its importance in the NTP hierarchy, using it to illustrate how time accuracy degrades as one moves further from the primary time source.

πŸ’‘Synchronization

Synchronization in the video refers to the process of aligning the time of network devices with a common reference point, ensuring that all devices have the same time. This is achieved through the use of NTP, which allows devices to adjust their internal clocks to match a more accurate time source. The script uses synchronization to emphasize the importance of consistent timekeeping for network reliability and log correlation.

πŸ’‘Internal Clock

An internal clock is the timekeeping mechanism within a device that tracks both time and date. The video script mentions that every device on a network has an internal clock, but these clocks can be inconsistent if not synchronized with a more accurate time source, which can lead to problems in correlating logs and other network functions.

πŸ’‘Log Correlation

Log correlation is the process of comparing and relating log entries from different devices to understand events that occur across a network. The video script uses the example of two routers with unsynced clocks to illustrate how log correlation can be challenging when devices have inconsistent timekeeping, emphasizing the need for NTP to ensure accurate and reliable log analysis.

πŸ’‘SSL Certificates

SSL (Secure Sockets Layer) certificates are digital certificates that provide secure communications over a network by encrypting data. The video mentions SSL certificates as one of the many things that can be affected by inconsistent timekeeping, as they often have expiration dates that need to be accurately tracked.

πŸ’‘NTP Server

An NTP server is a device or service that provides accurate time information to other devices on a network. In the video, the script explains how devices synchronize their clocks to an NTP server, which in turn synchronizes with a more accurate time source, such as an atomic clock or GPS. This process ensures that all devices on the network have a consistent and accurate time.

πŸ’‘UDP Port 123

UDP (User Datagram Protocol) port 123 is the standard port used by NTP for time synchronization messages. The video script mentions this port as a way to remember the protocol's standard configuration, highlighting the simplicity of setting up NTP for network time synchronization.

πŸ’‘Time Zone

A time zone is a region of the Earth that observes the same standard time. In the video, the script discusses setting the time zone on a router to ensure that the device's clock is adjusted for the correct local time. This is an important step in configuring NTP, as it ensures that the time synchronization is accurate according to the device's geographical location.

πŸ’‘Summer Time

Summer time, also known as daylight saving time, is the practice of setting the clock ahead of standard time during the longer days of summer, typically by one hour. The video script explains how to configure summer time on a router to account for this seasonal change, which is necessary for maintaining accurate timekeeping in regions that observe daylight saving time.

πŸ’‘DNS Server

A DNS (Domain Name System) server is a server that translates domain names into IP addresses. In the context of the video, a DNS server is used to resolve the domain name of an NTP server into an IP address, allowing the router to connect to the NTP server for time synchronization. This is an essential step in setting up NTP, as it enables the device to find and communicate with the time source.

Highlights

Introduction to Network Time Protocol (NTP) and its role in synchronizing clocks over a network.

Importance of consistent time for correlating logs, SSL certificates, and software in a network.

Illustration of issues caused by inconsistent time on network devices using router logs as an example.

Explanation of the hierarchy system used by NTP, starting with highly accurate timekeeping devices.

Definition of 'stratum' in NTP and its role in identifying the accuracy of a clock.

Description of stratum values ranging from 0 to 15, with stratum zero being the most accurate.

Clarification that stratum zero clocks do not connect over a network and are directly connected to time servers.

How NTP uses UDP port number 123 for communication.

Real-life setup example using an internet NTP server for smaller networks.

Recommendation to sync an internal device like a router, firewall, or server to an NTP server.

Demonstration of configuring NTP on a router, including setting the time zone and summer time.

Importance of setting a DNS server for translating the NTP server's domain name.

Process of configuring an NTP server on a router and the significance of the stratum value.

Explanation of how NTP gently nudges the time until it's fully synced and tips to speed up the process.

Useful NTP show commands: 'show ntp status' and 'show ntp associations' for checking synchronization and server details.

Configuration of a second router to sync its time with the first router, illustrating the stratum hierarchy.

Final notes on synchronizing the rest of the network devices with the primary NTP server for accurate timekeeping.

Promotion of a full CCNA course related to the video content.

Call to action for viewers to like, comment, and subscribe for channel growth support.

Transcripts

play00:00

hey what's up guys welcome to cert bros

play00:02

in this video we're going to be looking

play00:04

at

play00:09

[Music]

play00:14

ntp

play00:17

ntp stands for network time protocol

play00:21

it has the very important job of

play00:23

synchronizing clocks

play00:25

over a network time is one of those

play00:28

things that can be

play00:29

easily overlooked in a network though

play00:32

having inconsistent time

play00:33

even just by a few minutes can cause

play00:36

problems

play00:38

every device on a network will have an

play00:40

internal clock

play00:42

these internal clocks will track both

play00:44

the time and the date

play00:46

it's important to keep accurate clocks

play00:49

otherwise

play00:50

you may run into issues with correlating

play00:52

logs

play00:53

ssl certificates software and the list

play00:56

goes on

play00:58

let's take these two routers for example

play01:01

if something happens to the link

play01:02

connecting them we may want to look

play01:05

at the logs our two logs show the line

play01:08

went down

play01:09

on the 13th of september at 804

play01:13

if we then look at our ones logs it

play01:16

shows the link went down

play01:17

on the 1st of march at 12 25.

play01:20

the link went down at the same time but

play01:23

because the internal clocks are not

play01:25

synced

play01:25

it would be very difficult to correlate

play01:27

these logs

play01:29

now this is an extreme example but when

play01:31

dealing with a lot of log information

play01:33

even a few seconds can mean you're

play01:35

looking in completely the wrong place

play01:39

the problem is when our networks grow

play01:42

keeping on top of the time and date for

play01:43

every device

play01:44

becomes nearly impossible this is where

play01:47

ntp comes in

play01:49

all of the devices will sync their

play01:51

clocks to an ntp server which will have

play01:53

an accurate time

play01:55

so now we know the importance of ntp and

play01:58

what it does

play01:59

let's look at how it works ntp uses a

play02:03

hierarchy system

play02:05

at the very top we have the big boys the

play02:07

mack daddies

play02:08

these are highly accurate timekeeping

play02:10

devices such as

play02:12

atomic clocks gps or radio clocks

play02:16

they are known as reference clocks they

play02:19

have a stratum

play02:20

of zero meaning they are the most

play02:22

accurate

play02:24

what does strata mean ntp uses stratum

play02:27

values to identify the accuracy of a

play02:29

clock

play02:30

stratum values range between 0 to 15

play02:33

with 0 being the most accurate and 15

play02:36

being the least

play02:38

anything above 15 means the accuracy of

play02:40

the clock is not

play02:41

trustworthy stratum zero clocks do not

play02:45

connect over a network

play02:47

they are directly connected to time

play02:49

servers

play02:50

they then sync their time and date to

play02:52

the reference clock

play02:54

these are known as primary time servers

play02:59

the way the ntp strata model works is by

play03:01

adding a 1

play03:02

to the stratum value at each layer so

play03:05

these primary time servers have a

play03:07

stratum value of 1.

play03:09

as we go further down the stratum

play03:11

hierarchy the stratum values increase

play03:14

this is because the reference clock is

play03:16

further and further

play03:18

away meaning the time is less accurate

play03:22

ntp uses udp port number one

play03:25

two three so that's nice and easy to

play03:27

remember

play03:29

let's look at how a real-life setup

play03:31

could look using ntp

play03:35

first we need a time source for smaller

play03:38

networks

play03:39

that source is likely going to be an ntp

play03:42

internet server

play03:44

for larger more security conscious

play03:46

environments you may have your own

play03:48

internal gps clock

play03:50

i'll use an internet ntp server for this

play03:52

example

play03:53

there are several ntp servers available

play03:56

you just need to do

play03:57

a quick google search pool.ntp.org

play04:00

is a popular one when connecting to an

play04:03

internet ntp server

play04:05

most of the time it will be a stratum 1

play04:07

2 or 3 server

play04:10

you should then sync an internal device

play04:12

to that ntp server

play04:13

this could be a router firewall or

play04:16

server the choice is up to you

play04:18

i'll be using this router once our

play04:21

router is synced

play04:22

we can then use it to provide the time

play04:24

for the rest of the network

play04:26

this makes our router a stratum 3 device

play04:29

this is because

play04:30

our internet ntp server in this example

play04:33

is a stratum 2.

play04:34

if you have a more complex network with

play04:37

multiple routers

play04:38

firewalls and vlans you may set up more

play04:41

internal ntp

play04:42

servers let's try this for real

play04:45

i'm going to show you a basic ntp

play04:47

configuration

play04:49

here is router 1. it's already got an ip

play04:52

address and it's connected to the

play04:53

internet

play04:54

the first thing we need to do is set up

play04:56

the time zone and summer time

play04:59

not doing this can make our clock

play05:00

incorrect even with an ntp server

play05:03

so first let's set the time zone

play05:08

in config mode type clock

play05:13

time zone and because i'm in the uk

play05:17

we'll use gmt which is simply a word

play05:20

and 0 0 because it syncs up with the utc

play05:23

time

play05:24

your time zone might be different

play05:27

next let's change the summer time over

play05:30

here we have something called

play05:31

british summer time this is where our

play05:34

clocks go forward and back

play05:35

during the summer to set this up we need

play05:38

to type

play05:39

clock summer time

play05:44

bst which again is just a word

play05:47

and to make sure this reoccurs we're

play05:49

going to type recurring

play05:52

last sunday of march

play05:56

at 1am so that's when our clocks go

play05:58

forwards

play05:59

and last sunday of october

play06:02

at 2 a.m which is when our clocks go

play06:04

back

play06:07

okay now that's set we need to give our

play06:09

router a dns server

play06:11

that's because we need to translate our

play06:13

ntp server's domain name

play06:15

to set this up we need to type ip

play06:18

name server and i'm going to use

play06:20

google's dns server which is 8.8.8.8

play06:27

next we need to tell our router where to

play06:29

sync the time from

play06:31

so i'll type ntp server

play06:35

and now the name of the ntp server which

play06:37

is pool.ntp.org

play06:41

now this is a domain name that's going

play06:43

to translate to my nearest ntp server

play06:45

so that's why we needed to set the dns

play06:48

an important note here

play06:49

is that ntp doesn't sync the clock

play06:52

straight away

play06:53

the way the algorithm works is by gently

play06:55

nudging the time

play06:56

until it's fully synced so this can take

play06:59

a few minutes

play07:00

you can speed this up by manually

play07:02

setting the clock as close to the

play07:04

accurate time as possible

play07:06

then ntp doesn't have as much work to

play07:08

sync up

play07:09

there are two useful show commands for

play07:12

ntp

play07:13

let's exit out of here to privilege exec

play07:15

mode

play07:17

the first command is show ntp status

play07:23

this will show you if the device has

play07:24

synchronized

play07:26

the stratum value of the device and the

play07:28

ip address of the ntp

play07:30

server used for reference

play07:35

if we type show ntp associations

play07:42

this will show us the details of the ntp

play07:44

server we're using

play07:45

it shows us the ip address of the ntp

play07:48

server

play07:49

and the ip address of its reference

play07:52

clock

play07:53

it also shows us the stratum value of

play07:55

the ntp server

play07:56

and of course we can always check the

play07:58

time is correct by running the

play08:00

show clock command

play08:05

so now this router is synced with our

play08:06

ntp server

play08:08

let's open router

play08:11

we need to configure this router to sync

play08:13

its time with router 1.

play08:15

again all of the interfaces are already

play08:17

configured

play08:18

so i'll open global config by typing

play08:21

configure terminal

play08:23

and quickly set the time zone clock time

play08:26

zone

play08:27

the word gmt 0 0

play08:31

and then the summer time by typing clock

play08:33

summer time

play08:34

the word bst recurring last sunday of

play08:38

march at 1am

play08:42

last sunday of october at 2 am

play08:47

now let's set the ntp server ntp server

play08:52

and i'll type the ip address of router 1

play08:54

which is 192.168.0.254

play09:01

just as before we can exit out of here

play09:04

and use the show command

play09:06

show ntp status

play09:09

and as we can see it has now

play09:11

synchronized with router 1.

play09:13

we can also see that this router has a

play09:15

stratum value of

play09:16

4 which is 1 higher than router 1.

play09:19

this is because we are now one hop

play09:21

further away from the source

play09:23

if we type show ntp associations

play09:28

we can see router's one ip address its

play09:31

reference clock

play09:32

and its stratum value so there we have

play09:34

it a nice and

play09:36

simple ntp configuration you could then

play09:38

configure the rest of your devices to

play09:40

synchronize their time with router 1

play09:42

and they will all be synchronized and

play09:44

accurate this video is part of our full

play09:46

ccna course which can be found

play09:48

in the description so please feel free

play09:50

to go and check that out

play09:53

if you like this video don't forget to

play09:54

give it a thumbs up comment

play09:56

and subscribe the support from you guys

play09:58

really does help this channel grow

play10:01

other than that thank you for watching

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
NTPTime SynchronizationNetwork ProtocolClock AccuracyStratum HierarchyLog CorrelationNetwork DevicesSecurityCCNA CourseTech TutorialInternet Time