*:96 Internet Application Protocols and Standards

Exam 1997-09-19 with answers

Note: These are not the only correct answers. Others are possible.

Question 1

Write an ASN.1 data type to convey a diet plan för en dag. A diet plan consists of 4-6 meals, where each meal consists of a number of food items. Each food item is specified by a weight in grams and an item name as a text string.

Possible answer

Diet-plan ::= SEQUENCE SIZE (4..6) OF Meal

Meal ::= SEQUENCE OF Food-item

Food-item ::= SEQUENCE {
weight REAL -- in grams,
name VisibleString }

Question 2

The screen clipping above was taken from http://www.rsac.org/. How do you believe the HTML code behind this part of a web page looks like ?

Possible answer

Below is how the web page actually looks like. A correct answer must of course not be identical to this. It could show three <img>-s with at least an <a> surrounding the middle image, since the text on that image "Click here to register your websites" clearly shows that it is a hyperlink.

<a href="howto/index.html">

<img src="images/howto.gif" alt="How to Use Explorer &amp; RSACi together." border="0" width="195" height="115">

</a> <a href="sponsor.html"><img src="images/register.gif" alt="Webmasters! Register with RSACi!" border="0" width="195" height="115">

</a> <a href="faq.html">

<img src="images/faq.gif" alt="RSACi FAQ" border="0" width="195" height="115"></a>

Other correct answers:

One single image map would also be correct. Some students tried to construct the contents of the images with tables inside tables, and this would also work.

Question 3

You have received an e-mail message which is unreadable to your e-mail software, and you want to send it to a help desk which can find out what is wong with it. Which MIME structure is suitable for this, and why?

Possible answer

The media type message/rfc822 is specially designed for sending whole messages as body parts of other messages. So a suitable MIME structure might be a message with two body parts, the first a text asking for help, the second the forwarded unreadable message as Content-Type: message/rfc822. This might be one of several content parts, with other parts containing an explanationary text.

Some students answered with application/octet-stream, and this would also be possible, but then the receiving mailer would not automatically know that it should try to parse the content as a message.

Some students proposed multipart/report, but this format can only be used if the middle content part has a standardised format, and there is no such format in this case.

Question 4

Compare pros and cons of different methods for an HTTP server of knowing what a client has done in recent previous HTTP transactions.

Possible answer

This question was difficult, so answers containing less than what I write below will be accepted.

What to send

Choice

Advantage

All session information.

No information need be kept in the server.

Transaction ID identifying session information in the server.

Less amount of information to transfer back and forward.

How to send it

Method

Pros and cons

Put transaction ID in Magic Cookie.

Works well, but some people disable cookies because they are afraid of misuse.

Hidden field in a form.

Does not work if user does something else inbetween.

Put data in the URL which the user clicks, after a question mark.

Only works if the user continues by accessing this URL, not suitable for much data, user can see the URL.

An alternative to the methods above is to use the HTTP/1.1 features for persistent connections.