main abs (1) (2)
TRANSCRIPT
-
7/31/2019 MAIN ABS (1) (2)
1/74
M.R.C For Fast Ip Network Recovery 1
1. INTRODUCTION
In recent years the internet has been transformed from a special purpose network to an
ubiquitous platform for a wide range of everyday communication services. The demands on
Internet reliability and availability have increased accordingly. A disruption of a link in central
parts of a network has the potential to affect hundreds of thousands of phone conversations or
TCP connections, with obvious adverse effects.
The ability to recover from failures has always been a central design goal in the Internet.
IP networks are intrinsically robust, since IGP routing protocols like OSPF are designed to up-
date the forwarding information based on the changed topology after a failure. This re-
convergence assumes full distribution of the new link state to all routers in the network domain.
When the new state information is distributed, each router individually calculates new validrouting tables. This network-wide IP re-convergence is a time consuming process, and a link or
node failure is typically followed by a period of routing instability. During this period, packets
may be dropped due to invalid routes. This phenomenon has been studied in both IGP and BGP
context, and has an ad- verse effect on real-time applications. Events leading to a re-convergence
have been shown to occur frequently. MRC is based on building a small set of backup routing
configurations,that are used to route recovered traffic on alternate paths after a failure. The
backup configurations differ from the normal routing configuration in that link weights are set so
as to avoid routing traffic in certain parts of the network.
We observe that if all links attached to a node are given sufficiently high link weights,
traffic will never be routed through that node. The failure of that node will then only affect traffic
that is sourced at or destined for the node itself. Similarly, to exclude a link (or a group of links)
from taking part in the routing, we give it infinite weight. The link can then fail without any
consequences for the traffic. Our MRC approach is threefold. First, we create a set of backup
configurations, so that every network component is excluded from packet forwarding in one
configuration. Second, for each configuration, a standard routing algorithm like OSPF isused to
calculate configuration specific shortest paths and create forwarding tables in each router, based
on the configurations. The use of a standard routing algorithm guarantees loop-free forwarding
within one configuration. Finally, we design a forwarding process that takes advantage of the
backup configurations to provide fast recovery from a component failure. In our approach, we
construct the backup configurations so that for all links and nodes in the network, there is a
configuration where that link or node is not used to forward traffic.
-
7/31/2019 MAIN ABS (1) (2)
2/74
M.R.C For Fast Ip Network Recovery 2
Thus, for any single link or node failure, there will exist a configuration that will route the
traffic to its destination on a path that avoids the failed element. Also, the backup configurations
must be constructed so that all nodes are reachable in all configurations, i.e., there is a valid path
with a finite cost between each node pair. Shared Risk Groups can also be protected, by regarding
such a group as a single component that must be avoided in a particular configuration. We
formally describe MRC and how to generate configurations that protect every link and node in a
network. Using a standard shortest path calculation, each router creates a set of configuration-
specific forwarding tables. For simplicity, we say that a packet is forwarded according to a
configuration, meaning that it is forwarded using the forwarding table calculated based on that
configuration. In this paper we talk about building a separate forwarding table for each
configuration, but we believe that more efficient solutions can be found in a practical
implementation. When a router detects that a neighbor can no longer be reached through one of
its interfaces, it does not immediately inform the rest of the network about the connectivity
failure. Instead, packets that would normally be forwarded over the failed interface are marked as
belonging to a backup configuration, and forwarded on an alternative interface towards its
destination. The selection of the correct backup configuration, and thus also the backup next-hop.
The packets must be marked with a configuration identifier, so the routers along the path know
which configuration to use. Packet marking is most easily done by using specific values in the
DSCP field in the IP header. If this is not possible, other packet marking strategies like IPv6
extension headers or using a private address space and tunneling could be used. It is important to
stress that MRC does not affect the failure free original routing, i.e., when there is no failure, all
packets are forwarded according to the original configuration, where all link weights are normal.
Upon detection of a failure, only traffic reaching the failure will switch configuration.
1.1 SCOPE
Much effort has been devoted to optimizing the different steps of the convergence of IP
routing, i.e., detection, dissemination of information and shortest path calculation, but the since
most network failures are short lived, too rapid triggering of the re-convergence process can
cause route flapping and increased network instability.
The IGP convergence process is slow because it is reactive and global. It reacts to a
failure after it has happened, and it involves all the routers in the domain. In this paper we present
a new scheme for handling link and node failures in IP networks. Multiple Routing
Configurations (MRC) is a proactive and local protection mechanism that allows recovery in the
range of milliseconds.
-
7/31/2019 MAIN ABS (1) (2)
3/74
M.R.C For Fast Ip Network Recovery 3
MRC allows packet forwarding to continue over pre- configured alternative next-hops
immediately after the detection of the failure. Using MRC as a first line of defense against net-
work failures, the normal IP convergence process can be put on hold.
This process is then initiated only as a consequence of non-transient failures. Since no
global re-routing is performed, fast failure detection mechanisms like fast hellos or hardware
alerts can be used to trigger MRC without compromising net- work stability. MRC guarantees
recovery from any single link or node failure, which constitutes a large majority of the failures
experienced in a network. MRC makes no assumptions with respect to the root cause of failure,
e.g., whether the packet forwarding is disrupted due to a failed link or a failed router.
1.2 OBJECTIVE
The main idea of MRC is to use the network graph and the as- sociated link weights to
produce a small set of backup network configurations. The link weights in these backup
configurations are manipulated so that for each link and node failure, and re- gardless of whether
it is a link or node failure, the node that detects the failure can safely forward the incoming
packets to- wards the destination on an alternate link. MRC assumes that the network uses
shortest path routing and destination based hop-by-hop forwarding.
The shifting of traffic to links bypassing the failure can lead to congestion and packet loss
in parts of the network. This limits the time that the proactive recovery scheme can be used to
forward traffic before the global routing protocol is informed about the failure, and hence reduces
the chance that a transient failure can be handled without a full global routing reconvergence.
Ideally, a proactive recovery scheme should not only guarantee connectivity after a failure, but
also do so in a manner that does not cause an unacceptable load distribution. This requirement has
been noted as being one of the principal challenges for pre-calculated IP recovery schemes. With
MRC, the link weights are set individually in each backup configuration. This gives great
flexibility with respect to how the re- covered traffic is routed. The backup configuration used
after a failure is selected based on the failure instance, and thus we can choose link weights in the
backup configurations that are well suited for only a subset of failure instances.
-
7/31/2019 MAIN ABS (1) (2)
4/74
M.R.C For Fast Ip Network Recovery 4
2. SYSTEM ANALYSIS
2.1 EXISTING SYSTEM
Presently, the existing system has no guarantee on the recovery over the network failure.
The failures can include both the link and/or node failures. Also, it is very slow towards
recovering from the network failure or sometime not able to recover. The reasons remain many,
like congestion, cable failure and so on. As of now, there is a little information available
regarding the performance after the failure.
2.2 PROPOSED SYSTEM
Our proposed scheme guarantees recovery in all single failure scenarios, using a single
mechanism to handle both link and node failures, and without knowing the root cause of the
failure. MRC is strictly connectionless, and assumes only destination based hop-by-hop
forwarding. MRC is based on keeping additional routing information in the routers, and allows
packet forwarding to continue on an alternative output link immediately after the detection of a
failure.
2.3 SOWFTWARE REQUIREMENTS SPECIFICATION
2.3.1 FUNCTIONAL REQIREMENTS
Network Creation Routing Backup Path
2.3.2 NON-FUNCTIONAL REQUIRMENTS
Reliability Efficiency Fast Recovery
-
7/31/2019 MAIN ABS (1) (2)
5/74
M.R.C For Fast Ip Network Recovery 5
2.3.3 SOFTWARE AND HARDWARE DESCRIPTION
2.3.3.1 HARDWARE REQUIREMENTS
System Pentium Iv 2.4 Ghz
Ram 512 Mb
Hard Disk 40 GB
2.3.3.2 SOFTWARE REQUIREMENTS
Front End Java Technology
Operating System Windows XP Professional
Tools Used Eclipse
-
7/31/2019 MAIN ABS (1) (2)
6/74
M.R.C For Fast IP Network Recovery 6
3. SYSTEM DESIGN
Software design sits at the technical kernel of the software engineering process and is
applied regardless of the development paradigm and area of application. Design is the first
step in the development phase for any engineered product or system. The designers goal is to
produce a model or representation of an entity that will later be built. Beginning, once system
requirement have been specified and analyzed, system design is the first of the three technical
activities -design, code and test that is required to build and verify software.
The importance can be stated with a single word Quality. Design is the place where
quality is fostered in software development. Design provides us with representations of
software that can assess for quality. Design is the only way that we can accurately translate a
customers view into a finished software product or system. Software design serves as a
foundation for all the software engineering steps that follow. Without a strong design we risk
building an unstable system one that will be difficult to test, one whose quality cannot be
assessed until the last stage
3.1 DATA FLOW DIAGRAMS
The DFD takes an input-process-output view of a system i.e. data objects flow into the
software, are transformed by processing elements, and resultant data objects flow out of the
software. Data objects represented by labeled arrows and transformation are represented by
circles also called as bubbles. DFD is presented in a hierarchical fashion i.e. the first data flow
model represents the system as a whole. Subsequent DFD refine the context diagram (level 0
DFD), providing increasing details with each subsequent level.
The DFD enables the software engineer to develop models of the information domain
& functional domain at the same time. As the DFD is refined into greater levels of details, the
analyst performs an implicit functional decomposition of the system. At the same time, theDFD refinement results in a corresponding refinement of the data as it moves through the
processes that embody the applications. A context-level DFD for the system the primary
external entities produce information for use by the system and consume information
generated by the system. The labeled arrow represents data objects or object hierarchy. A
DFD identifies all inputs and outputs and reads left to right and top to bottom. It indicates
external sources and destinations of data with Squares. It indicates each process internal to the
system with rounded Circles. There must be no unnamed process. It identifies all data flows
for each process step, except simple Record retrievals and labels data flow on each arrow.
-
7/31/2019 MAIN ABS (1) (2)
7/74
M.R.C For Fast IP Network Recovery 7
3.1.1 DFD SYMBOLS
In the DFD, there are four symbols
1. Data Flow: Data move in a specific direction from an origin to a destination.
2. Process: People, procedures, or devices that use or produce (Transform) Data. The
physical component is not identified.
3. Source: External sources or destination of data, which may be People, programs,
organizations or other entities.
4. Data Store: Here data are stored or referenced by a process in the System.
Fig 3.1: Symbols of DFD
-
7/31/2019 MAIN ABS (1) (2)
8/74
M.R.C For Fast IP Network Recovery 8
3.1.2 CONSTRUCTING A DFD
Several rules of thumb are used in drawing DFDS:
Process should be named and numbered for an easy reference. Each name shouldbe representative of the process.
The direction of flow is from top to bottom and from left to right. Datatraditionally flow from source to the destination although they may flow back to
the source. One way to indicate this is to draw long flow line back to a source. An
alternative way is to repeat the source symbol as a destination. Since it is used
more than once in the DFD it is marked with a short diagonal.
When a process is exploded into lower level details, they are numbered. The names of data stores and destinations are written in capital letters. Process and
dataflow names have the first letter of each work capitalized.
A DFD typically shows the minimum contents of data store. Each data storeshould contain all the data elements that flow in and out.
Questionnaires should contain all the data elements that flow in and out. Missinginterfaces redundancies and like is then accounted for often through interviews.
3.1.3 SALIENT FEATURES OF DFDS
The DFD shows flow of data, not of control loops and decision are controlledconsiderations do not appear on a DFD.
The DFD does not indicate the time factor involved in any process whether thedataflow take place daily, weekly, monthly or yearly.
The sequence of events is not brought out on the DFD.Data Flow Diagrams are of two types:
1. Physical Data Flow Diagrams:
These are implementation-dependent i.e., they show theactual devices, departments, people, etc., involved in the system.
2. Logical Data Flow Diagrams: These diagrams describe the system independently of how it
is actually implemented, they show what takes places, rather than how an activity is
accomplished.
-
7/31/2019 MAIN ABS (1) (2)
9/74
M.R.C For Fast IP Network Recovery 9
The DFD is intended to represent information Flow but it is not a flow chart and is not
intended decision-making, flow of control, loops and other procedural aspects of the system.
DFD is a useful Graphical tool and is applied at the earlier stages of requirements analysis. It
may be further refined at preliminary design stage and is used as mechanism for top-level
structural design for software.
The DFD drawn first at a preliminary level is further expanded into greater details:
The context diagram is decomposed and represented with multiple rectangles. Each of these rectangles may be decomposed further and given as more detailed DFD. Explanation of DFD
-
7/31/2019 MAIN ABS (1) (2)
10/74
M.R.C For Fast IP Network Recovery 10
Fig 3.2: Data Flow Diagram (Level-1)
Fig 3.3: Data Flow Diagram (level-0)
Send a packet
Client
Router
MRC
Server
Client Router Server
-
7/31/2019 MAIN ABS (1) (2)
11/74
M.R.C For Fast IP Network Recovery 11
3.2 UNIFIED MODELING LANGUAGE DIGRAMS
3.2.1 OBJECTIVE DESIGNING AN INFORMATION SYSTEM
Following are the main objective of the system design phase Specify the logical elements Support business activities Ensure that a system feature meets user requirements Provide detailed software development specification
3.2.2 UNIFIED MODELING LANGUAGE
The Unified Modeling Language allows the software engineer to express an
analysis model using the modeling notation that is governed by a set of syntactic
semantic and pragmatic rules. A UML system is represented using five different
views that describe the system from distinctly different perspective.
Each view is defined by a set of diagram, which is as follows.
o User Model View This view represents the system from the users perspective. The analysis representation describes a usage scenario from the
end-users perspective.
o Structural Model view In this model the data and functionality are arrived from inside
the system.
This model view models the static structures. Behavioral Model View
o It represents the dynamic of behavioral as parts of the system,depicting the interactions of collection between various structuralelements described in the user model and structural model view.
Implementation Model View In this the structural and behavioral as parts of the system are
represented as they are to be built.
Environmental Model View In this the structural and behavioral aspects of the environment
in which the system is to be implemented are represented.
UML is specifically constructed through two different domains they are:
-
7/31/2019 MAIN ABS (1) (2)
12/74
M.R.C For Fast IP Network Recovery 12
UML Analysis modeling, this focuses on the user model and structural modelviews of the system.
UML design modeling, which focuses on the behavioral modeling,implementation modeling and environmental model views.
There are basically three different models of the system: The Use case model, represented in UML with use case diagrams, describes
the functionality of the system from the users point of view.
The Object model, represented in UML with class diagram, describes thestructure of a system in terms of objects, attributes, associations, and
operations.
The Dynamic model, represented in UML with sequence diagrams, state chartdiagrams, and activity diagrams, describes the internal behavior of the system.
There are basically five UML notations:
Use case diagrams Class diagrams State chart diagram Sequence diagram Collaboration diagram
-
7/31/2019 MAIN ABS (1) (2)
13/74
M.R.C For Fast IP Network Recovery 13
3.2.2.1 USE CASE DIAGRAM
Use cases are used during requirement elicitation and analysis to represent
the functionality of the system. Use cases focus on the behavior of the system from
an external point of view. A use case describes a function provided by the system
that yields a visible result for an actor.
Actorsare external entities that interact with the system. Examples of actors
include a user role (e.g., a system administrator, a bank customer) or another system.
Actors have unique names and descriptions.
Use casesdescribe the behavior of the system as seen from an actors point of
view. Behavior described by the use case model is also called external behavior .
When actors and use cases exchange information, they are said to communicate.
Fig 3.4: Use Case Diagrams
-
7/31/2019 MAIN ABS (1) (2)
14/74
M.R.C For Fast IP Network Recovery 14
3.2.2.2 CLASS DIAGRAM
Class diagrams describe the structure of the system in terms of classes and
objects. Classes are abstractions that specify the attributes and behavior of a set of
objects. Objectsare entities that encapsulate state and behavior. Each object has an
identity: It can be referred individually and is distinguishable from other objects.
In UML, boxes including three components depict classes and objects. The top
compartment displays the name of the class or object. The center compartment
displays its attributes, and bottom compartment displays its operations. The attribute
and operation compartment can be omitted for clarity. Object names are underlined to
indicate that they are instances. By convention, class name starts with an uppercase
letter.Objects in object diagrams may be given names for ease of reference. In that
case, their name starts with a lowercase letter. The type of attribute specifies the valid
range of values the attribute can take.
Fig 3.5: Class Diagrams
-
7/31/2019 MAIN ABS (1) (2)
15/74
M.R.C For Fast IP Network Recovery 15
3.2.2.3 SEQUENCE DIAGRAM
Sequence diagrams describe patterns of communication among a set of
interacting objects. An object interacts with another object by sending messages. The
reception of a message by an object triggers the execution of an operation, which in
turn may send messages to other objects. Arguments may be passed along with a
message and are bound to the parameters of the executing operation in the receiving
object.
Each column represents an object that participates in the interaction. The
vertical axis represents time top to bottom. Arrows show messages. Labels on arrows
represent message names and may contain arguments. Activations are depicted by
vertical rectangles. Actors are shown as the leftmost column.Sequence diagrams can be used to describe either an abstract sequence (i.e., all
possible interactions) or concrete sequences (i.e., one possible interaction). When
describing all possible interactions, sequence diagrams also provide notations for
conditionals and iterations.
Fig 3.6: Sequence Diagrams
-
7/31/2019 MAIN ABS (1) (2)
16/74
M.R.C For Fast IP Network Recovery 16
3.2.2.4 STATE CHART DIAGRAM
State chart diagram is one of the five UML diagrams used to model dynamic
nature of a system. They define different states of an object during its lifetime. And
these states are changed by events. So State chart diagrams are useful to model
reactive systems. Reactive systems can be defined as a system that responds to
external or internal events.
State chart diagram describes the flow of control from one state to another
state. States are defined as a condition in which an object exists and it changes when
some event is triggered. So the most important purpose of State chart diagram is to
model life time of an object from creation to termination.
Following are the main purposes of using State chart diagrams: To model life time of a reactive system. To describe different states of an object during its life time. Define a state machine to model states of an object.
Fig 3.7: State Chart Diagrams
-
7/31/2019 MAIN ABS (1) (2)
17/74
M.R.C For Fast IP Network Recovery 17
3.2.2.5 COLLABORATION DIAGRAM
A collaboration diagram, also called a communication diagram or interaction
diagram, is an illustration of the relationships and interactions among software objects
in the Unified Modeling Language (UML). The concept is more than a decade old
although it has been refined as modeling paradigms have evolved.
A collaboration diagram resembles a flowchart that portrays the roles,
functionality and behavior of individual objects as well as the overall operation of the
system in real time. Objects are shown as rectangles with naming labels inside. These
labels are preceded by colons and may be underlined. The relationships between the
objects are shown as lines connecting the rectangles. The messages between objects
are shown as arrows connecting the relevant rectangles along with labels that definethe message sequencing.
Collaboration diagrams are best suited to the portrayal of simple interactions
among relatively small numbers of objects. As the number of objects and messages
grows, a collaboration diagram can become difficult to read. Several vendors offer
software for creating and editing collaboration diagrams
Fig 3.8: Collaboration diagram
http://searchsoa.techtarget.com/definition/softwarehttp://searchsoa.techtarget.com/definition/objecthttp://whatis.techtarget.com/definition/0,,sid9_gci212134,00.htmlhttp://searchcio-midmarket.techtarget.com/definition/real-timehttp://whatis.techtarget.com/definition/0,,sid9_gci212552,00.htmlhttp://whatis.techtarget.com/definition/0,,sid9_gci212552,00.htmlhttp://searchcio-midmarket.techtarget.com/definition/real-timehttp://whatis.techtarget.com/definition/0,,sid9_gci212134,00.htmlhttp://searchsoa.techtarget.com/definition/objecthttp://searchsoa.techtarget.com/definition/software -
7/31/2019 MAIN ABS (1) (2)
18/74
M.R.C For Fast IP Network Recovery 18
4. 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 its constraints on implementation, designing of methods to
achieve changeover and evaluation of changeover methods.
4.1 MODULE DESCRIPTION
This application has been divided in to Three modules
Server Client Routers
4.1.1 Client Module
This module is used to send the data to server through routers It will provide user friendly interface to send the data to the required
destination
4.1.2 Routers Module
This are placed in between server and client to transfer the data. Whenever client send the data to the server it will pass through any one router. If the router is failed the data will be transferred through another router to
reduce the system failure.
4.1.3 Server Module
It will receive the data send by the client which came from the active router. It can have any number of clients.
-
7/31/2019 MAIN ABS (1) (2)
19/74
-
7/31/2019 MAIN ABS (1) (2)
20/74
M.R.C For Fast IP Network Recovery 20
That means that as long as a computer has a Java VM, the same program
written in the Java programming language can run on Windows 2000, a Solaris
workstation, or on an iMac.
4.2.3 THE JAVA PLATFORM
A platform is the hardware or software environment in which a program runs.
Weve already mentioned some of the most popular platforms like Windows 2000,
Linux, Solaris, and MacOS. Most platforms can be described as a combination of the
operating system and hardware. The Java platform differs from most other platforms
in that its a software-only platform that runs on top of other hardware-based
platforms.
The Java platform has two components: The Java Virtual Machine (Java VM) The Java Application Programming Interface (Java API)Youve already been introduced to the Java VM. Its the base for the Java
platform and is ported onto various hardware-based platforms.
The Java API is a large collection of ready-made software components that
provide many useful capabilities, such as graphical user interface (GUI) widgets. The
Java API is grouped into libraries of related classes and interfaces; these libraries are
known as packages. The next section, What Can Java Technology Do? Highlights
what functionality some of the packages in the Java API provide.
The following figure depicts a program thats running on the Java platform. As the
figure shows, the Java API and the virtual machine insulate the program from the
hardware.
Native code is code that after you compile it, the compiled code runs on a
specific hardware platform. As a platform-independent environment, the Java
platform can be a bit slower than native code. However, smart compilers, well-tuned
interpreters, and just-in-time byte code compilers can bring performance close to that
of native code without threatening portability.
The most common types of programs written in the Java programming
language are applets and applications. If youve surfed the Web, youre probably
already familiar with applets. An applet is a program that adheres to certain
conventions that allow it to run within a Java-enabled browser.
-
7/31/2019 MAIN ABS (1) (2)
21/74
M.R.C For Fast IP Network Recovery 21
However, the Java programming language is not just for writing cute,
entertaining applets for the Web. The general-purpose, high-level Java programming
language is also a powerful software platform. Using the generous API, you can write
many types of programs.
An application is a standalone program that runs directly on the Java platform.
A special kind of application known as a server serves and supports clients on a
network. Examples of servers are Web servers, proxy servers, mail servers, and print
servers. Another specialized program is a servlet.A servlet can almost be thought of as
an applet that runs on the server side. Java Servlets are a popular choice for building
interactive web applications, replacing the use of CGI scripts. Servlets are similar to
applets in that they are runtime extensions of applications. Instead of working inbrowsers, though, servlets run within Java Web servers, configuring or tailoring the
server.
How does the API support all these kinds of programs? It does so with
packages of software components that provides a wide range of functionality. Every
full implementation of the Java platform gives you the following features:
The essentials: Objects, strings, threads, numbers, input and output,data structures, system properties, date and time, and so on.
Applets: The set of conventions used by applets. Networking: URLs, TCP (Transmission Control Protocol), UDP (User
Data gram Protocol) sockets, and IP (Internet Protocol) addresses.
Internationalization: Help for writing programs that can be localizedfor users worldwide. Programs can automatically adapt to specific
locales and be displayed in the appropriate language.
Security: Both low level and high level, including electronicsignatures, public and private key management, access control, and
certificates.
Software components: Known as JavaBeansTM, can plug into existingcomponent architectures.
Object serialization: Allows lightweight persistence andcommunication via Remote Method Invocation (RMI).
Java Database Connectivity (JDBCTM): Provides uniform access to awide range of relational databases.
-
7/31/2019 MAIN ABS (1) (2)
22/74
M.R.C For Fast IP Network Recovery 22
The Java platform also has APIs for 2D and 3D graphics, accessibility,
servers, collaboration, telephony, speech, animation, and more. The following figure
depicts what is included in the Java 2 SDK. We cant promise you fame, fortune, or
even a job if you learn the Java programming language. Still, it is likely to make your
programs better and requires less effort than other languages. We believe that Java
technology will help you do the following:
Get started quickly: Although the Java programming language is apowerful object-oriented language, its easy to learn, especially for
programmers already familiar with C or C++.
Write less code: Comparisons of program metrics (class counts,method counts, and so on) suggest that a program written in the Javaprogramming language can be four times smaller than the same
program in C++.
Write better code: The Java programming language encourages goodcoding practices, and its garbage collection helps you avoid memory
leaks. Its object orientation, its JavaBeans component architecture, and
its wide-ranging, easily extendible API let you reuse other peoples
tested code and introduce fewer bugs.
Develop programs more quickly: Your development time may be asmuch as twice as fast versus writing the same program in C++. Why?
You write fewer lines of code and it is a simpler programming
language than C++.
Avoid platform dependencies with 100% Pure Java: You can keepyour program portable by avoiding the use of libraries written in other
languages. The 100% Pure JavaTM
Product Certification Program has a
repository of historical process manuals, white papers, brochures, and
similar materials online.
Write once, run anywhere: Because 100% Pure Java programs arecompiled into machine-independent byte codes, they run consistently
on any Java platform.
Distribute software more easily: You can upgrade applets easily froma central server. Applets take advantage of the feature of allowing new
-
7/31/2019 MAIN ABS (1) (2)
23/74
-
7/31/2019 MAIN ABS (1) (2)
24/74
-
7/31/2019 MAIN ABS (1) (2)
25/74
M.R.C For Fast IP Network Recovery 25
The designers felt that their main goal was to define a SQL interface for
Java. Although not the lowest database interface level possible, it is at a low
enough level for higher-level tools and APIs to be created. Conversely, it is at a
high enough level for application programmers to use it confidently. Attaining this
goal allows for future tool vendors to generate JDBC code and to hide many of
JDBCs complexities from the end user.
SQL CONFORMANCESQL syntax varies as you move from database vendor to database vendor. In
an effort to support a wide variety of vendors, JDBC will allow any query
statement to be passed through it to the underlying database driver. This allows
the connectivity module to handle non-standard functionality in a manner that issuitable for its users.
JDBC must be implemental on top of common database interfacesThe JDBC SQL API must sit on top of other common SQL level APIs.
This goal allows JDBC to use existing ODBC level drivers by the use of a
software interface. This interface would translate JDBC calls to ODBC and
vice versa.
Provide a Java interface that is consistent with the rest of the Java system Because of Javas acceptance in the user community thus far, the designers
feel that they should not stray from the current design of the core Java system.
Keep it simpleThis goal probably appears in all software design goal listings. JDBC is no
exception. Sun felt that the design of JDBC should be very simple, allowing for
only one method of completing a task per mechanism. Allowing duplicate
functionality only serves to confuse the users of the API.
Use strong, static typing wherever possibleStrong typing allows for more error checking to be done at compile time; also,
less error appear at runtime.
Keep the common cases simpleBecause more often than not, the usual SQL calls used by the programmer are
simple SELECTs, INSERTs, DELETEs and UPDATEs, these queries should
be simple to perform with JDBC. However, more complex SQL statements should
also be possible.
-
7/31/2019 MAIN ABS (1) (2)
26/74
M.R.C For Fast IP Network Recovery 26
Finally we decided to proceed the implementation using Java Networking.And
for dynamically updating the cache table we go for MS Access database.
Java has two things: a programming language and a platform.
Java is also unusual in that each Java program is both compiled and
interpreted. With a compile you translate a Java program into an intermediate
language called Java byte codes the platform-independent code instruction is passed
and run on the computer.
Compilation happens just once; interpretation occurs each time the program is
executed. The figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether its a Java development
tool or a Web browser that can run Java applets, is an implementation of the Java VM.
The Java VM can also be implemented in hardware.
Java byte codes help make write once, run anywhere possible. You can
compile your Java program into byte codes on my platform that has a Java compiler.
The byte codes can then be run any implementation of the Java VM. For example, the
same Java program can run Windows NT, Solaris, and Macintosh.
4.2.5.2 NETWORKING
4.2.5.2.1 TCP/IP stack
The TCP/IP stack is shorter than the OSI one:
4.2.5.2.2 IP DATAGRAM
The IP layer provides a connectionless and unreliable delivery system. It
considers each datagram independently of the others. Any association between
datagram must be supplied by the higher layers. The IP layer supplies a checksum that
includes its own header. The header includes the source and destination addresses.
The IP layer handles routing through an Internet. It is also responsible for breaking up
large datagram into smaller ones for transmission and reassembling them at the other
end.
-
7/31/2019 MAIN ABS (1) (2)
27/74
M.R.C For Fast IP Network Recovery 27
4.2.5.2.3 UDP
UDP is also connectionless and unreliable. What it adds to IP is a checksum
for the contents of the datagram and port numbers. These are used to give a
client/server model - see later.
4.2.5.2.4 TCP
TCP supplies logic to give a reliable connection-oriented protocol above IP. It
provides a virtual circuit that two processes can use to communicate.
4.2.5.2.5 INTERNET ADDRESSES
In order to use a service, you must be able to find it. The Internet uses an
address scheme for machines so that they can be located. The address is a 32 bit
integer which gives the IP address. This encodes a network ID and more addressing.
The network ID falls into various classes according to the size of the network address.
4.2.5.2.6 NETWORK ADDRESS
Class A uses 8 bits for the network address with 24 bits left over for other
addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network
addressing and class D uses all 32.
4.2.5.2.7 SUBNET ADDRESS
Internally, the UNIX network is divided into sub networks. Building 11 is
currently on one sub network and uses 10-bit addressing, allowing 1024 different
hosts.
4.2.5.2.8 HOST ADDRESS
8 bits are finally used for host addresses within our subnet. This places a limit
of 256 machines that can be on the subnet.
-
7/31/2019 MAIN ABS (1) (2)
28/74
-
7/31/2019 MAIN ABS (1) (2)
29/74
M.R.C For Fast IP Network Recovery 29
4.2.5.5 MAP VISUALIZATIONS
Charts showing values that relate to geographical areas. Some examples
include: (a) population density in each state of the United States, (b) income per
capita for each country in Europe, (c) life expectancy in each country of the world.
The tasks in this project include:
Sourcing freely redistributable vector outlines for the countries of the world,
states/provinces in particular countries (USA in particular, but also other areas);
Creating an appropriate dataset interface (plus default implementation), a
rendered, and integrating this with the existing XYPlot class in JFreeChart;
Testing, documenting, testing some more, documenting some more.
4.2.5.6 TIME SERIES CHART INTERACTIVITY
Implement a new (to JFreeChart) feature for interactive time series charts ---
to display a separate control that shows a small version of ALL the time series data,
with a sliding "view" rectangle that allows you to select the subset of the time series
data to display in the main chart.
4.2.5.7 DASHBOARDS
There is currently a lot of interest in dashboard displays. Create a flexible
dashboard mechanism that supports a subset of JFreeChart chart types (dials, pies,
thermometers, bars, and lines/time series) that can be delivered easily via both Java
Web Start and an applet.
4.2.5.8 PROPERTY EDITORS
The property editor mechanism in JFreeChart only handles a small subset of
the properties that can be set for charts. Extend (or re-implement) this mechanism to
provide greater end-user control over the appearance of the charts.
-
7/31/2019 MAIN ABS (1) (2)
30/74
M.R.C For Fast IP Network Recovery 30
4.3 FLOW CHART
Fig 3.9: flow chart
Start
Select The File To
Be Sent
CheckShortest
Path
Router 1 Router 2 Router 3
Data Received
Without Loss
Stop
If Router 2 Is
Shortest
If Router 3
Shortest
If Router 1 Is
Shortest
-
7/31/2019 MAIN ABS (1) (2)
31/74
M.R.C For Fast IP Network Recovery 31
4.3 SAMPLE CODE
4.3.1 Client Module Code
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Random;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class client1 implements ActionListener {
public JButton b1= new JButton("Browse");
-
7/31/2019 MAIN ABS (1) (2)
32/74
M.R.C For Fast IP Network Recovery 32
public JButton b2= new JButton("Split");
public JButton b3= new JButton("Send");
public JLabel la1= new JLabel("Select the file :");
public JLabel la2= new JLabel("File path :");
public JLabel la3= new JLabel("File Size (Bits) :");
public JLabel la4= new JLabel("CLIENT 1");
public JLabel c1= new JLabel();
public JTextField c2= new JTextField("");
public JTextArea t2= new JTextArea("");
public JScrollPane sc=new JScrollPane();
public JScrollPane sc1=new JScrollPane();public JTextArea t1= new JTextArea("");
public Font l = new Font("Times New roman" , Font.BOLD , 18);
public Font l2 = new Font("Times New roman" , Font.BOLD , 16);
public Font l1 = new Font("Times New roman" , Font.BOLD, 30);
public JFrame jf;
public Container c;
client1()
{
jf = new JFrame("Client1");
c = jf.getContentPane();
c.setLayout(null);
jf.setSize(1024,736);
c.setBackground( new Color(236,216,234));
b1.setBounds(300,110,100,35);
b1.setFont(l);
b1.setForeground(new Color(10,70,198));
b2.setBounds(700,400,100,35);
b3.setBounds(375,600,100,35);
b3.setFont(l);
b3.setForeground(new Color(10,70,198));
la1.setBounds(100,100,150,50);
la2.setBounds(100,150,150,50);
-
7/31/2019 MAIN ABS (1) (2)
33/74
M.R.C For Fast IP Network Recovery 33
la3.setBounds(100,200,150,50);
la4.setBounds(420,0,150,50);
c1.setBounds(300,160,400,35);
c1.setFont(l2);
c1.setForeground(new Color(120,0,0));
c2.setBounds(300,210,100,35);
c2.setForeground(new Color(30,70,98));
c2.setFont(l);
sc1.setBounds(400,300,100,200);
//b1.setBorderPainted(false);
sc.setBounds(100,300,300,200);t1.setColumns(20);
t1.setRows(10);
t1.setForeground(Color.BLUE);
t1.setFont(l);
sc.setViewportView(t1);
t2.setBounds(100,300,300,200);
t2.setColumns(20);
t2.setRows(10);
sc1.setViewportView(t2);
c.add(b1);
c.add(b3);
c.add(la1);
c.add(la2);
c.add(la3);
c.add(la4);
c.add(c1);
c.add(c2);
c.add(sc,BorderLayout.CENTER);
la1.setFont(l);
la2.setFont(l);
la3.setFont(l);
la4.setFont(l1);
-
7/31/2019 MAIN ABS (1) (2)
34/74
M.R.C For Fast IP Network Recovery 34
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
jf.show();
jf.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent win) {
System.exit(0);
}
});
int[] ports = new int[] { 2000 };
for (int i = 0; i < 1; i++) {Thread t = new Thread(new PortListener(ports[i]));
t.setName("Listener-" + ports[i]);
t.start();
}
}
public static void main (String args[])
{
new client1();
}
class PortListener implements Runnable {
BufferedOutputStream bos = null;
ServerSocket server;
Socket connection;
BufferedReader br = null;
int port;
public PortListener(int port) {
this.port = port;
}
public void run() {
try {
server = new ServerSocket(2000);
while (true)
-
7/31/2019 MAIN ABS (1) (2)
35/74
M.R.C For Fast IP Network Recovery 35
{
connection = server.accept();
br = new BufferedReader(new InputStreamReader(new BufferedInputStream(
connection.getInputStream())));
String strLine;
StringBuffer buffer = new StringBuffer();
System.out.println("hi");
while ((strLine = br.readLine()) != null)
{
System.out.println(strLine);buffer.append(strLine + "\n");
}
br.close();
connection.close();
t1.setText(buffer.toString());
byte[] byteArray;
Socket client = null;
try {
client = new Socket("127.0.0.1", 3000);
bos = new BufferedOutputStream(client.getOutputStream());
byteArray =t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
}
catch (UnknownHostException e1)
{
e1.printStackTrace();
}
catch (IOException e1)
{}
-
7/31/2019 MAIN ABS (1) (2)
36/74
M.R.C For Fast IP Network Recovery 36
finally
{}
}
}
catch (IOException e)
{
}
finally
{
}
}}
public void actionPerformed(ActionEvent e)
{
BufferedOutputStream bos = null;
byte[] byteArray;//=str.getBytes();
String strLine = null;
// String newline = "\n";
if (e.getSource()== b1)
{
JFileChooser chooser = new JFileChooser();
try {
File f = new File(new File("filename.txt").getCanonicalPath());
chooser.setSelectedFile(f);
} catch (IOException e1) {
}
chooser.showOpenDialog(b1);
int retval = chooser.showOpenDialog(b1);
if (retval == JFileChooser.APPROVE_OPTION){
File field = chooser.getSelectedFile();
c1.setText(field.getAbsolutePath());
}
File curFile = chooser.getSelectedFile();
-
7/31/2019 MAIN ABS (1) (2)
37/74
M.R.C For Fast IP Network Recovery 37
try{
FileInputStream fstream = new FileInputStream(curFile);
DataInputStream ins = new DataInputStream(fstream);
StringBuffer buffer = new StringBuffer();
while ((strLine = br.readLine()) != null) {
System.out.println (strLine);
buffer.append(strLine+ "\n");
}
t1.setText(buffer.toString());
String filelen=buffer.toString();int len=filelen.length();
String a=Integer.toString(len);
c2.setText(a);
}catch (Exception e1){
System.err.println("Error: " + e1.getMessage());
}
}
Random r = new Random();
//Random rm = new Random();
//Random ran = new Random();
int p1 =(Math.abs(r.nextInt()) % 20)+1;
int p2 =(Math.abs(r.nextInt()) % 20)+1;
int p3 =(Math.abs(r.nextInt()) % 20)+1;
//int p1=6;
//int p2=10;
//int p3=8;
String aString = Integer.toString(p1);
String bString = Integer.toString(p2);
String cString = Integer.toString(p3);
System.err.println("random value1 ="+aString );
System.err.println("random value2 ="+bString);
-
7/31/2019 MAIN ABS (1) (2)
38/74
-
7/31/2019 MAIN ABS (1) (2)
39/74
M.R.C For Fast IP Network Recovery 39
} catch (UnknownHostException e1) {
e1.printStackTrace();
} catch (Exception e1) {}
finally {}
}
else
if(p2
-
7/31/2019 MAIN ABS (1) (2)
40/74
M.R.C For Fast IP Network Recovery 40
byteArray = t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
} catch (UnknownHostException e1) {
e1.printStackTrace();
} catch (Exception e1) {}
finally {}
}
}}
}
4.3.2 Router Module Code
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedInputStream;
-
7/31/2019 MAIN ABS (1) (2)
41/74
-
7/31/2019 MAIN ABS (1) (2)
42/74
M.R.C For Fast IP Network Recovery 42
jf.setSize(1024,736);
c.setBackground( new Color(236,216,234));
la1.setBounds(150,150,150,35);
c1.setBounds(300,150,150,35);
la2.setBounds(150,200,150,35);
//t1.setBounds(150,250,400,240);
//t2.
t2.setColumns(20);
t2.setRows(10);
t2.setForeground(new Color(11,54,3));
t2.setFont(l);sc1.setViewportView(t2);
sc1.setBounds(650,250,250,150);
la3.setBounds(150,530,150,35);
c2.setBounds(300, 530, 150, 35);
c2.setForeground(new Color(30,30,98));
c2.setFont(l);
la4.setBounds(420, 50, 200, 35);
la5.setBounds(650,200,175,35);
sc.setBounds(100,300,300,200);
t1.setColumns(20);
t1.setRows(10);
t1.setForeground(new Color(10,50,100));
t1.setFont(l);
sc.setViewportView(t1);
//c.add(la1);
c.add(la2);
//c.add(c1);
c.add(sc);
c.add(sc1);
c.add(la3);
c.add(c2);
c.add(la4);
-
7/31/2019 MAIN ABS (1) (2)
43/74
M.R.C For Fast IP Network Recovery 43
c.add(la5);
la1.setFont(l);
la2.setFont(l);
la3.setFont(l);
la4.setFont(l1);
la5.setFont(l);
jf.show();
jf.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent win) {
System.exit(0);
}});
int[] ports = new int[] { 1000 };
for (int i = 0; i < 1; i++) {
Thread t = new Thread(new PortListener(ports[i]));
t.setName("Listener-" + ports[i]);
t.start();
public static void main (String args[])
{
new router1();
}
class PortListener implements Runnable {
BufferedOutputStream bos = null;
ServerSocket server;
Socket connection;
BufferedReader br = null;
int port;
public PortListener(int port) {
this.port = port;
}
public void run() {
if(this.port==1000)
{
-
7/31/2019 MAIN ABS (1) (2)
44/74
M.R.C For Fast IP Network Recovery 44
try {
server = new ServerSocket(1000);
while (true)
{
connection = server.accept();
br = new BufferedReader(
new InputStreamReader(new BufferedInputStream(
connection.getInputStream())));
String strLine;
StringBuffer buffer = new StringBuffer();
System.out.println("hi");while ((strLine = br.readLine()) != null)
{
System.out.println(strLine);
buffer.append(strLine + "\n");
}
br.close();
connection.close();
t1.setText(buffer.toString());
String filelen=buffer.toString();
int len=filelen.length();
String a=Integer.toString(len);
c2.setText(a);
byte[] byteArray;
Socket client = null;
try {
client = new Socket("127.0.0.1", 4000);
bos = new BufferedOutputStream(client.getOutputStream());
byteArray =t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
-
7/31/2019 MAIN ABS (1) (2)
45/74
-
7/31/2019 MAIN ABS (1) (2)
46/74
-
7/31/2019 MAIN ABS (1) (2)
47/74
M.R.C For Fast IP Network Recovery 47
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class client2 implements ActionListener {
String a;
String b;
public JButton b1= new JButton("Browse");
public JButton b2= new JButton("Split");
public JButton b3= new JButton("Send");
public JLabel la1= new JLabel("Select the file :");
public JLabel la2= new JLabel("File path :");public JLabel la3= new JLabel("File Size (Bits) :");
public JLabel la4= new JLabel("CLIENT 2");
public JLabel c1= new JLabel();
public JTextField c2= new JTextField("");
public JTextArea t2= new JTextArea("");
public JScrollPane sc=new JScrollPane();
public JScrollPane sc1=new JScrollPane();
public JTextArea t1= new JTextArea("");
public Font l = new Font("Times New roman" , Font.BOLD , 18);
public Font l1 = new Font("Times New roman" , Font.BOLD, 30);
public JFrame jf;
public Container c;
client2()
{
jf = new JFrame("Client2");
c = jf.getContentPane();
c.setLayout(null);
jf.setSize(1024,736);
c.setBackground( new Color(236,216,234));
b1.setBounds(300,110,100,35);
b2.setBounds(700,400,100,35);
b3.setBounds(375,600,150,50);
-
7/31/2019 MAIN ABS (1) (2)
48/74
M.R.C For Fast IP Network Recovery 48
la1.setBounds(100,100,150,50);
la2.setBounds(100,150,150,50);
la3.setBounds(100,200,150,50);
la4.setBounds(420,0,150,50);
c1.setBounds(300,160,400,35);
c2.setBounds(300,210,100,35);
c2.setForeground(new Color(30,70,98));
c2.setFont(l);
sc1.setBounds(400,300,100,200);
//b1.setBorderPainted(false);sc.setBounds(100,300,300,200);
t1.setColumns(20);
t1.setRows(10);
t1.setForeground(new Color(20,100,100));
t1.setFont(l);
sc.setViewportView(t1);
t2.setBounds(100,300,300,200);
t2.setColumns(20);
t2.setRows(10);
sc1.setViewportView(t2);
c.add(b1);
c.add(b3);
c.add(la1);
c.add(la2);
c.add(la3);
c.add(la4);
c.add(c1);
c.add(c2);
c.add(sc,BorderLayout.CENTER);
la1.setFont(l);
la2.setFont(l);
-
7/31/2019 MAIN ABS (1) (2)
49/74
-
7/31/2019 MAIN ABS (1) (2)
50/74
M.R.C For Fast IP Network Recovery 50
BufferedReader br = null;
int port;
public PortListener(int port) {
this.port = port;
}
public void run() {
try {
server = new ServerSocket(3000);
while (true)
{
connection = server.accept();
br = new BufferedReader(new InputStreamReader
(new BufferedInputStream(connection.getInputStream())));
String strLine;
StringBuffer buffer = new StringBuffer();
System.out.println("hi");
while ((strLine = br.readLine()) != null)
{
System.out.println(strLine);
buffer.append(strLine + "\n");
-
7/31/2019 MAIN ABS (1) (2)
51/74
M.R.C For Fast IP Network Recovery 51
}
br.close();
connection.close();
t1.setText(buffer.toString());
a=buffer.toString();
b=a.substring(6,14);
}
}
catch (IOException e)
{
}
finally
{
}
}
}
public void actionPerformed(ActionEvent e)
{
BufferedOutputStream bos = null;
-
7/31/2019 MAIN ABS (1) (2)
52/74
M.R.C For Fast IP Network Recovery 52
byte[] byteArray;//=str.getBytes();
String strLine = null;
// String newline = "\n";
if (e.getSource()== b1)
{
JFileChooser chooser = new JFileChooser();
try {
File f = new File(new File("filename.txt").getCanonicalPath());
chooser.setSelectedFile(f);
} catch (IOException e1) {
}
chooser.showOpenDialog(b1);
int retval = chooser.showOpenDialog(b1);
if (retval == JFileChooser.APPROVE_OPTION){
File field = chooser.getSelectedFile();
c1.setText(field.getAbsolutePath());
}
File curFile = chooser.getSelectedFile();
try{
FileInputStream fstream = new FileInputStream(curFile);
DataInputStream ins = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(ins));
-
7/31/2019 MAIN ABS (1) (2)
53/74
M.R.C For Fast IP Network Recovery 53
StringBuffer buffer = new StringBuffer();
while ((strLine = br.readLine()) != null) {
System.out.println (strLine);
buffer.append(strLine+ "\n");
}
t1.setText(buffer.toString());
String filelen=buffer.toString();
int len=filelen.length();String a=Integer.toString(len);
c2.setText(a);
}catch (Exception e1){
System.err.println("Error: " + e1.getMessage());
}
}
if(e.getSource()== b3)
{
if(b.equals("Router A"))
{
Socket client = null;
int Port = 9000;
try {
client = new Socket("127.0.0.1", Port);
-
7/31/2019 MAIN ABS (1) (2)
54/74
M.R.C For Fast IP Network Recovery 54
bos = new BufferedOutputStream(client.getOutputStream());
byteArray = t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
} catch (UnknownHostException e1)
{e1.printStackTrace();
}
catch (Exception e1) {}
finally {}
}
else
if(b.equals("Router B"))
{
Socket client = null;
int Port = 9001;
try {
client = new Socket("127.0.0.1", Port);
bos = new BufferedOutputStream(client.getOutputStream());
-
7/31/2019 MAIN ABS (1) (2)
55/74
M.R.C For Fast IP Network Recovery 55
byteArray = t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
} catch (UnknownHostException e1)
{
e1.printStackTrace();
}
catch (Exception e1) {}finally {}
}
else
if(b.equals("Router C"))
{
Socket client = null;
int Port = 9002;
try {
client = new Socket("127.0.0.1", Port);
bos = new BufferedOutputStream(client.getOutputStream());
byteArray = t1.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
-
7/31/2019 MAIN ABS (1) (2)
56/74
M.R.C For Fast IP Network Recovery 56
bos.close();
client.close();
} catch (UnknownHostException e1) {
e1.printStackTrace();
} catch (Exception e1) {}
finally {}
System.out.println("The Router Name="+b);
}
}
}
-
7/31/2019 MAIN ABS (1) (2)
57/74
M.R.C For Fast IP Network Recovery 57
4.5 FLOW CHART
Fig 4.1:Flow chart
Select The File To
Be Sent
Check
Shortest
Path
Router 1 Router 2 Router 3
Data Received
Without Loss
Stop
If Router 2 Is
Shortest
If Router 3
Shortest
If Router 1 Is
Shortest
Start
-
7/31/2019 MAIN ABS (1) (2)
58/74
M.R.C For Fast IP Network Recovery 58
4.4 SCREEN SHOTS
Client 1
-
7/31/2019 MAIN ABS (1) (2)
59/74
M.R.C For Fast IP Network Recovery 59
Client 1
-
7/31/2019 MAIN ABS (1) (2)
60/74
M.R.C For Fast IP Network Recovery 60
Router A
-
7/31/2019 MAIN ABS (1) (2)
61/74
M.R.C For Fast IP Network Recovery 61
Router B
-
7/31/2019 MAIN ABS (1) (2)
62/74
M.R.C For Fast IP Network Recovery 62
Router C
-
7/31/2019 MAIN ABS (1) (2)
63/74
M.R.C For Fast IP Network Recovery 63
Client 2
-
7/31/2019 MAIN ABS (1) (2)
64/74
M.R.C For Fast IP Network Recovery 64
Router A
-
7/31/2019 MAIN ABS (1) (2)
65/74
-
7/31/2019 MAIN ABS (1) (2)
66/74
M.R.C For Fast IP Network Recovery 66
unit testing, integration testing, system testing and acceptance testing. Initially the
tests are focused on each module individually to test whether it is functioning as a
unit. In conventional applications, unit-testing focuses on the smallest combinable
program unit the sub program (e.g. module, sub routine, procedure, and component).
After testing them individually, it is integrated into a program structure and does the
remaining testing.
Unit Testing Integration Testing Top-Down Integration Bottom Up Integration Validation Testing Compiling Test Execution Test Output Test Validation Test Criteria System Testing Acceptance Testing Black Box Testing White Box Testing
5.2.1 UNIT TESTING
The first level of testing is unit testing. When object-oriented software
is considered the concept of unit changes. Rather than testing an individual module,
the smallest testable unit is the encapsulated class or object. Class testing for object-
oriented software is the equivalent of unit testing for conventional software. Unlike
unit testing of conventional software, which tends to focus on the algorithmic detail of
a module and the data that flow across the module interface, class testing for object
oriented software is driven by the operations encapsulated by the class and state
behavior of the class.
-
7/31/2019 MAIN ABS (1) (2)
67/74
M.R.C For Fast IP Network Recovery 67
5.2.2 INTEGRATION TESTING
This testing is second level in testing process. After completion of unit
testing, which confirms the modules functionality, we integrated modules to form
sub systems. These subsystems are tested under this integration testing. It checks
whether data lost or preserved between interface calls. In this module whether data
flowed properly across the procedures is tested. Modules are integrated by moving
downward through the control hierarchy beginning from the main control module.
5.2.2.1 TOP-DOWN INTEGRATION
This method is an incremental approach to the construction of program
structure. Modules are integrated by moving downward through the control hierarchy,
beginning with the main program module. The module subordinates to the mainprogram module are incorporated into the structure in either a depth first of breadth-
first manner.
5.2.2.2 BOTTOM UP INTEGRATION
This method begins the construction and testing with the modules at the
lowest level in the program structure. Since the modules are integrated from the
bottom up, processing required for modules subordinate to a given level is always
available and the need for stubs is elimination. The bottom-up integration strategy
may be implemented with the following steps:
The low-level modules are combined into clusters that perform a specificsoftware
Sub-function. A drive (i.e.,), the control program for testing is written to co-ordinate test
case input and Output.
The cluster is tested. Drivers are removed and clusters are combined moving upward in the program
structure.
5.2.3 VALIDATION TESTING
At the end of the Integration Testing, software is completely assembled
as a package, interfacing errors have been uncovered and correction testing begun.
The system has been tested and implemented successfully and thus ensured that all
the requirements as listed in the software requirements specification are completely
fulfilled. In case of erroneous input corresponding error messages are displayed.
-
7/31/2019 MAIN ABS (1) (2)
68/74
M.R.C For Fast IP Network Recovery 68
5.2.3.1 COMPILING TEST
It was a good idea to do our stress testing early on, because it gave us time
to fix some of the unexpected deadlocks and stability problems that only occurred
when components were exposed to very high transaction volumes.
5.2.3.2 EXECUTION TEST
This program was successfully loaded and executed. Because of good
programming there were no execution error found.
5.2.3.3 OUTPUT TEST
The successful output screens are placed in the output screens section above.
5.2.3.4 VALIDATION TEST CRITERIA
Software testing and validation is achieved trough serried of black box teststhat demonstrate conformity with the requirements. A test plan outlines the classes of
tests to be conducted and a test procedure defines specific test cases that will be used
to demonstrate conformity with requirements. Both, the plan and the procedure are
designed to ensure that all functional requirements are achieved, documentation is
correct and other requirements are met.
5.2.4 SYSTEM TESTING
System testing is responsible to ensure total software is worked as per
requirements specified in requirement documents. The main reference for this level of
testing is requirement document. This goal of this testing is to see, whether system
meets its requirements or not.
5.2.4.1 ACCEPTANCE TESTING
Acceptance testing was top level testing which tests with some realistic data
of the client to demonstrate that the software is working satisfactory. Testing here
focuses on the external behavior of the system.
5.2.5 WHITE BOX TESTING
This strategy examines the logic of the program. To follow this method
we developed some test data that resulted in executing every instruction in the
program and module i.e. every path is tested. Systems are not designed as entire nor
are they tested as single systems. To ensure that the coding is perfect two types of
testing is performed or for that matter is performed or that matter is performed or for
that matter is performed on all systems.
-
7/31/2019 MAIN ABS (1) (2)
69/74
M.R.C For Fast IP Network Recovery 69
In this the test cases are generated on the logic of each module by drawing flow
graphs of that module and logical decisions are tested on all the cases.
It has been uses to generate the test cases in the following cases:
Guarantee that all independent paths have been executed. Execute all logical decisions on their true and false sides. Execute all loops at their boundaries and within their operational bounds. Execute internal data structures to ensure their validity.
This is a unit testing method where a unit will be taken at a time and tested thoroughly
at a statement level to find the maximum possible errors. I tested step wise every
piece of code, taking care that every statement in the code is executed at least once.
The white box testing is also called Glass Box Testin
5.2.6 BLACK BOX TESTING
In this strategy some test cases are generated as input conditions that fully
execute all functional requirements for the program. This testing has been uses to find
errors in the following categories:
Incorrect or missing functions Interface errors Errors in data structure or external database access Performance errors Initialization and termination errors.
In this testing only the output is checked for correctness. The logical flow of the data
is not checked.
This testing method considers a module as a single unit and checks the unit at
interface and communication with other modules rather getting into details at
statement level.
Here the module will be treated as a block box that will take some input and
generate output. Output for a given set of input combinations are forwarded to other
modules.This test involves the manual evaluation of the flow from one module to the
other and check accordingly for the process flow.
-
7/31/2019 MAIN ABS (1) (2)
70/74
M.R.C For Fast IP Network Recovery 70
5.3 TEST CASES
Test cases that reduced by a count that is greater than one, the number of
additional test cases that much be designed to achieve reasonable testing. Test cases
that tell us something about the presence or absence of classes of errors, rather than an
error associated only with the specific test at hand
5.3.1 TEST CASE 1
Test Precondition
Application must be installed
Computer must be working
Type of Testing: Smoke Testing
Objectives: To check whether application can be launched or not
Valid Condition: True
Priority: P1
Test Data: Launching the application by clicking an icon on desktop.
Steps to Reproduce: Start Computer
Click the icon on desktop Expected Results: Application is Launched Successfully.
5.3.2 TEST CASE 2
Test Precondition
Application must be installed
Computer must be working
Type of Testing: Smoke Testing
Objectives: To check whether application can be launched or not
Valid Condition: False
Priority: P1
Test Data: Launching the application by clicking an icon on desktop.
Steps to Reproduce: Start Computer
Click the icon on desktop Expected Results: Application is Launched Unsuccessfully.Try Again
-
7/31/2019 MAIN ABS (1) (2)
71/74
M.R.C For Fast IP Network Recovery 71
5.3.3 TEST CASE 3
Test Precondition
It should show the file contents and size of the file in client1 screen
Type of Testing: Functional TestingObjectives: To check whether the selected file contents are visible on the screen
Valid Condition: True
Priority: P1
Test Data: Selecting the file by clicking the browse button
Steps to Reproduce:
Click the Browse button
Select the required file Expected Results: File is selected successfully.
5.3.4 TEST CASE 4
Test Precondition
One of the active router should send the file in case of network failure
Type of Testing: Functional Testing
Objectives: To check whether the active router sends the file to the destination
Valid Condition: True
Priority: P1
Test Data: Sending the file through active router available
Steps to Reproduce:
Click the Send Button Check on the Destination Screen whether the file is received
5.3.5 TEST CASE 5
Test Precondition
There should be no difference in file contents at the receiver end
Type of Testing: Functional Testing
Objectives: To check whether there is no packet loss during transmission
Valid Condition: True
Priority: P1
Test Data: Comparing the file contents
-
7/31/2019 MAIN ABS (1) (2)
72/74
M.R.C For Fast IP Network Recovery 72
Steps to Reproduce:
Check the file size at the receiver end Expected Behavior: No packet loss
5.3.6 TEST CASE 6
Test Precondition
There should be no difference in file contents at the receiver end
Type of Testing: Functional Testing
Objectives: To check whether there is no packet loss during transmission
Valid Condition: false
Priority: P1Test Data: Comparing the file contents
Steps to Reproduce:
Check the file size at the receiver end Expected Behavior: packet loss.Try Again
-
7/31/2019 MAIN ABS (1) (2)
73/74
M.R.C For Fast IP Network Recovery 73
6. CONCLUSION AND FUTURE ENHANCEMENTS
6.1 CONCLUSION
We have presented Multiple Routing Configurations as an approach to achieve
fast recovery in IP networks.MRC is based on providing the routers with additional
routing configurations, allowing them to forward packets along routes that avoid a
failed component. MRC can act promptly after failure discovery
6.2 FUTURE ENHANCEMENT
As an future enhancement we can browse the multiple files and we can
send them to destination instead of browsing individual files which is an timeconsuming. We can maintain the buffer at receiver side and we can store the received
files and we can download them in future when required by the user.
-
7/31/2019 MAIN ABS (1) (2)
74/74
M.R.C For Fast IP Network Recovery 74
7. BIBLIOGRAPHY
7.1 REFERENCES
Professional Java Network Programming Java Complete Reference Data Communications and Networking, by Behrouz A Forouzan. Computer Networking: A Top-Down Approach, by James F. Kurose. Operating System Concepts, by Abraham Silberschatz.
7.2 WEBSITES REFERRED
http://java.sun.com http://www.sourcefordgde.com http://www.networkcomputing.com/
http://java.sun.com/http://java.sun.com/http://www.sourcefordgde.com/http://www.sourcefordgde.com/http://www.networkcomputing.com/http://www.networkcomputing.com/http://www.networkcomputing.com/http://www.sourcefordgde.com/http://java.sun.com/