CS50 - Section 12
- Section leader- Dan Ellard.
My office phone number is 496-6246 (8am-5pm), and my home phone
number is 643-9644 (6pm-10pm). Please do not call me after 10pm,
or before 10am on weekends.
By far the best way to reach me (or anyone on the course
staff) is via email. My email address
is ellard@deas. The email address of the course
account is lib50@fas.
email is also the easiest way for me to get
information to you. Please check your mail at once a day or so.
- Office hours- Sunday 2:00-4:00 (in the Science Center terminal
room), or by arrangement. (I'm available most afternoons, but
it's a good idea to call or email me ahead of time so I'll
know to be in my office when you drop by.)
- 1/1/96 - 1/9/96
- Extended office hours (at least for me). I'll try to make myself
available as much as I can during this period (although I also
will have other time commitments during that week).
- 1/9/96 5:00pm
- Your project is due! Late days cannot be applied
to the project, and late projects will be rejected.
Get this done on time.
- 1/10/96 9:00?
- Presentation of final projects (voluntary), exam review, and end
of semester celebration. Exact time and location are not
nailed down yet. If you have a problem with this time, but
want to participate, please let me know.
- 1/10 - 1/15
- Ask the Experts - a week-long open house where you can
drop in and ask whatever questions come up during
your review for the exam. Schedule and location
will be posted during reading period.
- Final exam review sessions. There will probably be at least two
of these. Watch your email, the course newsgroups, and the
cs50 motd for more information.
- 1/17/94 9:15am (?)
- Final examination, location TBD.
The Final Project
If you haven't gotten your proposal back from me yet, please do so as
soon as possible! I've marked up the proposals with notes, comments,
and suggested changes.
Just as your proposal should have closely resembled an assignment,
your implementation should resemble a solution set for an assignment.
It should contain a complete design of your project (filling
in whatever details were missing from your proposal), answer any
questions raised in the proposal, and of course contain a well
commented, organized, and working implementation of the code that
implements your project.
If you get stuck during the implementation, don't panic, and whatever
happens do not change your project. Send me email asking for
help- I'll probably be around a lot in early January.
Note that your grade on the project will reflect how well you
implement whatever it was that you propose to do, not how
complicated or impressive the program you write is. Therefore, if you
propose to write a program that plays a card game, but change your
mind over Christmas and decide to write a program that proves or
disproves Yao's hypothesis, I will have to give you a zero (although
perhaps someone else will give you an award).
I'm not going to write much in the notes about networking, because
it's all in the lecture notes and the Comer book. However, I will nag
you to read the lecture notes and the Comer book. Nag, nag,
Some things to keep in mind:
- Most of what we're talking about when we talk about networking,
at least in this course, is the Internet.
- Each location (or host) on the internet is identified
by one or more unique internet addresses. An internet host address
is a 32-bit integer, usually written as four decimal numbers
(each representing the value of one of the 8-bit bytes of
the address) separated by periods. For example, an IP
host address might be written as 220.127.116.11.
- Each internet address also contains a port, a 16-bit
integer. The port specifies "where" in that host each message
is destined. For example, if you want to telnet, ftp, send
mail, or get a web page from fas.harvard.edu, the host address
you would use for all of these operations would be
18.104.22.168. However, the port that you would use
would be different for each: for telnet the port is 23, for
ftp it is 21, smtp (for mail) is 25, and http (for WWW
service) is 80.
Most applications "know" what port they should use; there is
mutual agreement among software vendors and creators about
what port does what. This is why you can just telnet to a
host by name, and you don't usually have to include a port
number as part of an internet address for most operations.
There's a list of many of the standard port numbers in
/etc/services. This list is incomplete, but it is
interesting reading- you can see what services hosts might
- Each internet address also contains a protocol, usually
one of tcp, udp, or icmp. These are protocols built on top of
the basic IP protocol. If you look in /etc/services again,
you'll see that right after each port number is listed the
protocol used. If, for example, you tried to send a message
using UDP to port 23 of fas, it would just give you a blank
stare (or snub you entirely) instead of opening a telnet
connection; telnet uses TCP and doesn't expect TCP.
- The Internet is a network that connects networks.
At one point in time, it was clear where the boundary between
a local net (i.e. Harvard's internal network) and the
Internet was- there was a box in William James Hall that
connected Harvard's internal network with the ARPAnet (the
forerunner of the Internet). The wires running in one side
belonged to Harvard, and the wires running out the other side
belonged to ARPA.
Today, things are much more muddy. Inside Harvard, there are
many different networks- even inside the Science Center, there
are several different and distinct networks. These networks
are tied together by boxes that resemble, in form and
function, that box that used to live in William James Hall.
In this respect, Harvard (or even just the Science Center) has
the same basic architecture as the Internet.
In the meanwhile, there's still a box in William James Hall
that connects Harvard with the outside world (although there
may be other similar boxes on campus now, I think this is
still the main one). It is a part router of NEARnet, and
connects Harvard to NEARnet. NEARnet, however, is only a
network that connects businesses and schools in New England-
but it connects with other networks, which connect with other
networks, and so on.
- To communicate with computers on the Internet, the Internet
Protocol (IP) is used. Any computer that can communicate via
IP (and all contemporary computers provide some such
capability) can communicate with any other computer that uses
IP. All of the other internet protocols are built on top of
- IP is packet-based. This means that your messages (email, ftp,
telnet, etc) are all broken down into small, easily handled
messages. Each message carries with it (along with whatever
information you originally intended to send) information about
where the packet came from, where it is supposed to be going
(IP address and port) and enough information so that this
receiving computer can reconstruct the original message out of
the small packets. This reconstruction is done according to
the rules of IP and higher-level protocols.
- There are several higher-level protocols (built on top of IP). These
- TCP/IP is far and away the most popular protocol.
It is based on the notion of a connection
or a virtual circuit. This is analogous
to a telephone call- once you have a connection
with someone, you talk back and forth in a coordinated
manner (or at least if you cooperate with each other).
- UDP/IP is a datagram protocol. A datagram is
analogous to a telegram- you send it to someone
(i.e. another program running on another computer)
and you hope they get it- but you don't get the
feedback of them saying "uh-huh" or "what?" after
you speak. In fact, there's no way for you to know
if they're listening, or if they even exist!
In fact, sending messages via UDP has been
unfavorably compared with sending a message via
a bottle. Nevertheless, it is an important
protocol, and used by many important programs.
- The Internet Control Message Protocol. If the
internet is a giant postal service, then these are the
messages that one post office might send to another-
for example, telling the main office to stop sending
large packages for a while because the storage room is
completely full, etc.
Your Future and Computer Science
As CS50 draws to an end, you may find yourself wondering where to turn
for your next dose of Computer Science. The logical next step, of
course, is CS51, but after that you have a lot choices.
The courses have changed a lot since I took them, so there are a lot
of courses that I just don't know much about. The following courses,
however, are ones that I am familiar with and recommend:
- CS51 is the logical successor to CS50. Learn LISP,
which will (hopefully) open your eyes to a whole new way of
thinking about programming, and then return to more familiar
territory with MIPS and C++. Learn some sophisticated
algorithms and how to use them.
- The theory of computation. There are several abstract
mathematical models for computation, and this course dives
headlong into some of the most important. This stuff comes up
again and again, at least in the theoretical side of things.
Not for the mathematically faint-of-heart. Lots of proofs.
- A tour of data structures and algorithms.
Good stuff to know. I hear it has changed a lot (it's been
passed from professor to professor a few times), so I don't
know what it's like now. Ask someone who has recently taken
- A tour of the computer language countryside. Cool.
The course gets raves. I haven't taken it in its current
form, but from looking at the syllabus, I wish I could take
- Compilers; really cool. I find compilers to be a very
As a historical note, I took this course from Eric Roberts
when he was a visiting professor at Harvard.
- Operating systems; wicked cool. Find out what's really going on
inside UNIX and other operating systems. (I took this course
a long time ago, but from what I've heard it has gotten better
Don't take this course, however, unless you're willing to make
a serious commitment; it is quite challenging and the homework
is very time-consuming.
- CS224r, CS226r
- Randomized algorithms and efficient algorithms. If you have a
chance to take a course from Michael Rabin, then by all means
do so. You will need to have some theoretical mathematical
background in order for this course to make much sense
(algebra, computation theory) and you'll need a love of hard
puzzles in order to enjoy this course. (In most fields, by
the time someone writes a textbook and teaches a course about
something, the topic is five/ten years old. If you take one
of these courses, however, you'll be learning stuff that's
five years ahead of the field- not an opportunity that you
want to miss.
Please bring any errors or inconsistencies in this document
to the attention of the author.
Dan Ellard - (firstname.lastname@example.org)