Computer Networks, CS 514

Homework 1, 2013 September 10


This homework assignment has six questions; answer all of them. This assignment is due no later than 6:20 p.m. on Tuesday, September 24.

Your homework may turned-in on paper or via rclayton@monmouth.edu by email. If you mail your assignment, please submit a printable document — a PostScript .ps or PDF .pdf document, for example — and not a source document — a Word .docx or Latex .tex document, for example. Make sure you mail a printable document by the deadline.


  1. You are a network manager for a large LAN, and your objective is to reduce external Internet web traffic. Your LAN already uses a single large web cache, and your two possible actions are to increase the size of the existing cache or replace it with a cache cluster. Describe the circumstances under which it would be appropriate to take each action (that is, describe the circumstances under which it would be better to increase existing cache size, and the circumstances under which it would be better to replace the existing cache with a cache cluster).

    Answering this question requires making assumptions, and good answers will describe the assumptions used in the answer.


    If the cache hit-rate is high (> 90%), than adding more cache probably won't be cost effective; the improvement will be small (because HTTP requests have a long tail) and the cost will be large (relative to the benefits). If the cache hit rate is low (< 80%) adding more cache may help capture some external Internet traffic not already resident in the cache.

    Either a larger single cache or using a cache cluster increases the cache size. If a single cache has a high service time (a queue of waiting requests), distributing the load over a cache cluster will reduce the service time, which may justify the higher cost of a cache cluster over just adding more storage to a single cache.

  2. HTTP request messages are too big. Describe two techniques you would apply to the HTTP protocol to reduce the request message size. A new, smaller HTTP request messages should have the same functions as the original, full-size message (which means you can't throw out features to make the request smaller). Give a rough estimate of the size reduction produced by your techniques.

    Message size is measured in eight-bit bytes; don't bother with HTTP reply messages.


    One possible technique replaces ASCII-based HTTP message headers (and perhaps some portions of the body) with binary message headers. Each header field label would be a one- or two-byte value instead of an arbitrary-length text string. A ten-character header-field label would be replaced by a two-byte (let us suppose) value, for a 80% space savings; longer labels would save more space. No standards-compliant labels have less than three characters, so there always would be some savings.

    Binary headers don't change the data. Full message compression would reduce both the message overhead and the data in the message. HTTP currently uses compression, but it's optional if one or the other side doesn't or can't use it. Making compression mandatory would provide consistent benefit, but at possibly great cost to power- or CPU-limited devices. General purpose compression could result on 30 to 60% size reductions depending on data; special-purpose compression could have greater reductions.

  3. You have modified an HTTP server to implement within the server all the services usually implemented outside the server by CGI. Is it more appropriate to implement access to the new internal services using WSDL-SOAP or REST? Justify your answer.


    REST seems the better choice to replace CGI services.

    A CGI program is invoked via a URL: the name of the CGI program and its arguments are encoded as part of the URL. In this way CGI is much like REST, in which the name of the function and function parameter are also encoded in a URL requesting. In contrast, WSDL-SOAP packs away function and parameter information in a SOAP message which is further packed away inside an HTTP request.

    If a service involves sizable parameters, such as photos in an upload service, the large parameters can't be encoded in the URL and have to be included as part of the HTTP request. In this sense CGI is like WSDL-SOAP. However, CGI handles large parameters via POST requests, and REST can do the same. Further, REST can use the same encoding used by CGI, while WSDL-SOAP will most likely resort to an XML-based encoding.
  4. A colleague of yours thinks that DNS works by having each DNS server forward a query it can't answer to its parent until the query lands at a server that can answer it. Describe how your colleague's version of DNS differs from the way DNS actually works. Given DNSC, a DNS system that works as your colleague described it, and DNSA, an actual DNS system, which is better: DNSC or DNSA? Justify your answer.


    My colleague has DNS doing too much work going up the server hierarchy. My colleague's DNS sends requests hop-by-hop up the hierarchy to reach root servers. Actual DNS sends the query directly to a root server, skipping over intermediate servers, if the local resolver can't satisfy a query.

    From the point of view of caching, DNSC might be better than DNSA because a query can get a cache hit on the way up (that is, sooner) rather than on the way down the hierarchy. On the other hand, queries not satisfied out of a cache would reach an authoritative server faster (with fewer hops) in DNSA, and DNSA servers do not have to maintain parent pointers, which leads to a looser, more resilient hierarchy.

  5. Messages sent by the DNS protocol go up and down the DNS network, while messages sent by the SMTP protocol go directly from sender to receiver (ignoring mail drops and local delivery). Explain why it is that SMTP sends messages directly but DNS sends messages up and down its hierarchy.


    SMTP can send messages directly between sender and receiver because it uses DNS to resolve the receiver's IP address; that is, it relies on the work done by DNS to simplify setting-up sender-receiver communication. DNS, on the other hand, 1) can't rely on a lower-level service to resolve IP address, and 2) has to resolve any Internet address (let's assume), and requires a hierarchy to make such a task scalable.

  6. Give an example of the kind of problem a handshaking protocol is designed to avoid.


    A protocol uses handshaking to solve problems in exchanging and verifying information between the two end-points in communication. For example, the SSH protocol handshakes over end-point authentication, exchanging public keys (sometimes) and challenge texts to establish identity. More obviously, TCP handshakes during connection set-up to ensure both end-points know of and agree on the sequence numbers used in each direction.


This page last modified on 2013 September 10.