Cloud Computing and Web Services Overview
Cloud Computing and Web Services Overview
Services
UNIT 1
• Cloud Computing Basics
• Web Services
• Virtulization
Chapter 1: Web Services
• Distributed Computing,
• Parallel Computing,
• WSDL structure,
• SOAP- Structure of SOAP Message (In JAX-WS),
• SOAP Messaging Architecture,
• SOAP Header,
• Client-side SOAP Handler,
• REST What is REST?
• HTTP methods,
• Java API for RESTful Web Services (JAXRS)
What are Web Services?
• A Web service is a self-describing, self-contained software module
available via a network,such as the Internet, which completes tasks,
solves problems, or conducts transactions on behalf of a user or
application.
• Web services are client and server applications that communicate
over the World Wide Web’s(www)HyperText Transfer Protocol(HTTP).
• It is a method of communication between two devices over network.
• [Link],online currency converter
• A Web Service is can be defined by following ways:
• It is a client-server application or application component for communication.
• The method of communication between two devices over the network.
• It is a software system for the interoperable machine to machine communication.
• It is a collection of standards or protocols for exchanging information between two
devices or application.
• Types of Web Services
• There are mainly two types of web services.
• SOAP web services.
• RESTful web services.
Distributed Computing Infrastructure
• A distributed system is characterized as a collection of (probably
heterogeneous) networked computers, which communicate and
coordinate their actions by passing messages.
• Distribution is transparent to the user so that the system appears as a
single integrated facility.
• This is in contrast to a network infrastructure, where the user is aware
that there are several machines, is also aware of their location,
storage replication, and load balancing, and functionality is not
transparent.
Key technologies that facilitate the development of distributed
applications for Web services:
• Internet Protocols
• The OSI Reference Model
• The TCP/IP network protocol model
• Middleware
The Open System Interconnection
(OSI)Reference Model
The OSI layers are as follows:
• Physical layer (or Layer 1): This is the lowest of seven hierarchical layers in the ISO/OSI reference model and
specifies the electrical, mechanical, procedural, and functional requirements for activating, maintaining,
and deactivating a physical link between end systems.
• Data Link layer (or Layer 2): This layer provides the means to transfer data between network entities and to
detect and possibly correct errors that may occur in the physical layer.
• Network layer (or Layer 3): This layer responds to service requests from the transport layer (its immediate
higher-level layer) and issues service requests to the datalink layer. This layer performs network routing,
flow control, segmentation/de-segmentation, and error control functions.
• Transport layer (or Layer 4): This layer responds to service requests from the session layer (its immediate
higher-level layer) and issues service requests to the network layer. Data integrity is ensured at the
transport layer by maintaining flow control and by allowing users to request reliable data transport
between systems.
• Session layer (or Layer 5): This layer provides the mechanism for managing the dialogue between end-user
application processes. The session layer is responsible for setting up, managing, and then tearing down
sessions between presentation layer entities.
• Presentation layer (or Layer 6): This layer presents data to the application layer
and is responsible for data translation and code formatting. Tasks like data
compression, decompression, encryption, and decryption are associated with this
layer.
• Application layer (or Layer 7): This is the highest layer in the ISO/OSI reference
model that gives an application program access to the OSI network. This layer
interfaces directly to and performs common application services required by the
application programs and also issues requests to the presentation layer.
The TCP/IP Network Protocol Model
The TCP/IP stack comprises the following layers:
• Data link layer: The data link layer, or simply link layer, is the lowermost layer and provides the
interface to the actual network hardware. This interface may or may not provide reliable delivery,
and may be packet or stream oriented.
• Internetwork layer: The internetwork layer, also called the Internet layer or the network layer, is the
next layer up from the data link layer. This layer is responsible for routing datagrams – a term which
basically means “blocks of data” – from one host to another. The internetwork layer provides the
“virtual network” image of an Internet IP is the most important protocol in this layer; IP is the
bedrock protocol of TCP/IP.
• Transport layer: The transport layer provides end-to-end data transfer by delivering data between
the client and server sides of an application. Multiple applications can be supported simultaneously.
The most used transport layer protocol is the TCP which provides connection-oriented reliable data
delivery, duplicate data suppression,congestion control, and flow control.
• Application layer: The application layer is responsible for supporting network applications. The
application layer is provided by the program that uses TCP/IP for communication. An application is a
user process cooperating with another process usually on a different host.
Middleware
• definitions
• Contains the definition of one or more services. JDeveloper generates the following attribute declarations
for this section:
• name is optional.
• targetNamespace is the logical namespace for information about this service. WSDL documents can
import other WSDL documents, and setting targetNamespace to a unique value ensures that the
namespaces do not clash.
• xmlns is the default namespace of the WSDL document, and it is set to
[Link]
• All the WSDL elements, such as <definitions>, <types> and <message> reside in this namespace.
• xmlns:xsd and xmlns:soap are standard namespace definitions that are used for specifying SOAP-specific
information as well as data types.
• xmlns:tns stands for this namespace.
• xmlns:ns1 is set to the value of the schema targetNamespace, in the <types> section.
• types
• Provides information about any complex data types used in the WSDL document. When simple types are
used the document does not need to have a types section.
• message
• An abstract definition of the data being communicated. In the example, the message contains just one part,
response, which is of type string, where string is defined by the XML Schema.
• operation
• An abstract description of the action supported by the service.
• portType
• An abstract set of operations supported by one or more endpoints.
• binding
• Describes how the operation is invoked by specifying concrete protocol and data format specifications for
the operations and messages.
• port
• Specifies a single endpoint as an address for the binding, thus defining a single communication endpoint.
• service
• Specifies the port address(es) of the binding. The service is a collection of network endpoints or ports.
• SOAP- Structure of SOAP Message (In JAX-WS)
• A SOAP message is encoded as an XML document, consisting of an <Envelope> element,
which contains an optional <Header> element, and a mandatory <Body> element. The
<Fault> element, contained in <Body>, is used for reporting errors.
• 3. Stateless
• Stateless means the state of the service doesn't persist between
subsequent requests and response. It means that the request itself
contains the state required to handle the request. It can be a query-string
parameter, entity, or header as a part of the URI. The URI identifies the
resource and state (or state change) of that resource in the unit. After the
server performs the appropriate state or status piece (s) that matters are
sent back to the client through the header, status, and response body.
• 4. Layered system
• It is directly connected to the end server or by any intermediary whether a client cannot
tell. Intermediate servers improve the system scalability by enabling load-balancing and
providing a shared cache. Layers can enforce security policies.
• 5. Cacheable
• On the World Wide Web, customers can cache responses. Therefore, responses clearly
define themselves as unacceptable or prevent customers from reusing stale or
inappropriate data to further requests. Well-managed caching eliminates some client-
server interactions to improving scalability and performance.
• Compliance with the constraints will enable any distributed hypermedia system with
desirable contingency properties such as performance, scalability, variability, visibility,
portability, and reliability.
• HTTP methods
• 5 Essential HTTP Methods in RESTful API Development
• 1. GET
• The GET method is used to ‘retrieve’ a record or a collection of records from the
server.
• 2. POST
• The POST method sends data to create a ‘new record‘ on the server.
• 3. PUT
• The PUT method sends data to update an ‘existing record‘ on the server.
• 4. PATCH
• Like the PUT method, PATCH is also used to send data to update an ‘existing
record’ on the server. But the important difference between PUT and PATCH is
that PATCH only applies partial modifications to the record instead of replacing
the whole record.
• 5. DELETE
• The DELETE method is used to delete record(s) from the server.
• Java API for RESTful Web Services (JAX-RS)
• JAX-RS stands for JAVA API for RESTful Web Services. JAX-RS is a JAVA based
programming language API and specification to provide support for created
RESTful Web Services.
• Its 2.0 version was released on the 24th May 2013. JAX-RS uses annotations
available from Java SE 5 to simplify the development of JAVA based web services
creation and deployment. It also provides supports for creating clients for
RESTful Web Services.
• RESTful web services are designed to expose APIs on the web.
• It aims to provide better performance, scalability, and flexibility than traditinoal
web services, by allowing clients to access data and resources using predictable
URLs. Many well-known public web services expose RESTful APIs.
• The Java 6 Enterprise Edition specification for RESTful services is JAX-RS. In the
REST model, the server exposes APIs through specific URIs (typically URLs), and
clients access those URIs to query or modify data. REST uses a stateless
communication protocol. Typically, this is HTTP.
• The following is a summary of RESTful design principles:
• A URL is tied to a resource using the @Path annotation. Clients access the
resource using the URL.
• Create, Read, Update, and Delete (CRUD) operations are accessed via PUT, GET,
POST, and DELETE requests in the HTTP protocol.
• PUT creates a new resource.
• DELETE deletes a resource.
• GET retrieves the current state of a resource.
• POST updates a resources's state.
• Resources are decoupled from their representation, so that clients can request
the data in a variety of different formats.
• Stateful interactions require explicit state transfer, in the form of URL rewriting,
cookies, and hidden form fields. State can also be embedded in response
messages.
• Chapter 2 - Virtualization
• Characteristics of Virtualized Environments..
• Pros and Cons of Virtualization.
• Virtualization using KVM,
• Creating virtual machines,
• oVirt - management tool for virtualization environment.
Virtualization
• Virtualization technology is one of the fundamental components of cloud
computing, especially in regard to infrastructure-based services.
• Virtualization allows the creation of a secure, customizable, and isolated
execution environment for running applications, even if they are untrusted,
without affecting other users’ applications.
• The basis of this technology is the ability of a computer pro- gram—or a
combination of software and hardware—to emulate an executing
environment separate from the one that hosts such programs.
• Virtualization provides a great opportunity to build elastically scalable
systems that can provision additional capability with minimum costs.
• Therefore, virtualization is widely used to deliver customizable computing
environments on demand.
Introduction
• Virtualization is a large umbrella of technologies and concepts that are meant to provide
an abstract environment—whether virtual hardware or an operating system—to run
applications.
• The term virtualization is often synonymous with hardware virtualization, which plays a
fundamental role in efficiently delivering Infrastructure-as-a-Service (IaaS) solutions for
cloud computing.
• virtualization technologies provide a virtual environ- ment for not only executing
applications but also for storage, memory, and networking.
• Virtualization technologies have gained renewed interested recently due to the
confluence of several phenomena:
• Increased performance and computing capacity : Nowadays, the average end-user
desktop PC is powerful enough to meet almost all the needs of everyday computing, with
extra capacity that is rarely used.
• Almost all these PCs have resources enough to host a virtual machine manager and
execute a virtual machine with by far acceptable performance.
• The same consideration applies to the high-end side of the PC market, where
supercomputers can provide immense compute power that can accommodate the
execution of hundreds or thousands of virtual machines.
• Underutilized hardware and software resources: Hardware and software underutilization
is occurring due to (1) increased performance and computing capacity, and (2) the effect
of limited or irregular use of resources.
• Lack of space: The continuous need for additional capacity, whether storage or compute
power, makes data centers grow quickly.
• Companies such as Google and Microsoft expand their infrastructures by building large
data centers which are able to host thousands of nodes.
• Greening initiatives: Recently, companies are increasingly looking for ways to reduce the
amount of energy they consume and to reduce their carbon footprint.
• Data centers are one of the major power consumers; they contribute consistently to the
impact that a company has on the environment.
• Maintaining a data center operation not only involves keeping servers on, but a great deal
of energy is also consumed in keeping them cool.
• Infrastructures for cooling have a significant impact on the carbon footprint of a data
center.
• Hence, reducing the number of servers through server consolidation will definitely reduce
the impact of cooling and power consumption of a data center. Virtualization technologies
can provide an efficient way of consolidating servers.
• Rise of administrative costs: Power consumption and cooling costs have now
become higher than the cost of IT equipment.
• Moreover, the increased demand for additional capacity, which translates
into more servers in a data center, is also responsible for a significant
increment in administrative costs.
• Common system administration tasks include hardware monitoring, defective
hardware replacement, server setup and updates, server resources
monitoring, and backups.
• These are labor-intensive operations, and the higher the number of servers
that have to be managed, the higher the administrative costs.
• Virtualization can help reduce the number of required servers for a given
workload, thus reducing the cost of the administrative personnel.
Characteristics of virtualized environments
• Virtualization is a broad concept that refers to the creation of a virtual
version of something, whether hardware, a software environment, storage,
or a network.
• In a virtualized environment there are three major components: guest, host,
and virtualization layer.
• The guest represents the system component that interacts with the
virtualization layer rather than with the host.
• The host represents the original environment where the guest is supposed to
be managed.
• The virtualization layer is responsible for recreating the same or a different
environment where the guest will operate.
• As shown in the figure below:
• Such a general abstraction finds different applications and then implementations of the
virtualization technology.
• The most intuitive and popular is represented by hardware virtualization .
• In the case of hardware virtualization, the guest is represented by a system image
comprising an operating system and installed applications.
• These are installed on top of virtual hardware that is controlled and managed by the
virtualization layer, also called the virtual machine manager.
• The host is instead represented by the physical hardware, and in some cases the operating
system, that defines the environment where the virtual machine manager is running.
• In the case of virtual storage, the guest might be cli- ent applications or users that interact
with the virtual storage management software deployed on top of the real storage system.
• The case of virtual networking is also similar: The guest— applications and users—
interacts with a virtual network, such as a virtual private network(VPN), which is managed
by specific software(VPN client) using the physical network available on the node.
• The main common characteristic of all these different implementations is the fact that the
virtual environment is created by means of a software program.
• The ability to use software to emulate such a wide variety of environments creates a lot of
opportunities, previously less attractive because of excessive overhead introduced by the
virtualization layer.
• Such advantages have always been characteristics of virtualized solutions.
• Increased security
• Managed execution
• Portability
Increased Security
• The ability to control the execution of a guest in a completely transparent manner opens new possibilities
for delivering a secure, controlled execution environment.
• The virtual machine represents an emulated environment in which the guest is executed.
• All the operations of the guest are generally performed against the virtual machine, which then translates
and applies them to the host.
• This level of indirection allows the virtual machine manager to control and filter the activity of the guest,
thus preventing some harmful operations from being performed.
• Resources exposed by the host can then be hidden or simply protected from the guest.
• Sensitive information that is contained in the host can be naturally hidden without the need to install
complex security policies.
• Increased security is a requirement when dealing with untrusted code.
• By default, the file system exposed by the virtual computer is completely separated from the one of the host
machine.
• This becomes the perfect environment for running applications without affecting other users in the
environment.
Managed execution
• Virtualization of the execution environment not only allows increased
security, but a wider range of features also can be implemented.
• In particular, sharing, aggregation, emulation, and isolation are the most
relevant features are shown in the diagram.
• Sharing: Virtualization allows the creation of a separate computing
environments within the same host.
• In this way it is possible to fully exploit the capabilities of a powerful guest,
which would otherwise be underutilized.
• Aggregation: Not only is it possible to share physical resource among several
guests, but virtualization also allows aggregation, which is the opposite
process.
• A group of separate hosts can be tied together and represented to guests as
a single virtual host.
• This function is naturally implemented in middleware for distributed
computing, with a example represented by cluster management software,
which equipment the physical resources of a homogeneous group of
machines and represents them as a single resource.
• Emulation: Guest programs are executed within an environment that is controlled
by the virtualization layer, which ultimately is a program.
• This allows for controlling and tuning the environment that is exposed to guests.
• a completely different environment with respect to the host can be emulated, thus
allowing the execution of guest programs requiring specific characteristics that are
not present in the physical host.
• This feature becomes very useful for testing purposes, where a specific guest has to
be validated against different platforms or architectures and the wide range of
options is not easily accessible during development.
• Isolation: Virtualization allows providing guests—whether they are operating
systems, applications, or other entities—with a completely separate environment,
in which they are executed.
• The guest program performs its activity by interacting with an abstraction layer,
which provides access to the underlying resources.
• Isolation brings several benefits;
• it allows multiple guests to run on the same host without interfering with each other.
• Second, it provides a separation between the host and the guest.
• The virtual machine can filter the activity of the guest and prevent harmful operations against
the host.
• Besides these characteristics, another important capability enabled by virtualization is
performance tuning.
• It becomes easier to control the performance of the guest by finely tuning the properties
of the resources exposed through the virtual environment.
Portability
• The concept of portability applies in different ways according to the specific type of
virtualization considered.
• In the case of a hardware virtualization solution, the guest is packaged into a virtual image
that, can be safely moved and executed on top of different virtual machines.
• Except for the file size, this happens with the same simplicity with which we can display a
picture image in different computers.
• In the case of programming-level virtualization, as implemented by the JVM or the .NET
runtime, the binary code representing application components (jars or assemblies) can be
run without any recompilation on any implementation of the corresponding virtual
machine.
• This makes the application development cycle more flexible and application deployment
very straight forward: One version of the application, is able to run on different platforms
with no changes.
• Finally, portability allows the system always be ready to use as long as the required virtual
machine manager is available.
Pros and cons of virtualization
• Virtualization has now become extremely popular and widely used, especially
in cloud computing.
• The primary reason for its wide success is the elimination of technology
barriers that prevented virtualization from being an effective and viable
solution in the past.
• The most relevant barrier has been performance.
• The Internet connection and the advancements in computing technology
have made virtualization an interesting opportunity to deliver on-demand IT
infrastructure and services.
• Despite its renewed popularity, this technology has benefits and also
drawbacks.
Advantages of virtualization
• Managed execution and isolation are the most important advantages of virtualization.
• In the case of techniques supporting the creation of virtualized execution environments,
these two characteristics allow building secure and controllable computing environments.
• A virtual execution environment can be configured as a sandbox, thus preventing any
harmful operation to cross the borders of the virtual host.
• allocation of resources and their partitioning among different guests is simplified, being
the virtual host controlled by a program.
• This enables fine-tuning of resources, which is very important in a server consolidation
scenario and is also a requirement for effective quality of service.
• Portability is another advantage of virtualization, especially for execution virtualization
techniques.
• Virtual machine instances are normally represented by one or more files that can be easily
transported with respect to physical systems.
• they also tend to be self-contained since they do not have other dependencies besides the
virtual machine manager for their use.
• Portability and self-containment simplify their administration.
• Portability and self-containment also contribute to reducing the costs of
maintenance, since the number of hosts is expected to be lower than the
number of virtual machine instances.
• Since the guest program is executed in a virtual environment, there is very
limited opportunity for the guest program to damage the underlying
hardware.
• it is expected that there will be fewer virtual machine managers with respect
to the number of virtual machine instances managed.
• Finally, by means of virtualization it is possible to achieve a more efficient use
of resources.
• Multiple systems can securely coexist and share the resources of the
underlying host, without interfering with each other.
• This is a prerequisite for server consolidation, which allows adjusting the
number of active physical resources dynamically according to the current
load of the system, thus creating the opportunity to save in terms of energy
consumption and to be less impacting on the environment.
Disadvantages
1. Performance degradation
• Performance is definitely one of the major concerns in using virtualization technology. Since
virtualization interposes an abstraction layer between the guest and the host, the guest can
experience increased latencies.
• For example, in the case of hardware virtualization the causes of performance degradation are:
• Maintaining the status of virtual processors
• Support of privileged instructions
• Support of paging within VM
• Console functions
2. Inefficiency and degraded user experience
• Virtualization can sometime lead to an inefficient use of the host.
• some of the specific features of the host cannot be exposed by the abstraction layer and then
become inaccessible.
• In the case of hardware virtualization, this could happen for device drivers: The virtual machine
can sometime simply provide a default graphic card that maps only a subset of the features
available in the host.
• In the case of programming-level virtual machines, some of the features of the underlying
operating systems may become inaccessible unless specific libraries are used.
3. Security holes and new threats
• Virtualization opens the door to a new and unexpected form of phishing.
• The capability of emulating a host in a completely transparent manner led
the way to malicious programs that are designed to extract sensitive
information from the guest.
• In the case of hardware virtualization, malicious programs can preload
themselves before the operating system and act as a thin virtual machine
manager toward it.
• The operating system is then controlled and can be manipulated to extract
sensitive information of interest to third parties.
• The same considerations can be made for programming-level virtual
machines: Modified versions of the runtime environment can access sensitive
information or monitor the memory locations utilized by guest applications
while these are executed.
Virtualization using KVM
• The default virtualization technology supported in Ubuntu is KVM. For Intel and AMD hardware
KVM requires virtualization extensions. But KVM is also available for IBM Z and LinuxONE, IBM
POWER as well as for ARM64.
• Xen is also supported on Ubuntu, but not for all architecture, for example not for IBM Z and
LinuxONE. Xen can take advantage of virtualization extensions, when available, but can also be
used on hardware without virtualization extensions. Qemu is another popular solution for
hardware without virtualization extensions.
• KVM stands for Kernel-based Virtual Machine, and currently it has developed one of the most
popular virtual machines in the world. KVM is a full virtualization solution for Linux on x86
hardware containing virtualization extensions(Intel VT or AMD-V).
• It consists of a loadable kernel module, [Link] that provides the core virtualization infrastructure
and a processor specific module, [Link] or [Link]. KVM also requires a modified
QEMU although work is underway to get the required changes upstream.
• Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images.
Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.
with KVM, multiple virtual machines can run under the unmodified Linux or Windows images.
Every single virtual machine has its own virtualized hardware, containing network card(NIC),
storage devices, graphical user interface(GUI) etc.
• Compared with VMware and Hyper-V, KVM is open source. The kernel component of KVM is
included in mainline Linux, as of 2.6.20 and has since been fixed as a part of the kernel.
Benefits of using KVM:
• It support for any kind of guest OS.
• Efficient code
• KVM is open source and flexible
• User doesn’t have to pay for license.
oVirt - management tool for virtualization environment
• It is a complete virtualization management platform, licensed and developed as
open source software.
• It builds on the powerful KVM hypervisor and on the RHEV-M management server
released by Red Hat to the open source community.
• It is a large scale, centralized management for server and desktop virtualization.
• Provide an open source alternative to vCenter/vSphere. Two key components of
oVirt are:
• Hypervisor – oVirt Node
• Management Server – oVirt Engine
oVirt Node:
• It computes virtualization units that directly runs the virtual machine.
• oVirt nodes are servers using Linux x86_64 with the installed libvirt daemon
and VDSM(Virtual Desktop and Server Management) services.
• These are the set of packages and support services that are required for rapid
deployment of virtualization.
• The most preferred distribution to build the nodes is Red Hat Linux.
oVirt Engine:
• It is a control unit used for administrative tasks related to the management of
the global configuration of the entire virtualization infrastructure, the
management of virtual machines, storage and network settings.
• oVirt Engine is a set of software and services that implements the
functionality of the central control infrastructure.
• Using oVirt Engine interfaces, the administrator can run the whole setup
inside the oVirt.
Goals of the oVirt
• Build a community around all levels of the virtualization stack- hypservisor,
manager, GUI, API etc.
• To deliver both a cohesive complete stack and discretely reusable
components for open virtualization management.
• Provide a release of the project on a well defined schedule.
• Focus on management of the KVM hypervisor with exceptional guest support
beyond Linux.
• Provide a venue for user and developer communication and coordination.