An Acknowledgment-Based Approach For The Detection Of Routing Misbehavior In MANETs
#1

An Acknowledgment-Based Approach For The Detection Of Routing Misbehavior In MANETs

Abstract: We study routing misbehavior in MANETs (Mobile Ad Hoc Networks) in this paper. In general, routing protocols for MANETs are designed based on the assumption that all participating nodes are fully cooperative. However, due to the open structure and scarcely available battery-based energy, node misbehaviors may exist. One such routing misbehavior is that some selsh nodes will participate in the route discovery and maintenance processes but refuse to forward data packets. In this paper, we propose the 2ACK scheme that serves as an add-on technique for routing schemes to detect routing misbehavior and to mitigate their adverse effect. The main idea of the 2ACK scheme is to send two-hop acknowledgment packets in the opposite direction of the routing path. In order to reduce additional routing overhead, only a fraction of the received data packets are acknowledged in the 2ACK scheme. Analytical and simulation results are presented to evaluate the performance of the proposed scheme.



Technology to use:2007/Java
Reply
#2
[attachment=3946]

Abstract

We study routing misbehavior in MANETs (Mobile Ad Hoc Networks) in this paper. In general, routing protocols for MANETs are designed based on the assumption that all participating nodes are fully cooperative. However, due to the open structure and scarcely available battery-based energy, node misbehaviors may exist. One such routing misbehavior is that some selfish nodes will participate in the route discovery and maintenance processes but refuse to forward data packets. In this project, we propose the 2ACK scheme that serves as an add-on technique for routing schemes to detect routing misbehavior and to mitigate their adverse effect. The main idea of the 2ACK scheme is to send two-hop acknowledgment packets in the opposite direction of the routing path. In order to reduce additional routing overhead, only a fraction of the received data packets are acknowledged in the 2ACK scheme. Analytical and simulation results are presented to evaluate the performance of the proposed scheme.

System Analysis
1. Existing System

In an open MANET, different mobile nodes with different goals share their resources in order to ensure global connectivity. However, some resources are consumed quickly as the nodes participate in the network functions. For instance, battery power is considered to be most important in a mobile environment. An individual mobile node may attempt to benefit from other nodes, but refuse to share its own resources. Such nodes are called selfish or misbehaving nodes and their behavior is termed selfishness or misbehavior. One of the major sources of energy consumption in the mobile nodes of MANETs is wireless transmission. A selfish node may refuse to forward data packets for other nodes in order to conserve its own energy.
In MANETs, routing misbehavior can severely degrade the performance at the routing layer. Specifically, nodes may participate in the route discovery and maintenance processes but refuse to forward data packets.

2.Proposed System

Several techniques have been proposed to detect and alleviate the effects of such selfish nodes in MANETs. In proposed system two techniques were introduced, namely, watchdog and pathrater, to detect and mitigate the effects of the routing misbehavior, respectively. The watchdog technique identifies the misbehaving nodes by overhearing on the wireless medium. The pathrater technique allows nodes to avoid the use of the misbehaving nodes in any future route selections. The watchdog technique is based on passive overhearing. Unfortunately, it can only determine whether or not the next-hop node sends out the data packet. The reception status of the next-hop linkâ„¢s receiver is usually unknown to the observer.
We propose the 2ACK scheme to mitigate the adverse effects of misbehaving nodes. The basic idea of the 2ACK scheme is that, when a node forwards a data packet successfully over the next hop, the destination node of the next-hop page link will send back a special two-hop acknowledgment called 2ACK to indicate that the data packet has been received successfully. Such a 2ACK transmission takes place for only a fraction of data packets, but not all. Such a selective acknowledgment1 is intended to reduce the additional routing overhead caused by the 2ACK scheme. Judgment on node behavior is made after observing its behavior for a certain period of time.

3. Implementation Plan

We propose the 2ACK technique to detect such misbehaving nodes. Routes containing such nodes will be eliminated from consideration. The source node will be
able to choose an appropriate route to send its data. In this work, we use TCP to demonstrate the adverse effect of routing misbehavior and the performance of our proposed scheme.
The attackers (misbehaving nodes) are assumed to be capable of performing the following tasks:
 Dropping any data packet,
 Masquerading as the node that is the receiver of its next-hop link,
 Sending out fabricated 2ACK packets,
 Sending out fabricated hn, the key generated by the 2ACK packet senders, and
 Claiming falsely that its neighbor or next-hop links are misbehaving.
4. Problem Analysis
In this section, we describe the problems caused by routing misbehavior. But first, we summarize the notations and assumptions used throughout this paper.

4.1 Routing Misbehavior Model

We present the routing misbehavior model considered in this paper in the context of the DSR protocol. Due to DSRâ„¢s popularity, we use it as the basic routing protocol to
illustrate our proposed add-on scheme.
A selfish node does not perform the packet forwarding function for data packets unrelated to itself. However, it operates normally in the Route Discovery and the Route Maintenance phases of the DSR protocol. Since such misbehaving nodes participate in the Route Discovery phase, they may be included in the routes chosen to forward the data packets from the source. The misbehaving nodes, however, refuse to forward the data packets from the source. This leads to the source being confused.
4.2 Probability of Misbehaving Routes
In order to demonstrate the adverse effect of routing misbehavior, we estimate the probability of misbehaving routes in this subsection. A route is defined as misbehaving
when there is at least one router along the route that can be classified as misbehaving.
Our analysis is based on the following assumptions:
 The network nodes are randomly distributed over the entire network area. Each node™s location is independent of all other nodes™ locations. There are N nodes in the network area of size X _ Y
 The source and the destination of each transaction are chosen randomly among all nodes.
 Nodes (other than the source and the destination) are chosen as misbehaving nodes, independently, with probability pm.
Modules
The modules that are included in this project are
 Route Request for Identifying the misbehavior Node
 Message Transfer to the available path
 Route Maintenance
 Cache Updating for misbehavior node identification
Module 1: Route Request for Identifying the misbehavior Node
When a source node wants to send packets to a destination to which it does not have a route, it initiates a Route Discovery by broadcasting a ROUTE REQUEST. The node receiving a ROUTE REQUEST checks whether it has a route to the destination in its cache and also check if it is misbehavior node or not. If it has, it sends a ROUTE REPLY to the source including a source route, which is the concatenation of the source route in the ROUTE REQUEST and the cached route. If the node does not have a cached route to the destination, it adds its address to the source route and rebroadcasts the ROUTE REQUEST. When the destination receives the ROUTE REQUEST, it sends a ROUTE REPLY containing the source route to the source. Each node forwarding a ROUTE REPLY stores the route starting from itself to the destination. When the source receives the ROUTE REPLY, it caches the source route.
If any node not sends ack then we easily identified that is misbehavior node.
So find out the alternative path and forwarding the data to the destination.

Module 2: Message Transfer to the available path

The Message transfer relates with that the sender node wants to send a message to the destination node after the path is selected also find out that node is not a misbehavior node and status of the destination node through is true. The receiver node receives the message completely and then it send the acknowledgement to the sender node also near by nodes through the router nodes where it is received the message.

Module 3: Route Maintenance

Route Maintenance, the node forwarding a packet is responsible for confirming that the packet has been successfully received by the next hop. If no acknowledgement is received after the maximum number of retransmissions, the forwarding node sends a ROUTE ERROR to the source (also source easily understand that node is misbehavior ), indicating the broken link. Each node forwarding the ROUTE ERROR removes from its cache the routes containing the broken link.

Module 4: Cache Updating for misbehavior node identification

When a node detects a page link failure, our goal is to notify all reachable nodes that have cached that page link to update their caches if it is not a misbehavior node. To achieve this goal, the node detecting a page link failure, identifying the misbehavior node needs to know which nodes have cached the broken page link and needs to notify such nodes efficiently. Our solution is to keep track of identifying the misbehavior node in a distributed manner.

5. Algorithm Analysis
5.1 Details of the 2ACK Scheme

The 2ACK scheme is a network-layer technique to detect misbehaving links and to mitigate their effects. It can be implemented as an add-on to existing routing protocols for MANETs, such as DSR. The 2ACK scheme detects misbehavior through the use of a new type of acknowledgment packet, termed 2ACK. A 2ACK packet is assigned a fixed route of two hops (three nodes) in the opposite direction of the data traffic route.
To detect misbehavior, the 2ACK packet sender maintains a list of IDs of data packets that have been sent out but have not been acknowledged.

5.2 Authenticating the 2ACK Packets

We look into the problem of 2ACK packet fabrication in this subsection. Since the 2ACK packets are forwarded by an intermediate node, without proper protection, a misbehaving node N2 can simply fabricate 2ACK packets and claim that they were sent by node N3. Therefore, an authentication technique is needed in order to protect 2ACK packets from being forged.

5.3 Timeout for 2ACK Reception

The parameter timeout, will be used to set up a timer for 2ACK reception. If the timer expires before the expected 2ACK packet is received, the missing 2ACK packet counter, Cmis, will be incremented. Thus, an appropriate value of _ is important for the successful operation of the 2ACK scheme.

6. Related Works

The security problem and the misbehavior problem of wireless networks including MANETs have been studied by many researchers, Various techniques have been proposed to prevent selfishness in MANETs. These schemes can be broadly classified into two categories: credit-based schemes and reputation-based schemes.

6.1 Credit-Based Schemes

The basic idea of credit-based schemes is to provide incentives for nodes to faithfully perform networking functions. In order to achieve this goal, virtual (electronic)
currency or similar payment system may be set up. Nodes get paid for providing services to other nodes. When they request other nodes to help them for packet forwarding, they use the same payment system to pay for such services.

6.2 Reputation-Based Schemes

The second category of techniques to combat node misbehavior in MANETs is reputation-based. In such schemes, network nodes collectively detect and declare the
misbehavior of a suspicious node. Such a declaration is then propagated throughout the network so that the misbehaving node will be cut off from the rest of the network.

Software Requirement Specification

The software requirement specification is produced at the culmination of the analysis task. The function and performance allocated to software as part of system engineering are refined by establishing a complete information description as functional representation, a representation of system behavior, an indication of performance requirements and design constraints, appropriate validation criteria.
User Interface
* Swing - Swing is a set of classes that provides more powerful and flexible components that are possible with AWT. In addition to the familiar components, such as button checkboxes and labels, swing supplies several exciting additions, including tabbed panes, scroll panes, trees and tables.
* Applet - Applet is a dynamic and interactive program that can run inside a web page displayed by a java capable browser such as hot java or Netscape.
Hardware Interface
Hard disk : 40 GB
RAM : 512 MB
Processor Speed : 3.00GHz
Processor : Pentium IV Processor
Software Interface
JDK 1.5
Java Swing
MS-Access

Software Description

Java:
Java was conceived by James Gosling, Patrick Naughton, Chris Wrath, Ed Frank, and
Mike Sheridan at Sun Micro system. It is an platform independent programming
language that extends itâ„¢s features wide over the network.Java2 version introduces an
new component called Swing “ is a set of classes that provides more power
& flexible components than are possible with AWT.
- Itâ„¢s a light weight package, as they are not implemented by platform-specific code.
-Related classes are contained in javax.swing and its sub packages, such as javax.swing.tree.
-Components explained in the Swing have more capabilities than those of AWT
What Is Java?
Java is two things: a programming language and a platform.
The Java Programming Language
Java is a high-level programming language that is all of the following:
Simple
Object-oriented
Distributed
Interpreted
Robust
Secure
Architecture-neutral
Portable
High-performance
Multithreaded
Dynamic
Java is also unusual in that each Java program is both compiled and interpreted. With a compiler, you translate a Java program into an intermediate language called Java byte codes--the platform-independent codes interpreted by the Java interpreter. With an interpreter, each Java byte code instruction is parsed and run on the computer. Compilation happens just once; interpretation occurs each time the program is executed. This figure illustrates how this works.
Java byte codes can be considered as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether it's 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. The Java program can be compiled into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. For example, the same Java program can run on Windows NT, Solaris, and Macintosh.
The Java Platform
A platform is the hardware or software environment in which a program runs. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other, hardware-based platforms. Most other platforms are described as a combination of hardware and operating system.
The Java platform has two components:
The Java Virtual Machine (Java VM)
The Java Application Programming Interface (Java API)
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 (packages) of related components.
The following figure depicts a Java program, such as an application or applet, that's running on the Java platform. As the figure shows, the Java API and Virtual Machine insulates the Java program from hardware dependencies.

As a platform-independent environment, Java can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time byte code compilers can bring Java's performance close to that of native code without threatening portability.
What Can Java Do?
Probably the most well-known Java programs are Java applets. An applet is a Java program that adheres to certain conventions that allow it to run within a Java-enabled browser.
However, Java is not just for writing cute, entertaining applets for the World Wide Web ("Web"). Java is a general-purpose, high-level programming language and a powerful software platform. Using the generous Java API, we can write many types of programs.
The most common types of programs are probably applets and applications, where a Java application is a standalone program that runs directly on the Java platform.
How does the Java API support all of these kinds of programs?
With packages of software components that provide a wide range of functionality. The core API is the API included in every full implementation of the Java platform. The core API 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 Java applets.
Networking: URLs, TCP and UDP sockets, and IP addresses.
Internationalization: Help for writing programs that can be localized for users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language.
Security: Both low-level and high-level, including electronic signatures, public/private key management, access control, and certificates.
Software components: Known as JavaBeans, can plug into existing component architectures such as Microsoft's OLE/COM/Active-X architecture, OpenDoc, and Netscape's Live Connect.
Object serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI).
Java Database Connectivity (JDBC): Provides uniform access to a wide range of relational databases.
Java not only has a core API, but also standard extensions. The standard extensions define APIs for 3D, servers, collaboration, telephony, speech, animation, and more.
How Will Java Change My Life?
Java is likely to make your programs better and requires less effort than other languages. We believe that Java will help you do the following:
Get started quickly: Although Java is a powerful object-oriented language, it's 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 Java can be four times smaller than the same program in C++.
Write better code: The Java language encourages good coding practices, and its garbage collection helps you avoid memory leaks. Java's object orientation, its JavaBeans component architecture, and its wide-ranging, easily extendible API let you reuse other people's tested code and introduce fewer bugs.
Develop programs faster: Your development time may be as much as twice as fast versus writing the same program in C++. Why? You write fewer lines of code with Java and Java is a simpler programming language than C++.
Avoid platform dependencies with 100% Pure Java: You can keep your program portable by following the purity tips mentioned throughout this book and avoiding the use of libraries written in other languages.
Write once, run anywhere: Because 100% Pure Java programs are compiled into machine-independent byte codes, they run consistently on any Java platform.
Distribute software more easily: You can upgrade applets easily from a central server. Applets take advantage of the Java feature of allowing new classes to be loaded "on the fly," without recompiling the entire program.
We explore the java.net package, which provides support for networking. Its creators have called Java programming for the Internet. These networking classes encapsulate the socket paradigm pioneered in the Berkeley Software Distribution (BSD) from the University of California at Berkeley.

Networking Basics

Ken Thompson and Dennis Ritchie developed UNIX in concert with the C language at Bell Telephone Laboratories, Murray Hill, New Jersey, in 1969. In 1978, Bill Joy was leading a project at Cal Berkeley to add many new features to UNIX, such as virtual memory and full-screen display capabilities. By early 1984, just as Bill was leaving to found Sun Microsystems, he shipped 4.2BSD, commonly known as Berkeley UNIX.4.2BSD came with a fast file system, reliable signals, interprocess communication, and, most important, networking. The networking support first found in 4.2 eventually became the de facto standard for the Internet. Berkeleyâ„¢s implementation of TCP/IP remains the primary standard for communications with the Internet. The socket paradigm for inter process and network communication has also been widely adopted outside of Berkeley.
Socket Overview
A network socket is a lot like an electrical socket. Various plugs around the network have a standard way of delivering their payload. Anything that understands the standard protocol can plug in to the socket and communicate.
Internet protocol (IP) is a low-level routing protocol that breaks data into small packets and sends them to an address across a network, which does not guarantee to deliver said packets to the destination.
Transmission Control Protocol (TCP) is a higher-level protocol that manages to reliably transmit data. A third protocol, User Datagram Protocol (UDP), sits next to TCP and can be used directly to support fast, connectionless, unreliable transport of packets.
Client/Server
A server is anything that has some resource that can be shared. There are compute servers, which provide computing power; print servers, which manage a collection of printers; disk servers, which provide networked disk space; and web servers, which store web pages. A client is simply any other entity that wants to gain access to a particular server.
In Berkeley sockets, the notion of a socket allows as single computer to serve many different clients at once, as well as serving many different types of information. This feat is managed by the introduction of a port, which is a numbered socket on a particular machine. A server process is said to listen to a port until a client connects to it. A server is allowed to accept multiple clients connected to the same port number, although each session is unique. To mange multiple client connections, a server process must be multithreaded or have some other means of multiplexing the simultaneous I/O.
Reserved Sockets
Once connected, a higher-level protocol ensues, which is dependent on which port you are using. TCP/IP reserves the lower, 1,024 ports for specific protocols. Port number 21 is for FTP, 23 is for Telnet, 25 is for e-mail, 79 is for finger, 80 is for HTTP, 119 is for Netnews-and the list goes on. It is up to each protocol to determine how a client should interact with the port.
Java and the Net
Java supports TCP/IP both by extending the already established stream I/O interface. Java supports both the TCP and UDP protocol families. TCP is used for reliable stream-based I/O across the network. UDP supports a simpler, hence faster, point-to-point datagram-oriented model.
InetAddress
The InetAddress class is used to encapsulate both the numerical IP address and the domain name for that address. We interact with this class by using the name of an IP host, which is more convenient and understandable than its IP address. The InetAddress class hides the number inside. As of Java 2, version 1.4, InetAddress can handle both IPv4 and IPv6 addresses.
Factory Methods

The InetAddress class has no visible constructors. To create an InetAddress object, we use one of the available factory methods. Factory methods are merely a convention whereby static methods in a class return an instance of that class. This is done in lieu of overloading a constructor with various parameter lists when having unique method names makes the results much clearer.
Three commonly used InetAddress factory methods are shown here.
static InetAddress getLocalHost( ) throws UnknownHostException
static InetAddress getByName(String hostName) throws UnknowsHostException
static InetAddress[ ] getAllByName(String hostName)
throws UnknownHostException
The getLocalHost( ) method simply returns the InetAddress object that represents the local host. The getByName( ) method returns an InetAddress for a host name passed to it. If these methods are unable to resolve the host name, they throw an UnknownHostException.
On the internet, it is common for a single name to be used to represent several machines. In the world of web servers, this is one way to provide some degree of scaling. The getAllByName ( ) factory method returns an array of InetAddresses that represent all of the addresses that a particular name resolves to. It will also throw an UnknownHostException if it canâ„¢t resolve the name to at least one address. Java 2, version 1.4 also includes the factory method getByAddress( ), which takes an IP address and returns an InetAddress object. Either an IPv4 or an IPv6 address can be used.
Instance Methods
The InetAddress class also has several other methods, which can be used on the objects returned by the methods just discussed. Here are some of the most commonly used.
Boolean equals (Object other)- Returns true if this object has the same Internet address as other.
byte[ ] getAddress( )- Returns a byte array that represents the objectâ„¢s Internet address in network byte order.
String getHostAddress( )- Returns a string that represents the host address associated with the InetAddress object.
String getHostName( )- Returns a string that represents the host name associated with the InetAddress object.
boolean isMulticastAddress( )- Returns true if this Internet address is a multicast address. Otherwise, it returns false.
String toString( )- Returns a string that lists the host name and the IP address for conveneince.
Internet addresses are looked up in a series of hierarchically cached servers. That means that your local computer might know a particular name-to-IP-address mapping autocratically, such as for itself and nearby servers. For other names, it may ask a local DNS server for IP address information. If that server doesnâ„¢t have a particular address, it can go to a remote site and ask for it. This can continue all the way up to the root server, called InterNIC (internic.net).
TCP/IP Client Sockets
TCP/IP sockets are used to implement reliable, bidirectional, persistent, point-to-point, stream-based connections between hosts on the Internet. A socket can be used to connect Javaâ„¢s I/O system to other programs that may reside either on the local machine or on any other machine on the Internet.
There are two kinds of TCP sockets in Java. One is for servers, and the other is for clients. The ServerSocket class is designed to be a listener, which waits for clients to connect before doing anything. The Socket class is designed to connect to server sockets and initiate protocol exchanges.
The creation of a Socket object implicitly establishes a connection between the client and server. There are no methods or constructors that explicitly expose the details of establishing that connection. Here are two constructors used to create client sockets:
Socket(String hostName, int port) Creates a socket connecting the local host to the named host and port; can throw an UnknownHostException or anIOException.
Socket(InetAddress ipAddress, int port) Creates a socket using a preexisting InetAddress object and a port; can throw an IOException.
A socket can be examined at any time for the address and port information associated with it, by use of the following methods:
InetAddress getInetAddress( )- Returns the InetAddress associated with the Socket object.
int getPort( ) Returns the remote port to which this Socket object is connected.
int getLocalPort( ) Returns the local port to which this Socket object is connected.
Once the Socket object has been created, it can also be examined to gain access to the input and output streams associated with it. Each of these methods can throw an IOException if the sockets have been invalidated by a loss of connection on the Net.
InputStream getInputStream( )Returns the InputStream associated with the invoking socket.
OutputStream getOutputStream( ) Returns the OutputStream associated with the invoking socket.
TCP/IP Server Sockets
Java has a different socket class that must be used for creating server applications. The ServerSocket class is used to create servers that listen for either local or remote client programs to connect to them on published ports. ServerSockets are quite different form normal Sockets.
When we create a ServerSocket, it will register itself with the system as having an interest in client connections. The constructors for ServerSocket reflect the port number that we wish to accept connection on and, optionally, how long we want the queue for said port to be. The queue length tells the system how many client connection it can leave pending before it should simply refuse connections. The default is 50. The constructors might throw an IOException under adverse conditions. Here are the constructors:
ServerSocket(int port) Creates server socket on the specified port with a queue length of 50.
Serversocket(int port, int maxQueue)-Creates a server socket on the specified port with a maximum queue length of maxQueue.
ServerSocket(int port, int maxQueue, InetAddress localAddress)-Creates a server socket on the specified port with a maximum queue length of maxQueue. On a multihomed host, localAddress specifies the IP address to which this socket binds.
ServerSocket has a method called accept( ), which is a blocking call that will wait for a client to initiate communications, and then return with a normal Socket that is then used for communication with the client.
URL
The Web is a loose collection of higher-level protocols and file formats, all unified in a web browser. One of the most important aspects of the Web is that Tim Berners-Lee devised a scaleable way to locate all of the resources of the Net. The Uniform Resource Locator (URL) is used to name anything and everything reliably.
The URL provides a reasonably intelligible form to uniquely identify or address information on the Internet. URLs are ubiquitous; every browser uses them to identify information on the Web. Within Javaâ„¢s network class library, the URL class provides a simple, concise API to access information across the Internet using URLs.
Format
Two examples of URLs are http;//osborne and http:// osborne.com:80/index.htm.
A URL specification is based on four components. The first is the protocol to use, separated from the rest of the locator by a colon (Smile. Common protocols are http, ftp, gopher, and file, although these days almost everything is being done via HTTP. The second component is the host name or IP address of the host to use; this is delimited on the left by double slashes (/ /) and on the right by a slash (/) or optionally a colon (Smile and on the right by a slash (/). The fourth part is the actual file path. Most HTTP servers will append a file named index.html or index.htm to URLs that refer directly to a directory resource.
Javaâ„¢s URL class has several constructors, and each can throw a
MalformedURLException. One commonly used form specifies the URL with a string that is identical to what is displayed in a browser:
URL(String urlSpecifier)
The next two forms of the constructor breaks up the URL into its component parts:
URL(String protocolName, String hostName, int port, String path)
URL(String protocolName, String hostName, String path)
Another frequently used constructor uses an existing URL as a reference context and then create a new URL from that context.
URL(URL urlObj, String urlSpecifier)
The following method returns a URLConnection object associated with the invoking URL object. it may throw an IOException.
URLConnection openConnection( )-It returns a URLConnection object associated with the invoking URL object. it may throw an IOException.
JDBC
In an effort to set an independent database standard API for Java, Sun Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access mechanism that provides a consistent interface to a variety of RDBMS. This consistent interface is achieved through the use of plug-in database connectivity modules, or drivers. If a database vendor wishes to have JDBC support, he or she must provide the driver for each platform that the database and Java run on.
To gain a wider acceptance of JDBC, Sun based JDBCâ„¢s framework on ODBC. As you discovered earlier in this chapter, ODBC has widespread support on a variety of platforms. Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market much faster than developing a completely new connectivity solution.
JDBC Goals
Few software packages are designed without goals in mind. JDBC is one that, because of its many goals, drove the development of the API. These goals, in conjunction with early reviewer feedback, have finalized the JDBC class library into a solid framework for building database applications in Java.
The goals that were set for JDBC are important. They will give you some insight as to why certain classes and functionalities behave the way they do. The eight design goals for JDBC are as follows:
SQLevelAPI
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 JDBCâ„¢s complexities from the end user.
SQLConformance
SQL 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 is suitable for its users.
JDBC must be implemental on top of common database interfaces
The 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 Javaâ„¢s 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 simple

This 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 possible
Strong typing allows for more error checking to be done at compile time; also, less errors appear at runtime.
Keep the common cases simple
Because more often than not, the usual SQL calls used by the programmer are simple SELECTâ„¢s, INSERTâ„¢s, DELETEâ„¢s and UPDATEâ„¢s, these queries should be simple to perform with JDBC. However, more complex SQL statements should also be possible.

Class Diagram
5.2 Context Diagram
5.2.1 Route Request

Insert Cache Receive Request


Send Send
Request Path
5.2.2 Route Maintenance

Failure Ack Receive Data


Send Send
Data Ack

5.2.3 Message Transfer

Receive Ack Receive Data


Send Send
Data Ack
5.2.4 Cache Update

Receive Status


Send Update
Status Cache


5.3 Data Flow Diagram

A data flow diagram (DFD) is graphic representation of the "flow" of data through business functions or processes. More generally, a data flow diagram is used for the visualization of data processing. It illustrates the processes, data stores, external entities, data flows in a business or other system and the relationships between them
5.3.1 Route Request

5.3.2 Message Transfer
5.3.3 Route Maintenance
5.3.4 Cache Update

5.4 Architectural Design

The overall logical structure of the project is divided into processing modules and conceptual data structures is defined as Architectural Design.

6. System Testing

The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable fault or weakness in a work product. It provides a way to check the functionality of components, sub assemblies, assemblies and/or a finished product It is the process of exercising software with the intent of ensuring that the Software system meets its requirements and user expectations and does not fail in an unacceptable manner. There are various types of test. Each test type addresses a specific testing requirement.
Types of Tests

6.1 Unit testing

Unit testing involves the design of test cases that validate that the internal program logic is functioning properly, and that program input produce valid outputs. All decision branches and internal code flow should be validated. It is the testing of individual software units of the application .it is done after the completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform basic tests at component level and test a specific business process, application, and/or system configuration. Unit tests ensure that each unique path of a business process performs accurately to the documented specifications and contains clearly defined inputs and expected results.
6.1.1 Functional test

Functional tests provide systematic demonstrations that functions tested are available as specified by the business and technical requirements, system documentation, and user manuals.
Functional testing is centered on the following items:
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures : interfacing systems or procedures must be invoked.

6.1.2 System Test

System testing ensures that the entire integrated software system meets requirements. It tests a configuration to ensure known and predictable results. An example of system testing is the configuration oriented system integration test. System testing is based on process descriptions and flows, emphasizing pre-driven process links and integration points.
6.1.3 Performance Test

The Performance test ensures that the output be produced within the time limits,
and the time taken by the system for compiling, giving response to the users and request being send to the system for to retrieve the results.
6.2 Integration Testing
Software integration testing is the incremental integration testing of two or more integrated software components on a single platform to produce failures caused by interface defects.
The task of the integration test is to check that components or software applications, e.g. components in a software system or “ one step up “ software applications at the company level “ interact without error.
Integration testing for Server Synchronization:
Testing the IP Address for to communicate with the other Nodes
Check the Route status in the Cache Table after the status information is received by the Node
The Messages are displayed throughout the end of the application
6.3 Acceptance Testing

User Acceptance Testing is a critical phase of any project and requires significant participation by the end user. It also ensures that the system meets the functional requirements.
Acceptance testing for Data Synchronization:
The Acknowledgements will be received by the Sender Node after the Packets are received by the Destination Node
The Route add operation is done only when there is a Route request in need
The Status of Nodes information is done automatically in the Cache Updation process

7. Implementation

Implementation is the stage in the project where the theoretical design is turned Into a working system and is giving confidence on the new system for the users, which it will work efficiently and effectively. It involves careful planning, investigation of the current System and its constraints on implementation, design of methods to achieve the change over, an evaluation, of change over methods. Apart from planning major task of preparing the implementation are education and training of users. The more complex system being implemented, the more involved will be the system analysis and the design effort required just for implementation.
An implementation co-ordination committee based on policies of individual organization has been appointed. The implementation process begins with preparing a plan for the implementation of the system. According to this plan, the activities are to be carried out, discussions made regarding the equipment and resources and the additional equipment has to be acquired to implement the new system.
Implementation is the final and important phase, the most critical stage in achieving a successful new system and in giving the users confidence. That the new system will work be effective .The system can be implemented only after through testing is done and if it found to working according to the specification . This method also offers the greatest security since the old system can take over if the errors are found or inability to handle certain type of transactions while using the new system.
User Training
After the system is implemented successfully, training of the user is one of the most important subtasks of the developer. For this purpose user manuals are prepared and handled over to the user to operate the developed system. Thus the users are trained to operate the developed systems successfully in future .In order to put new application system into use, the following activities were taken care of:
Preparation of user and system documentation
Conducting user training with demo and hands on
Test run for some period to ensure smooth switching over the system.
The users are trained to use the newly developed functions. User manuals describing the procedures for using the functions listed on menu and circulated to all the users .it is confirmed that the system is implemented up to user need and expectations.
Security
The Administrator checks the path information and status information before the data transfer
Messages that are sent will receive the acknowledgements automatically if there is no page link failure after the message received by the Receiver Node
Failure of linkâ„¢s will automatically make updation in the Cache table to other nodes in the Network
We used two optimizations for our algorithm.
First, to reduce duplicate notifications to a node, we attach a reference list to each notification. The node detecting a page link failure is the root, initializing the list to be its notification list. Each child notifies only the nodes not in the list and updates the list
by adding the nodes in its notification list. The graph will be close to a tree.
Second, we piggyback a notification on the data packet that encounters a broken page link if that packet can be salvaged. When using the algorithm, we also use a small list of broken links, which is similar to the negative cache proposed in prior work, to prevent a node from being re-polluted by in-flight stale routes.

Conclusion

In this paper, we have investigated the performance degradation caused by such selfish (misbehaving) nodes in MANETs. We have proposed and evaluated a technique,
termed 2ACK, to detect and mitigate the effect of such routing misbehavior. The 2ACK technique is based on a simple 2-hop acknowledgment packet that is sent back by
the receiver of the next-hop link. Compared with other approaches to combat the problem, such as the overhearing technique, the 2ACK scheme overcomes several problems including ambiguous collisions, receiver collisions, and limited transmission powers. The 2ACK scheme can be used as an add-on technique to routing protocols such as DSR in MANETs.
We have presented the 2ACK scheme in detail and discussed different aspects of the 2ACK scheme. Extensive simulations of the 2ACK scheme have been performed to
evaluate its performance. Our simulation results show that the 2ACK scheme maintains up to 91 percent packet delivery ratio even when there are 40 percent misbehaving
nodes in the MANETs that we have studied. The regular DSR scheme can only offer a packet delivery ratio of 40 percent. The false alarm rate and routing overhead of the
2ACK scheme are investigated as well. One advantage of the 2ACK scheme is its flexibility to control overhead with the use of the Rack parameter.

References:

[1]. H. Miranda and L. Rodrigues, Preventing Selfishness in Open Mobile Ad Hoc Networks, Proc. Seventh CaberNet Radicals Workshop, Oct. 2002.
[2]. S. Marti, T. Giuli, K. Lai, and M. Baker, Mitigating Routing Misbehavior in Mobile Ad Hoc Networks, Proc. MobiCom, Aug. 2000.
[3]. D. Johnson, D. Maltz, Y.C. Hu, and J. Jetcheva, The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks (DSR), Internet draft, Feb. 2002.
Web Sites:
Java2s.com
Javaranch.com
Books Referred:
Core Java2, Pearson Education-2007, Cay S. Horstmann and Gary Cornell
Java2 “ Complete Reference-2007, Herbert Schild

Appendixes
Appendix A: Screen Shots

Code:
Appendix B: Sample Source Code
N1:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.net.*;
import java.util.*;
import java.io.*;
import java.sql.*;
public class N1 extends JFrame implements ItemListener
{
    // Variables declaration
    private JLabel title;
    private JTabbedPane Tab;
    private JButton exit;
    private JPanel contentPane;
    static JTextArea node1_Text;
    private JScrollPane jScrollPane3;
    private JPanel Node1;
    static JTextArea node2_Text;
    private JScrollPane jScrollPane4;
    private JPanel Node2;
    private JPanel Node3;
    // For Socket Communication
    public static boolean ack=false;
    JComboBox node_List;
    Socket N1_socket;
    ServerSocket N1_server;
    JLabel l1,l2;
    JButton send,clear;
    JTextField tf1;
    JScrollPane js;
    JTextArea message;
    JRadioButton jr;
    FileInputStream fis;
    int ch;
    String node2="",node4="";
    public int day;
    public String month="",year="",time="";
    public N1()
    {
        PathOne P=new PathOne();
        java.util.Timer t1=new java.util.Timer();
        t1.schedule(P,250);
        initializeComponent();
        try
        {
            fis=new FileInputStream("Node2.txt");
            while((ch=fis.read())!=-1)
                node2+=(char)ch;
            node2.trim();
            System.out.println("The Address of Node 2 is "+node2);
            fis=new FileInputStream("Node4.txt");
            while((ch=fis.read())!=-1)
                node4+=(char)ch;
            node4.trim();
            System.out.println("The Address of Node 4 is "+node4);
        }
        catch(Exception e)
        {
            System.out.println("File Read Exception "+e);
        }
        this.setVisible(true);
    }
    public void itemStateChanged(ItemEvent ie)
    {
        try
        {
            if(jr.getText().trim().equalsIgnoreCase("Node Active"))
            {
                jr.setText("Node Deactive");
                if(true)
                {
                    Socket statsoc = new Socket(node2, 2222);
                    DataOutputStream statdos = new DataOutputStream(statsoc.getOutputStream());
                    statdos.writeUTF("A");
                    statdos.writeUTF("False");
                    System.out.println("Send the status information to Node 2");
                    changeState("False");
                }
            }
            else
            {
                jr.setText("Node Active");
                if(true)
                {
                    Socket statsoc = new Socket(node2, 2222);
                    DataOutputStream statdos = new DataOutputStream(statsoc.getOutputStream());
                    statdos.writeUTF("A");
                    statdos.writeUTF("True");
                    System.out.println("Send the status information to Node 2");
                    changeState("True");
                }
            }
        }
        catch(Exception ee)
        {
            System.out.println(ee);
        }
    }
    private void initializeComponent()
    {
        title = new JLabel();
        Tab = new JTabbedPane();
        exit = new JButton();
        contentPane = (JPanel)this.getContentPane();
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        //-----
        node1_Text = new JTextArea();
        jScrollPane3 = new JScrollPane();
        Node1 = new JPanel();
        //-----
        node2_Text = new JTextArea();
        node1_Text.setText("                 Message Tranformation");
        node1_Text.append("\n"+"------------------------------------------------------------");
        node2_Text.setText("                 Message Tranformation");
        node2_Text.append("\n"+" -----------------------------------------------------------");
        jScrollPane4 = new JScrollPane();
        Node2 = new JPanel();
        //-----
        Node3 = new JPanel();
        
        title.setText("Mobile Ad-hoc Network");
        
        Tab.addTab("Node 1", Node1);
        Tab.addTab("Message", new MSG1());
        Tab.setMinimumSize(new Dimension(0, 17));
        Tab.setPreferredSize(new Dimension(0, 17));
        
        exit.setText("EXIT");
        exit.addActionListener(new ActionListener()
            {
            public void actionPerformed(ActionEvent e)
            {
                exit_actionPerformed(e);
            }
        });
        // components initialization
        l1=new JLabel("Destination Node");
        l2=new JLabel("Message");
        send=new JButton("SEND");
        clear=new JButton("CLEAR");
        node_List=new JComboBox();
        node_List.addItem("Node 2");
        node_List.addItem("Node 3");
        node_List.addItem("Node 4");
        jr=new JRadioButton("Node Active",true);
        jr.addItemListener(this);
        js=new JScrollPane();
        message=new JTextArea();
        js.setViewportView(message);
        //set position for components
            l1.setBounds(25,50,100,30);
        l2.setBounds(25,100,80,30);
        node_List.setBounds(135,50,100,20);
        js.setBounds(135,100,150,50);
        send.setBounds(50,180,80,30);
        clear.setBounds(140,180,80,30);
        jr.setBounds(100,230,150,30);
        // Add components in Node1 panel
        Node1.add(l1);
        Node1.add(l2);
        Node1.add(node_List);
        Node1.add(js);
        Node1.add(send);
        Node1.add(clear);
        Node1.add(jr);
        send.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                try
                {
                    String ch=getPath(getNodeName(String.valueOf(node_List.getSelectedItem()).trim()));
                    if(!ch.equals(""))
                    {
                        String sts=getState(getNodeName(String.valueOf(node_List.getSelectedItem()).trim()));
                        if(sts.equalsIgnoreCase("True"))
                        {
                        sendPacket(ch,String.valueOf(node_List.getSelectedItem()),message.getText());
                        }
                        else
                        {
                        JOptionPane.showMessageDialog(null,"Selected Node or Intermediate Node is Failured");
                        }
                    }
                    else
                    {
                    JOptionPane.showMessageDialog(null,"Required Path is not Avilable. Route Request Process Begins");
                    sendReq(getNodeName(String.valueOf(node_List.getSelectedItem()).trim()));
                    }
                }
                catch (Exception e1)
                {
                    System.out.println("send button catch  "+e1);
                }
            }
        });
        clear.addActionListener(new ActionListener()
            {
            public void actionPerformed(ActionEvent e)
            {
                message.setText("");
                //node_List.setText("");
            }
        });
        contentPane.setLayout(null);
        //contentPane.setBackground(new Color(204, 204, 255));
        addComponent(contentPane, title, 163,25,200,20);
        addComponent(contentPane, Tab, 9,57,556,377);
        addComponent(contentPane, exit, 253,450,83,28);
        TextArea3
        jScrollPane3.setViewportView(node1_Text);
        Node1.setLayout(null);
        Node1.setBorder(BorderFactory.createEtchedBorder());
        addComponent(Node1, jScrollPane3, 306,39,234,260);
        node2_Text.setMaximumSize(new Dimension(32767, 32767));
        jScrollPane4.setViewportView(node2_Text);
        Node2.setLayout(null);
        Node2.setBorder(BorderFactory.createEtchedBorder());
        addComponent(Node2, jScrollPane4, 255,41,283,218);
        Node3.setLayout(null);
        Node3.setBorder(BorderFactory.createEtchedBorder());
        
        this.setTitle("MANET");
        this.setLocation(new Point(0, 0));
        this.setSize(new Dimension(600, 517));
    }
    /** Add Component Without a Layout Manager (Absolute Positioning) */
    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 exit_actionPerformed(ActionEvent e)
    {
        System.exit(0);
        
    }
    
    public void Display(String Dest,String Msg,String Path)
    {
        node1_Text.append("\n"+"Destination ::  "+Dest);
        node1_Text.append("\n"+"Path ::  "+Path);
        node1_Text.append("\n"+"Message ::  "+Msg);
        getTime();
        node1_Text.append("\n"+"Transfered Date :: "+day+":"+month+":"+year);
        node1_Text.append("\n"+"Transfered Time :: "+time);
    }
public void sendPacket(String path,String node,String message)throws Exception
{
    String dest_node=node.trim();
    String route=path.trim();
    String msg=message.trim();
    Display(dest_node,msg,route);
    int outgoing=0;
    if(!node.equals(""))
    {
        if(!msg.equals(""))
        {
            if(!route.equals(""))
            {
                String nodeinfo="";
                int p=0;
                System.out.println("The Route for Message Transfer "+route);
                String r=route.substring(route.lastIndexOf('A')+2,route.lastIndexOf('A')+3);
                System.out.println("The Next Node for Message Transfer "+r);
                if(r.equalsIgnoreCase("B"))
                {
                    nodeinfo=node2;
                    p=6676;
                }
                else
                {
                    nodeinfo=node4;
                    p=6678;
                }
                System.out.println("The Selected Node "+nodeinfo+" and Port "+p);
                dest_node=getNodeName(dest_node);
                n1_client=new Socket(nodeinfo,p);
                DataOutputStream out= new DataOutputStream(n1_client.getOutputStream());
                String msg1=route+"`"+message;
                out.writeUTF(msg1);
                outgoing++;
                JDBC.updatePacket(dest_node,outgoing,1);
                getAck();
        }
        else
        {
            JOptionPane.showMessageDialog(this,"Failed To Getting Route");
        }
    }
    else
    {
        JOptionPane.showMessageDialog(this,"Empty Message Cannot Send");
    }
    }
    else
    {
        JOptionPane.showMessageDialog(this,"Select Destination Node ");
    }
    
}
public void getAck()
{
    try
    {
    in=new DataInputStream(n1_client.getInputStream());
    System.out.println(in.readUTF()+"\n");
    }
    catch (Exception e)
    {
        System.out.println(e);
    }
}
public String getState(String node)
{
    String sts="False";
    try
    {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con1 =DriverManager.getConnection("jdbc:odbc:DSR","sa","");
         Statement st=con1.createStatement();
         ResultSet rs=st.executeQuery("select Route_sts from Cache1 where Dest='"+node+"' and Route_Sts = 'True'");
         if(rs.next())
        {
             sts=rs.getString(1);
        }
    }
    catch(Exception e)
    {
        System.out.println(e);
    }
    return sts;
}
public void changeState(String sts)
{
    try
    {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con1 =DriverManager.getConnection("jdbc:odbc:DSR","sa","");
         Statement st=con1.createStatement();
         st.executeUpdate("Update Cache1 set Route_Sts = '"+sts+"'");
    }
    catch(Exception e)
    {
        System.out.println(e);
    }
}
public String getPath(String p)
{
    String b="";
    try
    {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con1 =DriverManager.getConnection("jdbc:odbc:DSR","sa","");
         Statement st=con1.createStatement();
         ResultSet rs=st.executeQuery("select Path from Cache1 where Dest='"+p.trim()+"' and Route_Sts = 'True'");
         if(rs.next())
        {
            b=rs.getString(1);
        }
    }
    catch (Exception e)
    {
        System.out.println(e);
    }
    if(!b.equals(""))
    {
        System.out.println("Source:  A");
        System.out.println("Destination:  "+p);
        System.out.println("Path Retrived:   "+b);
    }
    return b;
}
public String getNodeName(String node)
{
    String ch=node.trim();;
        if(ch.equals("Node 2"))
        {
            ch="B";
        }
        else if(ch.equals("Node 3"))
        {
            ch="C";
        }
        else if(ch.equals("Node 4"))
        {
            ch="D";
        }
    return ch;
}
public void getTime()
{
    java.util.Date d = new java.util.Date();
    String str=d.toString();
    String array[]=str.split(" ");
    day =d.getDate();
    month =array[1];
    year=array[5];
    time=array[3];
}
public void sendReq(String node)
{
    Socket s;
    DataInputStream dis;
    DataOutputStream dos;
    try
    {
        if(!node.equals(""))
       {
            while(true)
           {
                s=new Socket(node2,9996);
                System.out.println("Request to Path Two Server...");
                dos=new DataOutputStream(s.getOutputStream());
                dos.writeUTF(node);
                dis=new DataInputStream(s.getInputStream());
                String path2=dis.readUTF();
                if(!path2.equalsIgnoreCase("No Path"))
                {
                    if(node.equalsIgnoreCase("B"))
                    {
                        path2="A&"+path2;
                        path2=path2.trim();
                    }
                    System.out.println("Path is going to insert in the table"+path2);
                    boolean b=JDBC.insertCache("insert into  Cache1 values('"+node+"','"+path2+"',0,'True')");
                    if(b)
                    {
                        JOptionPane.showMessageDialog(null,"New Route is added in Cache Table");
                    }
                    else
                    {
                        JOptionPane.showMessageDialog(null,"Cache Updation Failed");
                    }
                  }
                  else
                  {
                    JOptionPane.showMessageDialog(null,"The Requested Node is Failed");
                  }
                System.out.println("Send the Route Request to Node 4");
                s=new Socket(node4,9998);
                System.out.println("Request to Path Four Server...");
                dos=new DataOutputStream(s.getOutputStream());
                dos.writeUTF(node);
                dis=new DataInputStream(s.getInputStream());
                path2=dis.readUTF();
                if(!path2.equalsIgnoreCase("No Path"))
                {
                        if(path2.equalsIgnoreCase("D"))
                        {
                            path2="A&"+path2;
                            path2=path2.trim();
                        }
                        System.out.println("Path is going to insert in the table"+path2);
                        boolean b=JDBC.insertCache("insert into  Cache1 values('"+node+"','"+path2+"',0,'True')");
                        if(b)
                        {
                            JOptionPane.showMessageDialog(null,"New Route is added in Cache Table");
                            break;
                        }
                        else
                        {
                            JOptionPane.showMessageDialog(null,"Cache Updation Failed");
                        }
               }
               else
               {
                    JOptionPane.showMessageDialog(null,"The Requested Node is Failed");
               }
                s.close();
                break;
           }
       }
       else
       {
       }
   }
   catch (Exception e)
   {
       System.out.println(e);
   }
}
Socket n1_client;
ServerSocket n1_server;
DataOutputStream out;
DataInputStream in;
    public static void main(String[] args)
    {
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);
        new N1();
        //Node1_Server node=new Node1_Server();
        //node.receive();
        new    MsgServer1();
    }
}
PathOne:
import java.net.Socket;
import java.net.ServerSocket;
import java.io.*;
import java.sql.*;
class PathOne extends java.util.TimerTask
{
    ServerSocket path_ss;
    Socket path_s;
    DataInputStream p_dis;
    DataOutputStream p_dos;
    String p_rcv="";
    String p_rep="";
    PathOne()
    {
        //runMethod();
    }
    public void run()
    {
        try
        {
            path_ss=new ServerSocket(9995);
            System.out.println("Path One Server Listening in the Port 9995....");
            while(true)
            {
                path_s=path_ss.accept();
                p_dis=new DataInputStream(path_s.getInputStream());
                p_rcv=p_dis.readUTF().trim();
                p_dos=new DataOutputStream(path_s.getOutputStream());
                
                if(!getPath(p_rcv).equals(""))
                {
                    p_dos.writeUTF(getPath(p_rcv));
                }
                else if(getPath(p_rcv).equals(""))
                {
                    p_dos.writeUTF("No Path");
                }
                else
                    p_dos.writeUTF("A");
            }
        }
        catch (Exception e)
        {
            System.out.println(e);
        }
    }
    public String getPath(String a)
    {
        String path="";
        try
        {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con=DriverManager.getConnection("jdbc:odbc:DSR","sa","");
            Statement st=con.createStatement();
            ResultSet rs=st.executeQuery("select Path from Cache1 where Dest='"+a.trim()+"' and Route_Sts = 'True'");
            while(rs.next())
            {
                path=rs.getString(1);
            }
        }
        catch (Exception e)
        {
            System.out.println(e);
        }
        return path;
    }
    public static void main(String args[])
    {
        new PathOne();
    }
}
[attachment=3946]
Contents
S.No Particulars Page No
1
2
3
4
5
6
7
8
9
10
11
Introduction
1.1 Abstract
Organization Profile
System Analysis
3.1 Existing System
3.2 Proposed System
3.3 Implementation Plan
Problem Formulation
4.1 Objectives
4.2 Software Requirement Specifications
4.3 Software Description
System Design
5.1 Design Overview
5.2 Context Diagram
5.3 Data Flow Diagram
System Testing
6.1 Unit Testing
6.2 Integration Testing
6.3 Acceptance Testing
Implementation
Conclusion
Bibliography
Appendixes
Appendix A: Screen Shots
Appendix B: Source Code
Reply
#3
hi thnx for this proj..
how abt performance analysis part in this project..
need to compare with the DSR and to show in the graph comparing with the 2ack scheme..
plz can u guide regarding such..
thank you..
Reply
#4
want interfaces for this project
Reply
#5
please mail me the following attached requirements
Reply
#6
need uml diagrams about this project plz make it as early as possible
Reply
#7
I need completing coding for this project because i am getting errors with the code i have, please send me the code.I have submission in coming two days..
i am more thankful those who will post the complete coding

MY E-MAIL ID: bharani_kumar2007[at]yahoo.co.in





Reply
#8

does anyone has the same project done in ns2
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: manets football, iterate resultset jdbc, java6 resultset getint, berkeley economics, acknowledgement based routing misbehavior detection in manet project, bidirectional routing in manets, electromyography in slash,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Opportunistic Routing in Multi-radio Multi-channel Multi-hop Wireless Networks seminar class 4 3,542 17-10-2017, 02:48 PM
Last Post: jaseela123d
  A Link-Based Cluster Ensemble Approach for Categorical Data Clustering 1 1,062 16-02-2017, 10:51 AM
Last Post: jaseela123d
  SUSPICIOUS EMAIL DETECTION seminar class 11 7,774 21-04-2016, 11:16 AM
Last Post: dhanabhagya
  DATA LEAKAGE DETECTION project topics 16 13,002 31-07-2015, 02:59 PM
Last Post: seminar report asees
  An Acknowledgement-Based Approach for the Detection of routing misbehavior in MANETs mechanical engineering crazy 2 2,941 26-05-2015, 03:04 PM
Last Post: seminar report asees
  Design and Implementation of TARF: A Trust-Aware Routing Framework for WSNs Projects9 6 3,510 10-01-2015, 11:13 PM
Last Post: Guest
  A PROACTIVE APPROACH TO NETWORK SECURITY nit_cal 1 2,241 19-09-2014, 12:52 AM
Last Post: [email protected]
  Credit Card Fraud Detection Using Hidden Markov Models alagaddonjuan 28 20,504 04-09-2014, 11:31 PM
Last Post: Charlescic
  Digital Image Processing Techniques for the Detection and Removal of Cracks in Digiti electronics seminars 4 4,855 22-07-2013, 09:37 PM
Last Post: Guest
  OBSTACLE DETECTION AND AVOIDANCE ROBOT seminar surveyer 5 7,506 24-06-2013, 10:44 AM
Last Post: computer topic

Forum Jump: