*:96 Internet Application Protocols and Standards

Exam 1998-09-26 with solutions

No. Question in English Question in Swedish Max
points

1

Write an ASN.1 specification to transfer an image. The image is sometimes in GIF and sometimes in JPEG format, and the choice of format must also be transferred. In addition to the picture, also its name, specified as a text string, shall be transferred. Skriv en ASN.1-specifikation för att överföra en bild. Bilden är i ibland i GIF och ibland i JPEG-format, och uppgift om formatet skall också överföras. Vid sidan av själva bilden skall även bildens namn, som en textsträng, överföras.

6

Solution 1:

Picture ::= SEQUENCE {
         name VisibleString,
         CHOICE {
         gif [0] Gif,
         jpeg [1] Jpeg } }

Gif ::= OCTET STRING

Jpeg ::= OCTET STRING

Solution 2:

Picture ::= SEQUENCE {
        type ENUMERATED {
           gif(0),
           jpeg(1) },
        data OCTET STRING,
        name VisibleString }

Note: BIT STRING is equally good as OCTET STRING. Many students proposed various text strings, like Graphic String, but they are not suitable for binary data like GIF or JPEG images.

2

There are two methods, in HTML, to specify exactly where an image is to be placed in a browser window, one older method, and one recently added method. Which are the methods, and how do they work? Det finns två olika metoder att i HTML ange exakt var i ett skärmfönster som en bild skall placeras. En äldre metod, och en nyligen införd metod. Vilka är metoderna, och hur fungerar de?

6

Older method:

Use tables with table cells with exactly specified height and width in pixels. Example:

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD HEIGHT=100 WIDTH=100>

Newer method:

Use style sheets. In the style sheet, which can be placed in the <HEAD>, you can specify styles as a kind of subclasses of an HTML command like <DIV> or <P>. A style can specify the exact pixel position of the object content. The HTML text can then contain for example <DIV class=x> which means that this division is to be positioned as specified for the style x.

 

Other methods

I do not primarily recommend these methods, since they are more complex than Style Sheets.

<LAYER can be used, but style sheets do the same more directly.

<OBJECT can be used, provided that the object code uses some method for exact positioning.

ALIGN, HSPACE, VSPACE, Non-breaking spaces, Invisible pictures are also tools which can be used to influence the positioning of images.

 

3

Is it possible, in e-mail, to specify that a certain body part is not included, and must be fetched from the net by the recipient? Which construct in the e-mail standards are specially defined for this? Är det möjligt, i e-post, att ange att en viss body part inte bifogas, utan får hämtas från nätet av mottagaren? Vilken mekanism i e-post-standarderna är speciellt konstruerad för detta?

6

Answer

Yes, there is a special MIME Content-Type for this,
Content-Type: Message/external-body

(A similar effect can also be achieved with an HTML-formatted message, containing some kind of code to explicitly download a certain URL. This method, however, may be less secure.)

4

In which ways can an HTTP server have more than one version of a document, and automatically deliver different versions depending on user settings and capabilities. Is the choice of version done by the server or by the client? (Note: I do not mean manual selection, where a user can select between links or with a menu on a web page!) På vilka sätt kan en HTTP-server ha mer än en version av ett dokument, och automatiskt leverera olika versioner beroende på användarens inställningar och egenskaper. Görs valet av version i servern eller i klienten? (OBS: Frågan avser inte manuellt urval, där användaren väljer länk på en websida eller via en meny på websidan.)

6

Answer

This is called "Content Negotiation" and can be either "server-driven" or "agent-driven". With "server-driven" negotiation, the client tells the server its capabilities and preferences, and an algorithm in the server selects what to send. With "agent-driven" negotiation, the server tells the client which versions it has, and the client selects which of them to download.

Examples of HTML commands used in server-driven negotiation are
Accept-Charset, Accept-Language -- commands by which the client tells the server its preferences.

Agent-driven HTML commands i based on the HTML command Alternates, with which the server tells the client which versions it has. Alternates is not much used.