On looking at RFCs For a useful exercise in putting 868 ‘client’

advertisement
On looking at RFCs
For a useful exercise in putting
network theory into practice, we
can write an RFC-868 ‘client’
How does a ‘protocols’ arise?
• Since the inception of networking, it’s been
a practice of the Internet Engineering Task
Force (IETF) to circulate draft-documents
known as RFCs (“Request For Comment”)
which set forth detailed proposals for new
network protocol standards, and then after
a period for discussion and revisions to
adopt these as official IETF ‘standards’
RFC868 – Time Protocol
• One of the early (and brief) examples of
an RFC is this two-page description of a
client-and-server application that provides
an accurate time-and-date to computers
anywhere on the Internet
• It was adopted a quarter-century ago, but
is still in use -- although newer protocols
now offer several superior capabilities
UTC
• The ‘Time Protocol’ expresses the current
time, at a specific location on the Earth’s
surface, in terms of the number of seconds
that have elapsed since January 1st, 1900
• This measurement is called Coordinated
Universal Time, formerly known as GMT
(Greenwich Mean Time), but allows both
the time and the date to be calculated for
locations in any ‘time-zone’ on the Earth
In-class exercise #1
• Read RFC868 and write a ‘client’ sockets
program which obtains the UTC integer
from an official U.S. Naval Observatory
server, then computes and displays the
current time-of-day here in California now
(i.e., Pacific Daylight Time), given that it’s
seven hours later in Greenwich, England
• Server’s hostname: ‘time-nw.nist.gov’
In-class exercise #2
• Enhance your solution by also displaying
the current date in California now (PDT)
• This enhancement is more challenging, as
you’ll need to use information about which
years are ‘leap’ years – and the rules are
slightly more complicated than those you
may have learned in grammar school!
• (See Robert Wolf’s email on our website)
Download