Unit 9 Flashcards

1
Q

SAQ 1 - A

Comparing how parameter data associated with HTTP GET requests and POST requests is sent and received, answer the following question.

What are the main similarities between GET and POST?

A

Parameter data is extracted by servlet code or JSP directives in exactly the same way, regardless of whether it is associated with a POST or a GET request. The underlying differences are hidden by the standard Java method calls or JSP directives. For both types of request, parameter data is normally sent in URL-encoded form, which means that any unsafe characters are replaced by their percent-encoded hexadecimal ASCII code values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SAQ 1 - B

Comparing how parameter data associated with HTTP GET requests and POST requests is sent and received, answer the following question.

What are the main differences between GET and POST?

A

GET requests append the parameter names and their values to the URL in the GET command line itself. POST requests send the parameter data in the body of the request, following the lines containing the POST command and any lines of header data. This means that parameters associated with a POST command are less visible to users. This can also accommodate much more parameter data, since the maximum length of the extended URL used by GET requests is limited on most systems. POST can also deal with more complex data such as files or binary data, whereas GET request data is much more limited in type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SAQ 2

What are the main issues to bear in mind when comparing thin clients, applet clients and application clients in Java EE?

A

Thin clients, typically browsers, may have limited functionality and operate mainly in pull mode, although these can be improved to some extent by the use of scripting languages such as JavaScript. They require only very limited hardware and software resources on the client machine.

Applets and application clients can provide a richer user interface and take some of the processing load away from the server for a more responsive client. They normally require more processing and storage on the client machine than thin clients.

Thin clients and applet-based clients have minimal deployment issues, assuming that most clients have a standard browser, though sometimes issues of browser versions and compatibility may arise. Compatibility issues are of more concern for applet-based clients since browsers vary in their treatment of applets, although this is often solved by using the Java Plug-in.

For application clients, there has to be a way of installing the client software on each client machine and keeping this up to date – this can be problematic, but some Java EE implementations allow deployment of the application client software on the server for automatic downloading to clients as required.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SAQ 3 - A

What are the advantages and disadvantages of Client polling

A

Client polling (using the refresh META tag) is simple and works on all browsers. Its disadvantage is that it can generate considerable web traffic by frequent reloading of web pages. It also requires opening and closing connections to the server for every request, and many of the reloads may be unnecessary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SAQ 3 - B

What are the advantages and disadvantages of RSS?

A

RSS feeds eliminate the problem of unnecessarily downloading whole web pages even if nothing on that page has changed – the page is download only if something has changed since the last time it was checked. However, repeated polling of the server is required by the RSS reader, so the overhead of repeated connection opening and closing is similar to the case of client polling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SAQ 3 - C

What are the advantages and disadvantages of The server push approach using multipart/x-mixed-replace?

A

The server push approach using multipart/x-mixed-replace puts the server in control of when the web page is reloaded. Hence page reloads should happen only when there is something new to download. Because the server keeps the HTTP connection with the client open while downloading a series of parts, it avoids the overhead of repeated opening and closing of HTTP connections. However, keeping the HTTP connection open may be a problem if there are many clients using this approach as most servers limit the number of possible HTTP connections. This approach is not supported by some browsers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SAQ 4 - A

What are the pros and cons of the following push technologies for applets and application clients?

A- UDP

A

UDP is connectionless and therefore each message is relatively efficient. However, it is unreliable in that messages can be lost or corrupted. It also has the disadvantage for large-scale systems that it requires the server to store IP addresses of all registered clients and to send one message per registered client for each notification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SAQ 4 - B

What are the pros and cons of the following push technologies for applets and application clients?

B - Multicast UDP

A

Multicast UDP has the same pros and cons as normal (unicast) UDP, but is more efficient when the sender has to communicate the same message to many receivers. A disadvantage is that not all routers support multicast UDP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SAQ 4 - C

What are the pros and cons of the following push technologies for applets and application clients?

C - TCP

A

TCP is a reliable connection-oriented protocol in that lost, corrupt or out-of-order data packets will be restored automatically by the TCP protocol software. Its disadvantage is relative inefficiency – setting up connections takes significant time and effort, and means that it is not suited to multicasting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SAQ 4 - D

What are the pros and cons of the following push technologies for applets and application clients?

D - Messaging services

A

Messaging services are the most general approach. They use asynchronous communication, which can aid responsiveness, combined with reliability. The publish/subscribe approach is well suited to implementing server push. However, the middleware may introduce a significant performance overhead in some cases, and most middleware is proprietary rather than standard.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SAQ 5

In distributed systems, what is the difference between physically synchronised clocks and logical clocks?

A

Physically synchronised clocks on different hosts will hold time values that are the same to within some specified tolerance. If they are externally synchronised, this common time will be synchronised to some standard time such as UTC. If they are internally synchronised, then the common time may differ significantly from standard time, but in some applications only internal synchronisation is essential. Logical clocks can be used in some situations where synchronisation is not required. Each host maintains a clock which it updates immediately after an event, such as sending or receiving a message. Messages sent to other hosts are time-stamped with the logical time of the sender. Receivers update their local logical clocks, if necessary, to ensure that events always have a later logical time than the event that caused them. Thus logical clocks can be used to record an order of events, although they are not applicable when the actual standard time is needed, such as in many real-time systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Exercise 1 - A

What requirements do you think a push technology approach might have?

A

Since the server is to send out data without an explicit client request, there must be a way for the server to ascertain to which clients the data should be sent. One way to do this is for each client to send an initial message to the server to register their interest in receiving regular information updates from the server. It could be quite resource intensive if the server has to send out the same update many times to all its registered clients – so it would be good if there was a way to send the update message only once but have all interested clients receive it. You may have thought of some different or additional requirements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Exercise 1 - B

Can you think of any push technology approaches currently in use on the Web?

A

The RSS (Really Simple Syndication) system, now available on many websites, arguably works in a push technology way. This allows you to sign up to receive occasional updates from a website whenever something important has changed or occurred. This avoids users having to frequently check a site to see if anything has happened. Only those clients who have registered for a given RSS service will receive the updates. However, there is some dispute about whether this is a pure push technology because to receive updates it is necessary to run an RSS reader program that polls the relevant website regularly while it is running. You might have thought of a different example – does it meet your requirements or our requirements from part (a)?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Exercise 2

Why do you think there is no such thing as multicast TCP, while there is multicast UDP?

A

In multicast UDP the server does not know anything about the clients in the multicast group it is sending to. It knows only the special IP address for the multicast group. This is acceptable in UDP because there is no need to set up a connection between server and client(s). In TCP, both the client and the server must know each other’s IP addresses in order to set up a connection. This would negate one of the advantages of multicast over unicast – the multicast server does not need to keep a list of registered clients.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Exercise 3 - a

Can you think of situations or applications where the following types of clock synchronisation would be appropriate in distributed systems?

(a) External synchronisation

A

This is essential where the time used by hosts is required to be correct in relation to standard time such as UTC. This would include applications that must carry out an activity at a specific actual time, such as the finishing time of an internet auction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Exercise 3 - a

Can you think of situations or applications where the following types of clock synchronisation would be appropriate in distributed systems?

(b) Internal synchronisation

A

Internal synchronisation is acceptable when the system time does not need to reflect the real-world time accurately. Such applications might be those where timestamping is used to indicate the order in which events occurred (such as in transactions). Here the actual values of the time are not important, only their relative order.

17
Q

Exercise 4 - A

A stratum 2 NTP host uses Cristian’s algorithm to synchronise with a stratum 1 host. It sends a number of requests, as described above, to estimate the round-trip time for messages between the two hosts. The measured round-trip times are 34, 26 and 30 milliseconds. The successive time values received, T1, T2 and T3, respectively, are 10:45:00:000, 10:45:00:049 and 10:45:00:100, using the format hh:mm:ss:uuu (where uuu represents the milliseconds).

What value would the stratum 2 host set if it uses only the first time T1 and the corresponding round-trip time?

A

The first round-trip time TR is 34 milliseconds. We need to set the time to T1 + TR /2, which is T1 plus 17 milliseconds. Hence the time should be set to 10:45:00:017.

18
Q

Exercise 4 - B

A stratum 2 NTP host uses Cristian’s algorithm to synchronise with a stratum 1 host. It sends a number of requests, as described above, to estimate the round-trip time for messages between the two hosts. The measured round-trip times are 34, 26 and 30 milliseconds. The successive time values received, T1, T2 and T3, respectively, are 10:45:00:000, 10:45:00:049 and 10:45:00:100, using the format hh:mm:ss:uuu (where uuu represents the milliseconds).

A

The lowest round-trip time TR is 26 milliseconds, and this gives the most accurate possible time setting from this data. We need to set the time to T2 + TR /2 which is T2 plus 13 milliseconds. Hence the time should be set to 10:45:00:062. Note that we do not average the round-trip times in this approach.