What time is it?
I'm sure you agree that time is of great importance in the real world and the same is true for networking.
If I asked you to have a meeting with me tomorrow at 9 a.m., one of the first questions is 9:00
AM, in which time zone I'm based in the U.K., but you may be based elsewhere.
So we're talking about 9:00 a.m. Eastern Time in the US or perhaps Pacific Time or are we talking
about 9:00 a.m. U.K. time.
Time is also of great importance when troubleshooting networking.
In this example, I've got three routers, router
1, router 2 and router 3.
And as an example, if I type Conft and then Control zed or control z, notice the time on this router.
The Syslog message is saying that the router was configured by the console, but this router thinks
it's in the year 2030, so it's done a bit of time travel.
This router thinks that it's in the year 2002, so it's stuck in the past. I've got a router with the
correct time in the UK, but the wrong date.
This router thinks that it's based in the future.
This router has the correct time currently in the UK.
This one doesn't.
This router, however, has the wrong date and so does this router.
Now, this becomes even more important when we're trying to troubleshoot an issue on the network. In this
example, I'll enable OSPF on router 2 it's already enabled on the other routers in the network.
So we can see that a relationship was formed in the year 2030 and according to this side a neighbor
relationship was formed in the year 2002, it's going to be very difficult to troubleshoot any kind
of issue taking place between the router in this network
because the date and time is not synchronized on the routers.
Now you can manually configure time on the routers.
So I could use the clock command as an example and set the time
on the routers
but that's not going to scale very well if I have many, many routers and in addition
clocks drift, so we ideally want to ensure that all the clocks on all the devices are synchronized to an atomic clock
somewhere.
The protocol used for synchronization of time is Network Time Protocol or NTP.
At the moment, if I type show NTP status on router 1, we can see that NTP is not enabled, NTP is
not enabled by default on Cisco routers and switches.
You need to configure the devices to talk to a time source.
Now in this example, I don't have an atomic clock which I can draw my time from.
You can, as an example, get NTP from various servers on the Internet.
Here's some examples of NTP servers available in the United Kingdom just do a search in Google or your
favorite search engine for various NTP services available online for security reasons, you might prefer
to get time from a local active directory server in your network rather than directly off the Internet.
But in this network, what we'll do is configure router 3 as a master or what's called a stratum
router, NTP has different levels
the lower the number, the closer you are to a atomic clock source.
So on router 3, you would use a command, now I'm good right now because I want to set up some other values
first, but you would specify a stratum value for the router once again, the lower the number,
the closer you are to an atomic source.
NTP uses a hierarchy of stratums where a router or a device was stratrum 3 would get its time from
a device with a lower number like 1 or 2, time would then be pushed across the network to multiple
devices from one level to another.
NTP is once again used for clock synchronization between network devices or computer systems over a data
network such as the Internet or our little network
in this example, it's been around for a long time.
So since the 1980s, it uses UDP port or user datagram protocol port
No one 123 time can be sent using unicast broadcasts or multi costs.
Here's a picture of a US Naval master clock, which has a stratum of zero.
providing time to many other devices using a hierarchal system.
Stratum 0 devices are very high precision time devices that have atomic clocks, GPS clocks or other
and so forth and so on.
Stratum 0 devices are very high precision time devices that have atomic clocks, GPS clocks or other
radio clocks.
They are known as reference clocks in NTP. Stratum 1 are synchronized to within a few microseconds
and are attached to stratum 0 devices.
They are referred to as primary time servers and then time filters down to other devices.
So stratum 2 devices will carry stratum 1 and stratum 3 will carry stratum 2 and that will
continue up to the maximum of 15.