CS 105 Final Examination Solutions Set -- Fall 1997

  1. Indicate whether each of the following statements is true or false:

    1. The Caesar Cipher is an example of a secure secret key encryption technique appropriate for use on the Internet.
      False

    2. Frequency division multiplexing can be used with either analog or digital data.
      True

    3. Public key encryption allows different people to use the same encryption key when they are not supposed to know the contents of the messages others are sending.
      True

    4. Visible light and electromagnetic waves are basically the same thing.
      True

    5. Modern program development techniques have eliminated flaws like the buffer overrun problem in the finger server that was exploited in 1987 by the Internet worm.
      False

    6. Two pairs of computers can communicate simultaneously on a token ring as long as the sections of cable that connect the members of each pair do not overlap with the sections connecting the other pair
      False

    7. Messages sent using the IP protocol may be delivered in a different order than the order in which they were sent.
      True

    8. All messages transmitted through the Internet are encrypted to ensure privacy.
      False

  2. Encode the message "SECRET" using the Vigenere cipher with the key "BE".
    UJEWGY

  3. Each packet transmitted through a network follows a format that partitions the binary digits in the message into distinct units. As we have seen, depending on the protocols used, these units may include such things as the:

    1. ethernet destination address

    2. ethernet source address

    3. packet length

    4. IP destination address

    5. IP source address

    6. TCP port number

    7. Error detecting code

    1. When an internet router examines a packet to decide how to forward the packet to its intended recipient, which of the fields listed above might it examine? (Just list the appropriate letters.)

      • IP destination address

      • Error detecting code

    2. When an Internet firewall examines a packet to decide whether to forward it to its intended recipient, which of the fields listed above might it examine?

      • IP source and destination address

      • TCP port number

      • Error detecting code

      • packet length

  4. Each of the following samples of HTML are a) derived from pages created by members of this class, and b) examples of either incorrect or inapproriate use of HTML.

    For each example, please briefly explain the problems with the HTML shown and indicate how to modify the HTML to make it correct while producing what the author appeared to have in mind. You can either clearly mark up the code shown or write a complete revision in the space provided.

    For the examples using "form" tags, you should assume that the fragment was extracted from a valid pair of opening and closing FORM tags.

    1. <H3 ALIGN=CENTER><FONT SIZE=+3><CENTER>
      1997-98
      </CENTER> 
      <BR> 
      <CENTER>
      SOME INTERESTING HEADER
      </FONT></CENTER>
      </H3>
      

      (The big problem here is that the block-level CENTER tag is illegal within any header tag (H3,etc.). One could also argue that the FONT tag should be deleted and the H3 turned into an H2 or H1.)

    2. <HR size=5>
      
      <TABLE align=left>
      <TD><IMG SRC="guesswhat.jpeg" ALIGN=LEFT WIDTH="288" HEIGHT="214"></TD>
      </TABLE>
      <P>
      i don't remember much...
      

      (The ALIGN=LEFT attribute of the table tag is supposed to make the table float to the margin with text wrapping around it. This is the only thing the TABLE seems to do and putting the ALIGN attribute within the IMG tag would have the same effect.)

    3. <UL>
      <table>
      <tr>
      <td></td>
      <td>
      <li><A HREF="someplace.html">HOME AWAY FROM HOME</A></li>
      <li><A HREF="someplaceelse.html">MY NEIGHBORHOOD</A></li>
      <li><A HREF="elsewhere.html">PARIS</A></li>
      </td>
      <td></td>
      </table>
      </UL>
      
      (At the least, you have to move the UL tags into the table cell to make this correct. The table doesn't have any function, however, so I would remove it too.)

    4. <p>
      Choose one of the following:
      <p align=center>
          <input type="radio" name=value="hereBefore" value=name="RadioButton">
          Done This</p>
      <p align="CENTER"> 
          <input type="radio" name=value="neverHere" value=name="RadioButton">
          Never Tried</p>
      

      (All members of a group of radio buttons should have the same name and different values.)

    5. <p>
      Indicate as many of the following that describe your experience:
      <UL>
      <LI>
          <input type="checkbox" name="Informative" value="CheckBox">
          Informative
      <LI>
          <input type="checkbox" name="educational" value="CheckBox">
          Educational
      <LI>
          <input type="checkbox" name="amusing" value="CheckBox">
          Amusing 
      </UL>
      
      (Check boxes don't use the value attribute.)

  5. My home telephone number is 413 458 9354 but when my phone bill arrives the phone company tells me that my account number is something like 413 458 9354 706. Given material covered in this class, why do you think the phone company doesn't just use the telephone number itself as my account number? What are the extra digits added for?
    Most likely the extra digits function somewhat like parity bits. They are part of an error detecting (and possibly even an error correcting code) that will enable the phone company to detect situation where someone incorrectly enters or records a customer's account number.

  6. A version of the code needed to set up everything for the color selection applet you created for Lab 7 this semester is shown below. As the assignment suggested, the code shown sets things up so that the scrollbars initially control the color of the background. Suppose you instead wanted the scrollbars to initially control the text color. Show all the changes that would need to be made to the code shown below to make the scrollbars initially control the text color. The changes you make should ensure that all the interface components (the scrollbars, choice and subcanvas) are displayed in a form consistent with this change.
     void begin() {
                
           red= new Slider(255 0,0,255,150);
           add(red);
           add(new Label("Red"));
           
           blue= new Slider(255 0,0,255,150);
           add(blue);
           add(new Label("Blue"));
           
           green= new Slider(255 0,0,255,150);
           add(green);
           add(new Label("Green"));
           
           item= new Choice();
           item.addItem("Background");
           item.addItem("Text");
           item.addItem("Text");
           item.addItem("Background");
           add(item);
           
           pad= new SubCanvas(this,200,100);
           add(pad);
           
           redbg=255;
           bluebg=255;
           greenbg=255;
    
           redtext=0;
           bluetext=0;
           greentext=0;
           
           textOrBg="Background";
           textOrBg="Text";
           
           showDisplay();
        }
    

  7. Explain two significant differences between IP and TCP.

  8. Many network protocols depend on other network protocols to deliver message for them. To accomplish this, the software responsible for implementing one protocol "stuffs" a message in that protocol's format into the data area of a message/packet of the format used by another protocol and then asks the software or hardware that implements the other protocol to deliver the message.

    For each of the following protocol pairs, indicate whether the first protocol is always/sometimes/never used to deliver messages by the second protocol by circling the appropriate choice. If cases where protocol A depends on protocol B and then in turn protocol B depends on protocol C, you should state that protocol A also depends on protocol C.

  9. If Alice want to send a signed message to Bob (not necessarily privately) she should:

    1. encrypt the message with Bob's public key.

    2. encrypt the message with her own public key.

    3. encrypt the message with Bob's private key.

    4. encrypt the message with her own private key.

  10. if Alice want to send a private, signed message to Bob she should:

    1. encrypt the message with her own private key.

    2. encrypt the message first with Bob's public key and then with her own private key.

    3. encrypt the message first with her private key and then with Bob's public key.

    4. enrypt the message first with her private key and then with her public key.

  11. Three unlabeled waveforms are shown below. One represents a carrier wave, one a digital signal to be transmitted and the last a modulated wave for transmission. Label each waveform appropriately.
    modulated wave
    carrier wave
    digital signal

  12. Three unlabeled waveforms are shown below. One represents a carrier wave, one an analog signal to be transmitted and the last a modulated wave for transmission. Label each waveform appropriately.
    analog signal
    modulated wave
    carrier wave

  13. Error correcting codes are used on CD's, but they are rarely used in network messages. Describe what is used instead and explain why.
    Rather than encoding messages in such a way that they can be corrected if they arrive in damaged condition, network protocols rely on encoding techniques that make it possible to recognize but not correct damaged packets together with mechanism for retransmitting such messages. There are two main reasons for this:

    1. retransmission mechanisms would be required anyway to deal with cases in which packets were not just damaged but actually completely lost.

    2. error correcting codes require the transmission of more bits that error detecting codes. Since errors occur relatively rarely it is more efficient to use the smaller error detecting encodings.

  14. Recall that the technique on which Ethernet is based is called CSMA/CD -- Carrier Sense Multiple Access with Collision Detection. The "CS" part (Carrier Sense) refers to the fact that each station listens to the network before it starts transmitting and waits if it hears a transmission in progress. The "CD" part (Collision Detection) refers to the fact that while a station is sending its own packet it listens to see if anyone else starts sending at the same time and stops its own transmission if it hears some other station's transmission mixed in with its own.

    Suppose defective ethernet hardware was installed on all the computers on an ethernet so that none of them did the "CS" part. Would this:

    1. Increase the average rate at which message could be delivered,

    2. Have no effect,

    3. Reduce the average rate at which message could be delivered, or

    4. Make it impossible for the network to deliver any messages.

    BRIEFLY, justify your answer.

    It would reduce the average rate at which messages could be delivered, but not make it totally impossible. The reduction in rate would be a direct result of the fact that collisions will last longer and therefore waste more potential transmission time. If the network load is low enough, however, each machine will eventually find a time when no other machine is trying to use the network. Therefore, communication is not impossible.

  15. One problem with using simple on-off keying to transmit digital data is that long sequences of repeated 0's or 1's produce a "flat" signal that gives the receiver no regular transitions that can be used to keep its timer synchronized with the sender.

    Suppose that to increase reliability, extra parity bits are added to data ultimately being transmitted using on-off keying.

    1. If odd parity is used and an extra parity bit is added after every seventh data bit (to form 8-bit units with odd parity), what is the longest sequence of repeated 0's or 1's that can actually be transmitted? Briefly explain your answer.
      Every sequence of 8 bits would have to contain at least 1 and at least one 0. So, the best you could do is get the ones (or zeroes) in two consecutive 8 bit segments as far from one another as possible as in:
      1000000 0 0000000 1

    2. Suppose that instead a parity bit is added after every eight bits (to form 9-bit units with odd parity), what is the longest sequence of repeated 0's or 1's that can actually be transmitted in this case?
      A string of 8 1's will be completed by adding 1 as a parity bit. You can many of these together to make a string of 1's of any length you like.