0% found this document useful (0 votes)
11 views78 pages

Integrative Programing Chapter 1

Intersystem communication allows different IT systems to share data and resources. There are several architectures for integrating independent systems, including point-to-point, hub-and-spoke, distributed, and service-oriented architectures. Middleware technology lies between applications and operating systems, enabling communication across different platforms and programming languages to integrate heterogeneous systems.

Uploaded by

melkamu tesfay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views78 pages

Integrative Programing Chapter 1

Intersystem communication allows different IT systems to share data and resources. There are several architectures for integrating independent systems, including point-to-point, hub-and-spoke, distributed, and service-oriented architectures. Middleware technology lies between applications and operating systems, enabling communication across different platforms and programming languages to integrate heterogeneous systems.

Uploaded by

melkamu tesfay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

CHAPTER ONE

OVERVIEW OF INTERSYSTEM
COMMUNICATION

By: Tarekegn D.(MSc.) @2023.


.
1. Intersystem Communication
▪ A system communication is defined as the connection of two or
more IT systems(Inter vs Intra system Communication)
▪ for the purpose of sharing data and other information resources.

▪ What is Intersystem Communication?

• the communication between the set of heterogeneous systems


that are integrated together.

▪ which puts together many heterogeneous subsystems

▪ the produced information objects are extremely different,

▪ yet should be contribute to the same process

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 2


...
➢ Q: How can establish the system which makes combination of
independent systems possible and relatively easy to user?

➢ Ans:

➢ By using level of design in integrated systems architecture that


involves

• the description of elements from which systems are built,

• interactions among those elements,

• patterns that guide their structure, and

• constraints on these patterns.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 3


Representation Concepts for Architecture
➢ Component: An object with independent existence, i.e.
✓ A module, process, procedure, or variable
➢ Interface: A typed object that denotes a logical point of interaction
between a component and its environment.
➢ Configuration: A collection of Constraints that wire the objects
into a specific architecture
➢ Mapping: A relationship that defines a syntactical translation from
the language of an abstract architecture to the language of a
concrete architecture
➢ Architectural Style: A language of design elements, constraints
that determine how they are to be used and a semantic definition of
the connectors associated with this style.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 4


1.1 Architectures for integrating system
• It provides a bridge between the heterogeneous
operational applications and platforms.
• A well-designed system, encompasses
– all of the system elements
– the relationships between the elements and
– the user interfaces to those elements.
– usually keep working no matter how many
applications are exchanged on.
– Why?
• Because it has good integrating architectural
design, which is the backbone of any complex
computer system.
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 5
1.1 Architectures for integrating system…
▪ Types of well-known system Integration Architectures
▪ Point-To-Point Architecture for System Integration(P2P-
SIA)
▪ Tightly coupled application components communication by using
participating devices known as “Peers.“
▪ Hub And Spoke Architecture for System Integration(H-SIA)
▪ Cross application components communication decoupled by
centeral device or server called a “ hub “.
▪ Distributed Architecture for System Integration(D-SIA)
▪ Distributed application components communication by using
smaller device known as “Agents.“
▪ Service Oriented Architecture for System Integration (SOA-
SIA)
▪ loosely coupled application services communication by using
6/17/2023 concept known as “we services.“
Copyright©2019/20 Tarekegn D.(MSc)\ 6
A. P2P-SIA
• is the original architecture used to support systems integration
• the simplest of the integration architectures

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 7


B. H-SIA
• worked on the principle that:
– all information coming from the applications had to be
processed within a single machine or server called a "hub".
– Hub
• Acting as a central point of control
• dealt with all message processing including
– routing, splitting and combining of messages, mapping,
and so on
– Hub and Spoke implementations decouple the sending and
receiving applications
• How the Hub and Spoke different from Point-to-Point?
– the applications on either side of the hub can be modified
independently of each other
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 8
B. H-SIA…

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 9


C. D-SIA
• Is a solution to the Hub and Spoke scalability issue
• by performing message translation, routing, splitting, and
combining closer to the source and target systems
– by using smaller computers known as “Agents.“
• Agents
– are connected to just one system and reduce the processing load
on that system
– take information from the application they are connected to,
then process it,
– and send it to any target application(s) interested in receiving
that information

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 10


C. D-SIA...
• Tier-Architectures of Applications
– Two-tier architecture: Clients and Servers
– Three-tier architecture:
• First tier: clients with GUI
• Middle tier: business logic
• Third tier: System services (databases)
– Peer-to-peer architecture: Equal peers

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 11


C. D-SIA…

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 12


D. SOA-SIA
• is essentially an enhanced version of distributed integration
architecture by
– using concept known as “web service“
• Uses loosely coupled software services to support the requirements
of business processes and software users
• Provides an integrated environment which spreads out the
workload, breaking down the different "silos" of business
functionality and operations.
• an application can customize and/or change the individual pieces or
"services" that it uses penning their processes to other applications
• vast and complex component based applications can be developed

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 13


D. SOA-SIA …

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 14


Middleware technology
• The traditional middleware technology definition

• It lies in the middle between the OS and the applications

• stresses vertical layers

• Applications on top of middleware(top interfaces),


middleware on top of the OS (bottom interfaces)

• The modern middleware technology definition

• The middleware lies in the middle between Application-to-


application and middleware-to-middleware

• emphasis on horizontal communication

• A key feature of middle ware is interoperability


6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 15
Integrative middleware technology
• But, many incompatible middleware systems exist

• Applications on middle ware A can work together

• Applications on middleware B can work together, too

• But, A-applications and B-applications cannot!

• The integrative middleware technology definition

• Any program design that serves to "glue together" or mediate


between two separate and often already existing programs

• This definition also emphasis on horizontal communication

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 16


Integrative middleware technology...
• The most common SW type that enables integration b/n
application/system
» program/component written in one programming language,
running on one platform to interact with an application
object across the network that are written in other
programming languages and running on other platforms
» a layer of software to mask heterogeneity and to provide a
convenient programming model to application
programmers.
» the primary role is to transfer data between applications.
» decouple the Frontend and Backend applications
– in order to enable changes on one side to be transparent
to other side

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 17


Integrative middleware technology...
• The primary functions are
– data generation
– Validation
– Authorization
– Conversion and re-formatting
– transaction mapping and logging.
• The primary services are:

▪ communication facilities

▪ naming remote entities(objects)&persistence(distributed file


system)

▪ distributed transactions and facilities for security


6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 18
Integrative middleware technology...
❖ An adapted Middleware reference model with layers, interfaces,
and protocols for networked communication.

Middleware

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 19


Integrative middleware technology...
• Middleware Protocols
▪ a middleware is an application that contains general-purpose
protocols to provide services
▪ example of middleware services
▪ authentication and authorization services
▪ distributed transactions (commit protocols; locking
mechanisms)
▪ middleware communication protocols (calling a procedure or
invoking an object remotely, synchronizing streams for real-
time data, multicast services)
▪ hence an adapted reference model for networked communications
is required

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 20


Integrative middleware technology...
• Presentation layer:
– to provide common data formatting/representation (wrapping for
tunneling, compression, character sets, (un)marshalling etc.) in
heterogeneous environment for object
• Session layer :
– Map object references to hosts to provide a series of related
connection-oriented transmissions between network nodes.
<URL:http://192.168.1.10:8080/Middleare/mywebservice.java>
– Implements object activation policies in the object adapter
– Object adapters need to be able to start up severs
• which register in an implementation repository or registry
– Implement operation dispatch
– Implement synchronization

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 21


Integrative middleware technology...
• DCE(Distributed Computing Environment) (Linux, heterogeneous)

• Remote Object Invocation(ROI)

• DCOM: Distributed Component Object Model


(Microsoft, homogeneous)

• CORBA: Common Object Request Broker


Architecture (OMG, heterogeneous)

• Java RMI (Oracle, homogeneous)

• Web Service (WS) – (Any, heterogeneous)

• Message Queuing Services

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 22


Integrative middleware technology...
• Difference
– Compile-time vs Run-time Objects
• Compile-time objects are dependent on particular
programming language.
• Run-time objects, the implementation is left “open” and this
approach to object-based distributed systems allows an
application to be constructed from objects written in multiple
languages.
– Run-time objects scheme may use object adapters that act as
wrappers that give implementations an object appearance.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 23


Integrative middleware technology...
• Intra-enterprise

• Most middleware technology has been designed for private

• Inter-enterprise

– Middleware technology has been designed for public

– adds at least two challenges

• Firewalls( & inter-enterprise security in general)

• Different middleware may be used at the two ends

• As well as different operating system, languages, etc

• So, what is solution?


6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 24
Integrative middleware technology...
• As a solution:

• Web Services

• Technology neutral interfaces to packages

• forget the idea of a single middleware technology in


intra-enterprise

• aims to address challenges of inter-enterprise

• high-level communication protocols


– remote procedure calls (RPC)
– remote object invocation (RMI,CORBA,DCOM,WS)

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 25


DCE(Distributed Computing Environment)
• is Architecture proposed by OSF
– defined and promoted by the Open Systems Foundation (OSF).
– Goal: to standardize an open UNIX environment to support
distributed computing
• First product from OSF
• Integrated package of software and tools for developing
distributed applications on an existing OS (UNIX or non-
UNIX)
• Hierarchically layered architecture
• is best described as an influential early middleware product
• subsequently fell behind in the marketplace due to
– its lack of standardized support for object-oriented languages.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 26


DCE... Why DCE ?
–Provides tools( DCE threads, RPC) and services( Directory
service et) to support distributed applications
– DCE components are well integrated
• Placement of each service in the hierarchically layered
architecture is important.
– Provides interoperability and portability across heterogeneous
platforms
– Supports data sharing
– Interoperates with global computing environments

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 27


DCE... Hierarchy
• From bottom to top
– Kernel and Transport Service
– Processes and Threads
– Basic computational units supported by the kernel.
– Everything else is a user-level component that
communicate via RPC and group comm.
– RPC and group communication
– Basic system services
– Time, directory naming
– Distributed File Service
– Distributed Services
– Concurrency control, group management
– Applications
– Security Services(Left) and management Services(Right)
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 28
DCE... Architecture overview

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 29


DCE... Supports Key Features
• The client server model
• Remote Procedure call model
• Data sharing model (Directory service, DFS)
• Distributed component Model
• Proven multi-platform interoperability.
• A mature set of relatively low-level support services.
• A mature interoperability protocol that is also used by DCOM.
• Support for object-like access to remote components.
• A lack until recently of any standard way to specify objects in its
IDL.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 30


CORBA(Common ORB Architecture)
• Specification designed by An Object Management Group's (OMG)
– is a standard or specification and not a particular piece of
software.
– Several implementations of the CORBA standard
• vendor-independent architecture
– open infrastructure that applications employed to work together
over networks.
– Enables enterprise-wide integrated computing by providing
interoperability between components.
– The components can be written in different languages, for
different platforms, and by different vendors.
• A common analogy is to consider CORBA as a software bus,
similar in function to the hardware bus

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 31


CORBA...
• can work with any number of clients and any number of servers
• also includes interfaces for specific industries:
– medical devices, telecom data streaming, and finance /currency
• Object web-the marriage of distributed objects &WWW
• Major computing companies chosen CORBA as the common way
to connect distributed objects across the internet and intranet
– sun, JavaSoft, IBM, Netscape, Apple, Oracle, BEA Systems..
• What features of CORBA lets you incorporate legacy systems
(existing systems) within the bus?
– It uses objects as unifying metaphor(representation)
– Entire system is self-described and component based
– Specification of a service is always separated from
implementation
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 32
CORBA...
Q. Why we sound CORBA is integrating Middleware technology
– Because
• it is a standard that enables an application object written in
one programming language, running on one platform to
interact with an application object across the network that are
written in other programming languages and running on
other platforms
• with its Legacy integration, rich distributed object
infrastructure, Location transparency, Network transparency,
Direct object communication, Dynamic Invocation Interface
➢ Example: a client application object written in C++ and running
under Windows can communicate with a server application object
on a remote machine written in Java running under LINUX/UNIX.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 33


CORBA...
Object management architecture (OMA)

Overall OMA consists 3-basic components

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 34


CORBA...
1. Object Request Broker (ORB)
– the core of any CORBA application integration.
– responsible for all communication

•The structure of CORBA ORB architecture


• locating objects, transferring invocations and return values
• communicating the data making up the request.
• notifying other ORBs of hosted Objects
• must be able to communicate IDL invocations via IIOP

with diverse interfaces:


6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 35
CORBA...
2. Horizontal facilities
• consist of general-purpose high-level services that are
independent of application domains.
• Such as: User interface, Information management, System
management, Task management
• Examples : mobile agents , data interchange, workflow ,
printing facilities, firewalls etc.
3. Vertical facilities
• consist of high-level services that are targeted to a specific
application domain.
• Examples electronic commerce, banking, manufacturing.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 36


CORBA... CORBA Components
• IDL (Interface Definition Language)
• Client/Server CORBA Objects
• ORBs(Object Request Brokers)
• GIOP / IIOP(General/Internet Inter ORB Protocols)

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 37


CORBA... IDL Architecture
▪ Defines public interface for any CORBA object.
◼ Client and Server
implemented based on
compilation of the IDL
◼ OMG has defined mappings
for:
◼ C, C++, Java, COBOL,

Smalltalk, ADA, Lisp,


Python, and IDLscript

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 38


CORBA... Application Implementing involves in general
the following steps

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 39


DCOM (Distributed Component Object Model)
▪ designed by Microsoft .NET initiative

▪ the distributed extension to COM (Component Object Model)


that builds an object remote procedure call (ORPC) layer on top
of DCE RPC to support remote objects
• provides the same functionality but across machines over a
network.
• can also work on a network within an enterprise or on other
networks besides the public Internet(uses TCP/IP and HTTP)
• a protocol that enables software components to communicate directly
over a network in a reliable, secure, and efficient manner.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 40


DCOM…
▪ an Application-level protocol for object-oriented uses the
RPC(Remote Procedural Call) mechanism to transparently send and
receive information between COM components (i.e., clients and
servers) on the same network.
▪ Addresses issues such as:
– Interoperability: Different applications, languages
– Versioning: Compatibility between a new version of a
server and old versions of clients
– New interfaces should preserve the old interface
– Naming: Use Globally unique identifiers

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 41


DCOM Architecture

❖ COM: Adds facilities to communicate across process and machine


boundaries.
❖ SCM: Service Control Manager, responsible for activating objects
❖ Proxy marshaler: handles the way that object references are passed between
different machines.
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 42
Cont…
▪ The IUnknown interface has three methods:
• AddRef(), Release() and QueryInterface()

• AddRef() and Release() are used to manage reference counts (for memory
management)

▪ Through IUnknown, it can control the lifetime of an object and invoke


QueryInterface.

▪ QueryInterface is the basic method to navigate among interfaces.

• This means that a client proxy dynamically loads multiple server stubs in the
remoting layer depending on the number of interfaces being used.

NOTE: The IDL language used by COM/ DCOM is called MIDL.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 43


The three different layers of DCOM and CORBA

▪ The top layer is the basic programming architecture, which is visible to the developers
of the client and object server programs.

▪ The middle layer is the remoting architecture, which transparently makes the interface
pointers or object references meaningful across different processes.

▪ The bottom layer is the wire protocol architecture, which further extends the remoting
architecture to work across different machines.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 44


DCOM VS. CORBA Summary
.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 45


RMI(Remote Method Invocation)
• It is a real distributed application interface for Java, written to
provide easy access to objects existing on remote virtual machines

• provide access to objects existing on remote virtual machines


• Remote objects can be treated similarly to local objects
• Handles marshaling, transportation, and garbage collection of the
remote objects
• Became part of the JDK with version 1.1
• Not an all-purpose ORB architecture like CORBA and DCOM
• Not language independent
• RMI is purely Java-specific
• Java to Java communications only

6/17/2023 46
Copyright©2019/20 Tarekegn D.(MSc)\
❑ RMI System Architecture (How it works)

▪ Built in three layers (they are all independent):


– Stub/Skeleton layer
– Remote reference layer
– Transport layer
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 47
❑ Steps To Develop RMI
▪ Create remote interfaces
– clients will use these to invoke remote methods

▪ Create remote implementation classes


– these implement the remote interfaces and provide the remote functionality

▪ Create server initialization application


– creates remote objects and binds them in the registry
– isn't needed if all remote implementation classes have a main() method that creates
instances and
binds them in the registry

▪ Create client classes


– these can utilize remote objects
– they
6/17/2023 Copyright©2019/20
locate remote objects by Tarekegn 48
D.(MSc)\
❑ Steps To Develop RMI
▪ .

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 49


❑ Example: App server: interface
import java.rmi.*;
public interface AppInterface extends Remote {
public String AppCall() throws RemoteException;
}

50
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ Example: App server: class
import java.rmi.*;
import java.rmi.server.*;

public class App extends UnicastRemoteObject


implements AppInterface {
private String message; // Strings are serializable

public App(String msg) throws RemoteException {


message = msg;
}

public String AppCall() throws RemoteException {


return message;
}
}

51
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ Example: Registering the App server
class AppServer {
public static void main (String[] argv) {
try {
Naming.rebind("rmi://localhost/AppServer",
new App("App, Service!"));
System.out.println("App Server is ready.");
}
catch (Exception e) {
System.out.println("App Server failed: " + e);
}
}
}

52
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ Example: The App client program

class AppClient {
public static void main (String[] args) {
AppInterface app;
String name = "rmi://localhost/AppServer";
try {
app = (AppInterface)Naming.lookup(name);
System.out.println(app.AppCall());
}
catch (Exception e) {
System.out.println("AppClient exception: " + e);
}
}
}

53
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ rmic(RMI Compiler)
▪ The class that implements the remote object should be compiled as usual

▪ Then, it should be compiled with rmic:

– rmic App

– This will generate files App_Stub.class and App_Skel.class

▪ These classes do the actual communication

– The “Stub” class must be copied to the client area

– The “Skel” was needed in SDK 1.1 but is no longer necessary

6/17/2023 Copyright©2019/20 Tarekegn 54


D.(MSc)\
Trying to Run RMI
▪ In three different terminal windows:

1. Run the registry program:

• rmiregistry

2. Run the server program:

• java AppServer

3. Run the client program:

• java AppClient

▪ If all goes well, you should get the “App, Service!” message

55
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
Web Services
Web services are open standard ( XML, SOAP, HTTP etc.) based
Web applications that interact with other web applications for the
purpose of exchanging data
• Web Services are self-contained, modular, distributed, dynamic
applications
• Web services are XML-based information exchange systems that
use the Internet for direct application-to-application interaction
• These systems can include
– Programs
– Objects
– Messages
– documents.

6/17/2023 Copyright©2019/20 Tarekegn 56


D.(MSc)\
Web Services…
• It covers all the details necessary to interact with the service,
including message formats (that detail the operations), transport
protocols and location.
– This allows and encourages WS-based applications to be
• loosely coupled
• component-oriented
• cross-technology implementations.

• The basic Web services platform is XML + HTTP


6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 57
Web Services...
✓ Benefits
1. Exposing the existing function on to network:
– allows you to expose the functionality of your existing code over the
network.
– So, other application can use the functionality of your program.
2. Connecting Different Applications i.e. Interoperability:
– allows to make the application platform and technology independent.
3. Standardized Protocol:
– allows to standardization of protocol stack that gives the business many
advantages like wide range of choices, reduction in the cost due to
competition and increase in the quality.
4. Low Cost of communication:
– allows to uses SOAP over HTTP protocol for the communication, so you
can use your existing low cost internet for implementing Web Services.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 58


Web Services...
• All the standard Web Services works using following components
i. SOAP (Simple Object Access Protocol)
ii. UDDI (Universal Description, Discovery and Integration)
iii. WSDL (Web Services Description Language)

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 59


WS...
➢ A popular interpretation of Web services is based on SOA:
• Uses 3 specifications components:
– WSDL
– SOAP
– UDDI
• Contains 2 Artifacts:
– Service
– Service description
• Plays 3 roles:
– Service provider
– Service registry
– Service requester
• Supports 3 behaviors(Operations):
– Publish: service descriptions
• Service provider &Service registry
– Find/ lookup: service descriptions
• Service requester &Service registry
– Bind/ invoke: services & service description.
• Service requester &Service provider 60
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\
Communication Paradigms
Socket communication
Low-level API for communication using underlying
network protocols

Remote Invocation
A procedure call abstraction for communicating between
entities

Indirect Communication
Communicating without direct coupling between sender
and receiver

6/17/2023 Copyright©2019/20 Tarekegn 61


D.(MSc)\
Network programming…
• Network programming refers to writing a programs
that running on Networked machines.
– programs running on client machines make requests to a
program (often called as server program) running on a server
machine.
• They involve networking services provided by the
transport layer, which is part of the Internet software
stack, often called TCP/IP stack
• The transport layer comprises two types of protocols,
1. TCP (Transport Control Protocol)
2. UDP (User Datagram Protocol).

6/17/2023 Copyright©2019/20 Tarekegn 62


D.(MSc)\
Network programming
• The most widely used programming interfaces for these protocols
are sockets.
• A socket is an endpoint of a two-way communication link between
two programs running on the network.
• Socket is bound to a port number so that the TCP layer can identify
the application that data is destined to be sent.

6/17/2023 Copyright©2019/20 Tarekegn 63


D.(MSc)\
Network programming
Socket Programming
• is a way of connecting two nodes on a network to
communicate with each other.
• One socket(node) listens on a particular port at an
IP, while other socket reaches out to the other to
form a connection.
• Server forms the listener socket while client
reaches out to the server.

6/17/2023 Copyright©2019/20 Tarekegn 64


D.(MSc)\
Network programming
Socket Programming

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 65


Network programming
• Server Socket
– create a socket - Get the file descriptor!
– bind to an address -What port am I on?
– listen on a port, and wait for a connection to be
established.
– accept the connection from a client.
– send/recv - the same way we read and write for a file.
– shutdown to end read/write.
– close to releases data.
–.

6/17/2023 Copyright©2019/20 Tarekegn 66
D.(MSc)\
Network programming
1. User Datagram Protocol (UDP) transports packets in a
connectionless manner.
– each data packet (also called datagram) is addressed and routed individually
and may arrive at the receiver in any order.
• For example, if process 1 on host A sends datagrams m1 and m2
successively to process 2 on host B, the datagrams may be
transported on the network through different routes and may arrive
at the destination in any of the two orders: m1, m2 or m2, m1.
• Sockets that use UDP for transport of packets are called
“datagram” sockets

6/17/2023 Copyright©2019/20 Tarekegn 67


D.(MSc)\
Network programming
2. Transmission Control Protocol (TCP) is connection-oriented and
transports a stream of data over a logical connection established
between the sender and the receiver.
• As a result, data sent from a sender to a receiver is guaranteed to be
received in the order they were sent.
• messages m1 and m2 are delivered in the same order they were sent
• sockets that use TCP for transport are called “stream” sockets.

6/17/2023 Copyright©2019/20 Tarekegn 68


D.(MSc)\
Network programming
Client side Socket Operations
1. Get connection to server:
client = new Socket( server, port_id );
2. Create I/O streams for communicating to server
is = new DataInputStream( client.getInputStream() );
os = new DataOutputStream( client.getOutputStream() );
3. Perform communication with server
Receiive from server :
String line = is.readLine();
Send to server :
os.writeBytes("Hello\n");
4. Close sockets:
client.close();

6/17/2023 Copyright©2019/20 Tarekegn 69


D.(MSc)\
Network programming
Server side Socket Operations
1. Open Server Socket:
ServerSocket server;
DataOutputStream os;
DataInputStream is;
server = new ServerSocket( PORT );
2. Wait for Client Request:
Socket client = server.accept();
3. Create I/O streams for communicating to clients
is = new DataInputStream( client.getInputStream() );
os = new DataOutputStream( client.getOutputStream() );
4. Perform communication with client
Receiive from client: String line = is.readLine();
Send to client: os.writeBytes("Hello\n");
5. Close sockets: client.close();
6/17/2023 Copyright©2019/20 Tarekegn 70
D.(MSc)\
Message And Queuing Services(MQS)
• In message queuing, a message is a collection of data sent by one
program and intended for another program
• Messaging: Programs communicate by sending each other data in
messages rather than calling each other directly.
• Queuing: a mechanism by which messages are held until an
application is ready to process them
– Messages are placed on queues in storage, allowing programs to run
independently of each other, at different speeds and times, in different
locations, and without having a logical connection between them
• Provides asynchronous between COM/DCOM Components
• Typical API for en-queuing and de-queuing messages
• Reliability guaranteed - but still a very new product and needs
maturation

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 71


MQS...
• Allows and promotes the loose coupling of components
– allows components to post messages for other components
– asynchronous rather than synchronous
– also known as MOM (Message-Oriented Middleware
• Two basic models
– point-to-point
• one component posts a message to a server
• only one component will consume a posted message
– publish/subscribe
• allows a component to publish a message to a topic on a
server
• components interested in a particular topic can subscribe to
that topic (messages can be consumed by a number of
components)
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 72
MQS...
• Publish-Subscribe Messaging
– Used when multiple
applications need to receive
the same messages
– The central concept is the
Topic.
– There may be multiple
Senders and multiple
Receivers.

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 73


MQS...
Point-to-Point Messaging
• Used when one process needs
to send a message to another
process
• There are two basic types:
– The first one involves a client
that directly sends a message to
another client.
– The second and more
common implementation is
based on the concept of a
Message Queue.
• even though there may be
multiple Senders of messages,
but there is only a single
Receiver.
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 74
MQS...
• Main features of message queuing
– There are no direct connections between programs
– Communication between programs can be time-independent
– Work can be carried out by small, self-contained programs
– Communication can be driven by events.
– Applications can assign a priority to a message.
– Security
– Data integrity
– Recovery support

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 75


MQS...

• No direct connections between programs in message queuing

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 76


Low-level Data Communications
• is defined as the interchange and processing encoded information
between distant locations using protocol
• A communications protocol is a system of digital message
formats and rules for exchanging those messages in or between
computing systems and in telecommunications

6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 77


Summary...
Read more...

Thank You

?
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 78

You might also like