CS70 Networking Theory and Essentials

David Morgan
Santa Monica College
see syllabus for email address


Administrativa

Syllabus
Grade information
Reading list, per chapter

Information

Textbook's website

RFC lookup

Remote Unix access with telnet

Using the knoppix boot CD

Fundamental Unix Commands

Using ftp

Protocols: non-cyber examples

MAC address assignments
 - listing
 - search

TCP/IP - Intro to the IP Protocols

TCP/IP Pocket Reference Guide

IP addresses

IP packet delivery

hub vs switch

Masks, routing, subnets

Network calculators:
  here's one
  and another

Real world DSL
 - Order #1
 - Order #2
 -
Analysis

- Order #3

Subnet mask chart

commercial routers

DNS - various resources

Windows networking
 
WindowsNetworking
 Practically networked

Using Samba book

Linux Network Administrator's Guide

Playing client
with telnet and netcat

Client/server sample:
 - echoserver.c
 - echoclient.c

Sockets: socket programming

Sockets: sample programs
 - letter-upgrader server
 - letter-upgrader's client

 - upper-echoback server
 - client for echo-back server

 - web (file-send) server
 - client for file-send server

nmap: Ethical Hacker article

Linux links
Linux man pages

Virtual Private Net

Protocols

ARP

IP

ICMP

TCP

UDP

echo (port 7)

discard (port 9)

chargen (port 19)


Slide presentations

Concepts

Design

Media

NICs

Signals (Ch6)

Transmission media (Ch7)

Error detection

Access technologies (Chs. 12+16 abridged)

Protocol layering & suites

Ethernet, a protocol example

HTTP, a protocol example

Interfaces and routes

ping

ARP address resolution

tcpdump

wireshark

Wires, hubs, switches

IP network addresses

traceroute

Networks: services 

Networks: sockets

internetworks

bridging

udp protocol

tcp protocol

nmap - port scanner

netstat

netcat (nc)

Apache (web server)

Apache CGI

BIND (name server)

DNS protocol

dhcpd (address server)

DHCP protocol

Samba (MS fileshare client) 

SMB (MS fileshare) protocol

stunnel

Networks: protocol interrelationships

Networks: miscellaneous essentials

Networks: modems & Point-to-Point Protocol

Networks: firewalls

Narrated slide presentations

internetworks  (33MB)

ping  (16MB)


 

FALL 2009
Section 4140 6:45p - 9:50p Tu Bus 259

This Website (http://homepage.smc.edu/morgan_david/)  will be used extensively to communicate with you. Announcements, grade reports, and assignments will be posted here. Please access the website from any SMC computer lab. Alternatively, it can be viewed from an internet-connected browser anywhere. You are responsible for awareness of the information posted here.

TCP and UDP Ports you should know
Q: where do the "well-known port" numbers come from?
A: IANA (Internet Assigned Numbers Authority) 

Q: what are the well-known port assignments?
A: the list is long (cf., /etc/services on any linux box) 

Q: which ones should we know for this class?
A: 21, 22, 23, 25, 53, 80, 110, 137-39 (look up what service each belongs to, above)
(11/17)

Apache cheat sheet - here's a quick reference card for Apache. It's formatted to be printed out as 2 pages, front-to-back on a single sheet, then folded tri-fold. (11/17)

Homework -
preview - the in-class exercise we will do, at the link entitled "xinetd"
read - textbook chapters
  25 UDP: Datagram Transport Service
  26 TCP: Reliable Transport Service
    4 Traditional Internet Applications; sections 4.1-4.10, about web service (11/17)

Slides we're viewing -
  "udp protocol"
  "nmap - port scanner"
  "miscellaneous but essential"
  "Apache (web server)" &  "HTTP - a protocol example"
  "Access technologies (Ch12)" - DSL, cable, etc. never got to it, but may. (11/17)

Homework -
preview - the in-class exercise we will do, at the link entitled "xinetd"
read - the write-up about nmap at the link entitled "nmap: Ethical Hacker article" below left.

Grades - updated, at link entitled "Grade information," at left. Please check your grades and call any anomalies to my attention. (11/4)

Slides we're viewing -
  "Networks: services"
  "udp protocol"
  "netstat" -  reports which ports and processes currently belong to each other
  "nmap - port scanner"
  "miscellaneous but essential"
  "Access technologies (Ch12)" - DSL, cable, etc. never got to it, but may. (11/4)

Various services and the server programs and protocols they use.

Service Server Linux executable Protocol used
name BIND /usr/sbin/named dns
web APACHE /usr/sbin/httpd http
MS sharing SAMBA /usr/sbin/smbd smb
address DHCP /usr/sbin/dhcpd dhcp
socket demo CHOMPER /opt/socketdemo/byteme none
letter upgrade letter upgrade server3 none, really

BIND, APACHE, SAMBA, DHCP are the big boys, while
CHOMPER (upcoming in-class exercise) and letter upgrader are little boys.
But they are all boys equivalently.
(11/4)

Homework: an extended assignment - read Hedrick
We are at the middle of our network stack tour. The overview of it is presented in Charles Hedrick's "Introduction to the Internet Protocols" which you printed out. Now, read it. Much of what it covers, we have covered in class already (the lower level part); the remainder, we are poised to cover now (the upper level part). Our coverage of the remainder of his essay will spread over the next three or four weeks. Please spread a complete reading of the document over the same time period. Read it at your pace. You're responsible for having read it. (10/27)

Homework -
read - the write-up about socket programming at the link entitled "Sockets: socket programming" below left.
read - textbook's chapter 3 about internet applications, sections 3.13-3.23. (You already read up through section 3.12. Review those sections again.)
read - textbook's chapter 25 about UDP.
read - textbook's Appendix 1 "A Simplified Application Programming Interface" up to page 570. This is an API by the author that masks/abstracts/simplifies the socket API (but relies on it underlying). Read the appendix through the discussion of the echo server (which was demonstrated in class on the first day). Scan the remainder of the Appendix, to observe the other kinds of servers (chat, web) offered as additional examples.
study - the code for the "world's simplest client-server pair" at the links entitled "letter-upgrader server" and "letter-upgrader client," left. They exemplify the structure of client and server programs through their use of the socket API. For contrast with them, take a quick look at the other two pairs (upper-echoback and web/file-send) which are a little more complicated but also reflect the standard socket programming structure. Satisfy yourself that you can identify the structure within those other two pairs.
do - if you have a linux machine download, compile, and run client4.c against an internet server. You get client4.c via anonymous ftp from sputnik. It resides in the pub directory. The counterpart server is running at 66.159.240.70 (dmorgan.us) on port 819. Client4 and server4 are identical to client3 and server3, shown in class, with the refinement that you specify IP address and port number values dynamically on the command line, instead of having to hard-edit them into the source and recompile it. Compile and run the client:

gcc client4.c -o client4
./client4

(when its error message demands parameters on the command line, supply them). It sends an R to the server, so should get an S back and say so on screen. Edit it, changing the R to some other letter. Compile, run, and verify that the letter that comes back is the next one in the alphabet. (10/27)

Slides we're viewing -
  "Networks: services"
  "Networks: sockets"
  "udp protocol"
  "miscellaneous but essential"
  "Access technologies (Ch12)" - DSL, cable, etc. never got to it, but may. (10/27)

Test - Tuesday November 3. Please bring a scantron form 882. (10/27)

Grades - updated, at link entitled "Grade information," at left. Please check your grades and call any anomalies to my attention. (10/27)

Crossover cable wiring - this shows the wiring pinouts for a crossover cable versus a straight-through cable. Without analyzing the connections fully, you can tell whether a cable is straight-thru or not by holding its two connectors next to each other in the same orientation and checking whether the wire connections (positions by insulation color) are identical in both. If not, it isn't a straight-thru patch cable. (10/20)

Future Homework - but current topic
do - assignment 7.7 (about Sally & Harry) due 10/27  (10/14)

Homework -
do - assignment 7 due 10/20
do - assignment 7.5 due 10/20
read - textbook chapters
  20 Internetworking Concepts
  22 Datagram Forwarding
read - information at links in left column
 "Network calculators"
 "Real world DSL"
 "Subnet mask chart"
 "commercial routers"
log in - to the management interface of my NetGear WGR-614 router. The "commercial router" link above tells you how. You're invited to do so and take a look around. I suggest you don't change anything but make it a read-only visit.
reread -
the page at the link entitled "Masks, routing, subnets," at left. You should understand it better this time.
anticipate - the in-class assignment at the assignment link entitled "internetworking." Print out 2 copies the 2-page worksheet found there.  Consider how you would fill it out. Make up some addresses and fill out the first copy, for practice and familiarization. Bring the second one to class blank next week. We will collectively perform the exercise.
  (10/14)

Slides we're viewing
  "IP packet delivery" under "Information" heading
  "ping"
  "traceroute"
  "internetworks" (10/13)

Golden rules for deciding how to ship a packet (Fore Systems "IP packet delivery"):

We reviewed the concept behind the "IP packet delivery": if IP thinks a destination IP address is local it arps for that IP address, if not it arps for the IP address of its default router (which comes from the routing table). Everything hinges on what "local" means. That is a function of the given destination address, the local address, and the local netmask. Network calculators and/or the linux "ipcalc" command can help you recreate IP's "thinking process" in this regard for particular subnets, addresses, and netmasks.

A related description of the thinking process comes from our textbook, Computer Networks and Internets, Douglas Comer. (10/13)

Grades - published at link entitled "Grade information," at left. Please check your grades and call any anomalies to my attention. (10/13)

Important: special provisions for October 6 - I will be absent. Please attend class virtually. Listen to the lecture, do the in-class activity, and in the ensuing week do the homework. See you October 13. (9/29)

Homework -
do - assignment at the link entitled "ethernet frames" in the column at right. It complements the wireshark homework you have done. Submit your answers to the questions following these preparation and submittal instructions (you will use ftp to deposit your answer file in your "assignments" subdirectory on sputnik; create it if it isn't already there; here's how.). Please name your file "frames.txt". I will grade these using an automated script, so the format of the answer is critical to intelligibility, as is the case (lower) of the filename. - due on sputnik.smc.edu by end-of-day Tuesday October 6
read - textbook chapters
  21 IP: Internet Addressing
  23 Support Protocols and Technologies (portion about ARP through 23.7)
read - "Introduction to the Internet Protocols" (you printed it out) sections 1 and 2
read - some supporting reading about arp.
note - section in left column under heading entitled "Protocols." These link primarily to the protocols' rfc's. rfc stands for Request for Comnment. A protocol's rfc is its defining functional definition in the form of a historical document that was written as an engineering blueprint before the protocol was implemented. Implementations then arose from programmer efforts following the blueprint as a guide. rfc's therefore contain the big picture rationale for their protocols. Sometimes they are too detailed for our purposes, but sometimes they are illuminating. Look over the ARP rfc. (9/29)

Slides we're viewing
 "Interfaces and routes"
 "ARP address resolution"
  "IP network addresses"
  "IP packet delivery" under "Information" heading
  "ping"
  "traceroute" (9/29)

Routing - important formulations of the "route" command
Three kinds of routes can appear in a routing table: host route for a specified individual machine, network route for a specified grouping of them, default route as catch-all for everything (unspecified) else. Here are the four key linux command formulations by which you add such routes to a routing table. Though there are 3 kinds of routes, note that 4 command formulations appear. We mentioned the concept of gateways (machines other than the destination, to which you would send the destination's packets for forwarding).  That accounts for there being 2 network route formulations below. One is for the case where the routed-to network is the one you yourself are plugged into, the other for the case where that network is "foreign" or "elsewhere" to you.

Add route to a machine (host route):
  route add –host 192.168.4.2 eth0 
Add route to a group of machines (network route - local) 
  route add –net 192.168.4.0 netmask 255.255.255.0 eth0 
Add route to a group of machines (network route - gatewayed) 
  route add –net 192.168.5.0 netmask 255.255.255.0 gw 192.168.4.1 
Add route to “any and all” (default route) 
  route add default gw 192.168.4.1

Study these commands intently and try to internalize the semantic meaning they embody. (9/29)

Network size for common netmasks:

Netmask: # of zero bits: Implied network size:
255.255.255.128 7 128 (126)
255.255.255.192 6 64 (62)
255.255.255.224 5 32 (30)
255.255.255.240 4 16 (14)
255.255.255.248 3 8 (6)
255.255.255.252 2 4 (2)

(9/23)

Errors corrected - in the hex arithmetic on the 20th and 21st slides of last night's presentation (at the link below-left entitled "Error detection"). (9/23)

Info about number systems - binary, hex, decimal etc. See the links on the class webpage for my other class, CS40, in the left hand column under the heading "Number bases." (9/22)

Homework -
do - assignment at the link entitled "error detection" in the column at right. Submit your answers to the questions following these preparation and submittal instructions (you will use ftp to deposit your answer file in your "assignments" subdirectory on sputnik; create it if it isn't already there; here's how.). Please name your file "error.txt". I will grade these using an automated script, so the format of the answer is critical to intelligibility, as is the case (lower) of the filename. - due on sputnik.smc.edu by end-of-day Tuesday September 29
read - the page at the link entitled "Masks, routing, subnets," at left.
read - textbook chapters
  8 Reliability and Channel Coding
  23 Access and Interconnection Technologies
( those sections of each chapter indicated in the chapter list)

anticipate - the in-class assignment at the link entitled "ifconfig/route"
preview - the document (pdf) at the link entitled "IP packet delivery" and the slide presentation entitled "IP addresses." (9/22)

Slides we're viewing
 "Interfaces and routes"
 "ARP address resolution"
 "Error detection" (9/22)

Accounts created - on sputnik.smc.edu as described below (9/16)

Homework -
read - page at link entitled "Using ftp" in column at left.
do - assignment at the link entitled "using ftp" in the column at right.
install - Wireshark on a computer that you use, from http://www.wireshark.org/.
do - assignment at the link entitled "wireshark" in the column at right. This exercise is designed to be done on a Windows machine (yours). It has 9 sections; please do the first 8. At the end are 13 questions. Please answer only questions 1, 3, and 13. Put the answers to those three questions in a file of either Microsoft Word (.doc) or Adobe Acrobat Reader (.pdf) format. Name the file either snifflab-<your last name>.doc or snifflab-<your last name>.pdf accordingly. No other format. So if your name is smith your file's name is snifflab-smith.doc. Note that question 13 requires you to capture a screenshot (PrintScrn key can copy the screen image to Windows' clipboard). Embed it in your snifflab file. Submit your file to me via anonymous ftp to dmorgan.us. There, alongside the familiar pub directory, you'll see one called "incoming". Upload your submittal files into that directory. It is "one-way" (upload only, no download) and "blind" (you can't open it to see what it contains. - due on dmorgan.us by end-of-day Monday September 21
read - textbook chapters
  8 Reliability and Channel Coding (about error detection)
  23 Support Protocols and Technologies (about arp protocol)
read those sections of each chapter indicated in the chapter list (9/15)

Slides we're viewing
 "Ethernet, a protocol example"
 "tcpdump"
 "Interfaces and routes"
 "ARP address resolution" (9/15)

Remote Unix system - 
Your username - your last name as it appears on my class list, all lowercase (e.g., obama). Duplicate last names are resolved by appending as many letters of the first names as needed to "break the tie." So if your lowercase last name doesn't work, add your first initial to it (e.g., obamab). Students enrolled in both CS70 and CS41 get 2 accounts, one is the last name with "70" appended, the other the last name with "41" appended (e.g., obama70 and obama41). Remember, all letters in lower case.
Your password - is 5 digits extracted from your phone number. If your phone number is 123-456-9876, then your password will be 56987 (final 2 digits from the 3-digit exchange, plus first 3 digits of the 4-digit number).
The target computer - is sputnik.smc.edu
Log in method - the assignment asks you to "log in." Translation: use telnet as discussed in class and described in the "Remote Unix access with Telnet" link at left. (9/15)

"Number please?" asks the switchboard operator. The switchboard is a board. It's for switching. Switching changes a circuit between you somebody. It can complete a circuit to your Aunt Bheulah in Iowa City so you can thank her for the knit socks. After you hang up if you want to call your uncle in Waco you'll need to switch circuits, to get a circuit to him instead of her. That's what the operator does for you. The "switch"ing in "switch"board is circuit switching. Now in computer networks it's not circuit switching anymore, it's packet switching.

 

Slides we're viewing
 "Ethernet, a protocol example"
 "Transmission media (Ch7)"
 "Signals (Ch6)"
 "Protocol layering & suites" (9/8)

Homework - 
read - textbook chapters
  5 Overview of Data Communications
  6 Information Sources and Signals
  7 Transmission Media
 13 Local Area Networks: Packets, Frames, and Topologies
 15 Wired LAN Technology (Ethernet and 802.3)
read those sections of each chapter indicated in the chapter list (see above section) (9/8)

Slides available online - for most if not all slides I will show in class. Tonight's slides are the ones at links entitled "Protocol layering & suites" and "Signals." Those links are toward the bottom of the column at left. (9/1) 

Course-long textbook reading - a chapter-by-chapter list. The textbook is divided into chapters and they in turn into numbered sections. The list tells you which sections to read for this course when chapters are assigned. For example if I assigned chapter 10 and it had 17 sections, if this list specifies "10.1-100.5, 10.7, 10.12-17" it means I didn't feel sections 10.6 nor 10.8-11 were relevant enough so I only list the balance of the chapter. Read unlisted portions for your own interest if you wish, but the listed sections are what's officially assigned to you. (9/1)

Textbook - Computer Networks and Internets, fifth edition, Douglas Comer, Pearson Prentice Hall , 2009. It appears to be offered in an online form (not familiar to me before today). (9/1)

Homework - 
read - textbook
 - chapter 1
 - chapter 2
 - chapter 3, 3.1-3.12 only
 - Appendix 1 up to p 570 only.
I will demonstrate the "echo" client and server programs featured in Appendix 1.
print out - the document at the link entitled "TCP/IP Pocket Reference Guide"
print out - the document at the link entitled "TCP/IP - Intro to the IP Protocols"
  the links are all in the column at left; bring both printouts to the next class.
install - Wireshark (below) on your computer if you have one. Run it.
print out - a screenshot of Wireshark's main interface after it's running.
bring to class next week - the above 3 printed items.
(9/1)

Listed homework assignments at right - will not necessarily all be assigned. So don't go off and try to do them all on that erroneous assumption. They will be assigned selectively and explicitly. (9/1)

TCP/IP and tcpdump Pocket Reference Guide - from SANS Institute. Please print it out 2-sided, fold it in 3 panels triptych style, and carry it with your materials for this class. The link to it is at left; it is an Adobe Acrobat .pdf file. (9/1)

"Live linux" CDs - here's a list of various self-contained bootable linux CDs. They typically convert memory into a RAM-disk, populate it with foundation files for the operating system, and proceed to boot linux. They do not molest your hard disk. The best known is probably knoppix (remarkable). FYI. (9/1)

Wireshark - is an excellent free packet capture utility. What is a packet, and why caputre it? We'll talk about that later. I will ask you to install and use Wireshark later in the semester, assuming you have a linux or windows computer available on which to do so. Please visit http://www.wireshark.org/. (9/1)

 

 

Eniac - 1946

Milestone in the history of computation

 

Assignments/due

Assgt. 1 telnet 

Assgt 1.5 review 

Assgt. 2 reading 

Assgt 2.5 review 

Assgt. 3 cmds 

Assgt 4  mansion 

Assgt 5 route

Assgt 6 gateway 

Assgt 7  masks 

Assigt 7.5 subnets 

Assgt 7.7 IP trans

Assgt 8  firewall

Assgt 9  false telnet

Assgt 10 gibson

Assgt 11 sessions

using ftp

ethernet frames

meet knoppix (in-class)

MAC addresses

wireshark

error detection

tcpdump/wireshark (in-class)

ifconfig/route (in-class)

internetworking
(in-class)

xinetd (in-class)

capture arp/ping session (in-class)

capture browse session (in-class)

firewall constrction
 - native iptables
- via webmin tool

nmap scanner
(in-class)

dns name server
(in-class)

apache web server
(in-class)

stunnel
(in-class)