LMU ☀️ CMSI 355
COMPUTER NETWORKS
Practice
  1. Research the following commands (these are Unix commands, but most have Windows equivalents): ping, traceroute, route, dig, nslookup, host, arp, rarp, netstat, ifconfig and lsof. Experiment with each but don’t hose your system playing around. Show output for one (non-trivial) sample run each of ping, traceroute, and netstat, annotating your output with a description of "what it all means."
  2. Write simple (one-line, if possible) scripts in Bash, JavaScript, Python, Ruby, and Perl script to display the IP address and hostname of the machine it is running on. If you have never written scripts in some of those languages before, now’s your chance to learn a new language!
  3. What are the ethernet addresses of www.utu.fi and p1-0.paix-bi1.bbnplanet.net?
  4. What do switches do with Ethernet frames that have all binary 1’s in the six frames following the preamble?
  5. How many hosts can be connected to the (sub)network 153.26.11.64/30? What range of IP addresses are they?
  6. What would an IP router do with an IP packet with destination address 249.16.22.88?
  7. Skim RFC 821 (SMTP), 959 (FTP) and 2616 (HTTP 1.1), and read RFC 959 (POP). Then write a five page summary on some of the technical aspects of each of these protocols.
  8. Write a Java, JavaScript, or Python client program for reading mail from a POP3 server. You only have to support logging in, status inquiries, and message retrieval; there is no need to implement delete.
  9. Verify that you can read mail from a POP3 server by telnetting to port 110, that you can see a web page contents by telnetting to port 80. Try listing directory contents and retrieving a file by telnetting to port 21. Explain what happened.
  10. Write a web server in Java, JavaScript, or Python that just responds to all requests with “Hello”. You can have it run on some port other than 80 if you like. Write it as a traditional socket based program. Don’t go overboard on this problem. All you have to do is read GET requests, ignore request parameters, and send back error responses for most requests. Do send back at least HTML page for /. Send back the page by writing the file out through the socket to the client.
  11. Write a socket-based program in the language of your choice for generating a table comparing two investments for a given initial balance, (fixed) rate of return, (fixed) tax rate, and length of time in years. The table should put the end-of-year values for a tax-deferred investment and taxable investment side by side. For example if you started with 1 dollar and your investments made 100% per year at a 33% tax rate, you’d produce:

    YearTax DeferredTaxed @ 33%
    0$1.00$1.00
    1$2.00$1.67
    2$4.00$2.79
    3$8.00$4.66
    .........
    20$1,048,576.00$28,466.20

    Sanity check: over a 20 year period, with a 12% return and 35% tax rate, you’d have $4.49 in the taxable account and $9.65 in the tax-deferred account).

  12. What is the maximum size of the data portion of an IP datagram?
  13. If you have a bunch of routers that can each connect a maximum of K networks, then how many routers (call this number R) are required to connect N networks? Write an equation for R in terms of N and K.
  14. How many bits per second can pass through a hub connecting 10 computers if the hub supposedly has a data rate of 10Mbps? How many bits per second can pass through a switch connecting 10 computers if the hub supposedly has a data rate of 10Mbps?
  15. In the old days when the host and network parts of an IP address was determined solely by the IP address itself (you know, when all hosts were part of Class A, B and C addresses) how many:
    1. Class A networks were allowed?
    2. Hosts per class A network were allowed?
    3. Class B networks were allowed?
    4. Hosts per class B network were allowed?
    5. Class C networks were allowed?
    6. Hosts per class C network were allowed?
    Note: don’t forget that some networks are reserved, and some hosts are reserved.
  16. Draw a picture of two networks with three hosts each connected by a IP router. One network uses 26 bits for the network part and the other uses 18. Label each host, router, and network with sample IP addresses. Make sure the addresses are consistent. Use slashes. Give a routing table for one host.
  17. Suppose you have a server and it gets 10 requests, each five seconds apart. Serving each client takes 10 seconds.
    1. Assuming the server is NOT threaded, how long does it take for the first reply to get sent back? The last reply? What is the average service time per client?
    2. Assuming the server is threaded (and the overhead of threading is insignificant), how long does it take for the first reply to get sent back? The last reply? What is the average service time per client?
  18. Does limiting the number of levels in a DNS hierarchy result in faster name resolution? That is if your organization restricts all names to three segments each instead of allowing ten segments will name resolution be faster? Why or why not?
  19. Write a generic threaded Java server. You instantiate it with a port to listen on. It listens and spawns a thread when a connection comes in. You’ll need some kind of interface or abstract class to allow the spawned thread to be generic enough. The only requirement is that the helper thread be passed the socket returned from the accept call.
  20. Do routers on the public Internet require TCP software? Why or why not?
  21. Give the network numbers and host numbers for each of the following
    1. 143.26.95.33/21
    2. 14.216.195.3/10
    3. 13.26.95.133/29
  22. Explain why the subnet mask 255.255.255.254 is practically useless, or at least, why would you feel bad if your boss assigned you and your workstation to a subnet with that mask.
  23. An IP packet addressed to 188.24.55.12 arrives to its destination network 188.24.55.0/24. It is received by the router, whose IP address is 188.24.55.1 and Ethernet address is E3:22:11:90:CB:14. The actual destination machine has Ethernet address 03:22:C4:AA:AA:27. Draw the ARP packet sent out by the router and the ARP packet sent back by the destination machine.
  24. Explain how a thread waiting on a socket gets unblocked by the operating system. Start your explanation with "An IP datagram containing a TCP segment arrives at the host."
  25. What congestion-control and delivery-order strategies are used in UDP?
  26. Network address translation requires computational overhead above and beyond simply rewriting IP address and Port number bits in packet headers. Name one required "computation."
  27. Suppose you want to promote a web site and you send out some (spam) emails with a URI pointing to your site. What is a cheap way to track which of the receipients actually visited your site by clicking on the link in the mail? (That is, you need to create a database or textfile with all the email addresses of people that visited your site because they read your email message.)
  28. Post a question to a USENET newsgroup. Access the USENET via Google Groups. Send me a hyperlink to the Google page with your question. Make sure the question is relatively sophisticated, articulated in perfect English, and answered by a total stranger.
  29. Run a traceroute to some host in Finland and record the trace. Which countries did your packets go through? Run another traceroute the following day and see if the trace is any different.
  30. Give one host each (full host name and IP address) from each of the following top-level domains: edu, int, com, gov, net, org, mil, arpa, as, za, il, es, cf, zw, and hu.
  31. It has been said that the number of Internet users doubles every year. How long can this process go on, assuming the earth’s population is six billion?
  32. Find the biggest cookie on your system and describe each part of it.
  33. Explain how to make a site whose hyperlinks seem to "disappear" after they have been clicked on.
  34. Explain the difference between
    a img {
      border-style: none;
      color: white;
    }

    and

    a,img {
      border-style: none;
      color: white;
    }
  35. What is wrong with this piece of JavaScript?
    function makeRedBackground() {
      x.style.background-color="#ff0000";
    }
    

    How do you fix it?