Lecture6 (1)
Lecture6 (1)
Computing
Risala Tasin Khan
Professor
IIT, JU
Introduction
• This interface is a service contract between the service provider and service
consumer.
• Applications behind the service interface can be written in Java, Microsoft .Net,
Cobol or any other programming language.
• Service interfaces are frequently defined using Web Service Definition
Language (WSDL) which is a standard tag structure based on xml (extensible
markup language).
• The services are exposed using standard network protocols—such as SOAP
(simple object access protocol)/HTTP or Restful HTTP (JSON/HTTP)—to send
requests to read or change data.
• At the appropriate stage the services are published in a registry that enables
developers to quickly find them and reuse them to develop new applications
or business processes.
Internal Structure of SOA
• In the Service-Oriented Architecture, the entire backend system is
majorly divided into three parts, that are: Service Provider, Service
Broker/Registry/Repository, and Service
Consumer/Requester.
• Service Provider:
• It is a maintainer and organization of the service that makes one or
more services available for others to use.
• The service provider creates a web service and provides information
about this service to the service registry.
• It has to decide the service category and trading partner agreements
that are required to use the services.
Cont…
• SOA enables mutual data exchange between programs of different vendors without the need for
additional programming or changes to the services.
• The services should be independent and they should have standard interfaces that can be called
to perform their tasks in a standard way.
• Also, a service need not have prior knowledge of the calling application and the application does
not need to have knowledge about how the tasks are performed by a service.
The Various Benefits of SOA
• Reliability:
• With small and independent services in the SOA, it becomes easier to
test and debug the applications instead of debugging the massive code
chunks, which makes the service-oriented architecture highly reliable.
• Location Independence:
• Services are located through the service registry and can be accessed
through Uniform Resource Locator (URL), therefore they can change
their location over time without interrupting consumer experience on
the system while making SOA location independent.
• Scalability:
• Services of the service-oriented architecture operate on different
servers within an environment, this increases its scalability.
The Various Benefits of SOA
• Reuse of Services:
• Various services can be reused by different applications.
• Having reusable services readily available also results in quicker time to
market.
Technologies Used by SOA
• Web Services:
• Web services are the prominent technology for implementing SOA systems and
applications.
• They use Internet technologies and standards for building distributed systems.
• Several aspects make Web services the technology of choice for SOA.
• First, they allow for interoperability across different platforms and programming
languages.
• Second, they are based on well-known and vendor-independent standards such as
HTTP, SOAP , XML, and WSDL .
• Third, they provide an intuitive and simple way to connect heterogeneous software
systems, enabling the quick composition of services in a distributed environment.
• Finally, they provide the features required by enterprise business applications to be
used in an industrial environment.
Web Services (Cont…)
• System architects develop a Web service with their
technology of choice and deploy it in compatible Web
or application servers.
• The service description document (Interface),
expressed by means of Web Service Definition
Language (WSDL), can be either uploaded to a global
registry or attached as a metadata to the service itself.
• Service consumers can look up and discover services in
global catalogs using Universal Description Discovery
and Integration (UDDI) or, most likely, directly retrieve
the service metadata by interrogating the Web service
first.
• The Web interface allows service consumers to
automatically generate clients for the given service and
embed them in their existing application.
Technologies used by Web
Services/SOA
• SOAP(Simple Object Access Protocol):
• SOAP (Simple Object Access Protocol) is a protocol used for
exchanging structured information in the implementation of
web services.
• It relies on XML (Extensible Markup Language) as its message
format and typically works over standard transport protocols
such as HTTP, SMTP, or TCP.
• SOAP enables communication between applications running
on different operating systems, with different technologies,
and across network boundaries.
Key Components of SOAP Architecture
•SOAP Envelope:
•Defines the structure of the message and what it contains.
•Consists of two parts: the Header (optional, for meta-information like authentication or transaction management)
and the Body (mandatory, containing the actual message payload).
•SOAP Encoding Rules:
•Specifies data types and how data is serialized and deserialized.
•Ensures that different platforms can understand and process the data correctly.
•SOAP Message:
•An XML document that contains the data being exchanged.
•Follows a strict structure with elements such as <Envelope>, <Header>, and <Body> .
• 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 indirect access allows the virtual machine manager (VMM) 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.
• Moreover, 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
Managed execution
(Advantage of Virtualization)
ABI defines:
• Calling conventions: How functions receive parameters and return values.
• Data types: Sizes and alignments of data types.
• System calls: How applications request services from the operating system.
• Binary format: The format of executable files and libraries
Machine reference model (Cont..)
• The highest level of abstraction is represented
by the application programming interface
(API), which is the interface between
applications and libraries and/or the
underlying operating system.
• For any operation to be performed in the
application level API, ABI and ISA are
responsible for making it happen.
• The high-level abstraction is converted into
machine-level instructions to perform the
actual operations supported by the processor.
• The machine-level resources, such as
processor, registers and main memory
capacities, are used to perform the operation
at the hardware level of the central processing
unit (CPU).
Privileged and Non Privileged Instructions
• Privileged instructions are CPU instructions that can only be executed in a privileged
mode, also known as kernel mode or supervisor mode.
• In this mode, the executing process has full access to all system resources and can perform
sensitive operations that could potentially affect the stability and security of the entire
system.
• Privileged instructions often involve direct control over hardware resources, memory
management, interrupt handling, and system configuration.
• Examples of privileged instructions include:
• Enabling and disabling interrupts
• Accessing certain control registers that configure CPU behavior
• Modifying memory protection settings
• Initiating input/output (I/O) operations
• Loading or modifying the page tables for virtual memory management
• Only the operating system kernel and certain trusted components run in privileged mode.
User-level applications run in a non-privileged mode, which restricts their direct access to
hardware and sensitive system resources
Cont..
• Non-privileged instructions are CPU instructions that can be
executed by user-level processes running in a non-privileged
mode.
• These instructions allow user-level programs to perform regular
computations and interact with the system in a controlled and
isolated manner, without direct access to privileged operations.
• Examples of non-privileged instructions include:
• Arithmetic and logical operations
• Memory read and write operations (within the process's allocated
memory space)
• User-level I/O operations
• Basic program control flow instructions (e.g., branching, function calls)
How Execution Virtualization Works
1. Initialization:
When a VM is started, the hypervisor allocates the necessary resources (CPU, memory, I/O devices) and
sets up the virtual environment. The VM runs as a process on the host OS (for Type 2 hypervisors) or
directly on hardware (for Type 1 hypervisors).
2. Instruction Execution:
Guest operating systems and applications execute instructions as if they were running on physical
hardware. The hypervisor intercepts privileged instructions, handles them, and translates them into actions
on the physical hardware.
3. I/O Operations:
I/O operations, such as disk reads/writes or network access, are handled by the hypervisor. The
hypervisor can present virtual devices to the guest OS, while mapping these operations to physical
devices.
How Execution Virtualization Works(Cont..)
•Context Switching:
•The hypervisor manages context switching between multiple VMs.
This involves saving and restoring the state of VMs, such as CPU
registers and memory mappings, to ensure isolation and fairness.
•Resource Management:
•The hypervisor controls resource allocation to ensure that one VM
doesn’t monopolize physical resources. It can dynamically allocate
CPU, memory, and I/O bandwidth based on the needs of each VM.
Hardware-level virtualization
• Hardware-level virtualization is a virtualization technique that provides an
abstract execution environment in terms of computer hardware on top of
which a guest operating system can be run.
• In this model, the guest is represented by the operating system, the host
by the physical computer hardware, the virtual machine by its emulation,
and the virtual machine manager by the hypervisor (see Figure 3.6).
• The hypervisor is generally a program or a combination of software and
hardware that allows the abstraction of the underlying physical hardware.
• Hardware-level virtualization is also called system virtualization, since it
provides ISA to virtual machines, which is the representation of the
hardware interface of a system.
• This is to differentiate it from process virtual machines, which expose ABI to
virtual machines.
Hypervisors
• A fundamental element of hardware virtualization is the hypervisor,
or virtual machine manager (VMM).
• It recreates a hardware environment in which guest operating
systems are installed.
Organization of VMM
• A virtual machine manager is internally organized as described in
Figure.
• Three main modules, dispatcher, allocator, and interpreter,
coordinate their activity in order to emulate the underlying
hardware.
• The dispatcher constitutes the entry point of the monitor and
reroutes the instructions issued by the virtual machine instance
to one of the two other modules.
• The allocator is responsible for deciding the system resources to
be provided to the VM: whenever a virtual machine tries to
execute an instruction that results in changing the machine
resources associated with that VM, the allocator is invoked by
the dispatcher.
• The interpreter module consists of interpreter routines. These
are executed whenever a virtual machine executes a privileged
instruction: a trap is triggered and the corresponding routine is
executed.
Criteria Required to be a VMM
• The design and architecture of a virtual machine manager, together with
the underlying hardware design of the host machine, determine the full
concept of hardware virtualization, where a guest operating system can be
transparently executed on top of a VMM as though it were run on the
underlying hardware.
• A VMM must satisfies the following two properties:
1. Equivalence: A guest running under the control of a virtual machine
manager should exhibit the same behaviour as when it is executed
directly on the physical host.
2. Resource control: The virtual machine manager should be in complete
control of virtualized resources.
H/W Virtualization Techniques
• Full Virtualization:
• Full virtualization refers to the ability to run a program, most likely an operating
system, directly on top of a virtual machine and without any modification, as though
it were run on the raw hardware.
• To make this possible, virtual machine managers are required to provide a complete
emulation of the entire underlying hardware.
• The moment the guest tries to access the resources of host machine, a trap is sent
to VMM and the VMM emulates the complete Hardware resources that the guest
wants to access.
• In Full Virtualization, the hypervisor emulates completely the hardware. The
guest operating system does not know that it is running on a virtual machine
and use hardware instructions to interact to the emulated hardware.
• The principal advantage of full virtualization is:
• complete isolation, which leads to enhanced security,
• ease of emulation of different architectures and
• coexistence of different systems on the same platform.
H/W Virtualization Techniques
• Paravirtualization:
• In Paravirtualization, the hypervisor provides an API that the guest operating
system can use to access the hardware.
• Here, the guest operating system knows that it is running on a virtual
machine and, instead of using hardware instructions, use the hypervisor API
to interact to the hardware.
• Typically, paravirtualization simplifies the operation of the hypervisor and
supports a better performance of the virtual machines.
• As a problem, not all the operating systems support paravirtualization on all
the hypervisors.
• Recently, Ubuntu include drivers for paravirtualization on VirtualBox, KVM
and HyperV. You do not need any additional software for these hypervisors.
However, this is not the same for all the operating systems and hypervisors.
• Windows, for instance, has an exceptional support for HyperV, but not for all
the other hypervisors.
Example
• As an example, consider the use of a graphic card by a virtual
machine.
• In full virtualization, the guest operating system use a driver that
thinks that it is running in a real hardware. The programs, e.g.
Microsoft Office, invoke driver functions using an API, the driver
interacts with the emulated hardware using hardware interruptions,
I/O operations and data memory manipulation. The hypervisor must
understand all the hardware emulations and translate the behaviour
in the real hardware.
• In paravirtualization, the guest operating system uses a driver that
interact with the drivers in the host with the help of VMM. The
programs, e.g. Microsoft Office, invoke driver functions in the guest
using an API, the guest driver invoke the host driver using another
API and the host driver executes the operation in the real hardware.
Programming language-level virtualization
• Programming language-level virtualization is mostly used to achieve ease of
deployment of codes, managed execution, and portability across different
platforms and operating systems.
• It consists of a virtual machine executing the byte code of a program, which
is the result of the compilation process.
• Compilers implemented and used this technology to produce a binary
format representing the machine code for an abstract architecture.
• The characteristics of this architecture vary from implementation to
implementation.
• At runtime, the byte code can be either interpreted or compiled against the
underlying hardware instruction set.
Programming language-level
virtualization(Cont..)
• The main advantage of programming-level virtual machines, also called process virtual machines, is
the ability to provide a uniform execution environment across different platforms.
• Programs compiled into byte code can be executed on any operating system and platform for which
a virtual machine able to execute that code has been provided.
• From a development lifecycle point of view, this simplifies the development and deployment efforts
since it is not necessary to provide different versions of the same code.
• The implementation of the virtual machine for different platforms is still a costly task, but it is done
once and not for any application.
• Moreover, process virtual machines allow for more control over the execution of programs since
they do not provide direct access to the memory.
• Implementations of this model are also called high-level virtual machines, since high-level
programming languages are compiled to a conceptual ISA, which is further interpreted or
dynamically translated against the specific instruction of the hosting platform.
How ABI works in virtualized environment
• Here's how ABI works in virtualization:
• Guest and Host ABI Compatibility:
• Virtualization involves running multiple guest operating systems on a single physical
host. Each guest OS has its own ABI, which is designed to work with its specific
hardware and software environment.
• However, the host OS or hypervisor may have a different ABI.
• To enable communication between the guest and host environments, there needs
to be a level of ABI compatibility. This compatibility ensures that guest applications
can make system calls and access resources provided by the host.
• ABI Translation and Emulation:
• In some cases, the guest and host ABIs might be different due to architectural
differences between the virtualized environment and the physical hardware.
• In such situations, ABI translation or emulation is employed.
• This involves intercepting system calls and other low-level interactions made by the
guest OS, translating them into a form that the host ABI understands, and then
carrying out the requested action in the host environment.
Application-level virtualization
• Application virtualization, also called application service virtualization refers to
running an application on a thin client; a terminal or a network workstation with
few resident programs and accessing most programs residing on a connected
server.
• The thin client runs in an environment separate from, sometimes referred to as
being encapsulated from, the operating system where the application is located.
• Application virtualization fools the computer into working as if the application is
running on the local machine, while in fact it is running on a virtual machine (such
as a server) in another location, using its operating system (OS), and being
accessed by the local machine.
• Incompatibility problems with the local machine’s OS, or even bugs or poor
quality code in the application, may be overcome by running virtual applications.
• Any user from any location can use the same application using internet as the
original application is located in a central server.
• It allows you to install the application to the server and make it virtual
to be used by multiple users over the network. Thus reducing the
need to install the desired applications on individual systems and
saving the cost for installing and licensing the software for every
machine.
• This has made the deployment of the applications an easy task for
the clients or partners. You can easily deliver the executable file of
the desired application to your clients making the deployments
easier.
Benefits of • You can place the virtualized applications anywhere on the server or
make required copies, saving them in different locations. Thus you
can use such applications on any type of endpoints either Windows,
Application macOS, iOS, or Android. Thus providing you the portability and you
do not have to worry if any of the endpoints have been
compromised, you are still able to use your application from another
endpoint.
Virtualizatio • You can easily remove the unwanted virtual applications directly thus
saving you from uninstalling the applications from individual systems.