+ All Categories
Home > Documents > Full Doc

Full Doc

Date post: 27-Nov-2014
Category:
Upload: hasan41
View: 337 times
Download: 0 times
Share this document with a friend
Popular Tags:
90
Transcript
Page 1: Full Doc
Page 2: Full Doc

INTRODUCTION:

There are inherently two threats posed by a compromised router. The attacker

may subvert the network control plane (e.g., by manipulating the routing protocol into

false route updates) or may subvert the network data plane and forward individual

packets incorrectly. The first set of attacks has seen the widest interest and the most

activity—largely due to their catastrophic potential. By violating the routing protocol

itself, an attacker may cause large portions of the network to become inoperable.

Thus,there have been a variety of efforts to impart authenticity and consistency

guarantees on route update messages with varying levels of cost and protection. We do

not consider this class of attacks in this paper.

Instead, we have focused on the less well-appreciated threat of an attacker

subverting the packet forwarding process on a compromised router. Such an attack

presents a wide set of opportunities including DoS, surveillance, man-in-the-middle

attacks, replay and insertion attacks, and so on. Moreover, most of these attacks can be

trivially implemented via the existing command shell languages in commodity routers.

The earliest work on fault-tolerant forwarding is due to Perlman who developed a

robust routing system based on source routing, digitally signed route-setup packets, and

reserved buffers. While groundbreaking, Perlman’s work required significant

commitments of router resources and high levels of network participation to detect

anomalies. Since then, a variety of researchers have proposed lighter weight protocols for

actively probing the network to test whether packets are forwarded in a manner

consistent with the advertised global topology.

Conversely, the 1997 WATCHERS system detects disruptive routers passively

via a distributed monitoring algorithm that detects deviations from a “conservation of

flow” invariant. However, work on WATCHERS was abandoned, in part due to

limitations in its distributed detection protocol, its overhead, and the problem of

ambiguity stemming from congestion. Finally, our own work broke the problem into

three pieces: a traffic validation mechanism, a distributed detection protocol, and a

rerouting countermeasure. We focused on the detection protocol, provided a formal

Page 3: Full Doc

framework for evaluating the accuracy and precision of any such protocol, and described

several practical protocols that allow scalable implementations. However, we also

assumed that the problem of congestion ambiguity could be solved, without providing a

solution. This paper presents a protocol that removes this assumption.

Page 4: Full Doc

Problem Analysis:

There are inherently two threats posed by a compromised router. The attacker

may subvert the network control plane (e.g., by manipulating the routing protocol into

false route updates) or may subvert the network data plane and forward individual

packets incorrectly. The first sets of attacks have seen the widest interest and the most

activity—largely due to their catastrophic potential. By violating the routing protocol

itself, an attacker may cause large portions of the network to become inoperable. Thus,

there have been a variety of efforts to impart authenticity and consistency guarantees on

route update messages with varying levels of cost and protection.

We do not consider this class of attacks in this paper. Instead, we have

focused on the less well-appreciated threat of an attacker subverting the packet

forwarding process on a compromised router. Such an attack presents a wide set of

opportunities including DoS, surveillance, man-in-the-middle attacks, replay and

insertion attacks, and so on. Moreover, most of these attacks can be trivially implemented

via the existing command shell languages in commodity routers. The earliest work on

fault-tolerant forwarding is due to Perlman who developed a robust routing system based

on source routing, digitally signed route-setup packets, and reserved buffers. While

groundbreaking, Perlman’s work required significant commitments of router resources

and high levels of network participation to detect anomalies.

Since then, a variety of researchers have proposed lighter weight protocols for

actively probing the network to test whether packets are forwarded in a manner consistent

with the advertised global topology [5], [10]. Conversely, the 1997 WATCHERS system

detects disruptive routers passively via a distributed monitoring algorithm that detects

deviations from a “conservation of flow” invariant, [3]. However, work on WATCHERS

was abandoned, in part due to limitations in its distributed detection protocol, its

overhead, and the problem of ambiguity stemming from congestion .

Finally, our own work broke the problem into three pieces: a traffic validation

mechanism, a distributed detection protocol, and a rerouting countermeasure. In [16] and

[4], we focused on the detection protocol, provided a formal framework for evaluating

the accuracy and precision of any such protocol, and described several practical protocols

that allow scalable implementations. However, we also assumed that the problem of

Page 5: Full Doc

congestion ambiguity could be solved, without providing a solution. This paper presents a

protocol that removes this assumption.

Implementation Plan:

In building a traffic validation protocol, it is necessary to explicitly

resolve the ambiguity around packet losses. Should the absence of a given packet be seen

as malicious or benign? In practice, there are three approaches for addressing this issue: .

Static Threshold: Low rates of packet loss are assumed to be congestive, while

rates above some predefined threshold are deemed malicious. .

Traffic modeling: Packet loss rates are predicted as a function of traffic

parameters and losses beyond the prediction are deemed malicious. .

Traffic measurement: Individual packet losses are predicted as a function of

measured traffic load and router buffer capacity. Deviations from these predictions are

deemed malicious.

Most traffic validation protocols, including WATCHERS [3], Secure Trace route,

and our own work described in [4], analyze aggregate traffic over some period of time in

order to amortize monitoring overhead over many packets. For example, one validation

protocol described in [4] maintains packet counters in each router to detect if traffic flow

is not conserved from source to destination. When a packet arrives at router r and is

forwarded to a destination that will traverse a path segment ending at router x, r

increments an outbound counter associated with router x. Conversely, when a packet

arrives at router r, via a path segment beginning with router x, it increments its inbound

counter associated with router x. Periodically, router x sends a copy of its outbound

counters to the associated routers for validation. Then, a given router r can compare the

number of packets that x claims to have sent to r with the number of packets it counts as

being received from x, and it can detect the number of packet losses.

Thus, over some time window, a router simply knows that out of m packets sent,

n were successfully received. To address congestion ambiguity, all of these systems

employ a predefined threshold: if more than this number is dropped in a time interval,

then one assumes that some router is compromised.

Page 6: Full Doc

In order to avoid false positives, the threshold must be large enough to include

the maximum number of possible congestive legitimate packet losses over a

measurement interval. Thus, any compromised router can drop that many packets without

being detected. Unfortunately, given the nature of the dominant TCP, even small

numbers of losses can have significant impacts. Subtle attackers can selectively target the

traffic flows of a single victim and within these flows only drop those packets that cause

the most harm. For example, losing a TCP SYN packet used in connection establishment

has a disproportionate impact on a host because the retransmission time-out must

necessarily be very long (typically 3 seconds or more). Other seemingly minor attacks

that cause TCP time-outs can have similar effects—a class of attacks well described in .

All things considered, it is clear that the static threshold mechanism is inadequate

since it allows an attacker to mount vigorous attacks without being detected. Instead of

using a static threshold, if the probability of congestive losses can be modeled, then one

could resolve ambiguities by comparing measured loss rates to the rates predicted by the

model. One approach for doing this is to predict congestion analytically as a function of

individual traffic flow parameters, since TCP explicitly responds to congestion.

Another approach is to model congestion for the aggregate capacity of a link.

A widely applied rule-of-thumb suggests that routers must be able to buffer a full delay

bandwidth product. This controversial paper argues that due to congestion control effects,

the rule-of-thumb is wrong, and the amount of required buffering is proportional to the

square root of the total number of TCP flows. To achieve this, the authors produced an

analytic model of buffer occupancy as a function of TCP behavior. We have evaluated

their model thoroughly and have communicated with the authors, who agree that their

model is only a rough approximation that ignores many details of TCP, including time-

outs, residual synchronization, and many other effects. Thus, while the analysis is robust

enough to model buffer size it is not precise enough to predict congestive loss accurately.

Hence, we have turned to measuring the interaction of traffic load and buffer

occupancy explicitly. Given an output buffered first-in first-out (FIFO) router, congestion

can be predicted precisely as a function of the inputs (the traffic rate delivered from all

input ports destined to the target output port), the capacity of the output buffer, and the

speed of the output link. A packet will be lost only if packet input rates from all sources

Page 7: Full Doc

exceed the output link speed for long enough. If such measurements are taken with high

precision it should even be possible to predict individual packet losses. It is this approach

that we consider further in the rest of this paper. We restrict our discussion to output

buffered switches for simplicity although the same approach can be extended to input

buffered switches or virtual output queues with additional adjustments (and overhead).

Because of some uncertainty in the system, we cannot predict exactly which individual

packets will be dropped. So, our approach is still based on thresholds. Instead of being a

threshold on rate, it is a threshold on a statistical measure: the amount of confidence that

the drop was due to a malicious attack rather than from some normal router function. To

make this distinction clearer, we refer to the statistical threshold as the target significance

level.

Page 8: Full Doc
Page 9: Full Doc

Existing System:

The earliest work on fault-tolerant forwarding is due to Perlman who developed a

robust routing system based on source routing, digitally signed route-setup packets, and

reserved buffers. While groundbreaking, Perlman’s work required significant

commitments of router resources and high levels of network participation to detect

anomalies. Since then, a variety of researchers have proposed lighter weight protocols for

actively probing the network to test whether packets are forwarded in a manner consistent

with the advertised global topology. Conversely, the 1997 WATCHERS system detects

disruptive routers passively via a distributed monitoring algorithm that detects deviations

from a “conservation of flow” invariant. However, work on WATCHERS was

abandoned, in part due to limitations in its distributed detection protocol, its overhead,

and the problem of ambiguity stemming from congestion.

LIMITATION OF EXISTING SYSTEM:

Static user-defined threshold is used, which is fundamentally limiting.

It cannot identify the fault router efficiently

Page 10: Full Doc

Proposed System:

In this paper, we develop a compromised router detection protocol that

dynamically infers the precise number of congestive packet losses that will occur. Once

the congestion ambiguity is removed, subsequent packet losses can be safely attributed to

malicious actions. We believe our protocol is the first to automatically predict congestion

in a systematic manner and that it is necessary for making any such network fault

detection practical.

ADVANTAGES

Protocol does not suffer from the limitations of static thresholds.

To the best of our knowledge, this paper is the first serious attempt to distinguish

between a router dropping packets maliciously and a router dropping packets due

to congestion.

Page 11: Full Doc
Page 12: Full Doc

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor : Any Processor above 500 MHz.

Ram : 512Mb.

Hard Disk : 40 GB.

Compact Disk : 650 Mb.

Input device : Standard Keyboard and Mouse.

Output device : VGA and High Resolution Monitor.

SOFTWARE REQUIREMENTS

Operating System : Windows Family.

Language : JDK 1.5

Data Bases : Microsoft SQL Server

Front End : Java Swing

Page 13: Full Doc
Page 14: Full Doc

Modules:

• Message Transmission

• Traffic Validation

• Response

• Identify Malicious Router

Module description:

Message Transmission

• A mechanism for transferring messages between source and destination in a

system through a router buffer memory.

• Send a message contains the source details, destination details, routes details and

message sizes etc.

• To send the messages from source to destination using different routers with

main router.

• To send the messages for text file or text messages only.

Page 15: Full Doc

Select Router

SubRouter

Main Router

Source

File

Destination

Router

Send File

Packets

Packets Files

AcknowledgementAcknowledgement

Acknowledgement

Page 16: Full Doc

Traffic Validation

• Every time to check the buffer size and send the messages from source to

destination.

• Modern routers routinely drop packets due to bursts in traffic that exceed their

buffering capacities,

• Protocols that validate aggregate traffic require synchronization in order to agree

on a time interval during which to collect traffic information.

• A message part which has a source, destination ,router details value only in the

buffer control block of the first buffers of the chains containing one message, part

being devoted to the storing of information indicative of the address of the next

router containing the next message, the message part of the first buffer of the

chain containing the last message being set to a fixed value; at least one free

buffer queue;

• At least one buffer control block for storing an address for a next buffer in said at

least one free buffer queue;

• If no memory in the buffer then the messages are discarded due to congestion will

occur. The malicious router having free memory but discard the messages.

• The acknowledgement received by source the messages are not received to the

destination.

Page 17: Full Doc

Login

Data Store

Check Router Availability

Start

RegisterAvailable

Available

Page 18: Full Doc

Response

• For send the messages are delivered to the destination. The messages are reaching

the destination then it will send the acknowledgement to the source.

• To check the acknowledgement the messages are delivered or not.

• Every time the check the response which router via send the messages from

source to destination.

• While a packet that has been modified in transit represents clear evidence of

tampering, a missing packet is inherently ambiguous:

• It may have been explicitly blocked by a compromised router or it may have been

dropped benignly due to network congestion.

Sub

Router

Source

File

Router

Select Router

Destination

Send File

Packets

Acknowledgement

Main

Router

Page 19: Full Doc

Identify Malicious Router

• To send the messages from different routers then monitoring by the main router.

• To check the routers status graph and to identify malicious router in the graph.

• One of the most important factors in terms of protocol practicality is the size of

the state at each router that needs to be maintained. Assume that we wish to

provide fault-tolerant forwarding between each source and destination pair in the

network

• It would probably be more efficient, though, to have all of the routers in the

network synchronize with each other instead of having many more, smaller

synchronization rounds.

Page 20: Full Doc

System Architecture

Page 21: Full Doc

Data Flow Diagram

Page 22: Full Doc

SYSTEM TESTING:

Page 23: Full Doc

Testing is performed to identify errors. It is used for quality assurance.

Testing is an integral part of the entire development and maintenance process. The goal

of the testing during phase is to verify that the specification has been accurately and

completely incorporated into the design, as well as to ensure the correctness of the design

itself. For example the design must not have any logic faults in the design is detected

before coding commences, otherwise the cost of fixing the faults will be considerably

higher as reflected. Detection of design faults can be achieved by means of inspection as

well as walkthrough.

Testing is one of the important steps in the software development phase. Testing

checks for the errors, as a whole of the project testing involves the following test cases:

Static analysis is used to investigate the structural properties of the Source code.

Dynamic testing is used to investigate the behavior of the source code by

executing the program on the test data.

1. UNIT TESTING:

Unit testing is conducted to verify the functional performance of each modular

component of the software. Unit testing focuses on the smallest unit of the software

design (i.e.), the module. The white-box testing techniques were heavily employed for

unit testing.

FUNCTIONAL TESTS:

Functional test cases involved exercising the code with nominal input

values for which the expected results are known, as well as boundary values and special

values, such as logically related inputs, files of identical elements, and empty files.

Three types of tests in Functional test:

Performance Test

Stress Test

Structure Test

PERFORMANCE TEST:

Page 24: Full Doc

It determines the amount of execution time spent in various parts of the unit,

program throughput, and response time and device utilization by the program unit.

STRESS TEST:

Stress Test is those test designed to intentionally break the unit. A Great deal

can be learned about the strength and limitations of a program by examining the manner

in which a programmer in which a program unit breaks.

STRUCTURED TEST:

Structure Tests are concerned with exercising the internal logic of a program and

traversing particular execution paths. The way in which White-Box test strategy was

employed to ensure that the test cases could Guarantee that all independent paths within a

module have been have been exercised at least once.

Exercise all logical decisions on their true or false sides.

Execute all loops at their boundaries and within their operational bounds.

Exercise internal data structures to assure their validity.

Checking attributes for their correctness.

Handling end of file condition, I/O errors, buffer problems and textual

errors in output information

2. INTEGRATION TESTING:

Integration testing is a systematic technique for construction the program structure

while at the same time conducting tests to uncover errors associated with interfacing. i.e.,

integration testing is the complete testing of the set of modules which makes up the

product. The objective is to take untested modules and build a program structure tester

should identify critical modules.

Critical modules should be tested as early as possible. One approach is to wait until all

the units have passed testing, and then combine them and then tested. This approach is

evolved from unstructured testing of small programs. Another strategy is to construct the

Page 25: Full Doc

product in increments of tested units. A small set of modules are integrated together and

tested, to which another module is added and tested in combination. And so on. The

advantages of this approach are that, interface dispenses can be easily found and

corrected.

The major error that was faced during the project is linking error. When all

the modules are combined the link is not set properly with all support files. Then we

checked out for interconnection and the links. Errors are localized to the new module and

its intercommunications. The product development can be staged, and modules integrated

in as they complete unit testing. Testing is completed when the last module is integrated

and tested.

TESTING TECHNIQUES / TESTING STRATRGIES:

TESTING:

Testing is a process of executing a program with the intent of finding an error. A good

test case is one that has a high probability of finding an as-yet –undiscovered error. A

successful test is one that uncovers an as-yet- undiscovered error.

System testing is the stage of implementation, which is aimed at ensuring that the system

works accurately and efficiently as expected before live operation commences. It verifies

that the whole set of programs hang together. System testing requires a test consists of

several key activities and steps for run program, string, system and is important in

adopting a successful new system. This is the last chance to detect and correct errors

before the system is installed for user acceptance testing.

The software testing process commences once the program is created and the

documentation and related data structures are designed. Software testing is essential for

correcting errors. Otherwise the program or the project is not said to be complete.

Software testing is the critical element of software quality assurance and represents the

ultimate the review of specification design and coding.

Testing is the process of executing the program with the intent of finding the error.

A good test case design is one that as a probability of finding an yet undiscovered error.

A successful test is one that uncovers an yet undiscovered error.

Page 26: Full Doc

Any engineering product can be tested in one of the two ways:

White box testing:

This testing is also called as Glass box testing. In this testing, by knowing the specific

functions that a product has been design to perform test can be conducted that

demonstrate each function is fully operational at the same time searching for errors in

each function. It is a test case design method that uses the control structure of the

procedural design to derive test cases. Basis path testing is a white box testing.

Basis path testing:

Flow graph notation

Cyclomatic complexity

Deriving test cases

Graph matrices Control

Black Box Testing:

In this testing by knowing the internal operation of a product, test can be conducted to

ensure that “all gears mesh”, that is the internal operation performs according to

specification and all internal components have been adequately exercised. It

fundamentally focuses on the functional requirements of the software.

The steps involved in black box test case design are:

Graph based testing methods

Equivalence partitioning

Boundary value analysis

Comparison testing

SOFTWARE TESTING STRATEGIES:

Page 27: Full Doc

A software testing strategy provides a road map for the software developer. Testing is a

set activity that can be planned in advance and conducted systematically. For this reason

a template for software testing a set of steps into which we can place specific test case

design methods should be strategy should have the following characteristics:

Testing begins at the module level and works “outward” toward the

integration of the entire computer based system.

Different testing techniques are appropriate at different points in time.

The developer of the software and an independent test group conducts

testing.

Testing and Debugging are different activities but debugging must be

accommodated in any testing strategy.

INTEGRATION TESTING:

Integration testing is a systematic technique for constructing the program structure while

at the same time conducting tests to uncover errors associated with. Individual modules,

which are highly prone to interface errors, should not be assumed to work instantly when

we put them together. The problem of course, is “putting them together”- interfacing.

There may be the chances of data lost across on another’s sub functions, when combined

may not produce the desired major function; individually acceptable impression may be

magnified to unacceptable levels; global data structures can present problems.

VALIDATION TESTING:

Software validation is achieved through a series of tests that demonstrates conformity

with requirements. A test plan outlines the classes of test to be conducted and a test

procedure defines specific test cases that will be used to demonstrate conformity with

requirements. Thus the proposed system under consideration has been tested by

validation and found to be working satisfactorily.

PROGRAM TESTING:

Page 28: Full Doc

The logical and syntax errors have been pointed out by program testing. A syntax error is

an error in a program statement that in violates one or more rules of the language in

which it is written. An improperly defined field dimension or omitted keywords are

common syntax error. These errors are shown through error messages generated by the

computer. A logic error on the other hand deals with the incorrect data fields, out-off-

range items and invalid combinations. Since the compiler s will not deduct logical error,

the programmer must examine the output. Condition testing exercises the logical

conditions contained in a module. The possible types of elements in a condition include a

Boolean operator, Boolean variable, a pair of Boolean parentheses A relational operator

or on arithmetic expression. Condition testing method focuses on testing each condition

in the program the purpose of condition test is to deduct not only errors in the condition

of a program but also other a errors in the program.

SECURITY TESTING:

Security testing attempts to verify the protection mechanisms built in to a system well, in

fact, protect it from improper penetration. The system security must be tested for

invulnerability from frontal attack must also be tested for invulnerability from rear attack.

During security, the tester places the role of individual who desires to penetrate system.

SYSTEM SECURITY MEASURES:

System security refers to the technical innovations and procedures applied to the

hardware and operating systems to protect against deliberate or accidental damage from a

defined threat. In contrast, data security is the protection of data from disclosure,

modification and destruction.

Data privacy and security are issues that go beyond the scope of system development.

They are actually a societal concern. Our organization depends heavily on the use of data

bases requires special controls to maintain viable information. These controls are

classified in to three general categories.

Page 29: Full Doc

Physical securities are production from fire flood and other physical

damage.

Database integrity through data validation techniques.

Control measures through passwords encryption and monitoring users on a

regular basis.

Password is the most common authentication mechanism based on sharing of secret. In a

password –based system each user has a password, which may initially be assigned by

the system or an administrator. In Online Recruitment System, only administrator is

allowed to change the user’s passwords. The system stores all users passwords and users

them to authenticate the user. When logging in, the system request the user supplies a

presumably secret, user specific password. This way the passwords provide protection to

some extent

The proper backup of data in the form of hardcopies as well as on paper stationary is a

measure of disaster recovery planning.

User Manual

Page 30: Full Doc

JAVA:

It is a Platform Independent. Java is an object-oriented programming language

developed initially by James Gosling and colleagues at Sun Microsystems. The language,

initially called Oak (named after the oak trees outside Gosling's office), was intended to

replace C++, although the feature set better resembles that of Objective C.

The following diagram shows the Java 2 Platform Standard Edition Architecture

Fig 3.2.1.1 Java 2 Platform Standard Edition

The following are some of the features which have made Java one of the most popular among the various available programming languages.

Simple

Page 31: Full Doc

Java was developed by taking the best points from other programming languages,

primarily C and C++. Java therefore utilizes algorithms and methodologies that are

already proven. Error prone tasks such as pointers and memory management have either

been eliminated or are handled by the Java environment automatically rather than by the

programmer. Since Java is primarily a derivative of C++ which most programmers are

conversant with, it implies that Java has a familiar feel rendering it easy to use.

Object Oriented

Even though Java has the look and feel of C++, it is a wholly independent

language which has been designed to be object-oriented from the ground up. In object-

oriented programming (OOP), data is treated as objects to which methods are applied.

Java's basic execution unit is the class. Advantages of OOP include: reusability of code,

extensibility and dynamic applications

Distributed

Commonly used Internet protocols such as HTTP and FTP as well as calls for

network access are built into Java. Internet programmers can call on the functions

through the supplied libraries and be able to access files on the Internet as easily as

writing to a local file system.

Interpreted

When Java code is compiled, the compiler outputs the Java Bytecode which is an

executable for the Java Virtual Machine. The Java Virtual Machine does not exist

physically but is the specification for a hypothetical processor that can run Java code. The

byte code is then run through a Java interpreter on any given platform that has the

interpreter ported to it. The interpreter converts the code to the target hardware and

executes it.

Robust

Page 32: Full Doc

Java compels the programmer to be thorough. It carries out type checking at both

compile and runtime making sure that every data structure has been clearly defined and

typed. Java manages memory automatically by using an automatic garbage collector. The

garbage collector runs as a low priority thread in the background keeping track of all

objects and references to those objects in a Java program. When an object has no more

references, the garbage collector tags it for removal and removes the object either when

there is an immediate need for more memory or when the demand on processor cycles by

the program is low.

Secure

The Java language has built-in capabilities to ensure that violations of security do

not occur. Consider a Java program running on a workstation on a local area network

which in turn is connected to the Internet. Being a dynamic and distributed computing

environment, the Java program can, at runtime, dynamically bring in the classes it needs

to run either from the workstation's hard drive, other computers on the local area network

or a computer thousands of miles away somewhere on the Internet. This ability of classes

or applets to come from unknown locations and execute automatically on a local

computer sounds like every system administrator's nightmare considering that there could

be lurking out there on one of the millions of computers on the Internet, some viruses,

Trojan horses or worms which can invade the local computer system and wreak havoc on

it.

Java goes to great lengths to address these security issues by putting in place a

very rigorous multilevel system of security:

First and foremost, at compile time, pointers and memory allocation are removed

thereby eliminating the tools that a system breaker could use to gain access to system

resources. Memory allocation is deferred until runtime.

Even though the Java compiler produces only correct Java code, there is still the

possibility of the code being tampered with between compilation and runtime. Java

guards against this by using the byte code verifier to check the byte code for language

Page 33: Full Doc

compliance when the code first enters the interpreter, before it ever even gets the chance

to run.

The byte code verifier ensures that the code does not do any of the following:

Forge pointers

Violate access restrictions

Incorrectly access classes

Overflow or underflow operand stack

Use incorrect parameters of byte code instructions

Use illegal data conversions

At runtime, the Java interpreter further ensures that classes loaded do not access

the file system except in the manner permitted by the client or the user.

Sun Microsystems will soon be adding yet another dimension to the security of

Java. They are currently working on a public-key encryption system to allow Java

applications to be stored and transmitted over the Internet in a secure encrypted form.

Architecturally Neutral

The Java compiler compiles source code to a stage which is intermediate between

source and native machine code. This intermediate stage is known as the byte code,

which is neutral. The byte code conforms to the specification of a hypothetical machine

called the Java Virtual Machine and can be efficiently converted into native code for a

particular processor.

Portable

By porting an interpreter for the Java Virtual Machine to any computer

hardware/operating system, one is assured that all code compiled for it will run on that

system. This forms the basis for Java's portability. Another feature which Java employs in

order to guarantee portability is by creating a single standard for data sizes irrespective of

processor or operating system platforms.

Page 34: Full Doc

High Performance

The Java language supports many high-performance features such as

multithreading, just-in-time compiling, and native code usage.

Java has employed multithreading to help overcome the performance problems

suffered by interpreted code as compared to native code. Since an executing program

hardly ever uses CPU cycles 100 % of the time, Java uses the idle time to perform the

necessary garbage cleanup and general system maintenance that renders traditional

interpreters slow in executing applications. [NB: Multithreading is the ability of an

application to execute more than one task (thread) at the same time e.g. a word processor

can be carrying out spell check in one document and printing a second document at the

same time.

Since the byte code produced by the Java compiler from the corresponding source

code is very close to machine code, it can be interpreted very efficiently on any platform.

In cases where even greater performance is necessary than the interpreter can provide,

just-in-time compilation can be employed whereby the code is compiled at run-time to

native code before execution.

An alternative to just-in-time compilation is to link in native C code. This yields

even greater performance but is more burdensome on the programmer and reduces the

portability of the code.

Dynamic

By connecting to the Internet, a user immediately has access to thousands of

programs and other computers. During the execution of a program, Java can dynamically

load classes that it requires either from the local hard drive, from another computer on the

local area network or from a computer somewhere on the Internet.

Page 35: Full Doc

Applets

A web page received from the web tier can include an embedded applet. An applet is a

small client application written in the Java programming language that executes in the Java

virtual machine installed in the web browser. However, client systems will likely need the Java

Plug-in and possibly a security policy file in order for the applet to successfully execute in the

web browser. Web components are the preferred API for creating a web client program because

no plug-ins or security policy files are needed on the client systems. Also, web components

enable cleaner and more modular application design because they provide a way to separate

applications programming from web page design. Personnel involved in web page design thus do

not need to understand Java programming language syntax to do their jobs.

Application Clients

An application client runs on a client machine and provides a way for users to handle

tasks that require a richer user interface than can be provided by a markup language. It typically

has a graphical user interface (GUI) created from the Swing or the Abstract Window Toolkit

(AWT) API, but a command-line interface is certainly possible.

3.2.6 Eclipse 3.2

Eclipse is a tool that is used to edit the java programs that are created and has a

very user friendly environment and makes the process to be very simple. Some of the

advantages of using this application and its features are explained below.

In the Eclipse environment, every file is stored inside a project. This means that

every document, folder, code file (.java) and compiled code (.class) has to be contained

by a project. Hence the Eclipse project framework is explained.

It is necessary to create a new project to develop a new Java program, but also to

edit existing code (i.e., a .java file stored inside a diskette). To create a new project select

Page 36: Full Doc

from the main menu line "File > New > Project ...” You may also select "New >

Project ..." by right clicking any point of the package explorer window.

To create or edit Java programs, a Java project should be created. Java project can

also store program related information, such as code documentation and other related

files. Simple projects should only be created to store documents and other files with no

Java code. Plug-in Development projects are used to add new modules and facilities to

the Eclipse environment.

Eclipse Modeling Framework projects are used to create analysis and design

models. Source folders are the folders that store the Java source code files (the .java

files). By placing your Java files inside a source folder, they will be automatically

compiled.

Another striking feature of this version is that every imported element is

duplicated. This means that the programmer may delete the copy of these files that

Eclipse manages, and still have the original file. Nevertheless, when importing an

existing Eclipse project, the project contents will not be duplicated. Hence, special care

needs to be taken when deleting files from Eclipse workspace, especially while deleting

those Eclipse imported projects, as no other copies may exist.

The files created using Eclipse may also be exported as normal files (File system),

Java Jar files and even Zip files. This is achieved through a process similar to the

importing process already detailed, selecting the "Export" option.

It is also possible copying, cutting and pasting files and folders from Eclipse to

your file system (i.e., Windows explorer) and vice versa (i.e., selecting a file, pressing

CTRL+C, then choosing a destination folder and pressing CTRL+V).

Page 37: Full Doc

MySQL Server

MySQL is a multithreaded, multi-user SQL database management system which

has, according to MySQL AB, more than 10 million installations. MySQL is owned and

sponsored by a single for-profit firm, the Swedish company MySQL AB, which holds the

copyright to most of the code base. This is similar to the JBoss model and how the Free

Software Foundation handles copyright in its projects, and dissimilar to how the Apache

project does it, where the software is developed by a public community and the copyright

to the code base is owned by its individual authors.

There are APIs available that allow applications written in numerous

programming languages to access MySQL databases, including: C, C++, C#, D, Borland

Delphi (via dbExpress), Eiffel, Smalltalk, Java (with a native Java driver

implementation), Lisp, Perl, PHP, Python, Ruby, REALbasic (Mac), FreeBasic, and Tcl;

each of these uses a specific API. An ODBC interface called MyODBC allows additional

programming languages that support the ODBC interface to communicate with a MySQL

database, such as ASP or Coldfusion. MySQL is mostly implemented in ANSI C.

Uses

MySQL is popular for web applications and acts as the database component of the

LAMP, MAMP, and WAMP platforms

(Linux/Mac/Windows-Apache-MySQL-PHP/Perl/Python), and for open-source bug

tracking tools like Bugzilla. Its popularity as a web application is closely tied to the

popularity of PHP, which is often combined with MySQL and nicknamed the Dynamic

Duo. It is easy to find many references that combine the two in websites and books (PHP

and MySQL for Dummies, PHP and MySQL Bible, Beginning PHP and MySQL, etc.).

PHP and MySQL are also essential components for running the popular WordPress

blogging platform. Wikipedia runs on MediaWiki software, which also uses PHP and a

MySQL database.

Administration

Page 38: Full Doc

To administer MySQL databases one can use the included command-line tool

(commands: MySQL and mysqladmin). Also downloadable from the MySQL site are

GUI administration tools: MySQL Administrator and MySQL Query Browser. Both of

the GUI tools are now included in one package called MySQL GUI Tools.

A widespread and popular alternative, written in PHP, is the free software web

application phpMyAdmin which is a server side tool. For client side MySQL

administration and development, the leading tools are Navicat MySQL GUI by

PremiumSoft and MySQL admin family by SQL Maestro Group, which provide the same

functionality as phpMyAdmin but more advanced in the Import/Export, Query Building,

OLAP, BLOB Editing, Backup and Data Sync. features. Navicat is also available for

PostgreSQL - Navicat PostgreSQL Manager.

Platforms

MySQL works on many different platforms—including AIX, BSDi, FreeBSD,

HP-UX, GNU/Linux, Mac OS X, NetBSD, Novell NetWare, OpenBSD, OS/2 Warp,

QNX, SGI IRIX, Solaris, SunOS, SCO OpenServer, SCO UnixWare, Tru64, Windows

95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP and

Windows Vista. A port of MySQL to OpenVMS is also available

Page 39: Full Doc
Page 40: Full Doc

Conclusion

To the best of our knowledge, this paper is the first serious attempt to distinguish

between a router dropping packets maliciously and a router dropping packets due to

congestion. Previous work has approached this issue using a static user-defined threshold,

which is fundamentally limiting. Using the same framework as our earlier work (which is

based on a static user-defined threshold) , we developed a compromised router detection

protocol _ that dynamically infers, based on measured traffic rates and buffer sizes, the

number of congestive packet losses that will occur. Subsequent packet losses can be

attributed to malicious actions. Because of no determinism introduced by imperfectly

synchronized clocks and scheduling delays, protocol _ uses user-defined significance

levels, but these levels are independent of the properties of the traffic. Hence, protocol _

does not suffer from the limitations of static thresholds. We evaluated the effectiveness of

protocol _ through an implementation and deployment in a small network. We show that

even fine-grained attacks, such as stopping a host from opening a connection by

discarding the SYN packet, can be detected.

Page 41: Full Doc

Future Enhancement:

Detecting Malicious Packet Losses is very useful to find out the malicious

routers. Note that links can also be penalized due to natural losses. We do not

differentiate between losses caused by adversarial behavior and natural losses because

lossy links should be avoided just as well. In future we are planning to eliminate routers

or add new routers separately.

If there is a malicious router in the network, we try to remove it manually or we

will transmit messages through alternative router.

Page 42: Full Doc
Page 43: Full Doc
Page 44: Full Doc

//this is pgm_2 - server // eg pgm for start the Server Socket and continue the Listening ...............// page 456 start

// Request and Response and //Send Acknoledgement from

server to clientimport java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*;import java.io.*;import java.net.*;import java.util.*;import java.sql.*;import javax.sql.*;import java.lang.*;import java.util.Vector;import java.awt.Toolkit;import java.util.Timer;import java.util.TimerTask;import java.util.StringTokenizer;import javax.naming.*;import javax.naming.directory.*;import java.util.Calendar;

class serverH extends JFrame{

Toolkit toolkit; Timer timer; int sto,tt; long delay,time; static int i=0,st1,counter; String mesg,act="active",ss1;ServerSocket ss=new ServerSocket(8888); Connection con; Statement st; DefaultListModel model1; private JLabel jLabel1;

private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4;

Page 45: Full Doc

private JList jList1; private JScrollPane jScrollPane1; private JTextArea jTextArea1; private JScrollPane jScrollPane2; private JButton jButton1; private JButton jButton2; private JButton jButton3; private JButton jButton4;

private JButton jButton5; private JButton jButton6;

private JPanel contentPane; Vector data=new Vector();

ArrayList a1=new ArrayList(); ArrayList a2=new ArrayList(); ArrayList allname=new ArrayList(); String logsys,log,sname,all,desname,smesg; Thread t1; String source,destination,state,smsg,srcname,msgtime; FileOutputStream output,op1; String fd;

boolean sta=true,stak; int end;

// ServerSocket ss1=new ServerSocket(4444); // forwarding msg to appropriate port..

Socket cs,cs1,cs2; ObjectInputStream in,in1,in2; ObjectOutputStream ois1,ois2,ois3; String res1;

int staa=0,che; String hh;

Vector v1,v2; String name[]=new String[100]; String allsta; int portno; int numWarningBeeps=10 ;

boolean sss;

serverH()throws Exception{

portno=8888;v1=new Vector();setResizable(false);

allsta="allow";jLabel1 = new JLabel();

Page 46: Full Doc

jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel();

model1=new DefaultListModel(); jList1 = new JList(); jScrollPane1 = new JScrollPane();

jTextArea1 = new JTextArea(); jScrollPane2 = new JScrollPane(); jButton1 = new JButton();

jButton2 = new JButton(); jButton3 = new JButton();

jButton4 = new JButton(); jButton5 = new JButton();jButton6 = new JButton();

contentPane = (JPanel)this.getContentPane(); op1=new FileOutputStream("msgbackup.txt");output=new FileOutputStream("msgbackup.txt",true);

jTextArea1.setText("Server Started ....");

jLabel1.setText("Currently Connected System ..."); jLabel2.setText("Message Details ..."); jLabel3=new JLabel(new ImageIcon(""));

// jLabel4.setText("jLabel4");

jList1.addListSelectionListener(new ListSelectionListener() {

public void valueChanged(ListSelectionEvent e)

{ //jList1_valueChanged(e); } }); jScrollPane1.setViewportView(jList1);

jScrollPane2.setViewportView(jTextArea1);

//--------Changed---------down---------> jButton1.setText("Blocked");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

act="dactive"; jButton5.setEnabled(true);

jButton1.setEnabled(false);//System.out.println(" Allow clicked ...."+allsta);

} });

Page 47: Full Doc

jButton5.setText("Non Blocked"); jButton5.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{ act="active";jButton1.setEnabled(true);jButton5.setEnabled(false);

} });

//--------Changed---------up--------->

jButton2.setText("Message Send Allow"); jButton2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) { allsta="allow";

jButton3.setEnabled(true);jButton2.setEnabled(false);System.out.println(" Allow clicked ...."+allsta);

} });

jButton3.setText("Message Send Not Allow"); jButton3.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{ allsta="notallow";

jButton2.setEnabled(true);jButton3.setEnabled(false);System.out.println(" Not Allow clicked ...."+allsta);

} });

//*****************************************************jButton6.setText("Send Blocked Msg...");

jButton6.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) { try

{

Page 48: Full Doc

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection

con1=DriverManager.getConnection("jdbc:odbc:maintable","sa","vgn");Statement st1=con1.createStatement();String hh="HIGH";String app="SELECT * FROM maintable

where type like '"+hh+"'";ResultSet rs=st1.executeQuery(app);System.out.println(" Query : "+app);

while(rs.next()){

System.out.println(" <- Inside the High loop -> ");

String src = rs.getString(1);String dest = rs.getString(2);String time = rs.getString(3);String msg =rs.getString(4);String stt =rs.getString(5);String info =

src+"#"+dest+"#"+time+"#"+msg+"#"+stt;System.out.println(" <- Schedule

Performing HIGH -> "+info);if(stt.equals("dactive")){

Socket sock=new Socket((dest.trim()),1234);//socket pgm for data transfer from router to destination

ObjectOutputStream oost=new ObjectOutputStream(sock.getOutputStream());

String all=src+" : "+msg;oost.writeObject(all);Thread.sleep(1000);

}

}app="delete FROM maintable where type like

'"+hh+"' ";st1.executeUpdate(app);}catch (Exception e4){

System.out.println(e4);

Page 49: Full Doc

}

} });

//*****************************************************jButton4.setText("EXIT");

jButton4.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) { //jButton4_actionPerformed(e);

System.exit(0); } });

addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent e){

System.exit(0);}

});

String rew="";

op1.write(rew.getBytes()); contentPane.setLayout(null);

/*addComponent(contentPane, jLabel1, 351,44,153,18); addComponent(contentPane, jLabel2, 24,42,210,18); addComponent(contentPane, jLabel3, 9,4,99,38); addComponent(contentPane, jLabel4, 121,8,392,35);

addComponent(contentPane, jScrollPane1, 359,65,131,209); addComponent(contentPane, jScrollPane2, 12,66,333,373);

//addComponent(contentPane, jButton1, 377,289,123,28); addComponent(contentPane, jButton2, 377,323,123,28); addComponent(contentPane, jButton3, 377,359,123,28);

addComponent(contentPane, jButton4, 378,393,123,28); */

addComponent(contentPane, jLabel3, 0,0,560,100); addComponent(contentPane, jLabel1, 370,114,173,18); addComponent(contentPane, jLabel2, 24,114,210,18); //addComponent(contentPane, jLabel3, 9,44,99,38); addComponent(contentPane, jLabel4, 121,78,392,35);

addComponent(contentPane, jScrollPane1, 377,135,151,209);

Page 50: Full Doc

addComponent(contentPane, jScrollPane2, 12,136,350,373); addComponent(contentPane, jButton1, 377,360,151,28);

addComponent(contentPane, jButton5, 377,395,151,28); addComponent(contentPane, jButton2, 377,430,151,28);

addComponent(contentPane, jButton3, 377,465,151,28); addComponent(contentPane, jButton6, 377,500,151,28);

addComponent(contentPane, jButton4, 280,515,80,28);

//

********************************************************************

/*Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:maintable");st=con.createStatement();*/

//************************************************************************

MouseListener mouseListener = new MouseAdapter() {

public void mouseClicked(MouseEvent mouseEvent) { JList jList1 = (JList) mouseEvent.getSource(); if (mouseEvent.getClickCount() == 2) {

int index = jList1.locationToIndex(mouseEvent.getPoint());

if (index >= 0) { Object o = jList1.getModel().getElementAt(index);

//System.out.println(">>" + ((o==null)? "null" : o.toString()) + " is selected.");

String tatext=jTextArea1.getText();view v1=new view(o.toString());//System.out.println("Double-clicked on: " + o.toString());}}}

};//jList1.addMouseListener(mouseListener);jButton2.setEnabled(false);jButton5.setEnabled(false);this.setTitle("Router_1_Main..."); this.setLocation(new Point(100, 100)); this.setSize(new Dimension(560, 590));

Page 51: Full Doc

//this.setSize(new Dimension(540, 490)); this.setVisible(true);

toolkit = Toolkit.getDefaultToolkit(); timer = new Timer(); timer.scheduleAtFixedRate(new RemindTask(), 0, //initial

delay 1 * 1000); //subsequent rate

} // Constructor class closed ..........

private void addComponent(Container container,Component c,int x,int y,int width,int height)

{ c.setBounds(x,y,width,height); container.add(c);

}

private void

jButton1_actionPerformed(ActionEvent e) {

}

private void jButton2_actionPerformed(ActionEvent e)

{ //System.out.println("\

njButton2_actionPerformed(ActionEvent e) called."); // TODO: Add any handling code here

}

private void

jButton3_actionPerformed(ActionEvent e) {

//System.out.println("\njButton3_actionPerformed(ActionEvent e) called.");

// TODO: Add any handling code here

}

private void jButton4_actionPerformed(ActionEvent e)

Page 52: Full Doc

{ //System.out.println("\

njButton4_actionPerformed(ActionEvent e) called."); // TODO: Add any handling code here

}

class RemindTask extends TimerTask { public void run()

{ while (true) {

sss=true; while (sss) { if (numWarningBeeps > 0)

{ long time = System.currentTimeMillis(); if (time - scheduledExecutionTime() > 5)

{ return; } //If it's not too late, beep. //toolkit.beep();

System.out.println("Waiting for Scheduling Request !"+numWarningBeeps);

//receive1();userupdate();numWarningBeeps--;

} else {

//toolkit.beep(); System.out.println("Time's up!");

sss=false; numWarningBeeps = 5; userupdate(); break;

//timer.cancel(); //Not necessary because we call System.exit //System.exit(0); //Stops the AWT thread (and everything else)

}

Page 53: Full Doc

}// if closed} // run() closed

} }

public void userupdate() {Vector ft=new Vector();

try{

System.out.println(" Inside the user update .....");Connection con1=null;Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con1=DriverManager.getConnection("jdbc:odbc:maintable","sa","vgn");Statement st1=con1.createStatement();String app="SELECT * FROM userlist";ResultSet rs=st1.executeQuery(app);

while(rs.next()){

System.out.println(" Inside the TABLE .....");String name=rs.getString(1);ft.add(name);System.out.println(ft);

}

//Thread.sleep(10000);

}catch (Exception eee){

System.out.println(" Could not get The table values...."+eee);}

jList1.setListData(ft);//

}

Page 54: Full Doc

public void msg(){

// ss=new ServerSocket(portno);try{

System.out.println("\n Server Socket Started and Listening...\n");cs=new Socket();cs1=new Socket();//new dest();counter=0;while(true){

sta=true;che=0;while(sta){

receive();counter++;

}if(counter==3){

//schedule();//forward(v1);counter=0;

}

//System.out.println("+++++-----------*****/////// Datas are stored int he table........");

}

}catch (Exception eee){

//System.out.println(" Could not receive the 8888 server port");}

}public void receive()

{String full;try{

System.out.println(" Server 1 is listening ....");

Page 55: Full Doc

cs1=ss.accept();cs=ss.accept();cs2=ss.accept();

//Thread.sleep(1000);//---------------------- 1 --------------------------------in1=new ObjectInputStream(cs1.getInputStream());String resu=(String)in1.readObject();System.out.println(" USer Add "+resu);adduser(resu);//------------------------ 2

-----------------------------------

ois1=new ObjectOutputStream(cs1.getOutputStream());

ois1.writeObject(allsta);System.out.println(" Send to client allow or

not :"+allsta);

//------------------- 3 User List------------------------------------------

ois2=new ObjectOutputStream(cs1.getOutputStream());

ois2.writeObject(data);System.out.println(" send to the user name vector

list :"+data);//------------------- 4

-----------------------------------------

in=new ObjectInputStream(cs.getInputStream());String res=(String)in.readObject();System.out.println(" Receive the msg : "+res);//-------------------------------------------------------------

-

//System.out.println(" fIRST ARUMENT : "+res);StringTokenizer tokens = new

StringTokenizer(res,":");

while(tokens.hasMoreTokens()){

//System.out.println(tokens.nextToken());source=tokens.nextToken();destination=tokens.nextToken();

Page 56: Full Doc

state=tokens.nextToken();hh=tokens.nextToken();smsg=tokens.nextToken();

sto=0;if(smsg.equals("LOGOUT")){

deluser(source);sto=1;//System.out.println(source+" is now

logout ....");}che=0;if(smsg.equals("LOGINnull")){

adduser(source);sto=1;//System.out.println(source+" User is

now connected ....");che=1;

}if(smsg.endsWith("null"))

{sta=false;//

// mesg=smsg.substring(0,end-4);

//smsg=

}

//----------------------------------------------------//time = System.currentTimeMillis();time=System.nanoTime();//long delay=0;try{

Calendar cal=Calendar.getInstance();delay=cal.getTimeInMillis();//delay=System.currentTimeMillis();// tt=Integer.parseInt(delay);//String delay11=""+cal.getTime();

//System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@"+delay11);

Page 57: Full Doc

}catch (Exception rte){

System.out.println(rte);}//

//-----------------------------------------------------end=smsg.length();int ac=0;

if(smsg.equals("LOGOUT")){ full=source+" : Now Logout...."; sto=1;}else if(smsg.equals("LOGINnull")){ full=source+" : Now Login...."; sto=1;}else if((smsg.trim()).equals("notall")){

full="";ac=1;//smsg="aaaa";

}else if(smsg.endsWith("null"))

{sta=false;smsg=smsg.substring(0,end-

4);full=source+":

"+destination+": "+smsg;//

// mesg=smsg.substring(0,end-4);

//smsg=

}else {smsg=smsg.substring(0,end);full=source+": "+destination+": "+smsg;

// full=source+": "+destination+": "+smsg.substring(0,end-4);

}

Page 58: Full Doc

//System.out.println(" msg are : "+full);

try{

if((ac==0)&&(sto==0)){

ss1=act; //--------Changed------------------>

String hhh="HIGH"; //System.out.println("<-

Before-> "+source+": "+destination+": "+hh+" : "+smsg.substring(0,end-4)+" : "+sss+" : "+state) ;

jTextArea1.setText(jTextArea1.getText()+"\n"+full);System.out.println(" +++ >

Smsg values : "+smsg);System.out.println(" Inside

the user update .....");Connection con1=null;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con1=DriverManager.getConnection("jdbc:odbc:maintable","sa","vgn");Statement

st1=con1.createStatement();String query = "insert into

maintable values('"+source+"','"+destination+"','"+hh+"','"+smsg+"','"+ss1+"','"+delay+"','"+hhh+"')";

//System.out.println(" query :"+query);

st1.executeUpdate(query);String query1 = "insert into

sendmsg values('"+source+"','"+destination+"','"+hh+"','"+smsg+"','"+ss1+"','"+delay+"','"+hhh+"')";

st1.executeUpdate(query1);}else{

jTextArea1.setText(jTextArea1.getText()+"\n"+full);

Page 59: Full Doc

ac=0;}

//System.out.println("query="+query);

//System.out.println(">>>>>>>>>>>>>>>>>>>>>>>the values are successfully inserted");

}catch (Exception eee13){

System.out.println(eee13);}

//String app="SELECT * FROM supplierdetail";

//System.out.println(app);//ResultSet rs=st.executeQuery(app);

}

//*********** User add ***********************

//jList1.setListData(data);//*********** User Delete

**********************in2=new

ObjectInputStream(cs2.getInputStream());String lresu=(String)in2.readObject();

//System.out.println("@@@@@@@@@@@@@ 3 rd argument :"+lresu);

if(che==0){deluser(lresu);}

Page 60: Full Doc

//-------------------User List--send to source----------------------------------------

//ois2=new ObjectOutputStream(cs1.getOutputStream());

//ois2.writeObject(data);//------------------------------------------------------------

//********************************************v1.removeAllElements();

//v2.removeAllElements();

}catch (Exception eee){

//System.out.println(eee);}

}

public void deluser(String sname){

try{

String app="SELECT * FROM userlist";ResultSet rs=st.executeQuery(app);while(rs.next()){String f1=rs.getString(1);if(f1.equals(sname))

{app="delete * from userlist where username like

'"+sname+"' ";//st.executeUpdate(app);}

System.out.println("high record ...........");}

}catch (Exception e){}

for(int uu=0;uu<i;uu++){

Page 61: Full Doc

if(name[uu].equals(sname)){

//i--;data.removeElementAt(uu);i--; //one user remove then automatically

total user capacity reduced by 1 from the listjList1.setListData(data);//t1.start();adduser("update");//data.add(name);

break;

}}

}

public void adduser(String sname){

if(sname.equals("update")){

try {

jList1.setListData(data);//ois1=new ObjectOutputStream(cs1.getOutputStream());//ois1.writeObject(data);

} catch (Exception erw) {

System.out.println(" Inside Add User update : "+erw); }

}else{ if(i==0)

{name[i]=sname;allname.add(sname);//System.out.println(" st=1;

name="+name[i]);data.add(name[i]);try{

Page 62: Full Doc

String query = "insert into userlist values('"+sname+"')";

//st.executeUpdate(query);}catch (Exception eee){}

//data.add(sname);

i++;}else{

st1=0;for(int y=0;y<i;y++){

if(((name[y].trim()).equals(sname.trim()))) //a 0 1 b 2 a{

st1=0;break;

}else{

//System.out.println(" st="+st+" name= "+name[y]+" res1= "+res1+" y= "+y+ " i= "+i);

st1=1;}

}if(st1==1){

name[i]=sname;//System.out.println(" st=1;

name="+name[i]);data.add(name[i]);try{

String query = "insert into userlist values('"+sname+"')";

//st.executeUpdate(query);}

Page 63: Full Doc

catch (Exception erer){}

//allname.add(res1);i++;st1=0;}

}

}// update else closed.........//***********************

//System.out.println("---------------------------------------------"+i+" \n");for(int r=0;r<i;r++){

//System.out.println(" Sys name : "+ r+"/"+i+" : "+ name[r]+"\n");

}//System.out.println("@"+data);

// }// if string is logout then not added in the userlist list.............jList1.setListData(data);//model1.addElement(allname);

//}System.out.println("--------------------------------------------- \n");}public static void main(String[] args) throws Exception{

//JFrame.setDefaultLookAndFeelDecorated(true); //JDialog.setDefaultLookAndFeelDecorated(true); try {

//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { //System.out.println("Failed loading L&F: "); //System.out.println(ex); }

//timer t=new timer(10);

Page 64: Full Doc

// new dest();serverH se=new serverH();se.msg(); //System.out.println(" Dest class called on here...\n\n");

}

REFERENCES

[1] X. Ao, Report on DIMACS Workshop on Large-Scale Internet Attacks,

http://dimacs.rutgers.edu/Workshops/Attacks/internet-attack- 9-03.pdf, Sept. 2003.

[2] R. Thomas, ISP Security BOF, NANOG 28, http://www.nanog.

org/mtg-0306/pdf/thomas.pdf, June 2003.

[3] K.A. Bradley, S. Cheung, N. Puketza, B. Mukherjee, and R.A. Olsson, “Detecting

Disruptive Routers: A Distributed Network Monitoring Approach,” Proc. IEEE Symp.

Security and Privacy (S&P ’98), pp. 115-124, May 1998.

[4] A.T. Mizrak, Y.-C. Cheng, K. Marzullo, and S. Savage, “Detecting and Isolating

Malicious Routers,” IEEE Trans. Dependable and Secure Computing, vol. 3, no. 3, pp.

230-244, July-Sept. 2006.

[5] L. Subramanian, V. Roth, I. Stoica, S. Shenker, and R. Katz, “Listen and Whisper:

Security Mechanisms for BGP,” Proc. First Symp. Networked Systems Design and

Implementation (NSDI ’04), Mar. 2004.


Recommended