# Introduction ireless communication nowadays surrounds us in many colors and flavors, each with its specific frequency band, coverage, and variety of applications. It has matured to a large volume, and standards have advanced for personal area Networks, local area Networks in addition to Broadband wireless access. In Ad-Hoc networks, every node is inclined to forward data to different nodes, and so the determination of which nodes forward data is made dynamically based totally on the network connectivity. Minimum configuration and brief deployment make Ad-Hoc networks suitable for emergency situations like natural or human-caused disasters, navy conflicts, emergency medical situations and many others. # a) Routing in Ad Hoc Networks Mobile ad-hoc Networks alternate their topology frequently and without previous observe makes packet routing in ad-hoc networks a difficult assignment. The cautioned procedures for routing can be divided into topology-based and position-based routing. Fig 1 .1 represents the right category of ad-hoc routing Algorithms. Topology -based routing protocols use the information about the links that exist in the network to carry out packet forwarding. They may be further divided into proactive, reactive, and hybrid strategies. Proactive algorithms rent classical routing strategies which include distance-vector routing (e.g., DSDV) or link-state routing (e.g., OLSR and TBRPF). They preserve routing facts about the available paths within the network even though those paths are not presently used. In response to this observation, reactive routing protocols had been evolved (e.g., DSR, TORA, and AODV). Reactive routing protocols maintain only the routes which are presently in use, thereby decreasing the load at the network when most effective a small subset of all available routes is in use at any time. however, they nonetheless have a few inherent barriers. Hybrid ad-hoc routing protocols along with ZRP integrate local proactive routing and international reactive routing with the intention to obtain a higher level of efficiency and scalability. Position-based routing algorithms remove a number of the constraints of topology-based routing by using extra information. as a result does now not require the establishment or maintenance of routes. The nodes have neither to store routing tables nor to transmit messages to maintain routing tables updated. As an in addition benefit, position-based routing supports the delivery of packets to all nodes in a given geographic region in a natural way. This kind of provider is referred to as geocasting. # b) Attacks on Ad Hoc Networks Wireless the structure of an Ad-Hoc network, or lack thereof, leads to a few special kinds of attacks. Especially attacks at the connectedness of the network which means that attacks on the routing protocol. A number of those attacks are Routing Loop, Black hole, gray hole, Partitioning, Blackmail, Wormhole, rushing attack, resource consumption, dropping Routing traffic, location disclosure and so forth. # c) Security Model and Attributes The sector of security is big and a few model to apply for attacking the problem is needed. Some of the attributes need to be considered for classifying the one of kind security desires of the applications of an Ad-Hoc network. Which can be Confidentiality, Authentication, Availability, Integrity, Non-Repudiation, fact of discovery, Isolation, lightweight computations, location, Self, Byzantine robustness and many others. # d) Security of Ad-Hoc Networks Security vulnerabilities in ad-hoc networks are: Limited computational capabilities: generally, nodes in ad-hoc networks are modular, independent, and restricted in computational functionality and consequently can also grow to be a source of vulnerability after they take care of public-key cryptography at some point of normal operation. Limited power supply: due to the fact nodes generally use the battery as power supply, an interloper can exhaust batteries by developing extra transmissions or excessive computations to be performed by means of nodes. Challenging key management: Dynamic topology and movement of nodes in an Ad Hoc network make key control difficult if cryptography is used within the routing protocol. # II. Review of Literature Farid Bin Beshr et.al (2016), reveal about Adopting Intrusion Detection system (IDS) that allows the routing protocol to avoid misbehavior nodes and links. The IDS have to characteristic low overhead controlling packet, excessive accuracy degree and low price of both false alarms and missed detection rate. The proposed system primarily based on assigning a few nodes called "guard nodes" the obligation of overhearing and reporting the misbehaving nodes. The scheme is proposed to conquer the majority of the drawbacks related to the Watchdog strategies. [1] Chinthanai Chelvan.k et.al (2014), describes EAACK(enhanced Adaptive Acknowledgement) demonstrates better malicious-behavior-detection rates in positive instances while does not greatly have an effect on the network performances. The Intrusion Detection systems named EAACK protocol in particular designed for MANETs and compared to different famous mechanisms includes, Watchdog scheme .The effects confirmed positive performances towards Watchdog in the cases of receiver collision and fake misbehavior record. [2] A Al-Roubaiey et.al(2010) illustrates Adaptive ACKnowledgment (AACK), for fixing great issues: the limited transmission power and receiver collision. This mechanism is an enhancement to the TWOACK scheme where its detection overhead is decreased even as the detection efficiency is increased. The AACK mechanism may not work well on long paths with the intention to take a significant time for the end to end acknowledgments. This problem will deliver the misbehaving nodes more time for losing more packets. [3] P.Nandhini Sri et.al (2016) decides that during this selfish node detection, data packet transmission among the nodes the routing path is mounted and maintained so long as it's far wished and routing overhead is substantially decreased. The simulation end result shows that the detection of the selfish node with a massive delay. Therefore shortcut tree routing (STR) ( ) E protocol has been proposed in future work that is used for improving the overall performance of the selfish node and also route discovery overhead with low memory consumption and it provides the most appropriate routing path. [4] Usha Sakthivel et.al (2011) finds out's selfish behavior of a node impacts the throughput of the network. The nodes may additionally choose a back down value of shorter duration. An algorithmic technique for misbehaving node detection and isolation in ad hoc networks by way of enhancing the protocol getting used inside the lower layers which consequently improves the performance of the network have been proposed. Similarly, studies can verify the practicality of the proposed concept. [5] Kashyap Balakrishnan et.al (2005) defines network-layer acknowledgment-based schemes, termed the TWOACK and the S-TWOACK schemes, which can be honestly introduced-on to any source routing protocol. The TWOACK scheme detects such misbehaving nodes, after which seeks to relieve the problem with the aid of notifying the routing protocol to keep away from them in future routes. The schemes detect selfish nodes (links) so that other nodes may also avoid them in future route selections, with the goal of universal improvement in end-to-end packet delivery ratio. [6] Suganya.N.R et.al(2013) evaluates, from the angle of reproduction allocation, we have a look at the effect of selfish nodes in a mobile ad hoc network that is termed as selfish replica allocation. In our method, every node computes credit risk facts on different related nodes personally to appraise the degree of selfishness. Our method can detect two unique kinds of routing manipulation even as keeping a low rate of false positives when showing the simulation effects. [7] Rasika Mali et.al (2015) present different techniques for detection of misbehavior of nodes such as Watchdog, ExWatchdog, TWOACK, S-TWOACK, 2ACK and Adaptive ACKnowledgment (AACK), CONFIDANT, Record and Trust Based Detection. All techniques are analyzed with parameters like type of misbehavior, key mechanism used, advantages, limitations an performance evaluation using Packet Delivery Ratio (PDR) and throughput. Still the problem of receiver collision, limited transmission power and partial dropping are unsolved. [8] III. Misbehaving Node Detection in ANET An individual mobile node can also attempt to benefit from other nodes, however, refuse to proportion its own resources. Such nodes are known as selfish or misbehaving nodes and their behavior is termed selfishness or misbehavior. One of the main sources of energy consumption inside the mobile nodes of MANETs is wireless transmission. A selfish node can also refuse to forward data packets to other nodes that allow you to conserve its very own energy. # a) Misbehavior Detection and Mitigation To mitigate the unfavorable consequences of routing misbehavior, the misbehaving nodes need to be detected in order that these nodes can be avoided with the aid of all properly-behaved nodes. on this paper, we attention on the subsequent problem. i. Resurrecting Duckling This mechanism can be adapted for node authentication in ad-hoc wireless networks. During the imprinting technique, the devices can trade cryptographic keys for signing messages. it is able to be possible to use the resurrecting ducking method to enforce a key distribution protocol to be used with IP sec or another security protocol. ii. Packet Dropping The concept of packet dropping committed via the misbehaving nodes. There are kinds of packet dropping carried out by using the misbehaving nodes, simple dropping, and selective dropping. As pointed out earlier than, the simple dropping is typically devoted to the aid of the selfish node, whilst the malicious node includes both simple dropping and selective dropping. In simple dropping, the misbehaving nodes drop all of the packets now not to or from them; even as in selective dropping, the misbehaving nodes only drop data packets no longer to or from them while forwarding the control packets, including route request, route reply, and many others. iii. Packet Misrouting Within the MANET, a malicious node can misroute the data packets to its colluding partner or a randomly selected destination with the intention to mount further attacks to the networks or disrupt the regular communication. Throughout the detection process, the detection hardware can pay no attention to the destinations which receive misrouted data packets. All that the detection hardware cares is the misbehaving node misrouting data packets. If the detection hardware identifies that the node is committing packet misrouting, it's going to send out the warning message. # IV. Proposed Methodology The proposed system is used to detect the misbehavior routing using 2ACK and additionally take a look at the confidentiality of the data message in MANETs environment. here, we used a scheme referred to as 2ACK scheme, wherein the destination node of the following hop link will send lower back a 2 hop acknowledgment known as 2ACK to suggest that the data packet has been acquired efficiently. The proposed work (2ACK with confidentiality) is as follows. ? If the 2ACK time is much less than the wait time and the original message contents are not altered at the intermediate node then, a message is given to sender that the link is working well. ? If the 2ACK time is more than the wait time and the unique message contents are not altered on the intermediate node, then a message is given to sender that the link is misbehaving. ? If the 2ACK time is more than the wait time and the original message contents are altered at the intermediate node, then the message is given to sender that the link is misbehaving and confidentiality is lost. ? If the 2ACK time is less than the wait time and the original message contents are altered at the intermediate node then, a message is given to sender that the link is working properly and confidentiality is lost. At the destination, a hash code can be generated and in comparison with the sender's hash code to test the confidentiality of the message. Consequently, if the link is misbehaving, sender to transmit messages will now not use it in future and loss of packets may be avoided. # a) System Model In the existing system, there is a possibility that when a sender chooses an intermediate link to send some message to destination, the intermediate link may give problems such as the intermediate node may not forward the packets to destination, it may take very long time to send packets or it may modify the contents of the packet. In MANETs, as there is no retransmission of packets once it is sent, hence care is to be taken that packets are not lost. Noting that a misbehaving node can either be the sender or the receiver of the next-hop link, we have focused on the problem of detecting misbehaving links instead of misbehaving nodes using 2ACK scheme. In the next-hop link, a misbehaving sender or a misbehaving receiver has a similar adverse effect on the data packet. It will not be forwarded further. The result is that this link will be tagged. Our approach is used to discuss the significant simplification of the routing detection mechanism and also checking the confidentiality of the message in MANETs environment. Module 1: Sender module (Source node). The task of this module is to read the message and then divide the message into packets of 48 bytes in length, send the packet to the receiver through the intermediate node and receive the acknowledgement from the receiver node through the intermediate node. After sending every packet the "Cpkts" counter is incremented by 1. 2ACK time is compared with the wait time. If 2ACK is less than the wait time, "Cmiss" counter is incremented by 1. The ratio of "Cmiss" to "Cpkts" is compared with the "Rmiss" (a threshold ratio). If it is less than "Rmiss", the link is working properly otherwise misbehaving. Module 2: Intermediate module (Intermediate node). The task of this module is to receive a packet from the sender, alter/don't alter the message and send it to the destination. Get 2ACK packet from the receiver and send 2ACK packet to the sender. Module 3: Receiver module (Destination node). The task of this module is to receive a message from the intermediate node, take out destination name and hash code and decode it. Compare the hash code of source node and the destination node for security purpose. Send 2ACK to source through the intermediate node. # b) Algorithm of 2ACK Scheme and Ant Implementation We have used the triplet of N1 ? N2 ? N3 as an example to illustrate 2ACK's pseudo code. Where N1 is assumed as the source node, N2 is the intermediate node and N3 is the destination node. Note that such codes run on each of the sender/receivers of the 2ACK packets. Nomenclature: {Cpkts = the number of the message packets sent, Cmiss = the number of the 2ACK packets missed, d = the acknowledgment ratio. WT = waiting time, i.e., the maximum time allotted to receive 2ACK packet} # Global Journal of Computer Science and Technology Volume XVIII Issue I Version I Take out destination name and hash code; Decode the message; Send 2ACK packet to N2; end iv. Ant N1 and N3 parallel while (true) do if ((Cmiss/Cpkts)>d and (hash code of source msg) ! = (hash code of destination msg)) then Link is misbehaving and the confidentiality is lost; end if ((Cmiss/Cpkts)d and (hash code of source msg) =(hash code of destination msg)) then Link is misbehaving; end if ((Cmiss/Cpkts)