Sample Questions & Answers

advertisement
Middleware Sample Questions & Answers
Following are samples of exam questions. In the exam paper you may find single questions from this
list or a combination of questions, or similar questions with a different wording.
Note: After some questions I will have noted how many times it has been asked in the summer and
autumn exams since 2007.
All questions in the exam paper will address the content of the posted lecture notes.
1. What is middleware? Give an example. [asked once]
 Middleware is a layer of software placed between the distributed applications and
the network.
 A network can connect a lot of devices that provide network services (printer,
scanner, etc). Users need appropriate means by which to discover the appropriate
service they need. One solution is to use a directory.
 The directory service binds service names to {<attribute, value>} pairs.
 Attributes can be used to lookup service names.
 Attributes for a printer are type (colour/black & white), speed, resolution
etc.
2. What is the purpose of a middleware system?
 It provides services such as name resolution, resource discovery and sharing, remote
execution, event notification, directories and security. Therefore, any distributed
application can benefit from middleware services as those mentioned above.
3. Show how DNS name space is organized. [asked once]
4. How many different types of DNS records exist? Define each of them.
 4 Types
 Type = A
 name is hostname
1
 value is IP address
 Type = NS
 name is domain (eg.foo.com)
 value is hostname of an authoritative name server for this domain.
 Type = CNAME
 name is alias name for some “canonical” (the real) name www.imbm.com is
really servereast.backyup.ibm.com
 value is canonical name
 Type = MX
 value is the canonical name of mail server associated with name
5. DNS is implemented as a distributed database. Present its architecture.
 The system is implemented by many computers that run the service – it is a multiserver distributed architecture.
 The core component is a distributed database:
 local control of data;
 data is available across the entire network;
6. How is DNS lookup process speeded up? [asked once]
 Delegation: assigns responsibility for a sub-domain to another organisation; the
parent domain contains only pointers to sources of the sub-domain’s data.
 Caching: store data for future reference.
7. Explain the DNS protocol. [asked once]
 The DNS protocol has a certain chain of events:
1. The resolver sends the query to the local DNS server.
2. If not solved, the local DNS relays it to a root server. If the root name server
has a record for the hostname, it’ll send the reply. Otherwise, it will relay
the query to an authoritative server for that domain which should have a
record of the hostname.
3. The reply message goes to the root and then to the local name server.
4. Queries can also be recursive or iterative.
8. What is the role of a DNS resolver? [asked once]
 Resolvers are clients (on the applications side) that access name servers. They and
their cache memories are part of the host operating system.
 The resolver handles:
 Querying a name server,
 Interpreting responses,
 Returning the information to the programs that requested it.
 Usually, the resolver is a set of library routines that are compiled into applications.
9. Jini is a discovery service. Present its architecture.
 In Jini services can be implemented in other programming languages, but they must
encapsulate each object in a Java Native Interface wrapper so that the Java
environment can still dynamically load the objects.
2
 The Jini surrogate architecture lets limited-capability devices deliver their code to an
entity called a surrogate host.
10. How does the Jini lookup service work? [asked once]
 The lookup service maps interfaces indicating the functionality provided by a service
to sets of objects that implement the service.
 A device wanting to offer a service uploads the serialised Java object, called a service
proxy, to the Jini lookup service.
 Entries in the lookup service are leased, allowing the lookup service to reflect
accurately the set of currently available services.
11. How do the Jini discovery/join protocols work? [asked once]
 The discovery/join protocols allow a new device to add a new service to the Jini
system and a reference to this service is stored by the lookup service:
 Firstly, the service provider locates a lookup service by issuing a request on
the local network for any lookup services to identify themselves;
 Secondly the lookup service gets a request; it then sends an object back to
the server. This object, known as a registrar, acts as a proxy to the lookup
service, and runs in the service's JVM.
 Thirdly, a service object for the service is loaded into the lookup service. This
service object contains the Java interface for the service, including the
methods that users and applications will invoke to execute the service along
with any other descriptive attributes.
12. Jini facilitates client interaction with a server. Follow the client and server chains of events,
explaining each event.
 Client chain of events:
 Prepare for discovery,
 Discover a lookup service,
 Prepare a template for lookup search,
 Lookup the service,
 Call the service.
 Server chain of events:
 Prepare for discovery,
 Discover a lookup service,
 Create information about the service,
 Export the service,
 Renew the lease periodically.
13. How is Jini made reliable and scalable?
 Reliable:
 To handle network failures, Jini leases a resource to a client for a fixed
amount of time. When the period expires the client must renew the lease to
continue accessing the service. The lease automatically expires for all
authorized users when the service goes down.
 Scalable:
3
 Groups of Jini services form a community.
 Jini communities can link together into larger groups.
 The Jini lookup service for a particular community can register itself in other
communities, thereby acting as the interface for sharing its resources with
other communities clients.
14. Give a thorough presentation of UPnP functions.

15. What is UPnP?
 Universal Plug and Play (UPnP) is an architecture for pervasive peer-to-peer network
connectivity of intelligent appliances, wireless devices, and PCs of all form factors.
16. What entities are making a UPnP system? [asked twice]
 A UPnP device is a container of services and nested devices.
 The smallest unit of control in a UPnP network is a service. A service exposes actions
and models its state with state variables.
 A control point in a UPnP network is a controller capable of discovering and
controlling other devices.
17. Explain how an UPnP-enabled device becomes a member of a UPnP network of devices.
[asked once]
 It uses auto-configuration where it searches for a DHCP server (it must run a DHCP
client), and if a server is not found it picks an IP address from the link-local range.
An ARP request is issued to check for duplicates before the network is joined.
18. Show how a UPnP service is defined and accessed.
 A service in UPnP device consists of a state table, a control server and an event
server.
 The state table models the state of the service through state variables and updates
them when the state changes.
 The control server receives actions requests, executes them, updates the state table
and returns the response.
 The event server publishes events to interested subscribers anytime the state of the
service changes.
19. What is a UPnP controller?
 A control point in a UPnP network is a controller capable of discovering and
controlling other devices.
 It is expected that devices will incorporate control point functionality (and viceversa) to enable true peer-to-peer networking.
4
20. Draw and explain the UPnP architecture. What are its main services? [SSDP asked once]
 SSDP (Simple Service Discovery Protocol)
 Allows UPnP services to be discovered.
 GENA (Generic Event Notification Architecture)
 A subscription to a control point interested in receiving event notifications
must be renewed periodically to continue to receive notifications, and can
also be cancelled using GENA.
 SOAP (Simple Object Access Protocol)
 SOAP defines the use of Extensible Markup Language (XML) and HTTP to
execute remote procedure calls.
 UPnP uses SOAP to deliver control messages to devices and return results or
errors back to control points.
21. How is a UPnP service discovered?

22. What’s a Home Gateway? [asked once]
 A home gateway is a home networking device, used as a gateway to connect devices
in the home to the Internet or other WAN.
23. Name three relevant requirements for a home gateway. Explain these requirements.
[asked once]
 The home gateway access network and home network must be technology agnostic
and be managed by a single entity.
 The home gateway and associated devices and services must be easy to install and
configure. They must also be manageable by the Broadband Service Provider.
5
 Home Gateway support functions must support appropriate connections to
corporate resources.
24. Explain the concept of remote execution. [benefits asked twice, problems asked once]
 Features:
 The application is distributed and part of the code is executed on remote
computer (-s).
 Remote code (procedures) is called the same way as if it were running on
the same host.
 The code distribution is transparent.
 Benefits
 Better use of resources.
 Load balancing.
 Depending on the network, shorter execution time.
 Problems
 Space of addressing;
 Heterogeneity of computing platforms;
 Networks can introduce errors, delays.
25. Explain the concept and implementation ideas of RMI – Remote Method Invocation.
[asked three times] [ ‘what is remote method invocation’ asked once] (I can make it up)
 Environment:
 the platform is JVM;
 client/server architecture;
 servers register their RMI services with a lookup service;
 clients lookup the registry for a remote object reference.
 Implementation:
 as easy as local execution;
 the service is located by URL returned by the lookup process;
 rmi registry returns URLs like: //hostname:port/service_name.
26. Analyse the RMI computing model. Explain how it works (I can make up). [asked four times]
6
27. What are the RMI components? [asked twice]
Every RMI service is defined by an interface that describes the methods that can be
invoked remotely.
 The stub object implements a particular RMI interface, on the client side.
 The skeleton object, on the server side, listens for incoming RMI requests and passes
them to the RMI service.
 The implementation object will be called by the skeleton which invokes the
appropriate method and, later, will pass the results back to the stub.
28. Use an example to discuss the remote interface.

29. Explain the idea of remote activation.
 Services are registered with rmiregistry but not instantiated; they are inactive until
called upon by a client. One special daemon process, remote method invocation
activation system daemon (rmid), listens for calls and instantiates RMI services on
demand.
30. Present the remote activation process/service.
 The first request for reference to the object automatically creates the remote
(active) object.
 Activatable objects that run in the same JVM can be grouped in an “activation
group”
 Remote objects that were destroyed due to a system failure or exit, can be
restarted.
31. What is a faulting remote reference?
 A faulting remote reference acts as a proxy between the remote client and the
currently-inactivated server.
 A server installation program notifies the activation system of an activatable remote
object and registers the faulting remote reference with the rmiregistry.
 The faulting reference maintains both:
 A persistent handle and,
 A transient remote reference to the targets remote object.
32. What steps are needed in order to create an activatable remote object?
1. Create an activation group descriptor that may include some properties.
2. Register the activation group descriptor with the RMI activation daemon process.
3. Create an activation descriptor that describes an activatable remote object.
4. Register the activation descriptor with the activation system.
5. Add a registry entry for the RMI service, so that clients may locate the service.
7
33. Explain the concept of event notification in distributed systems. [asked once]
 The idea: One object can react to a change occurring in another object.
 For example, in interactive applications, actions performed by the user cause
changes in objects that maintain the state of the application, in turn the objects that
are responsible for displaying the current state view of the application are notified
whenever the state changes.
34. How does a publish-subscribe system work? [asked three times]
A publish-subscribe system consists of three elements:
 The publishing program, called SimpleTopicPublisher which creates a connection to
the TopicConnectionFactory, creates a topic, publishes one or more messages to the
topic, and then closes the connection.
 The receiving program, called SimpleTopicSubscriber which looks up a topic, creates
a connection, subscribes to topic, registers a message listener to the topic and closes
the connection.
 The message listener automatically calls the onMessage method when a message
arrives. The onMessage method converts the incoming message to be displayed as
text on screen.
35. How can an event-based distributed system be characterised?
 Heterogeneous: Event-generating objects publish the types of events they offer,
subscribers provide interfaces for receiving notifications.
 Asynchronous: Notifications are sent asynchronously.
36. Analyse the possible multiple roles of an observer.
Note: An observer decouples an object of interest from its subscribers.
 Forwarding: Carries out all the work of sending notifications.
 Filtering of Notifications: Reduces the number of notifications according to some
filter on the content of each notification.
 Patterns of Events: Subscribers can specify patterns of events they are interested in.
A pattern defines a relationship among several events.
 Notification Mailboxes: Notifications need to be delayed until subscribers are ready
to receive them.
37. How can an object pass information to another one?
 An object can pass an object reference (subscriber) to the object that is the event
source.
 The event source will then invoke one of the subscriber’s methods to notify it.
38. What is CORBA?
 An architecture that enables pieces of programs, called objects, to communicate
with one another regardless of what programming language they were written in or
what operating system they're running on.
8
39. Explain the role played by ORBs (Object Request Broker) in CORBA. [asked twice]
 ORBs help the client to invoke a method on a remote object.
 This involves locating the object, activating it if necessary, and then communicating
the client’s request.
40. Use a drawing to define CORBA’s main components.
41. How does CORBA name service work?
 The CORBA name service allows names to be bound to remote object references of
CORBA objects within naming contexts.
 A naming context is the scope within which a set of names applies and each name
within a context must be unique.
42. Present the CORBA event channel and its different types. [asked four times] (subset of event
service)
 CORBA event channels are objects that may be used to allow multiple suppliers to
asynchronously communicate with multiple consumers, or multicast a notification.
 The channel is like a buffer that can be operated by either push or pull.
 Pushed by the supplier where the consumer implements the PushConsumer
interface with method push and the ref is registered with suppliers.
 Pulled by the consumer where the the supplier implements the PullSupplier
interface with method pull and the ref is registered with consumers.
 Canonical Push Model: This channel plays the role of a notifier, where the suppliers
are active.
 Canonical Pull Model: This channel plays the role of a procurer, where consumers
are active.
 Hybrid Push/Pull Model: This channel plays the role of a queue, where both
suppliers and consumers are active.
 Hybrid Pull/Push Model: This channel plays the role of an intelligent agent, where
both suppliers and consumers are passive.
43. What is an event channel federation? Explain using a diagram.
9
44. Present the Notification Service in CORBA.
 The Notification Service extends the Event Service.
 Notifications may be defined as data structures.
 Event consumers can use filters and can discover the event types offered by
suppliers on a channel.
 Event suppliers are provided with a means of discovering the events that the
consumers are interested in.
45. Explain the main concepts and components used by CORBA’s trading service. [asked twice]
[asked to provide a request for a printer as an example once]
 A trader stores ads for services. An ad is known as a service offer.
 Placing an ad is known as an export operation and it is executed by an exporter.
 The object that provides the service is called the service provider.
 A client can then query the trader based on the service properties using a filter
called a constraint.
 The act of searching the trader for a service provider that meets certain criteria is
called import.
46. Show a typical CORBA trading service example. [asked once]
10
47. How can the dynamic property be helpful in CORBA’s trading service? [asked once]
 A dynamic property does not store the actual value for an offers property. Instead it
stores an object reference to an object that can deliver the current value when the
trader evaluates a constraint.
 Dynamic properties are ideally suited for environments in which property values
must reflect rapidly changing information.
48. Explain the purpose of a trader federation and the policies that can be assigned to different
links.
 All traders in a federation are typically configured to use the same type repository.
Exporters must choose the trader where to export a service offer.
 Link Policies:
 local_only_policy: queries not passed.
 If_no_local: queries will be passed via this link if no matching offers could be
found locally.
 always: queries will always be passed via that link.
49. Compare the name and the trading services of CORBA. [asked once] [ asked to provide
examples once]
 The CORBA trade service allows clients to locate objects with the help of a trader.
 Unlike the Naming Service where an object is located by name, an object in the
Trading Service does not have a name. Rather, the trader advertises an object based
on the kind of service provided by the object.
 The CORBA name service allows names to be bound to remote object references of
CORBA objects within naming contexts.
 A naming context is the scope within which a set of names applies and each name
within a context must be unique.
50. What is the purpose of CORBA IDL?
 A client will know what message to send because the server has an interface
specified in CORBA IDL.
 IDL separates object interfaces from their implementations.
 IDL definitions focus on object interfaces, the operations supported by those
interfaces, and exceptions that may be raised by operations.
51. What is GIOP?
 The General Inter-ORB Protocol is a specification for communication protocols
between ORBs.
 Features: GIOP makes several assumptions about the underlying transport layer:
 Transport is connection-oriented.
 Connections are full-duplex.
 Connections are symmetric.
11
52. Why is GIOP using a common data representation?
 GIOP is using a common data representation in order to enable interaction using
objects written in various programming languages.
 It is also optimum for network usage because it maps IDL definitions to a lower-level
representation of data types. This data is more network friendly.
 It also translates little-endian to big-endian.
53. What is a messaging-oriented middleware system?
 A messaging-oriented middleware system may be referred to as the process by
which distributed entities can exchange messages in a P2P fashion.
 Each peer connects to a messaging agent that provides means for creating, sending,
receiving and reading messages.
 The sender and the receiver need to know the message format and what destination
to use – loosely coupled.
54. Explain how a queue works in a messaging-oriented middleware system. [asked twice]
 In a messaging-oriented system each message is addressed to a specific queue.
 Queues retain all messages until they are consumed or expired.
 Each message has only one consumer, there is no timing dependencies among peers
and the receiver acks the successful processing of a message.
55. Explain how topics work in a messaging-oriented middleware system. [asked twice]
 In a messaging-oriented middleware system messages are addressed to a topic.
 Topics retain messages as long as it takes to distribute them to current subscribers.
 There is a timing dependency, a subscriber will consume messages after it has
created a subscription, and it must continue to be active in order for it to consumer
messages.
56. Analyse JMS programming model. Diagram Extra. [asked twice]
12
Note: Java Message Service is a Java API that allows distributed applications to use
messages. It is a tool for messaging-oriented middleware. It allows Java applications to
access other messaging systems.
 A connection factory is the object a client uses to create a connection with a
provider.
 It encapsulates a set of connection config parameters that has been defined by an
administrator.
 A pair of connection factories come preconfigured with J2EE SDK and is available as
soon as the service is started.
 Each connection factory is an instance of wither the QueueConnectionFactory or the
TopicConnectionFactory interface.
57. How does a message listener work?
 A message listener is an object that acts like an asynchronous event handler for
messages. It implements the MessageListener interface, which contains one
method, onMessage. This method includes the actions taken when a message
arrives.
 The message listener is registered with a specific QueueReceiver or TopicSubscriber
by using the setMessageListener method.
 A message listener is not specific to a particular destination; it can get messages
from either a queue or a topic, depending on where it is set.
58. Present a message service either point-to-point or publish-subscribe.
 In a Point-to-point messaging service each message is addressed to a specific queue.
 Queues retain all messages until they are consumed or expire.
 In a Point-to-point messaging service each message has only one consumer and
there are no timing dependencies among peers.
 The receiver also acks the successful processing of a message so that a sender knows
it has been successfully sent, before the receiver consumes the message.
13
59. Explain how a messaging system can be made reliable.
A messaging system can be made more reliable by:
 Controlling message acknowledgement.
 Specifying message persistence, which instructs the provider to ensure that the
message is not lost if the provider fails.
 Setting message priority levels, which orders message based on their priority and
sends the messages based on this priority.
 Allowing messages to expire, which means that messages will not be delivered if
they become obsolete.
 Creating temporary destinations, which only last for the duration of the connection
and can be used to implement a simple request/reply mechanism.
60. Explain what transactional messaging is.
 L16 – SL8
61. Define what is a P2P system using Napster protocol as an example.
 P2P aims to provide a cost-effective solution for sharing resources in computer
networks and uses algorithms for the placement and retrieval of data.
 Napster was created in 1999, and shares files using centralized indexes, where files
are stored and accessed on peer’s hosts.
 Napster protocol for one client:
 File request submitted to the centralized index.
 Receive list of peers offering file.
 File request sent to one peer hosting file.
 File delivered.
 Offer of own files followed by index update.
62. What is routing overlays?
 Routing overlays is a middleware algorithm responsible for locating hosts and
objects.
 It is an application routing algorithm that delivers a request from a client to the host
that stores the addressed object.
 Any object can be located anywhere in the network at any time.
 The request is routed through a set of hosts, exploiting knowledge at each of them
to locate the destination.
63. What is cloud computing?
 Cloud computing is the delivery of computing as a service rather than a product,
whereby shared resources, software, and information are provided to computers
and other devices as a service over a network (typically the Internet).
14
64. Discuss the cloud stack of layers.
 Each layer encompasses one or more cloud services.
 Cloud services belong to the same layer if they have equivalent levels of abstraction.
 One cloud layer is higher in stack if its services can be composed of services from the
underlying layers.
 The cloud stack of layers includes (from bottom to top): hardware, software kernel,
cloud software infrastructure, cloud software environment and cloud applications.
65. What is cloud software infrastructure?
 The cloud software infrastructure provides fundamental software resources.
 It is enabled by virtualization and virtual machines are the key elements e.g.
Amazon’s Elastic Compute Cloud.
 The cloud software infrastructure also provides several academic open-source cloud
projects to build a private cloud.
66. Give the classification of clouds.
Cloud services can be classified into three types based on access and location:
 Public Cloud:
 Available to anyone on the internet.
 Any user can sign up to use the public cloud e.g. Microsoft Windows Azure.
 Private Cloud:
 This is a proprietary cloud that provides cloud services to a limited number
of users.
 Private clouds are usually within data centers behind a firewall.
 Hybrid Cloud:
 Provides services that run on a public cloud, but limits access to it through a
virtual private network (VPN).
Other Questions
1.
Draw the architecture model of a home network that has a Home Gateway. [10] (Part of a 10 mark
question) [asked once]
2.
How is Jini using the event notification? [3] [asked once]
3.
By default, Java Message Service works in persistent delivery mode. What does this mean? [5] [asked
once]
4.
One important service of mobile middleware is that of context-awareness. Present the sources of
information for the context-awareness service. [5] [asked three times] (not sure if on course?)
5.
There are two ways to consume a message in JMS. Explain these two possibilities. [5] [asked twice]
(also not sure if it is on the course)
 Synchronously: the receiver explicitly fetches messages from the destination by calling the
receive method; the method can block until a message arrives, or can time out.
 Asynchronously: the receiver registers a message listener. Whenever a message arrives, the
JMS provider delivers the message by calling the listener’s onMessage method.
15
6.
How many types of name servers exist and what roles do they have? [asked once]
 There are two types of name servers:
 Primary master: gets data for the zone it’s authoritative for from files on the host it
runs on;
 Secondary master: gets its zone data from a primary master.
7.
Use a diagram to explain the JINI model. [asked once]
Note: CORAB & RMI important. Also DNS.
15 Questions on CORBA
10 Questions on UPnP
9 Questions on RMI
8 Questions on Messaging Oriented Middleware
6 Questions on DNS
5 Questions on Jini
5 Questions on Event Notification
4 Questions on Cloud
2 Questions on First lecture
2 Questions on Peer to Peer.
…Thanks Giller!
16
Download