CS413: Final Exam

Take your time and read each question carefully. Some have multiple parts. Be sure to answer each part. Use more pages if necessary. Be sure to put your name on each exam page.

1.Fill in the blanks:

  1. Most of the tasks in a computer are __________________ bound.
  2. Predicted SJF uses __________________ to estimate the length of the next processing burst.
  3. _____________________ is a condition that happens when a process waits for something that may never happen.
2. Assume that two or more processes communicate with each other using enqueue() and dequeue() (described below) on a circular queue. Complete these procedures using semaphores. Make sure that a processes calling enqueue() will block if the queue is full, and a process calling dequeue() will block if the queue is empty. Also make sure that no races can happen. Don't forget the semaphore initializations.
      const int MAXQUEUE = 10;
      int queue[ MAXQUEUE ];
      int tail;
      int head;

      /* Other declarations and initializations here */




      void enqueue( int a )
      {



          queue[ tail] = a;
          tail = (tail + 1)%MAXQUEUE;



      }

      int dequeue()
      {



          tmp = queue[ head ];
          head = (head + 1)% MAXQUEUE;



      } 
      
3. Complete the following broadcast() procedures. sendBroadcast() sends a message to N processes that will call receiveBroadcast(). sendBroadcast() and receiveBroadcast() will block until the message has been delivered to the N processes. Don't forget to initialize the semaphores.
      const int N = 5;
      int theMessage;

      /* Other declarations and initializations here */





      void sendBroadcast( int msg )
      {
	


	
          theMessage = msg;




      }


      int receiveBroadcast()
      {




          int tmp = theMessage;





          return tmp;
      }
      
4. Write what the following acronyms stand for and give a brief description (about 4 lines each) of what they mean.
  1. TCP
  2. IP
  3. UDP
  4. FTP
  5. ARP
  6. LAN
  7. HTTP
  8. SMTP
  9. WWW
  10. HTML
  11. DNS
  12. ATM
  13. CSMA/CD

5. Number the seven layers in the ISO reference model. Give a brief description (4 lines) of what each of them represent. Also for each layer give an example of a program, protocol, or feature that falls in that layer.

6. Assume the following IP address:

IP Address: 128.211.1.30
SubnetMask: 255.255.255.0
7. Explain how the mapping from IP addresses to Ethernet addresses is done (about 10 lines).

8. What are the differences between UDP and TCP? Explain some of the uses of UDP (about 10 lines).

9. How large should be the retransmision timer of TCP? What are the consequences of making this timer too short or too large? How TCP estimes this timer? (about 20 lines)