You should EMAIL me homeworks, alex at theparticle dot com. Start email subject with "CISC 7330X HW# "
HW# 1 (due by 2nd class;): Email me your name, prefered email address, IM account (if any), major, and year.
HW# 2 (due by 3rd class): Write an Internet page grabber program. Your program should work similarly to UNIX program ``wget'' (or ``curl'')... only much simpler. Read the description of `wget' online. You specify a URL at command line, and your program connects and downloads a web-page. Tip: Internet search engine is your friend. Submit the program source code. [hw2 hint (feel free to use any programming language; highly recommend Java). Another hint: if you're doing this on Ubuntu, and can't find documentation for functions via "man" command, run this: apt-get install manpages-dev, which will install the linux programmer's manual pages; you'll be able to do: man gethostbyname to get documentation for the function, etc.].
HW# 3: In any language of your choice, implement a simple web-server. Your web-server should serve pages from some folder. You should be able to point your web-browser at the URL of your web-server, and see pages (and images) in that folder. This is not much different than writing a web-client. I recommend you use Java, since it's pretty easy to setup a basic server in that language---although you're free to use any language.
HW# 4: In this homework, you'll implement a simple Chat Server. Your server will start listening for connections. When a connection arrives, it will create a new thread to handle that connection (maintain a list of connections). When a string (line of text, your sockets are reading lines of text) arrives on any connection, the server will forward that string to all other connections. Pseudo code might look something like this:
The code isn't much longer than the pseudo code, but I'd like you all to figure it out on your own. Now, when you run the server, you should be able to telnet into that server. If more than one person telnets into that server, then everything one person types will be seen by everyone else. You can test it by running multiple Telnet instances (in different terminals), and seeing whether everything you type in one window appears in the other window. (you can google on how to install telnet client for your operating system).
If you're feeling creative, think of how you'd handle user names and nicknames in such a system. How would one person find out who is connected? How would they find out information about other users?
Submit just the source code via email.
HW# 5 (due by N+1 class;): In any programming language of your choice (C prefered), write an NTP client. NTP is Network Time Protocol. Your program sends a UDP packet to the server. The server responds with a similarly formatted UDP packet with the current time. A public ntp server is: pool.ntp.org. This homework is part research part programming. Research part: Find the NTP specification, and determine what the UDP packet format is (google, etc.). Programming Part: Write a program to send the packet and recieve a response. When your program is executed, it will output the current time (recieved from NTP server) to standard output, in ``Wed Sep 24 07:29:23 EDT 2008'' format, (Note that since you're using UDP, not all packets will get through---so you might need to run the program a few times in order to get the correct time). You can lookup the format for the to/from message in ``NTP RFC'' (google for it)---the format is pretty simple. Your program should work similar to the unix utility ``ntptime''. Note that you should not use any "NTP" libraries---this homework is about creating your own UDP packet and sending it via the regular socket API. [hw4 hint].
HW# 6 (due by N+1 class;): In any language, build a DNS client. This is similar to HW5 (feel free to reuse the code from hw5). Accept hostname as command line argument. Construct a UDP packet with hostname, and send it to a DNS server. Recieve a UDP packet as response, and display the IP address on standard output. Note, your program must not use any DNS libraries (such as `gethostbyname' functions, etc.). ie: In this homework, you are writing your own DNS library.
HW# 7: Part1: This is half a page (few paragraphs) thinking-and-writing part. In many situations, you need to transmit a sequence of packets across the network. You generally cannot do much about big connection problems (lots of packets getting lost). But for situations when only a few packets are lost, perhaps there's a way to use error correction codes to `correct' the lost packet (without retransmission). Design a system and write up this design in a few paragraphs. You need to explain what correction scheme you will use, what will the sender be responsible for, how will the client know that packet is missing, and exactly how it will reconstruct the missing packet.