





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Fall 2005 Final Exam Solutions Material Type: Exam; Class: Network Application Design; Subject: Electrical & Computer Engineer; University: Virginia Polytechnic Institute And State University; Term: Fall 2005;
Typology: Exams
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Virginia Tech ECE 4564: Network Application Design Final Exam Fall 2005 Solutions
Questions 1-20 are multiple choice questions. Circle only the one best answer for each.
If the word “PAGE” is in all capitals in the footer of each page of your exam, then the order of multiple choice questions is different from what is provided here. However, the questions and solutions are the same for both versions of the exam.
(a) The “If-Modified-Since” header field. (b) The “Not-Modified” header field. (c) The “Content-Length” header field. (d) Cookies. Answer: (a). This header field allows a client to retrieve an entity only if its cached copy is stale.
(a) When an application leaves a group. (b) In response to an IGMP query message from a router for a group to which an application on the host is joined. (c) When an application requests to join a new group. (d) When an application requests to join a new group or in response to an IGMP query message from a router for a group to which an application on the host is joined. Answer: (d). A host sends an IGMP group report message when an application requests a join for a socket and the host is not currently already in the multicast group. The host also sends an IGMP group report message in response to an IGMP query message from a router if the host still has at least one socket joined to the multicast group.
(c) Part of the IP datagram causing the error is carried in the ICMP message. The port number of the associated socket is in the IP header of the original IP datagram. (d) Part of the IP datagram causing the error is carried in the ICMP message. The port number of the associated socket is in the TCP or UDP header of the original IP datagram. Answer: (d). The IP and TCP or UDP header of the original datagram that triggered the ICMP error message is sent back in the ICMP message. The port field in the TCP or UDP header allows the system software to identify the socket which caused the error. An error code can be returned and/or an exception can be thrown.
(a) Confidentiality. (b) Authentication. (c) Confidentiality and authentication. (d) None of the above. Answer: (b). AH, or Authentication Header, provides only authentication.
(a) Deny access to the secure network from a host with a specific IP address. (b) Deny TCP connection requests from the public network to the secure network. (c) Allow TCP traffic only for a connection established from a host in the secure network. (d) Allow UDP traffic only if addressed to a specific host in the secure network. Answer: (c). A stateless firewall cannot implement rule (c) since it requires that the firewall keep state information about the host which initiated the TCP connection. The other filtering rules rely only on information within the packet being processed, thus requiring no state information.
(a) Key distribution to clients is more scaleable since public keys can be distributed to a large number of clients by a relatively small number of trusted certificate authorities. (b) Asymmetric key encryption offers stronger encryption than symmetric key encryption. (c) Asymmetric key encryption can be used for both authentication and confidentiality. (d) Asymmetric key encryption can be used for authentication, confidentiality, and integrity. Answer: (a). Clients need to trust a certificate authority, not maintain shared (symmetric) keys with every possible server that they may want to access.
(a) To identify input and output parameters of a remote procedure call. (b) To take parameter values and create a message passed to or from a remote procedure. (c) To convert arguments to a canonical intermediate format. (d) To convert a complex data type to a stream of data. Answer: (b). Marshalling of arguments is the process of serializing arguments, putting them in the right representation, and generating a message to be sent to the remote procedure. Marshaling needs to know the input and output parameters and their type, but it does not identify this information itself. And while marshalling may convert data to a canonical intermediate format (depending on the data representation used) and may convert complex data types to a stream of data, these are not always done by marshalling and are not a comprehensive description of the task of marshalling.
(a) clients do not have to know the port number of the remote program before executing. (b) remote programs to not be executed until needed by a client. (c) remote programs to share a single port on the server host. (d) multiple versions of a remote program to run on a server without using version numbers. Answer: (a). Remote programs register with the port mapper. Clients query the port mapper for the port number of the remote procedure. Thus, clients do not need to know in advance the specific port number used by the remote procedure to which they are trying to connect.
(a) To pass data without encoding. (b) To pass data using XDR’s canonical intermediate format. (c) To pass a complex data structure with XDR. (d) To pass type information, but not the data itself. Answer (a). To put data as-is, i.e., without encoding, into the XDR stream.
(a) Tags with NDR indicate only the type of the data, but not the representation scheme. Tags with SOAP with XML indicate both an encoding style and the type of data. (b) Tags with NDR indicate the representation scheme and the type of the data. Tags with SOAP with XML indicate only the type of data, but not the encoding style. (c) Tags with NDR indicate the representation scheme and the type of the data. Tags with SOAP with XML indicate only an encoding style, but not the type of data. (d) Tags with NDR indicate only the representation scheme, but not the type of the data. Tags with SOAP with XML indicate both an encoding style and the type of data. Answer (d). This is true for both NDR and SOAP with XML.
(a) The receiver always translates from a canonical intermediate format for the data to the receiver’s native representation of the data. (b) The receiver always translates from the sender’s native representation of the data to the receiver’s native representation of the data. (c) The receiver always puts the most significant byte of the data in the high-order (rightmost) byte. (d) The receiver always puts the most significant byte of the data in the low-order (rightmost) byte. Answer (b). “Receiver-makes-right” is a form of asymmetric data representation. The receiver translates from the sender’s native format.
a) Write a code snippet that allows mSocket to receive datagrams sent by other hosts to IP multicast group 239.255.10.10 and port 7000. For this part, the code should not actually attempt to receive any datagrams. The following code joins the multicast group 239.255.10.10. Note that we do not need to do anything additional to receive datagrams sent to port 7000 since the initialization code above bound port 7000 to the socket.
// Create IPAddress object for multicast group address. IPAddress mcastAddress = IPAddress.Parse("239.255.10.10");
// Create MulticastOption object with this group and any interface. MulticastOption mcastOption = new MulticastOption(mcastAddress, IPAddress.Any);
// Join the group. mSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, mcastOption);
b) Write a code snippet that receives a multicast datagram on Socket mSocket, but only from the host with IP address 10.10.1.50 and source port 5555. If a datagram is received with some other source host and port, then the code should attempt to receive another datagram. The code should continue receiving until a datagram is received from the host and port of interest. When a datagram is received from the host and port of interest, then the datagram should be in a buffer of type byte[]. The following code performs the desired function. At the end, the buffer will contain a datagram from the host and port of interest. Note that there is not a requirement that the code considers exceptions.
// Create EndPoint object for desired sender’s address. IPAddress ipDesired = IPAddress.Parse("10.10.1.50"); IPEndPoint ipepDesired = new IPEndPoint(ipDesired, 5555); EndPoint epDesired = (EndPoint)ipepDesired;
// Create EndPoint object for sender’s address. IPEndPoint ipepSender = new IPEndPoint(IPAddress.Any, 0); EndPoint epSender = (EndPoint)ipepSender;
// Buffer for datagram. byte[] buffer = new byte[1024];
// Receive an incoming datagram until the EndPoint values match. do { // Receive incoming datagram. int received = mSocket.ReceiveFrom(buffer, ref epSender); while (!epDesired.Equals(epSender));
This version of the question appears on exams where “Page” is in mixed case in the footer of each page of the exam.
a) Consider the C# struct shown below and the associated code for initialization. struct snow { public int x; public int[] y; }
snow s; s.y = new int[2]; s.y[0] = 6; s.y[1] = 7; s.x = 5; Assume that XDR is used to represent instance s of structure snow. For each four-byte field below, show values that would be used in the XDR representation of s as initialized in the code above. Give your answer in decimal within each four-byte field. You may not need to use all eight of the four-byte fields that are shown. Start with the left-most four-byte field. The answer is shown below. Note that the only metadata is the length of array y[ ].
b) Consider the snippet from a WSDL file shown below. <xsd:complexType name="Piece"> <xsd:all> <xsd:element name="active" type="xsd:boolean"/> <xsd:element name="index" type="xsd:int"/> <xsd:element name="speed" type="xsd:float"/> <xsd:element name="angle" type="xsd:float"/> </xsd:all> </xsd:complexType> Specify a C# struct that corresponds to the WSDL definition above. Each element defined in the WSDL file corresponds to an element of the structure.
struct Piece { public Boolean active; public int index; public float speed; public float angle; }