Section 06, 5/5/11
Section slides: PDF
The code from section, commented:
Awesome Link of the Day
IP over Avian Carriers. Network
protocols don't need to run over a traditional network. Some people in Norway implemented TCP/IP
via carrier pidgeon! Some more mundane examples include the data transfer between your computer and
your iPod over USB, or the messages sent for example between a debugger and the kernel of another
computer if you're debugging a new OS, via serial port.
Notable questions from section
- Will this program work for non-text files, like PDFs?
Yes! Give it a try with your favorite online PDF or image file.
- Will other parts of the HTML file be included when we retrieve it, like the CSS and
This is more of a question about webserver internals, but no. If a web browser requests a page,
the server will send it the HTML for just that page (which may include CSS and JS manually
inlined), and it's up to the browser to parse the file, and issue additional requests for any
CSS or JS files included via a
- How would you get files from another computer that wasn't running a webserver?
To get any data over the network, you need to be connecting to some computer that will accept
connections on some port, and speaks some known network protocol over that connection.
Otherwise, the other computer will just ignore any requests. Other examples are getting files
from an SSH server via
scp; connecting to an FTP server; or peer-to-peer
filesharing programs, which open ports and listen for requests from other peers!