Midterm Test Answers - Network Application Design | ECE 4564, Exams of Electrical and Electronics Engineering

Fall 2006 Midterm Material Type: Exam; Class: Network Application Design; Subject: Electrical & Computer Engineer; University: Virginia Polytechnic Institute And State University; Term: Fall 2006;

Typology: Exams

Pre 2010

Uploaded on 11/08/2007

third-1
third-1 🇺🇸

14 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 4564

Midterm Exam

Fall 2006 Page 1 of 8
Virginia Tech
ECE 4564: Network Application Design
Midterm Exam

Fall 2006
Part A: Multiple Choice: Choose the best answer for each question. If unclear, state any assumptions
that you make in answering the question. (3 points each).
1. The following is a key difference between TCP and UDP.
(a) TCP provides a reliable datagram service, while UDP provides a best-effort datagram service.
(b) TCP provides a reliable stream service, while UDP provides a best-effort datagram service.
(c) TCP uses a header, so it is less efficient than UDP which is a “header-less” protocol.
(d) TCP uses port numbers to identify process- or application-level end-points, while UDP does not
use port numbers.
Answer: (b). Only answer (b) is true.
2. An HTTP user agent running on a host with Microsoft Windows as the operating system can
successfully access a server running on a host with Linux as the operating system. What makes this
possible?
(a) Both the user agent and the server use a common set of protocols, specifically IP, TCP, and
HTTP.
(b) Both the user agent and the server must use a common or similar sockets interface to the
TCP/IP protocol suite.
(c) Microsoft Windows and Linux use a common implementation for the TCP/IP protocol stack.
(d) The developers of the server software must write the server with special features to
accommodate Microsoft Windows.
Answer: (a). A common set of protocols is required, as indicated in answer (a). The client and server can use
different interfaces to TCP/IP and different implementations. Special features are not required to allow use of
HTTP with a Linux server and a Windows client.
3. What is an “ephemeral socket”?
(a) A socket created by a client and that is connected to the server.
(b) A socket created by a server and that is connected to the client.
(c) A socket created by a server and that is used to accept connections from a client.
(d) A socket temporarily created by a server to receive UDP datagrams.
Answer: (b). An ephemeral socket is created when the accept call returns and is connected to the client whose
connection was accepted.
4. Why does the client for the UDP TIME service need to send a message to the server, while the client
for the TCP TIME service does not?
(a) The UDP TIME service requires a simple authentication message be sent to the server, while
this feature is provided by TCP when it establishes a connection.
(b) Different people developed the TIME protocol for UDP than developed the TIME protocol for
TCP.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Midterm Test Answers - Network Application Design | ECE 4564 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

Virginia Tech

ECE 4564: Network Application Design

Midterm Exam  Fall 2006

Part A: Multiple Choice: Choose the best answer for each question. If unclear, state any assumptions that you make in answering the question. (3 points each).

  1. The following is a key difference between TCP and UDP.

(a) TCP provides a reliable datagram service, while UDP provides a best-effort datagram service. (b) TCP provides a reliable stream service, while UDP provides a best-effort datagram service. (c) TCP uses a header, so it is less efficient than UDP which is a “header-less” protocol. (d) TCP uses port numbers to identify process- or application-level end-points, while UDP does not use port numbers. Answer: (b). Only answer (b) is true.

  1. An HTTP user agent running on a host with Microsoft Windows as the operating system can successfully access a server running on a host with Linux as the operating system. What makes this possible? (a) Both the user agent and the server use a common set of protocols, specifically IP, TCP, and HTTP. (b) Both the user agent and the server must use a common or similar sockets interface to the TCP/IP protocol suite. (c) Microsoft Windows and Linux use a common implementation for the TCP/IP protocol stack. (d) The developers of the server software must write the server with special features to accommodate Microsoft Windows. Answer: (a). A common set of protocols is required, as indicated in answer (a). The client and server can use different interfaces to TCP/IP and different implementations. Special features are not required to allow use of HTTP with a Linux server and a Windows client.
  2. What is an “ephemeral socket”?

(a) A socket created by a client and that is connected to the server. (b) A socket created by a server and that is connected to the client. (c) A socket created by a server and that is used to accept connections from a client. (d) A socket temporarily created by a server to receive UDP datagrams.

Answer: (b). An ephemeral socket is created when the accept call returns and is connected to the client whose connection was accepted.

  1. Why does the client for the UDP TIME service need to send a message to the server, while the client for the TCP TIME service does not? (a) The UDP TIME service requires a simple authentication message be sent to the server, while this feature is provided by TCP when it establishes a connection. (b) Different people developed the TIME protocol for UDP than developed the TIME protocol for TCP.

(c) TCP provides the server with the IP address and port number of the client when there is a connection request. UDP does not provide this information when it establishes a connection. (d) The server needs to know the IP address and port number of the client. With UDP, this is provided by the client sending a message to the server. With TCP, this is provided by the client connecting to the server. Answer: (d). Only answer (d) is correct. Note that UDP does not establish a connection, as specified in answer (c).

  1. Using the Sockets class with Microsoft’s .NET, how is a SYN message generated by a host?

(a) Socket.Socket() (b) Socket.Connect() (c) Socket.Synchronize() (d) Socket.Accept()

Answer: (b). Calling the Socket.Connect method at the client causes TCP at the client to generate a SYN request to the server. TCP at the server will also generate a SYN request to the client, but this might be done by TCP at the server before Socket.Accept is called, as is the case with pending connections. So, answer (a) is better than answer (b). There is no such method as Socket.Synchronize.

  1. Is HTTP a stateless protocol?

(a) No. It supports “cookies” that provide state information. (b) No. It uses TCP which is a stateful protocol. (c) Yes. No state is maintained by HTTP between different HTTP requests. (d) Yes. It uses UDP which is a stateless protocol.

Answer: (c). HTTP is stateless, although other schemes may be used with HTTP to maintain state. For example, using cookies is a way to maintain state, but state is maintained outside of TCP. HTTP uses TCP, not UDP.

  1. Under what conditions do HTTP persistent connections offer the greatest advantage?

(a) When both the client and server use only HTTP/1.1. (b) When the client-server round-trip time is low. (c) When objects are being transferred from client to server using PUT or POST. (d) When small objects are being transferred.

Answer: (d). With non-persistent connections, a TCP connection has to be established for each object retrieved. This adds a round-trip time (RTT) to the access for every object. This is the most significant if the object is small so that the RTT dominates the transfer time or if the RTT is high. So, persistent connections offer the greatest advantage if the RTT is high or the object size is small. Note that persistent connections can be used with either HTTP/1.1 or HTTP/1.0, but is the default in HTTP/1.1.

(c) TCP at the client waits to receive a “FIN” from the server and then sends a “FIN” and an “ACK” to TCP at the server. (d) TCP does not send any segment initiated by this Shutdown call.

Answer: (b). TCP at the client will send a “FIN” to TCP at the server. This does not free resources as in answer (a). TCP at the client can still receive data from the server and, when it receives a FIN from the server, it will send only an “ACK” back to the server. This is contradictory to answer (c). Answer (d) is also false.

  1. Which of the following is not an appropriate use of time-outs for socket operations at a server?

(a) To detect a client that is “hung” or otherwise unresponsive. (b) To help avoid deadlock due to an unresponsive client. (c) To wait for TCP to complete sending a stream of data from the client. (d) To reduce resources expended due to a denial-of-service attack. Answer: (c). Time-outs are not a way to deal with TCP’s Nagle algorithm, as suggested by answer (c). The other answers are all appropriate uses for time-outs at the server.

  1. Assume that host A establishes a TCP connection with host B. Then, host A sends a string, “abcdefghi”, to host B using the Socket.Send() method and host B calls Socket.Receive() to receive this string. Which of the following is possible under normal Socket operation? (a) Host B receives “defghi” when it calls Socket.Receive() for the first time and receives “abc” when it calls Socket.Receive() the second time (b) Host B receives “abc” when it calls Socket.Receive () for the first time and receives “abc” again when it calls Socket.Receive() for the second time (c) Host B receives “abcfghi” when it calls Socket.Receive() for the first time. (d) Host B only receives “abc” when it calls Socket.Receive() for the first time;

Answer: (d) TCP maintains reliable communication so Socket.Receive receives the string in the correct order and no packet loss should happen. TCP does not maintain the boundary of application layer packets. Hence, Socket.Receive may only return part of the string. Calling Socket.Receive multiple times will ensure that the remainder of the string gets received.

  1. Which of the following lists the correct layer names for OSI reference model?

(a) Physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer (b) Nework access layer, Internet layer, Host-to-Host layer, Process layer (c) ARP layer, IP layer, TCP layer, Application layer (d) Hardware interface layer, Application pogram interface layer, User interface layer Answer: (a)

  1. Which of the following is true?

(a) To maintain strong consistency, a client should not cache any objects.

(b) To maintain weak consistency, a client should check an object by sending a conditional get with if-modified-since header line every time the object is referenced. (c) Consistency is not an issue for HTTP since HTTP server is stateless. (d) HTTP reverse proxy cache is usually located close to HTTP servers while HTTP forward proxy cache is usually located close to HTTP clients. Answer: (d). A client can maintain strong consistency while still cache an object. To ensure strong consistency, a client just check the object by sending a conditional get with if-modified-since header line every time the object is referenced. For week consistency, a client only checks the object after a certain expiration date. Hence, (a) and (b) are incorrect.

  1. Which of the following is true?

(a) The TTL (Time To Live) field in the IP header of a packet specifies the maximum number of seconds that this packet can exist in a network (b) The TTL (Time To Live) field in the IP header of a packet specifies the maximum number of routers that this packet can pass (c) An IP address uniquely identifies a network protocol (d) IP provides reliable services by using IP level acknowledgement packets

Answer: (b). IP address identifies a network interface. IP is unreliable

  1. Which of the following does not have an asynchronous version?

(a) Receive() (b) Bind() (c) Accept() (d) SendTo() Answer: (b).

  1. The most commonly used server type is:

(a) Iterative connectionless (b) Iternative connection-oriented (c) Concurrent connectionless (d) Concurrent connection-oriented

Answer: (d).

  1. Stateful protocols are better for low-bandwidth network connections because:

(a) They require the use of the UDP protocol (b) They send out-of-band data (c) They have low latency (d) They require less data to be transferred between the client and server

  1. Using TCP, a client sends an application layer message to a server. While receiving this message, how can the server determine the boundary of this application layer message? Describe at least three possible ways.

Correct answers need to provide at least three distinct ways for determining end of application layer message. The socket.Receive() function returns with 0 bytes received, indicating the client side close its connection and is not going to send any additional data. The message has a special byte sequence that marks the end of the message. When the server sees this special byte sequence, the server knows that it reaches the boundary of the application layer message. The message has a length field that indicates the length of the message. When the length of the message equals the length field’s value, the server knows that it reaches the boundary of the application layer message.

Answers that are also correct though are not taught in class: There is a default size for the message defined by the application layer protocol

  1. Name and describe the meanings of the different parts in the following URL:

http://: the protocol is http mytest.org: host name 5676: port number /cgi-bin/customer.pl: cgi script name and its location id=SFTW: data passed to cgi script

  1. Present a convincing argument, through pseudo-code, showing you understand the use of the traditional BSD socket calls (not the async versions) for socket communication. List the socket calls needed to initialize, send, receive, and wrap-up socket communication for each of the following application types: TCP server, TCP client, UDP server, and UDP client. You do not need to include specific address structures or full and correct method calls. Demonstrate that you understand what calls are needed for each application type and how to use them.

http://mytest.org:5676/cgi-bin/customer.pl?id=SFTW

Figure 1: TCP client and server

Figure 2: UDP client and server