Anda di halaman 1dari 98

F T ra n sf o F T ra n sf o

PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
1
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

INTRODUCTION
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
2
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

1. INTRODUCTION
1.1 ABOUT THE PROJECT

Adhoc networks are multi-hop wireless networks of small computing devices


with wireless interfaces. The computing devices could be conventional computers (for
example, PDA, laptop, or PC) or backbone routing platforms or even embedded processors
such as sensor nodes. The problem of optimal placement of caches to reduce overall cost
of accessing data is motivated by the following two defining characteristics of ad hoc
networks. First, the ad hoc networks are multi-hop networks without a central base station.
Thus, remote access of information typically occurs via multi-hop routing, which can
greatly benefit from caching to reduce access latency. Second, the network is generally
resource constrained in terms of channel bandwidth or battery power in the nodes. Caching
helps in reducing communication, this results in savings in bandwidth, as well as battery
energy. The problem of cache placement is particularly challenging when each network
node has a limited memory to cache data items.

In our network model, there are multiple data items; each data item has a
server, and a set of clients that wish to access the data item at a given frequency. Each
node carefully chooses data items to cache in its limited memory to minimize the overall
access cost. Essentially, in this article, we develop efficient strategies to select data items
to cache at each node. In particular, we develop two algorithms a centralized
approximation algorithm, which delivers a 4approximation (2-approximation for uniform
size data items) solution, and a localized distributed algorithm, which is based on the
approximation algorithm and can handle mobility of nodes and dynamic traffic conditions.
Using simulations, we show that the distributed algorithm performs very close to the
approximation algorithm. Finally, we show through extensive experiments on ns2 [10] that
our proposed distributed algorithm performs much better than a prior approach over a
broad range of parameter values. Ours is the first work to present a distributed
implementation based on an approximation algorithm for the general problem of cache
placement of multiple data items under memory constraint.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
3
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

1.2 MODULE DESCRIPTION:

The project entitled as “BENEFIT BASED DATA CACHING IN ADHOC


NETWORKS” developed using JAVA. Modules display as follows.

· Network module
· Uploading the file module
· DataCaching module
Network Module

This is the module that appears like a network. In this network user can put the
hosts and the number of hosts must be less than 50 and more than 10 nodes. In this
network every host is connected to the network.

Uploading the file module

In this module the user can browse and select the data items such as files. Note that
the data item must be in text file format. Word documents also can be sent but those are
not visible in the destination node.

DataCaching module:

In this it will get all the information that is sent from source to destination nodes.
Note that while traversing the file from source and destination nodes must not be same. We
can see the transferred file in the destination host and we can also observe the transfer
history of the file in the Transfer_history text document.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
4
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

LITERATURE SERVEY
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
5
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

2. LITERATURE SERVEY

Below, we categorize the prior work by the number of data items and network
topology. Single Data Item in General Graph. The general problem of determining optimal
cache placements in an arbitrary network topology has similarity to two problems in graph
theory, namely, facility location problem and the k-median problem. Both the problems
consider only a single facility type (data item) in the network. In the facility-location
problem, setting up a cache at a node incurs a certain fixed cost, and the goal is to
minimize the sum of total access cost and the setting-up costs of all caches without any
constraint. On the other hand, the k-median problem minimizes the total access cost under
the number constraint, that is, that at most k nodes can be selected as caches. Both
problems are NP-hard, and a number of constant-factor approximation algorithms have
been developed for each of the problems under the assumption of triangular inequality of
edge costs. Without the triangular inequality assumption, either problem is as hard as
approximating the set cover and thus cannot be approximated better unless P ¼ NP. Here,
JV j is the size of the network. In other related work, Nuggehalli et al. formulate the
caching problem in ad hoc networks as a special case of the connected facility location.

Single Data Item in Tree Topology Several papers in the literature circumvents
the hardness of the facility location and k-median problems by assuming that the network
has a tree topology. In particular, Tamir and Vigneron et al. design optimal dynamic
programming polynomial algorithms illustrating cache placement problem under memory
constraint. The k-median problem in undirected and directed trees, respectively. In other
works, Krishnan et al. consider the placement of k “transparent” caches, Kalpakis et al.
consider a cost model involving reads, writes, and storage, and Bhattacharya et al. present
a distributed algorithm for sensor networks to reduce the total power expended. All of the
above works consider only a single data time in a tree network topology. Multiple Data
Items Hara proposes three algorithms for cache placement of multiple data items in ad hoc
networks. In the first approach, each node caches the items most frequently accessed by it.
The second approach eliminates replications among neighboring nodes introduced by the
first approach. The third approach requires creation of “stable” groups to gather
neighborhood information and determine caching placements. The first two approaches are
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
6
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

largely localized and, hence, would fare very badly when the percentage of client nodes in
the network is low or when the access frequencies are uniform. For the third approach, it is
hard to find stable groups in ad hoc networks because of frequent failures and movements.
All the above approaches assume the knowledge of access frequencies. In extensions of the
above work, in, Hara generalizes the above approaches for push-based systems and
updates, respectively. In other related works, Xu et al. discuss placement of “transparent”
caches in tree networks. Our work on cache placement problem is most closely related to
the works by Yin and Cao and Baev and Rajaraman. Yin and Cao design and evaluate
three simple distributed caching techniques, namely, Cache Data, which caches the
passing-by data item, Cache Path, which caches the path to the nearest cache of the
passing-by data item, and Hybrid Cache, which caches the data item if its size is small
enough or, else, caches the path to the data. They use LRU policy for cache replacement.
To the best of our knowledge, the work by Yin and Cao is the only one that presents a
distributed cache placement algorithm in a multihop ad hoc network with a memory
constraint at each node. Thus, we use the algorithms in as a comparison point for our
study. Baev and Rajaraman design an approximation algorithm for the cache placement
problem with uniform size data items. For the nonuniform-size data items, they show that
there is no polynomial-time approximation unless P ¼ NP. They circumvent the
onapproximability by increasing the given node memory capacities by the size of the
largest data item and generalize their approximation algorithm. However, their approach
(as noted by themselves) is not amenable to an efficient distributed implementation.

In this article, we circumvent the non-approximability of the cache


placement problem by choosing to maximize the benefit (reduction in total access cost)
instead of minimizing the total access cost. In particular, we design a simple centralized
algorithm that delivers a solution whose benefit is at least 1/4 (1/2 for uniform-size data
items) of the optimal benefit without using any more than the given memory capacities. To
the best of our knowledge, ours and that by Baev and Rajaraman are the only2 works that
present approximation algorithms for the general placement of cache placement for
multiple data items in networks with memory constraint. However, as noted before, Baev
and Rajaraman approach is not amenable to an efficient distributed implementation,
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
7
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

whereas our approximation algorithm yields a natural distributed implementation that is


localized and shown (using ns2 simulations) to be efficient even in mobile and dynamic
traffic conditions. Moreover, as stated in Theorem 2, our approximation result is an
improvement over that in when optimal access cost is at least ð1=40Þth of the total access
cost without the caches. Finally, unlike that in, we do not make the assumption of the cost
function satisfying the triangular inequality. A preliminary version of this article has
appeared in the main additions in this article compared to that in are

1. The approximation result for non-uniform size data items

2. Details on the maintenance of the nearest and second-nearest cache table entries

3. Data expiry and cache update models and more extensive simulations.

We have developed a paradigm of data caching techniques to support effective


data access in ad hoc networks. Here, the data expiry model is TTL-per-request, and the
cache update model is cache deletion. (a) Average query delay. (b) Query success ratio. (c)
Total number of messages. Varying mean query generate time on spatial data access
pattern by comparing Random Caching, Hybrid Cache and DGA, with vmax ¼ 10 m=s. (a)
Average query delay. (b) Query success ratio. (c) Total number of messages. Fig. 12.
Varying mean query generate time on spatial data access pattern with cache update in
mobile networks with vmax ¼ 10 m=s. Here, the data expiry model is TTL-per-item, and
the cache update model is server multicast. (a) Average query delay. (b) Query success
ratio. (c) Total number of messages. Particular,

We have considered the memory capacity constraint of the network nodes and
developed efficient algorithms to determine near-optimal cache placements to maximize
reduction in overall access cost. Reduction in access cost leads to communication cost
savings and, hence, better bandwidth usage and energy savings. Our later simulation
experience with ns2 also shows that better bandwidth usage also in turn leads to less
message losses and, thus, better query success ratio. The novel contribution in our work is
the development of a 4-approximation centralized algorithm, which is naturally amenable
to a localized distributed implementation. The distributed implementation uses only local
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
8
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

knowledge of traffic. However, our simulations over a wide range of network and
application parameters show that the performance of the two algorithms is quite close. We
note that ours is the first work that presents a distributed implementation based on an
approximation algorithm for the problem of cache placement of multiple data items under
memory constraint. We further compare our distributed algorithm with a competitive
algorithm (Hybrid Cache) presented in the literature that has a similar goal. This
comparison uses the ns2 simulator with a complete wireless networking protocol stack
including dynamic routing. We consider a broad range of application parameters and both
stationary and mobile networks. These evaluations show that our algorithm significantly
outperforms Hybrid Cache, particularly in more challenging scenarios, such as higher
query frequency and smaller memory.

Algorithm

Ø CACHE PLACEMENT ALGORITHMS


ü Centralized Greedy Algorithm (CGA)
ü Distributed Greedy Algorithm (DGA)
Ø Nearest Cache Tables
Ø Data Expiry and Cache Updates
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
9
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Advantages

The distributed implementation uses only local knowledge of traffic. However, our
simulations over a wide range of network and application parameters show that the
performance of the two algorithms is quite close. This is the first work that presents a
distributed implementation based on an approximation algorithm for the problem of cache
placement of multiple data items under memory constraint.

Applications

This work can be designed, implemented and evaluated in a wireless multi-hop ad hoc
instant messenger with 7 Pocket PCs fully implementing the basic features of the DSR
protocol along with a few design alternatives. It paves the way for more future work
incorporating possibly more nodes and more optimized features of the DSR Protocol. For
example, an optimized cache structure can be considered and its effect may be tested with
more nodes in the system.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
10
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SYSTEM ANALYSIS
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
11
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

3. SYSTEM ANALYSIS
3.1 REQUIREMENTS ANALYSIS DOCUMENT

Requirement Analysis is the first phase in the software development


process. The main objective of the phase is to identify the problem and the system
to be developed. The later phases are strictly dependent on this phase and hence
requirements for the system analyst to be clearer, precise about this phase. Any
inconsistency in this phase will lead to lot of problems in the other phases to be
followed. Hence there will be several reviews before the final copy of the analysis
is made on the system to be developed. After all the analysis is completed the
system analyst will submit the details of the system to be developed in the form of
a document called requirement specification.

The Requirement analysis task is a process of discovery, refinement,


modeling and specifications. The software scope, initially established by a system
engineer and refined during software project planning, is refined in detail. Models
of required data, information and control flow and operational behavior are created.
Alternative solutions are analyzed and allocated to various software elements.

Both the developer and the customer take an active role in requirement
analysis and specification. The customer attempts to reformulate a sometimes-
nebulous concept of software function and performance into concrete detail. The
developer acts as interrogator, consultant and problem solver. The communication
content is very high. Changes for misinterpretation of misinformation abound.
Ambiguity is probable.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
12
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Requirement analysis is a software engineering task that bridges the gap


between the system level software allocation and software design. Requirement
analysis enables the system engineer to specify the software function and
performance indicate software interface with other system elements and establish
constraints that software must meet. It allows the software engineer, often called
analyst in this role, to refine the software allocation and build model of the data,
functional and behavioral domains and that will be treated by software.

Requirements analysis provides the software designer with models that can
be translated into data, architectural, interface and procedural design. Finally, the
requirement specification provides the developer and customer with the means to
access quality once software builds.

Software requirements analysis may be divided into five areas of effort

· Problem recognition

· Evaluation and Synthesis

· Modeling

· Review

Once the tasks in the above areas have been accomplished, the specification
document would be developed which now forms the basis for the remaining
software engineering tasks. Keeping this in view the specification document of the
current system has been generated.

REQUIREMENTS-DETERMINATION

Requirements – Determination is the process, by which analyst gains the


knowledge of the organization and apply it in selecting the right technology for a
particular application.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
13
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

3.2 SOFTWARE AND HARDWARE REQUIREMENTS


SPECIFCATION

SOFTWARE REQUIREMENTS:

· Application Layer : JDK 1.5 or latest

· Operating System : WindowsXP or latest

HARDWARE REQUIREMENTS:

· 512 MB RAM

· 40 GB Hard Disk

· Pentium 4 Compatibility to load WindowsXP

3.3 EXISTING SYSTEM

In the existing system efficiency is very low. Difficult to measure the size
of the memory. Accessing the latency time is very high and Bandwidth too. The
System the memory capacity constraint of the network nodes and developed
efficient algorithms to determine near-optimal cache placements to maximize
reduction in overall access cost. High in access cost leads to communication cost
savings and, hence, better bandwidth usage and energy savings. Our later
simulation experience with ns2 also shows that better bandwidth usage also in turn
leads to less message losses and, thus, better query success ratio.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
14
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

3.4 PROPOSED SYSTEM

Contribution in our work is the development of a 4-approximation


centralized algorithm, which is naturally amenable to a localized distributed
implementation. The distributed implementation uses only local knowledge of traffic.
However, our simulations over a wide range of network and application parameters show
that the performance of the two algorithms is quite close. We note that ours is the first
work that presents a distributed implementation based on an approximation algorithm for
the problem of cache placement of multiple data items under memory constraint. Our
distributed algorithm with a competitive algorithm (Hybrid Cache) presented in the
literature that has a similar goal. This comparison uses the ns2 simulator with a complete
wireless networking protocol stack including dynamic routing. We consider a broad range
of application parameters and both stationary and mobile networks. These evaluations
show that our algorithm significantly outperforms Hybrid Cache, particularly in more
challenging scenarios, such as higher query frequency and smaller memory.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
15
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SYSTEM DESIGN
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
16
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

4.1 UNIFIED MODELING LANGUAGE (UML):

Grady Booch, James Rumbaugh and Ivar Jacobson have collaborated to combine
the best features of their individual object oriented analysis and design methods into a
unified method the unified modeling language, the version 1.0 for the Unified Modeling
was released in January 1997 the main parts of UML are based on the Booch, OMT and
OOSE methods.

The goals of UML are:

· To model systems using object-oriented concepts.


· To establish an explicit coupling between conceptual as well as executable.
· To address the issues of scale inherent in complex, mission critical system.
· To create a modeling language usable by both humans and machines
BASIC BUILDING BLOCKS OF UML:

The basic building blocks in UML are things and relationships; these are combined in
different ways following different rules to create different types of diagrams. In UML
there are nine types of diagrams, below is a list and brief description of them. The more
in depth descriptions in the document, will focus on the first five diagrams in the list,
which can be seen as the most general, sometimes also referred to as the UML core
diagrams.

1. USECASE DIAGRAMS: shows a set of use cases, and how actors can use them.

2. CLASS DIAGRAMS: describes the structure of the system, divided in classes with
different connections and relationships.

3. SEQUENCE DIAGRAMS: shows the interaction between a set of objects, through


the messages that may be dispatched between them.

4. STATECHART DIAGRAMS: state machines, consisting of states, transitions,


events and activities.

5. ACTIVITY DIAGRAMS: shows the flow through a program from an defined start
point to an end point.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
17
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

6. OBJECT DIAGRAMS: A set of objects and their relationships, this is an snapshot


of instances of the things found in the class objects.

7. COLLABRATION DIAGRAMS: collaboration diagram emphasize structural


ordering of objects that send and receive messages.

8. COMPONENT DIAGRAMS: shows organizations and dependencies among a set


of components. These diagrams address static implementation view of the system.

9. DEPLOYMENT DIAGRAMS: show the configuration of run-time processing


nodes and components that live on them.

4.1.2 BEHAVIOURAL DIAGRAMS:

USE CASE DIAGRAMS:

Use case diagrams identify functionality provided by the system, the users who interact
with the system (actors), and the association between the users and the functionality. Use Cases
used in the analysis phase of software development to articulate the high-level requirement of the
system.

· The primary goals of Use Cases Diagrams include:


· Providing a high-level view of what the system does.
· Identifying the users actors of the system.
· Determining areas needing human-computers interfaces.
· Use cases extend beyond pictorial diagram. In fact, text-based use cases description are
often used to supplement diagram, and explore use case functionality in more details.
· In essence, use case diagram can illustrate the requirements of the system.

ACTIVITY DIAGRAMS

Activity diagrams can be in many places in the design process; sometimes


even before use case diagrams for understanding the workflow of a process. But they can
also be used for defining how use cases interact or even for detailed design. Basic
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
18
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

elements in activity diagrams are activities, branches (conditions and selections),


transitions, forks and joins.

Activity states: Activity states mark an object. The Notations for these states are
rounded Rectangles. The same notation as found in state chart diagrams.

Transition: When a activity state is completed Processing Moves to another activity


state are used to mark this movement. Transitions are modeled using arrows.

Synchronization Bar: Activities often can be done in parallel. To split processing


(“fork”), or to resume processing when multiple activities have been completed (“join”),
synchronization bars are used. These are modeled as solid rectangles, with multiple
transitions going in and/or out.

Initial state: The initial state marks the entry point and the initial activity state. The
notation for the initial state is the same as in the state chart diagrams, a solid circle. There
can only be one initial state on a diagram.

Final state: Final states mark the end of the modeled workflow. There can be multiple
Final states on a diagram, and these states are modeled using a solid circle surrounded by
another circle.

SEQUENCE DIAGRAMS:

UML sequence diagrams are used to model the flow of control between objects. It cans
him hard to understand the overall flow in a complex system without modeling it.
Sequence diagrams model the interactions through messages between objects; it is
common to focus the model on scenarios specified by uses-cases. It is also often useful
input to the detailed class diagram to try to model the specified use cases with sequence
diagrams, necessary forgotten operations and relations are usually found.

Sequence diagrams document the interactions between classes to achieve a result, such as
a use case. Because UML is designed for object programming, this communications
between classes are known as messages. The sequence diagrams lists objects
horizontally, and time vertically, and models these messages overtime.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
19
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

In a sequence diagram, classes and actors are listed as columns, with vertical lifelines
indicating the life time of the object overtime.

Object: Objects are instances of classes, and are arranged horizontally. The pictorial
representation for an object is a class (a rectangle) with the name prefixed by object
name(optional) and a semicolon.

Actor: Actor can also communicate with objects so can be listed as column. An actor is
modeled using the ubiquitous symbol, the stick figure.

Life Line: The lifetime identifies the existence of the object overtime. The notation for
the lifeline is a vertical dotted line extending from an object.

Activation: Activations, modeled as rectangular boxes on the lifetime, indicate when the
object is performing and action.

Message: Messages, modeled as horizontal arrows between activations, indicate the


communications between objects.

4.1.3 STRUCTURAL DIAGRAMS

CLASS DIAGRAM:

Class diagram identify the class structure of a system, including the properties and methods of
each class. Also depicted are the various relationships that can exist between classes, such as an
inheritance relationship. The class diagram is one of the most widely used diagrams from the
UML specification.

OBJECT DIAGRAM:

Object diagram model instances of classes. This type of diagram is used to describe the
system at a particular point in time. Using this technique, we can validate the class diagram and
its multiplicity rules with real-world data, and record test scenarios. From a notation standpoint,
object diagrams borrow elements from class diagrams.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
20
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

COMPONENT DIAGRAM:

Component diagrams fall under the category of an implementation diagram, a king of diagram
that models the implementation and deployment of the system. A component diagram in
particular, is used to describe the dependencies between various software components such as the
dependency between executable files and source files. This information is similar to that within
make files, which describes source code dependencies and can be used to properly compile an
application.

DEPLOYMENT DIAGRAM:

Deployment diagrams are another model in the implementation diagram category. The
deployment diagram models the hardware used in implementing a system and the association
between those hardware components. Components can also be shown on a deployment diagram
to show the location of their deployment. Deployment diagrams can also be used early on in the
design phase to document the physical architecture of a system.

USECASE DIAGRAM:

join Receive

Send Signals
Resolving address

Receive Signals Routing

Host Network

GetAddress Organizing

Dis connect from


network Remove
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
21
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

CLASS DIAGRAM:

LOCAL SEARCH
SENDER
destinationNode
Sender ID : int ROUTE DISCOVERY
receverID : int sender : int search()
message : string destination : int
date : string
time : string routediscovery()
NEIGHBOUR SEARCH
requestForward() destinationNode

search()

depends on

depends on

CACHE UPDATION
RECEIVER sender : int
senderID : int updatingRoute : string
message : string MESSAGE SENDING
date : string message updation()
time : string destination
length : int route

messageTransform()
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
22
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SEQUENCE DIAGRAM

New Node Network Parent

Enter the Network


Find the Parent

Return parent node position

Attach as Child node

Recpgnize the network

calculating new address

updating the routing

Return address and routing


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
23
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SYSTEM
IMPLEMENTATION
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
24
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

5.SYSTEM IMPLEMENTATION

Implementation is the stage of the project when the theoretical design is turned out into
a working system. Thus it can be considered to be the most critical stage in achieving a
successful new system and in giving the user, confidence that the new system will work
and be effective.

The implementation stage involves careful planning, investigation of the existing


system and it’s constraints on implementation, designing of methods to achieve
changeover and evaluation of changeover methods.

Implementation is the process of converting a new system design into operation. It is


the phase that focuses on user training, site preparation and file conversion for installing a
candidate system. The important factor that should be considered here is that the
conversion should not disrupt the functioning of the organization.

SOFTWARE TECHNOLOGIES

JAVA AWT

In this section, we will learn about the java .awt.*; package available with JDK.
AWT stands for Abstract Windowing Toolkit. It contains all classes to write the program
that interface between the user and different windowing toolkits. We can use the AWT
package to develop user interface objects like buttons, checkboxes, radio buttons and
menus etc. This package provides following interfaces and classes as follows:
• AWT classes form 3 categories:
Ø Graphics
• colors, fonts, images, polygons, …
• draws stuff, defines events
Ø Components
• GUI components: buttons, menus, frames (window), panel (w/o window), dialog
(window)
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
25
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

• Container class contains components, layout managers


Ø Layout Managers
• Gives rule for graphical layout of components in a container
• Ex: layout components in a grid

JAVA JFC
• Java Foundation Classes (or JFC) is a comprehensive set of graphical user interface
classes
• JFC is comprised of:
§ AWT
§ Swing – More GUI widgets based on AWT
§ Java 2D – 2D graphical routines
§ Drag and Drop
§ Accessibility APIs

SWINGS

Swing is built on top of AWT and is entirely written in Java, using AWT’s
lightweight component support. In particular, unlike AWT, the architecture of Swing
components makes it easy to customize both their appearance and behavior. Components
from AWT and Swing can be mixed, allowing us to add Swing support to existing AWT-
based programs. For example, swing components such as JSlider, JButton and JCheckbox
could be used in the same program with standard AWT labels, textfields and scrollbars.
We can subclass the existing Swing UI, model, or change listener classes without having to
reinvent the entire implementation. Swing also has the ability to replace these objects on-
the-fly.

In Swing, classes that represent GUI components have names beginning


with the letter J. Some examples are JButton, JLabel, and JSlider. Altogether there are
more than 250 new classes and 75 interfaces in Swing — twice as many as in AWT.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
26
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

JAVA SWING CLASS HIERARCHY

The class JComponent, descended directly from Container, is the root class
for most of Swing’s user interface components.

Swing contains components that are used to build a GUI. To learn and understand these
swing programs, AWT Programming knowledge is not required.

· JPanel is Swing’s version of the AWT class Panel and uses the same
default layout, FlowLayout. JPanel is descended directly from JComponent.
· JFrame is Swing’s version of Frame and is descended directly from that
class. The components added to the frame are referred to as its contents; these are
managed by the contentPane. To add a component to a JFrame, we must use its
contentPane instead.
· JInternalFrame is confined to a visible area of a container it is placed in. It
can be iconified , maximized and layered.
· JWindow is Swing’s version of Window and is descended directly from
that class. Like Window, it uses BorderLayout by default.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
27
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

· JDialog is Swing’s version of Dialog and is descended directly from that


class. Like Dialog, it uses BorderLayout by default. Like JFrame and JWindow,
JDialog contains a rootPane hierarchy including a contentPane, and it allows
layered and glass panes. All dialogs are modal, which means the current thread is
blocked until user interaction with it has been completed. JDialog class is intended
as the basis for creating custom dialogs; however, some of the most common
dialogs are provided through static methods in the class JOptionPane.
· JLabel, descended from JComponent, is used to create text labels.
· The abstract class AbstractButton extends class JComponent and provides a
foundation for a family of button classes, including
· JTextField allows editing of a single line of text. New features include the
ability to justify the text left, right, or center, and to set the text’s font.
· JPasswordField (a direct subclass of JTextField) you can suppress the
display of input. Each character entered can be replaced by an echo character. This
allows confidential input for passwords, for example. By default, the echo character
is the asterisk, *.
· JTextArea allows editing of multiple lines of text. JTextArea can be used
in conjunction with class JScrollPane to achieve scrolling. The underlying
JScrollPane can be forced to always or never have either the vertical or horizontal
scrollbar;
· JButton is a component the user clicks to trigger a specific action.
· JRadioButton is similar to JCheckbox, except for the default icon for each
class. A set of radio buttons can be associated as a group in which only one button
at a time can be selected.
· JCheckBox is not a member of a checkbox group. A checkbox can be
selected and deselected, and it also displays its current state.
· JComboBox is like a drop down box. You can click a drop-down arrow
and select an option from a list. For example, when the component has focus,
pressing a key that corresponds to the first character in some entry’s name selects
that entry. A vertical scrollbar is used for longer lists.
· JList provides a scrollable set of items from which one or more may be
selected. JList can be populated from an Array or Vector. JList does not support
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
28
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

scrolling directly, instead, the list must be associated with a scrollpane. The view
port used by the scroll pane can also have a user-defined border. JList actions are
handled using ListSelectionListener.
· JTabbedPane contains a tab that can have a tool tip and a mnemonic, and it
can display both text and an image.
· JToolbar contains a number of components whose type is usually some
kind of button which can also include separators to group related components
within the toolbar.
· FlowLayout when used arranges swing components from left to right until
there’s no more space available. Then it begins a new row below it and moves from
left to right again. Each component in a FlowLayout gets as much space as it needs
and no more.
· BorderLayout places swing components in the North, South, East, West
and center of a container. We can add horizontal and vertical gaps between the
areas.
· GridLayout is a layout manager that lays out a container’s components in a
rectangular grid. The container is divided into equal-sized rectangles, and one
component is placed in each rectangle.
· GridBagLayout is a layout manager that lays out a container’s components
in a grid of cells with each component occupying one or more cells, called its
display area. The display area aligns components vertically and horizontally,
without requiring that the components be of the same size.
· JMenubar can contain several JMenu’s. Each of the JMenu’s can contain a
series of JMenuItem ’s that we can select. Swing provides support for pull-down
and popup menus.
· Scrollable JPopupMenu is a scrollable popup menu that can be used
whenever we have so many items in a popup menu that exceeds the screen visible
height.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
29
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SWING AND AWT

The Java Message Service (JMS) API is a Java Message Oriented


Middleware (MOM) API for sending messages between two or more clients. JMS is a part
of the Java Platform, Enterprise Edition, and is defined by a specification developed under
the Java Community Process. It is a messaging standard that allows application
components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send,
receive, and read messages. It allows the communication between different components of
a distributed application to be loosely coupled, reliable, and asynchronous.

Messaging is a form of loosely coupled distributed communication, where


in this context the term 'communication' can be understood as an exchange of messages
between software components. Message-oriented technologies attempt to relax tightly
coupled communication (such as TCP network sockets, CORBA or RMI) by the
introduction of an intermediary component, which in this case would be a queue. The latter
approach allows software components to communicate 'indirectly' with each other.
Benefits of this include message senders not needing to have precise knowledge of their
receivers, since communication is performed using this queue. This is the first of two
types: point to point and publish and subscribe.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
30
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

JDBC

The JDBC (Java Database Connectivity) API defines interfaces and classes
for writing database applications in Java by making database connections. Using JDBC
you can send SQL, PL/SQL statements to almost any relational database. JDBC is a Java
API for executing SQL statements and supports basic SQL functionality. It provides
RDBMS access by allowing us to embed SQL inside Java code. Because Java can run on a
thin client, applets embedded in Web pages can contain downloadable JDBC code to
enable remote database access. We can create a table, insert values into it, query the table,
retrieve results, and update the table with the help of a JDBC Program.
Although JDBC was designed specifically to provide a Java interface to
relational databases, we may find that you need to write Java code to access non-relational
databases as well.
JDBC ARCHITECTURE

Java application calls the JDBC library. JDBC loads a driver which talks to the
database. We can change database engines without changing database code.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
31
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

JDBC BASICS - JAVA DATABASE CONNECTIVITY STEPS


Before we can create a java jdbc connection to the database, we must first import
the java.sql package. import java.sql.*; The star ( * ) indicates that all of the classes in the
package java.sql are to be imported.
1. Loading a database driver
In this step of the jdbc connection process, we load the driver class by calling
Class.forName() with the Driver class name as an argument. Once loaded, the
Driver class creates an instance of itself. A client can connect to Database Server
through JDBC Driver. Since most of the Database servers support ODBC driver
therefore JDBC-ODBC Bridge driver is commonly used. The return type of the
Class.forName (String ClassName) method is “Class”. Class is a class in java.lang
package.
try {
Class.forName(”sun.jdbc.odbc.JdbcOdbcDriver”); //Or any other driver
}
catch(Exception x){
System.out.println( “Unable to load the driver class!” );
}

2.Creating a oracle jdbc Connection


The JDBC DriverManager class defines objects which can connect Java
applications to a JDBC driver. DriverManager is considered the backbone of JDBC
architecture. DriverManager class manages the JDBC drivers that are installed on
the system. Its getConnection() method is used to establish a connection to a
database. It uses a username, password, and a jdbc url to establish a connection to
the database and returns a connection object. A jdbc Connection represents a
session/connection with a specific database. Within the context of a Connection,
SQL, PL/SQL statements are executed and results are returned. An application can
have one or more connections with a single database, or it can have many
connections with different databases. A Connection object provides metadata i.e.
information about the database, tables, and fields. It also contains methods to deal
with transactions.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
32
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

JDBC URL Syntax:: jdbc: <subprotocol>: <subname>

JDBC URL Example:: jdbc: <subprotocol>: <subname>•Each driver has its own
subprotocol.

• Each subprotocol has its own syntax for the source. We’re using the jdbc odbc
subprotocol, so the DriverManager knows to use the
sun.jdbc.odbc.JdbcOdbcDriver.
try{
Connection
dbConnection=DriverManager.getConnection(url,”loginName”,”Password”)
}
catch( SQLException x ){
System.out.println( “Couldn’t get connection!” );
}

3. Creating a jdbc Statement object,


Once a connection is obtained we can interact with the database. Connection
interface defines methods for interacting with the database via the established
connection. To execute SQL statements, you need to instantiate a Statement object
from your connection object by using the createStatement() method.
Statement statement = dbConnection.createStatement(); A statement object is used
to send and execute SQL statements to a database.

Three kinds of Statements


Statement: Execute simple sql queries without parameters. Statement
createStatement() Creates an SQL Statement object.
Prepared Statement: Execute precompiled sql queries with or without parameters.
PreparedStatement prepareStatement (String sql) returns a new PreparedStatement
object. PreparedStatement objects are precompiled SQL statements.
Callable Statement: Execute a call to a database stored
procedure.CallableStatement prepareCall(String sql) returns a new
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
33
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

CallableStatement object. CallableStatement objects are SQL stored procedure call


statements.
4.Executing a SQL statement with the Statement object, and returning a jdbc
resultSet.
Statement interface defines methods that are used to interact with database
via the execution of SQL statements. The Statement class has three methods for executing
statements: executeQuery(), executeUpdate(), and execute(). For a SELECT statement, the
method to use is executeQuery . For statements that create or modify tables, the method to
use is executeUpdate. Note: Statements that create a table, alter a table, or drop a table are
all examples of DDL statements and are executed with the method executeUpdate. execute()
executes an SQL statement that is written as String object.
ResultSet provides access to a table of data generated by executing a Statement.
The table rows are retrieved in sequence. A ResultSet maintains a cursor pointing
to its current row of data. The next() method is used to successively step through
the rows of the tabular results.
ResultSetMetaData Interface holds information on the types and properties of the
columns in a ResultSet. It is constructed from the Connection object.

SQL
Oracle strives to comply with industry-accepted standards and participates
actively in SQL standards committees. Industry-accepted committees are the American
National Standards Institute (ANSI) and the International Organization for Standardization
(ISO), which is affiliated with the International Electrotechnical Commission (IEC). Both
ANSI and the ISO/IEC have accepted SQL as the standard language for relational
databases. When a new SQL standard is simultaneously published by these organizations,
the names of the standards conform to conventions used by the organization, but the
standards are technically identical.

How SQL Works


The strengths of SQL provide benefits for all types of users, including
application programmers, database administrators, managers, and end users. Technically
speaking, SQL is a data sublanguage. The purpose of SQL is to provide an interface to a
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
34
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

relational database such as Oracle Database, and all SQL statements are instructions to the
database. In this SQL differs from general-purpose programming languages like C and
BASIC. Among the features of SQL are the following:
It processes sets of data as groups rather than as individual units.
It provides automatic navigation to the data.
It uses statements that are complex and powerful individually, and that therefore
stand alone. Flow-control statements were not part of SQL originally, but they are
found in the recently accepted optional part of SQL, ISO/IEC 9075-5: 1996. Flow-
control statements are commonly known as "persistent stored modules" (PSM), and
the PL/SQL extension to Oracle SQL is similar to PSM.
SQL lets you work with data at the logical level. You need to be concerned
with the implementation details only when you want to manipulate the data. For example,
to retrieve a set of rows from a table, you define a condition used to filter the rows. All
rows satisfying the condition are retrieved in a single step and can be passed as a unit to
the user, to another SQL statement, or to an application. You need not deal with the rows
one by one, nor do you have to worry about how they are physically stored or retrieved.
All SQL statements use the optimizer, a part of Oracle Database that determines the most
efficient means of accessing the specified data. Oracle also provides techniques that you
can use to make the optimizer perform its job better.
SQL provides statements for a variety of tasks, including:
Querying data
Inserting, updating, and deleting rows in a table
Creating, replacing, altering, and dropping objects
Controlling access to the database and its objects
Guaranteeing database consistency and integrity
SQL unifies all of the preceding tasks in one consistent language.

Common Language for All Relational Databases

All major relational database management systems support SQL, so you can
transfer all skills you have gained with SQL from one database to another. In addition, all
programs written in SQL are portable. They can often be moved from one database to
another with very little modification.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
35
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

What is Oracle?
Oracle is the name of the database management system that comes from Oracle
Corporation.
Oracle9i is the latest product released by Oracle Corporation. Unlike Oracle8i,which is
only a database management system, Oracle9i is a collection of following software
Oracle9i Application Server – Oracle9iAS
Oracle9i Database Server – Oracle9iDB
Oracle9i Developer Suite – Oracle9iDS
In simple words Oracle9i is a platform and not a simple database management system.
Oracle9iDB is the database management system that is used to store and access data.
Oracle is by far the most widely used relational database management system (RDBMS).
Oracle Corporation is second largest software company next to Microsoft.
Oracle Corporation is also into Enterprise Resource Planning (ERP). It has Oracle
Applications that includes Oracle Financials etc.

Oracle Database Server


Oracle database server is one of the databases that are widely used inclient/server
computing as back-end. Front-end programs that are written using application development
tools such as Visual basic access Oracle and submit SQL commands for execution.
Oracle8i onwards oracle is trying to provide extra facilities that are required to be
an internet database.
Figure 1: Oracle Server as Server in Client/Server computing model.
Oracle8i provides special features to support various types of data that is to be
stored in web sites. Oracle supports both OLTP (online transaction processing)
applications as well data warehouse applications, which contain a very large database
(VLDB).
One of the biggest advantages of Oracle has been its presence on around 100
different platforms. Oracle is quite scalable, which means it can scale up and down very
easily as the requirements change.
Oracle also provides Java Virtual Machine (JVM) as part of database. This enables
oracle to run java programs. In fact, starting from Oracle8i, oracle can run programs
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
36
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

written either in PL/SQL or Java.

Oracle Instance
Oracle instance is a collection of memory structures and processed that are used to
manage oracle database. Each oracle database is to be accessed by one or more Oracle
instances. If two or more instances are accessing the same database, it is called as parallel
server architecture.
In order to start using an oracle database, we must first start Oracle instance. Oracle
instance will them open the database and make it available to users.
It is beyond the scope of this book to discuss what Oracle instance actually
contains. Please read “Oracle Concepts” manual for complete information about oracle
instance.
In nutshell every oracle installation contains at least one Oracle Instance
and one oracle database.
Hard disk
Primary Memory (RAM)
Oracle Instance
Oracle Database
Figure 2: Oracle Instance and Oracle Database.
What Is Personal Oracle?
Personal Oracle is one of the flavors of Oracle. This is not a product that is used by
production system (systems where real data is stored). This is more like a learning tool. It
runs on desktop PCs. In personal oracle, oracle instance, oracle database and client
application all run on the same machine (see figure 3).
Whereas in Oracle database server, only oracle instance and database reside on the
server and client applications run on clients.
Oracle Instance
Oracle Database
Client
It is also possible to develop an applications using Personal Oracle on you
desktop/laptop and deploy them in a client/server environment.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
37
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Starting up Database
Before we access oracle database, we must start oracle database. Starting up oracle
database means starting oracle instance and associating oracle instance with an oracle
database so that oracle instance can access the database.
The process is very length and complicated. Several steps are involved in it.But
fortunately we do not have to know all that happens when a database starts. We just need
to select an option or two to startup database.
Generally you do not have to startup database in case of Oracle Server running on
Windows NT/Windows 2000 as oracle server automatically starts in this case. However, if
you ever have to start oracle database on Windows
NT/Windows 2000, follow the steps given below:
1. Start services program using Administrative Tools -> Service in Windows/2000
or Control Panel -> Service on Windows NT.
2. If service OracleServiceOracle8i has not yet started, click on it with right button
and select start option from popup menu.
The exact name of the service depends on the name you have given to oracle instance at
the time of installing it.
Starting SQL*PLUS
Sql*plus is a tool that comes along with Oracle. It is used to issue SQL and
SQL*PLUS commands. It provides command line interface through which we can enter
SQL and SQL*PLUS command.
To start SQL*PLUS, take the steps given below:
1. Select start->programs->Oracle - Oracle8i.
Oracle8i is the name of the instance. It may be different on your system.
2. Then select Application Development -> SQL Plus.
3. When Log On dialog box is displayed, enter username, password and Host
string. Use tab key to move from one field to another. For more information about
each of these fields, see next section.
4. Click on OK.
5. If the information supplied is valid then you enter into Oracle andSQL*PLUS
will display SQL> prompt.
Username, Password and Host String
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
38
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Oracle is a multi-user database. Whoever is access the database must log on to


database. To log on we have to supply username and password. When the given
username and password are recognized by Oracle, it will allow us to access data. A user
can access only the data that belongs to his/her and not the data of others. However, it is
possible for a user to grant privileges to others so that other can access his/her data.
Creation of users and management of overall security is the responsibility of
Database Administrator (DBA). DBA is the person who makes sure that database is
functioning smoothly. He is responsible for operations such as taking backup of the
database, recovering the database in the event of failure, fine tuning database to get best
performance. So, if you want to have a new account under your name, please consult
administrator of your database.
Username & Password
Every user who wants to access oracle database must have an account in the
database. These accounts are created by DBA. Each account is associated with username
and password.
Oracle comes with a set of predefined accounts. The following are the usernames and
passwords of these accounts.
Username Password
system manager
sys change_on_install
Scott tiger
Demo demo
Note: when you enter into oracle using either system or sys then you become DBA. That
means you get special privileges to perform major operations such as creating users etc.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
39
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

CODING
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
40
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

6. CODING:

The goal of the coding or programming phase is to translate the design of the
system produced during the design phase into code in a given programming language,
which can be executed by a computer and that performs the computation specified by the
design.

The coding phase affects both testing and maintenance. The goal of coding is not
to reduce the implementation cost but the goal should be to reduce the cost of later phases.
In other words the goal is not to simplify the job of programmer. Rather the goal should be
to simplify the job of the tester and maintainer.

Coding Approach

There are two major approaches for coding any software system. They are top-
Down approach and Bottom-up approach.

Bottom-up approach can be best suitable for developing the object oriented
systems. During system design phase to reduce the complexity, we decompose the system
into an appropriate number of subsystems, for which objects can be modeled
independently. These objects exhibit the way the subsystems perform their operations.
Once objects have been modeled they are implemented by means of coding. Even
though related to the same system as the objects are independent of each other the Bottom
up approach is more suitable for coding these objects.

In this approach we first do the coding of objects independently and then we


integrate these modules into one system to which they belong.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
41
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Simulation.java

package action;

import java.awt.BorderLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JFrame;

import javax.swing.JMenu;

import javax.swing.JMenuBar;

import javax.swing.JMenuItem;

import javax.swing.JSplitPane;

import javax.swing.event.MenuEvent;

import javax.swing.event.MenuListener;

public class Simulation extends JFrame implements ActionListener,MenuListener

private JMenuBar bar;

private JMenu file;

private JMenuItem exit;

private JMenuItem send;

public static PaintPanel pp;

public Simulation()

bar=new JMenuBar();
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
42
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

file=new JMenu("File");

file.setMnemonic('f');

file.addMenuListener(this);

send=new JMenuItem("Send");

send.addActionListener(this);

send.setActionCommand("send");

send.setMnemonic('s');

file.add(send);

exit=new JMenuItem("Exit");

exit.addActionListener(this);

exit.setActionCommand("Exit");

exit.setMnemonic('x');

file.add(exit);

bar.add(file);

setJMenuBar(bar);

pp=new PaintPanel();

setLayout(new BorderLayout());

final JSplitPane spt = new JSplitPane(JSplitPane.VERTICAL_SPLIT,true);

spt.setDividerLocation(350);

spt.setLeftComponent(pp);
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
43
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

setTitle("MANET Simulator");

add(spt);

setVisible(true);

setDefaultCloseOperation(DISPOSE_ON_CLOSE);

setExtendedState (MAXIMIZED_BOTH);

public static void main(String args[])

new Simulation();

public void menuSelected(MenuEvent e)

{ // TODO Auto-generated method stub

public void menuDeselected(MenuEvent e)

{ // TODO Auto-generated method stub

public void menuCanceled(MenuEvent e)

{ // TODO Auto-generated method stub

public void actionPerformed(ActionEvent e)

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
44
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

if(e.getSource().equals(exit))

System.exit(0);

if(e.getSource().equals(send))

new SenderForm();

PaintPanel.java

package action;

import java.awt.Graphics2D;

import java.awt.Point;

import java.awt.Color;

import java.awt.Graphics;

import java.awt.RenderingHints;

import java.awt.event.MouseEvent;

import java.awt.event.MouseAdapter;

import java.util.Iterator;

import java.util.Vector;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
45
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import java.util.Date;

public class PaintPanel extends JPanel

private int pointCount=0;

private Point points[]=new Point[1000];

String name;

int i=0;

int hostport=5000;

Date d=new Date();

public static HostContainer nt = new HostContainer();

public PaintPanel()

addMouseListener(

new MouseAdapter()

public void mouseClicked(MouseEvent event)

if (i<50)
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
46
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

long host_id=new Date().getTime();

Point point = event.getPoint(); //Get the Point Position

name="Host";

i++;

name=name+String.valueOf(i);

hostport++; //Assign unique port for every Host

Host node = new Host(point, name,hostport,host_id);

//Create Object and pass arguments through constructor

nt.addHost(node); //Add object of Host class to HostContainer Class

repaint();

else

JOptionPane.showMessageDialog(null,"Allowed only 50 Receiver Hosts");

);

public void paint(final Graphics g)

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
47
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Graphics2D gg = (Graphics2D) g;

gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,

RenderingHints.VALUE_ANTIALIAS_ON);

g.setColor(Color.RED);

gg.clearRect(0, 0, getWidth(), getHeight());

Iterator treeTraverse = nt.getIterator();

Vector v = nt.getVector();

while (treeTraverse.hasNext())

Host host = (Host) treeTraverse.next();

gg.setColor(Color.RED);

gg.fillOval(host.position.x - 10, host.position.y - 10, 18, 18);

gg.setColor(Color.BLACK);

gg.drawString("[" +host.name +"]", host.position.x - 20,host.position.y + 20);

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
48
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SenderForm.java

package action;

import java.awt.GridBagLayout;

import java.awt.GridBagConstraints;

import javax.swing.JOptionPane;

import java.io.File;

import java.util.Iterator;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JButton;

import javax.swing.JFileChooser;

import javax.swing.filechooser.FileFilter;

import javax.swing.JTextField;

import javax.swing.JComboBox;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.Component;

public class SenderForm extends JFrame implements ActionListener

private JLabel label1;

private JLabel label2;

private JTextField txt1;


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
49
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

private JButton browse,submit,cancel;

private JComboBox sou,des;

private String name,sname,dname;

private GridBagLayout layout;

private GridBagConstraints cons;

private HostContainer containerOBJ;

int host_count;

int i=-1;

public SenderForm()

super("Select File to Traversing..");

containerOBJ=PaintPanel.nt;

layout=new GridBagLayout();

setLayout(layout);

cons=new GridBagConstraints();

host_count=containerOBJ.size();

final String source_nodes[]=new String[host_count];

Iterator treeTraverse = containerOBJ.getIterator();

while (treeTraverse.hasNext())

i++;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
50
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Host host = (Host) treeTraverse.next();

source_nodes[i]=host.name;

label1=new JLabel("Select Source Node");

label1.setToolTipText("Source");

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(label1,0,2,5,5);

sou=new JComboBox(source_nodes);

sou.setMaximumRowCount(5);

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(sou,0,12,5,5);

label2=new JLabel("Select Destination Node");

label2.setToolTipText("Destination");

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(label2,15,4,5,5);

des=new JComboBox(source_nodes);

des.setMaximumRowCount(5);

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(des,15,12,5,5);

txt1=new JTextField();

txt1.setToolTipText("TextBox");

cons.fill=GridBagConstraints.HORIZONTAL;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
51
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

addComponent(txt1,20,2,5,5);

browse=new JButton("Browse");

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(browse,20,10,5,5);

browse.addActionListener(this);

submit=new JButton("Submit");

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(submit,30,2,2,2);

submit.addActionListener(this);

submit.setActionCommand("submit");

cancel=new JButton("Cancel");

cons.fill=GridBagConstraints.HORIZONTAL;

addComponent(cancel,30,10,5,5);

cancel.addActionListener(this);

cancel.setActionCommand("cancel");

setVisible(true);

setSize(400,400);

private void addComponent(Component component,int row,int column,int width, int


height)

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
52
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

cons.gridx=column;

cons.gridy=row;

cons.gridwidth=width;

cons.gridheight=height;

layout.setConstraints(component, cons);

add(component);

public void actionPerformed(ActionEvent ae)

if (ae.getSource()==browse)

JFileChooser chooser = new JFileChooser();

chooser.setCurrentDirectory(new File("."));

chooser.setFileFilter(new FileFilter()

public boolean accept(File f)

return f.getName().toLowerCase().endsWith(".jpg")|| f.isDirectory();

public String getDescription() {

return "JPEG Files";

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
53
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

});

int returnVal = chooser.showOpenDialog(this);

if (returnVal == JFileChooser.APPROVE_OPTION)

name = chooser.getSelectedFile().getPath();

File filename = chooser.getSelectedFile();

txt1.setText(filename.getAbsolutePath());

System.out.println("Cover Image" +name);

} //End Code For JFilChooser

if(ae.getSource().equals(cancel))

setVisible(false);

if(ae.getSource().equals(submit))

if (txt1.getText().equals(""))

JOptionPane.showMessageDialog(null,"Select FileName you want to Transfer");

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
54
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

else if (sou.getSelectedItem().equals(des.getSelectedItem()))

JOptionPane.showMessageDialog(null,"Please Select Different Destination Name");

else if(host_count<10)

JOptionPane.showMessageDialog(null,"Number of Receiver should be Greater 10");

else if(host_count>50)

JOptionPane.showMessageDialog(null,"Number of Receiver should be Greater 50");

else

BufferTransfer bufferTransfer=new BufferTransfer();

sname=(String)sou.getSelectedItem();

dname=(String)des.getSelectedItem();

try {

new TransferObject(sname,dname,txt1.getText(),bufferTransfer);

catch (Exception e) {

// TODO Auto-generated catch block


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
55
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

e.printStackTrace();

Host.java

package action;

/*

* The class is used to maintain all the information

* about the individual host eg(position, name, and windowSize)

*/

import java.awt.Point;

import java.io.Serializable;

public class Host implements Serializable

private static final long serialVersionUID = 1654566548251023645L;

public Point position;// x,y position of the pixel


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
56
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

public String name; // name of the host

public int distance; // distance from router

public int hostPort; // retrieve port no

public long host_id; //set unique host id to each host

public Host(Point pos,String nam,int port,long id)

position = pos;

name = nam;

hostPort = port;

host_id=id;

new HostResponse(hostPort);

HostContainer.java

package action;

import java.io.Serializable;

import java.util.Iterator;

import java.util.Vector;

import javax.swing.JOptionPane;

/*

* This class is used to store all the host


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
57
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

* provide service the necessay place

*/

public class HostContainer

private Vector hostVector = null;

public HostContainer()

hostVector = new Vector();

public void addHost(Host host)

hostVector.add(host);

public Iterator getIterator() // to retrieve all the hosts under iterator

Vector vector = new Vector(hostVector);

return vector.iterator();

public Vector getVector() // to retrieve the vector which content all the hosts

Vector vector = new Vector(hostVector);


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
58
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

return vector;

public int size() // Get Vector Size.

return hostVector.size();

HostResponse.java

package action;

import java.io.*;

import java.net.*;

import javax.swing.JOptionPane;

public class HostResponse implements Runnable

int port;

Thread thread;

public HostResponse(int port)

this.port=port; //Assign port

thread=new Thread(this);
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
59
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

thread.start();

public HostResponse(){}

public void run()

while(true)

try

ServerSocket socket;

Socket connsocket;

BufferTransfer bufferTransfer;

TransferObject transferObject=new TransferObject();

ObjectInputStream objectInputStream;

socket=new ServerSocket(port);// create server socket and bind with port 6789

System.out.println("Server Connected");

connsocket=socket.accept(); // waiting to accept data from socket

objectInputStream=new ObjectInputStream(connsocket.getInputStream());

bufferTransfer = (BufferTransfer) objectInputStream.readObject();// Read data from socket

if (bufferTransfer.getDestination_type().equals("Process")) //Proect Next Host

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
60
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

transferObject.neighbour_node(bufferTransfer.getCurrent_host(),bufferTransfer.getDestin
ation_name(),bufferTransfer.getFilename(),bufferTransfer); //Change source and
destination and then continue

else if(bufferTransfer.getDestination_type().equals("Destination"))

//Confirm Data Packet reach destination

Writeobject writeobject=new Writeobject();

//Generate Output when that file reach destination

writeobject.output(bufferTransfer);

bufferTransfer.getRefuse_packet_container().removeAll(bufferTransfer.getRefuse_packet
_container());

bufferTransfer.getCrossing_host_name().removeAll

(bufferTransfer.getCrossing_host_name());

bufferTransfer.getDestination_not_reachable_list().removeAll

(bufferTransfer.getDestination_not_reachable_list());

else if(bufferTransfer.getDestination_type().equals("Failure"))

//Check status for Not Reachable

Writeobject writeobject=new Writeobject();

writeobject.output(bufferTransfer);

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
61
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

connsocket.close();

socket.close();

catch(Exception error)

System.out.println("error in Server==>"+error);

SubHostResponse.java

package action;

import java.io.*;

import java.net.*;

public class SubHostResponse

public SubHostResponse(int port,BufferTransfer bufferTransfer)

Socket socket;

ObjectOutput dataout;

try
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
62
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

System.out.println("Client Communicate with appropriate port");

socket=new Socket("127.0.0.1",port);

// Made socket connection on the port number 6789 in the host 127.0.01

dataout=new ObjectOutputStream(socket.getOutputStream());

// Bind socket stream with Buffered stream

dataout.writeObject(bufferTransfer);

dataout.flush();

socket.close();

catch(Exception error)

System.out.println("Error in Client"+error);

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
63
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Writeobject.java

/*

* The class is used to write information to log file

* about the Output eg(Source Name,Destinatin name, Traverse path)

*/

package action;

import java.io.FileOutputStream;

import java.util.Date;

public class Writeobject

private FileOutputStream fos;

public void output(BufferTransfer bufferTransfer)

try

fos = new FileOutputStream("Transfer_history.txt",true);

String s_line="\n--------------------------------------------------------------------";

String res_output="\nS.Name==>"+bufferTransfer.getSource_name()+"D.Name==>"

+bufferTransfer.getDestination_name();

//Assign Source and Destinatin name for write the log file

String date = "\n" +new Date().toString();

fos.write(date.getBytes());
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
64
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

fos.write(s_line.getBytes());

fos.write(res_output.getBytes());

fos.write(s_line.getBytes());

fos.write(bufferTransfer.getCrossing_host_name().toString().getBytes());

//Display traversing Data Packer path info

fos.write(s_line.getBytes());

fos.close();

catch(Exception e)

System.out.println("File Write"+e.getMessage());

TransferObject.java

package action;

import java.awt.Point;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
65
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

import java.util.Iterator;

import java.util.Vector;

import javax.swing.JOptionPane;

public class TransferObject

private BufferTransfer bufferTransfer;

public static TransferObject transferObject;

byte[] buffer;

FileInputStream fis;

public TransferObject(String sname,String dname,String


fname,BufferTransfer bufferTransfer) throws Exception

this.bufferTransfer=bufferTransfer;

transferObject=new TransferObject();

this.sname=sname;

this.dname=dname;

this.fname=fname;

bufferTransfer.setSource_name(sname); // Set Souce Name

bufferTransfer.setDestination_name(dname); // Set Destination name

bufferTransfer.setFilename(fname); // Set File Name

File f=new File(fname);

try {
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
66
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

fis =new FileInputStream(f);

buffer=new byte[fis.available()];

fis.read(buffer);

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

bufferTransfer.setBuffer(buffer);

transferObject.neighbour_node(sname,dname,fname,bufferTransfer);

public TransferObject()

{}

int dest_avail_confirm=0, region_short_node=0, sdt=0, next_sdt=0 ,trans_port=0


,trans_port_copy=0, dest_reach_confirm=0;

String sname,dname,fname,trans_node_type="";

Point s_point,reg_point; //For get source point

long trans_port_id; //Assign port id for transfer

Vector current_reg_vector=new Vector();

//For set Current region Host(Find out host 120 Distance)


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
67
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Vector current_reg_vector_next=new Vector();

//For set Next Current region Host(include 120 Distance)

String region_short_node_name="None"; // Assign Next Host for Tranverse

//For declare value for next iteration loop

String not_reach_alternate_host="None",not_reach_alternate_host_copy="None";

Point not_reach_alternate_host_point = null;

int not_reach_hostport = 0;

int fdt=0;

public void neighbour_node(String sname,String dname,String fname,BufferTransfer


bufferTransfer) throws Exception

dest_reach_confirm=0;

Iterator treeTraverse = PaintPanel.nt.getIterator(); // Iteration for Host information

while (treeTraverse.hasNext()) //Find out source and destination


point {

Host host = (Host) treeTraverse.next();

if (host.name.equalsIgnoreCase(sname))

s_point=host.position; //Assign Source


Position }

Iterator treeTraverse_dist = PaintPanel.nt.getIterator(); //Iterate all host from hostcontainer

while (treeTraverse_dist.hasNext())

Host host = (Host) treeTraverse_dist.next();


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
68
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

//Get Host list from HostContainer Class

sdt = (int)Math.sqrt(Math.pow((s_point.x-host.position.x), 2) + Math.pow((s_point.y-


host.position.y), 2)); //Find the Distance from Source and iterate host

if((sdt>0)&&(sdt<=125)&&(!bufferTransfer.getRefuse_packet_container().contains(host.h
ost_id)) && (!bufferTransfer.getDestination_not_reachable_list().contains(host.name))&&
(!bufferTransfer.getCrossing_host_name().contains(host.name))) //Check particular
Region

current_reg_vector.add(host.name);

bufferTransfer.setRefuse_host_id(host.host_id);

//Code for Check Next iteration host are available(within next 125 Region)

Iterator treeTraverse_dist_next = PaintPanel.nt.getIterator();

while(treeTraverse_dist_next.hasNext())

Host host_next = (Host) treeTraverse_dist_next.next();

//Get Host list from HostContainer Class

next_sdt = (int)Math.sqrt(Math.pow((host.position.x-host_next.position.x), 2) +
Math.pow((host.position.y-host_next.position.y), 2)); //Find the Distance from Source and
iterate host

if((next_sdt>0)&&(next_sdt<=125)&&(!bufferTransfer.getRefuse_packet_container().cont
ains(host_next.host_id))&&(!host_next.name.equals(sname))&&(!bufferTransfer.getCross
ing_host_name().contains(host.name))) //Check particular Region

current_reg_vector_next.add(host_next.name);

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
69
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

} //End for check Next iteration

if((region_short_node<=sdt)&&((current_reg_vector_next.size()>0)||(host.name.equals(bu
fferTransfer.getDestination_name())))&&

(!bufferTransfer.getCrossing_host_name().contains(host.name)))

region_short_node=sdt;

region_short_node_name=host.name; //Assign next host

dest_reach_confirm++;

trans_port=host.hostPort;

//get Unique port for next host

current_reg_vector_next.removeAll(current_reg_vector_next);

if (current_reg_vector.contains(dname))

//Check Destinatin host are avaiable in Region

JOptionPane.showMessageDialog(null,"Successfully sent");

String fob="Hosts/"+dname;

File f=new File(fob);

f.mkdir();

//Make Directory if not exists


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
70
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

FileOutputStream fos;

try {

fos = new FileOutputStream(fob+"/Output.txt");


//Genrate the .txt for output

fos.write(bufferTransfer.getBuffer());
//Generate output when File reach their Destination

fos.close();

catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

bufferTransfer.setDestination_type("Destination");

new SubHostResponse(trans_port,bufferTransfer);

else if (!region_short_node_name.equals("None"))

//Assign for next Host to Traverse

current_reg_vector.removeAll(current_reg_vector);

region_short_node=0;

sdt=0;

bufferTransfer.setCurrent_host(region_short_node_name);
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
71
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

bufferTransfer.setCross_host_name(region_short_node_name);

System.out.println("Next Host to Process-->"+bufferTransfer.getCurrent_host());

bufferTransfer.setDestination_type("Process");

new SubHostResponse(trans_port,bufferTransfer);

//Control transfer to client(Such as Sender)

else

//Prevent Data Packet Not reachable Condition (Two step back)

if (bufferTransfer.getCrossing_host_name().size()>=2)

try

if
(bufferTransfer.getCrossing_host_name().size()>=2)

bufferTransfer.setDestination_not_reach_host(bufferTransfer.getCross
ing_host_name().lastElement().toString());

//Assign particular Host name into Not Reachable list

trans_port=transferObject.freeup_Host(bufferTransfer.getCrossing_host_name().lastEleme
nt().toString(),bufferTransfer); //Free up surrounding host
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
72
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

bufferTransfer.getCrossing_host_name().remove(bufferTransfer.getCrossing_host_name().
lastElement());

//Remove From Travering Host List

bufferTransfer.setCurrent_host(bufferTransfer.getCrossing_host_name().lastElement().toS
tring()); //Set Current host name to traverse next Iteration

trans_port=transferObject.freeup_Host(bufferTransfer.getCrossing_host_name().lastEleme
nt().toString(),bufferTransfer);

////Free up surrounding host (120 Distance from not reachable host)

bufferTransfer.getCrossing_host_name().remove(bufferTransfer.getCrossing_host_name().
lastElement()); //Remove from Taversing Host list

System.out.println("NextHost to Process(Recover)-->."+bufferTransfer.getCurrent_host());

bufferTransfer.setDestination_type("Process"); //Set type for process another iteration

new SubHostResponse(trans_port,bufferTransfer);

//Control transfer to client(Such as Sender)

catch(Exception e)

System.out.println("Exception in not reachable"+e.getMessage());

else if (bufferTransfer.getCrossing_host_name().size()>=1)

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
73
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

JOptionPane.showMessageDialog(null,"No More Sub Host Receiver Available in Next


Host Region "+bufferTransfer.getCurrent_host());

bufferTransfer.setDestination_type("Failure");

else if (bufferTransfer.getCrossing_host_name().isEmpty())

JOptionPane.showMessageDialog(null,"Put Receiver Host in 125 Region");

bufferTransfer.setDestination_type("Failure");

else

JOptionPane.showMessageDialog(null,"Destination Not Reachable");

bufferTransfer.setDestination_type("Failure");

public int freeup_Host(String freeuphost_param,BufferTransfer bufferTransfer)

try

Iterator iterator_getpoint = PaintPanel.nt.getIterator();

while(iterator_getpoint.hasNext())
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
74
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Host host_next_alter_host = (Host) iterator_getpoint.next();

//Get Host list from HostContainer Class

if (freeuphost_param.equals(host_next_alter_host.name))

not_reach_alternate_host_point=host_next_alter_host.position;

//Get the Host point posistion

not_reach_hostport=host_next_alter_host.hostPort;

//Get corresponding hostport

catch(Exception e)

System.out.println("Exception in Getting Point"+e.getMessage());

try

// Free up from refuse List host

Iterator treeTraverse_dist_freeup_host = PaintPanel.nt.getIterator();

while(treeTraverse_dist_freeup_host.hasNext())

{
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
75
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Host host_next_free = (Host) treeTraverse_dist_freeup_host.next();


//Get Host list from HostContainer Class

fdt=(int)Math.sqrt(Math.pow((not_reach_alternate_host_point.x-ost_next_free.position.x),
2) + Math.pow((not_reach_alternate_host_point.y-host_next_free.position.y), 2));

//Find the Distance from Source and iterate host

if (fdt<=125) //Check that particular host is avaiable in 125 Region Distance

bufferTransfer.getRefuse_packet_container().remove(host_next_free.host_id);
}

catch(Exception e)

System.out.println("Exception in Free-up Host"+e.getMessage());


}

return not_reach_hostport;

} //End function

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
76
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

BufferTransfer.java

package action;

/*

* The class is used to maintain all the information

* about the individual host eg(position, name, and windowSize)

*/

import java.io.*;

import java.util.Vector;

public class BufferTransfer implements Serializable

String
source_name,destination_name,filename,destination_type,current_host,cross_host_name;

long refuse_host_id; //Reject host id when

Vector crossing_host_name=new Vector();

//List for File traverse path

Vector refuse_packet_container=new Vector();

//Refuse list for already file traversed

Vector destination_not_reachable_list=new Vector();

//Refuse list for packet not reachable

String destination_not_reach_host;

byte[] buffer=new byte[1024];


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
77
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

public Vector getCrossing_host_name() {

//Get Info for file traversing Host

return crossing_host_name;

public void setCross_host_name(String cross_host_name) {

//Add Cross host name to vector list

crossing_host_name.add(cross_host_name);

public void setRefuse_host_id(long refuse_host_id) {

//reject host for one host traverse

refuse_packet_container.add(refuse_host_id);

public Vector getRefuse_packet_container() {


//get Reject host

return refuse_packet_container;

public String getCurrent_host() {


//get Current host

return current_host;

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
78
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

public void setCurrent_host(String current_host) {


//set Current host

this.current_host = current_host;

public String getDestination_name() {


//get Destinatin Host

return destination_name;

public void setDestination_name(String destination_name) {

//set Destinatin Host

this.destination_name = destination_name;

public String getDestination_type(){


// get Destination type wheather that host is Process/Destination

return destination_type;

public void setDestination_type(String destination_type) {

// set Destination type wheather that host is Process/Destination

this.destination_type = destination_type;

public String getFilename() {


// get Name for which file want to trasfer through network

return filename;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
79
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

public void setFilename(String filename) {


// get Name for which file want to trasfer through network

this.filename = filename;

public String getSource_name() {


//get Source name select by user

return source_name;

public void setSource_name(String source_name) {

//set Source name select by user

this.source_name = source_name;

public byte[] getBuffer() {

return buffer;

public void setBuffer(byte[] buffer) {


//Set output message read from input file given by user

this.buffer = buffer;

public Vector getDestination_not_reachable_list() {


//Get vector contains that not reachable host name

return destination_not_reachable_list;
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
80
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

public void setDestination_not_reach_host(String


destination_not_reach_host)

destination_not_reachable_list.add(destination_not_reach_host);

}
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
81
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SYSTEM TESTING
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
82
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

7. SYSTEM TESTING:

Testing is the process of finding differences between the expected behavior


specified by system models and the observed behavior of the system. Testing is a critical
role in quality assurance and ensuring the reliability of development and these errors will
be reflected in the code so the application should be thoroughly tested and validated.

Unit testing finds the differences between the object design model and its
corresponding components. Structural testing finds differences between the system design
model and a subset of integrated subsystems. Functional testing finds differences between
the use case model and the system.

Finally performance testing, finds differences between non-functional requirements


and actual system performance. From modeling point of view, testing is the attempt of
falsification of the system with respect to the system models. The goal of testing is to
design tests that exercise defects in the system and to reveal problems.

Testing Concepts

The model elements used during testing:

§ A component is a part of the system that can be isolated for testing. A component
can be an object, a group of objects, or one or more subsystems.

§ A fault, also called bug or defect, is a design or coding mistake that may cause
abnormal component behavior.

§ An erroneous state is a manifestation of a fault during the execution of the system.


An erroneous state is caused by one or more faults and can lead to a failure.

§ A failure is a deviation between the specification and the actual behavior. A failure
is triggered by one or more erroneous states. Not all erroneous states trigger a
failure.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
83
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

§ A test case is a set of inputs and expected results that exercises a component with
the purpose of causing failures and detecting faults.

§ A test stub is the partial implementation of components on which the tested


component depends. A test driver is a partial implementation of a component that
depends on the tested components.

§ A correction is a change to a component. The purpose of a correction is to repair a


fault.

Testing Activities

Testing a large system is a complex activity and like any complex activity. It has to
be broke into smaller activities. Thus incremental testing was performed on the project i.e.,
components and subsystems of the system were tested separately before integrating them
to form the subsystem for system testing.

Unit Testing

Unit testing focuses on the building blocks of the software system that is the
objects and subsystems. There are three motivations behind focusing on
components. First unit testing reduces the complexity of overall test activities
allowing focus on smaller units of the system, second unit testing makes it easier to
pinpoint and correct faults given that few components are involved in the rest.
Third unit testing allows parallelism in the testing activities, that is each component
are involved in the test. Third unit testing allows parallelism in the testing
activities that is each component can be tested independently of one another.

The following are some unit testing techniques.

Equivalence Testing: It is a black box testing technique that minimizes the number
of test cases. The possible inputs are partitioned into equivalence classes and a test
case is selected for each class. In this project, the system is divided into
equivalence classes and tested.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
84
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Boundary Testing:

It is a special case of equivalence testing and focuses on the conditions at


the boundary of the equivalence classes. Boundary testing requires that the
elements be selected from the edges of the equivalence classes. In this project the
system shows an error message when no machine or job is selected.

Path Testing:

It is a white box testing technique that identifies faults in the


implementation of the component the assumption here is that exercising all possible
paths through the code at least once. Most faults will trigger failure. This acquires
knowledge of source code.

Integration Testing

Integration testing defects faults that have not been detected. During
unit testing by focusing on small groups on components two or more components
are integrated and tested and once tests do not reveal any new faults, additional
components are added to the group. This procedure allows testing of increasing
more complex parts on the system while keeping the location of potential faults
relatively small. I have used the following approach to implements and integrated
testing.

Top-down testing strategy unit tests the components of the top layer and
then integrated the components of the next layer down. When all components of
the new layer have been tested together, the next layer is selected. This was
repeated until all layers are combined and involved in the test. In this project, two
or more components are tested together. Here the top down approach is followed.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
85
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Validation Testing

The systems completely assembled as package, the interfacing have been


uncovered and corrected, and a final series of software tests are validation testing. The
validation testing is nothing but validation success when system functions in a manner that
can be reasonably expected by the customer. The system validation had done by series of
Black-box test methods.

In this project, save schedule, generate schedule tests are black box tests.

System Testing

§ System testing ensures that the complete system compiles with the functional
requirements and non-functional requirements of the system, the following are
some system testing activities.

§ Functional testing finds differences between the functional between the functional
requirements and the system. This is a black box testing technique. Test cases are
divided from the use case model.

§ Performance testing finds differences between the design and the system the design
goals are derived from the functional requirements.

§ Pilot testing the system is installed and used by a selected set of users – users
exercise the system as if it had been permanently installed.

§ Acceptance testing, I have followed benchmarks testing in a benchmarks testing the


client prepares a set of test cases represent typical conditions under which the
system operates. In our project, there are no existing benchmarks. But, there are
certain benchmarks available on the Internet regarding the minimum and maximum
time limits for generating the random Big Integer values. We have used these to
test the system.

In this project, all the components are tested together and get the required results.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
86
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

TESTING

Test Test Case Expected Actual Result


No Output Output
1 Source host and Dialog box to be Dialog box to be passed
destination hosts are same. displayed saying displayed saying
please select please select
different destination different
name destination name

2 Source host and Dialog box to be Dialog box to be passed


destination hosts are not displayed saying displayed saying
same. success fully sent. success fully sent.

3 Source and Destination Dialog box to be Dialog box to be passed


Hosts are not within the displayed saying put displayed saying
125m region. receiver host in 125 put receiver host in
Region 125 Region

4 Source and Destination Dialog box to be Dialog box to be passed


Hosts are within the 125m displayed saying displayed saying
region. success fully sent. success fully sent.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
87
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SAMPLE

OUTPUT SCREENS
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
88
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

8. OUTPUT SCREENS:

MANET Simulator:-
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
89
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Browsing the data item for sending from source host to destination host
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
90
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Source and Destination hosts must be different


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
91
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Data item successfully sent from source host to destination host


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
92
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

Nodes must be within the 125m region only


F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
93
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

SCOPE FOR FUTURE


ENHANCEMENTS
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
94
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

9. SCOPE FOR FUTURE ENHANCEMENTS:

In this project the focus is on developing efficient caching techniques in adhoc


networks with memory limitations. This work can be designed, implemented and evaluated
in a wireless multi-hop ad hoc instant messenger with 7 Pocket PCs fully implementing the
basic features of the DSR protocol along with a few design alternatives. It paves the way
for more future work incorporating possibly more nodes and more optimized features of
the DSR Protocol. For example, an optimized cache structure can be considered and its
effect may be tested with more nodes in the system.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
95
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

CONCLUSION
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
96
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

10. CONCLUSION:

We have developed a paradigm of data caching techniques to support effective data


access in ad hoc networks. Here, the data expiry model is TTL-per-request, and the cache
update model is cache deletion. (a) Average query delay. (b) Query success ratio. (c) Total
number of messages. Varying mean query generate time on spatial data access pattern by
comparing Random Caching, Hybrid Cache and DGA, with vmax ¼ 10 m=s. (a) Average
query delay. (b) Query success ratio. (c) Total number of messages. Fig. 12. Varying mean
query generate time on spatial data access pattern with cache update in mobile networks
with vmax ¼ 10 m=s. Here, the data expiry model is TTL-per-item, and the cache update
model is server multicast. (a) Average query delay. (b) Query success ratio. (c) Total
number of messages. Particular, we have considered the memory capacity

Constraint of the network nodes and developed efficient algorithms to determine


near-optimal cache placements to maximize reduction in overall access cost. Reduction in
access cost leads to communication cost savings and, hence, better bandwidth usage and
energy savings. Our later simulation experience with ns2 also shows that better bandwidth
usage also in turn leads to less message losses and, thus, better query success ratio. The
novel contribution in our work is the development of a 4-approximation centralized
algorithm, which is naturally amenable to a localized distributed implementation. The
distributed implementation uses only local knowledge of traffic. However, our simulations
over a wide range of network and application parameters show that the performance of the
two algorithms is quite close. We note that ours is the first work that presents a distributed
implementation based on an approximation algorithm for the problem of cache placement
of multiple data items under memory constraint. We further compare our distributed
algorithm with a competitive algorithm (Hybrid Cache) presented in the literature that has
a similar goal. This comparison uses the ns2 simulator with a complete wireless
networking protocol stack including dynamic routing. We consider a broad range of
application parameters and both stationary and mobile networks. These evaluations show
that our algorithm significantly outperforms Hybrid Cache, particularly in more
challenging scenarios, such as higher query frequency and smaller memory.
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
97
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

BIBLIOGRAPHY
F T ra n sf o F T ra n sf o
PD rm PD rm
Y Y
Y

Y
er

er
ABB

ABB
y

y
bu

bu
2.0

2.0
to

to
re

re
98
he

he
k

k
lic

lic
C

C
w om w om
w

w
w. w.
A B B Y Y.c A B B Y Y.c

11. BIBLIOGRAPHY:

· Aazami, S. Ghandeharizadeh, and T. Helmi, “Near Optimal Number of Replicas


for Continuous Media in Ad-Hoc Networks of Wireless Devices,” Proc. Int’l
Workshop Multimedia Information Systems, 2004.
· Awerbuch, Y. Bartal, and A. Fiat, “Heat and Dump: Competitive Distributed
Paging,” Proc. IEEE Symp. Foundations of Computer Science (FOCS ’93), 1993.
· Baev and R. Rajaraman, “Approximation Algorithms for Data Placement in
Arbitrary Networks,” Proc. ACM-SIAM Symp. Discrete Algorithms (SODA ’01),
2001.
· S. Bhattacharya, H. Kim, S. Prabh, and T. Abdelzaher, “Energy-Conserving Data
Placement and Asynchronous Multicast in Wireless Sensor Networks,” Proc. ACM
Int’l Conf. Mobile Systems, Applications, and Services (MobiSys ’03), 2003.
· L. Breslau, P. Cao, L. Fan, G. Phillips, and S. Shenker, “Web Caching and Zipf-
Like Distributions: Evidence and Implications,” Proc. IEEE INFOCOM ’99, 1999.

Anda mungkin juga menyukai