|
|
HomeworksYou should EMAIL me homeworks, alex at theparticle dot com. Start email subject with "CISC 7332X 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: List clients; 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. [hw 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: Read Publish subscribe pattern wiki. Refactor (modify) your HW4 (chat server) to implement this pattern. The clients, upon connecting, will subscribe to the message bus. New messages are put on the bus. Implement a logging utility (to save all messages to a file), by having the logger subscribe to the message bus. Note that in this homework, you're implementing your own message bus, your own subscribe and publish logic, and your own message object. It's all just software you're writing. Submit the new code, etc. HW# 8: 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. HW# 9: Re-implement HW#5 using ``Raw Sockets'' (also in C programming language, if possible). Specifically, this means that you will pass SOCK_RAW to `socket' function, instead of the SOCK_DGRAM as in HW5. Google for ``raw sockets programming tutorial'' and you'll find some help in doing this. The gist is that you'll be constructing the whole packet yourself (including the IP header, etc.), sending it, and recieving it. The resulting program should work -exactly- like HW5. Note to Windows users... depending on what version of Windows, or what service packs you have, this program may not work (using Windows socket API). I highly recommend you do this homework in a unix environment (ie: Linux). Again, Google is your friend. If not sure how to do something, email me. Submit source code, along with instruction show to compile/run it. HW# 10: Write a 2-page (single spaced) description/design of how you think a P2P service should work. You're allowed to describe an existing model, or come up with your own. Make sure you take care of multiple users and searching in your idea. You can emphasize different aspecs, like security, efficiency, robustness, etc. The description should be detailed enough to implement the model (don't leave any major open holes in the idea). Submit the description in TXT (or PDF) format. e.g. think BitTorrent, how would you make it better/different?
|