Angle and Context Free Grammar Based Precarious Node Detection and Secure Data Transmission in MANETs

Growing attractiveness of Mobile Ad Hoc Networks (MANETs), its features, and usage has led to the launching of threats and attacks to bring negative consequences in the society. The typical features of MANETs, especially with dynamic topology and open wireless medium, may leave MANETs vulnerable. Trust management using uncertain reasoning scheme has previously attempted to solve this problem. However, it produces additional overhead while securing the network. Hence, a Location and Trust-based secure communication scheme (L&TS) is proposed to overcome this limitation. Since the design securing requires more than two data algorithms, the cost of the system goes up. Another mechanism proposed in this paper, Angle and Context Free Grammar (ACFG) based precarious node elimination and secure communication in MANETs, intends to secure data transmission and detect precarious nodes in a MANET at a comparatively lower cost. The Elliptic Curve function is used to isolate a malicious node, thereby incorporating secure data transfer. Simulation results show that the dynamic estimation of the metrics improves throughput by 26% in L&TS when compared to the TMUR. ACFG achieves 33% and 51% throughput increase when compared to L&TS and TMUR mechanisms, respectively.


Introduction
Mobile Ad Hoc Networks (MANETs) embrace various computational nodes that can communicate with one another within a specified wireless range. The most favoured feature of MANETs is their capability to allow communication during node mobility. However, the shared wireless medium of MANET facilitates inactive and adversarial eavesdropping on data communications, where adversaries can start various overwhelming attack on the network. Many protocols have been designed for protecting the wireless communication but do not grant significance in privacy protection and leave mobile nodes to be noticeable by wireless analysis. Secure data transmission in MANET is thus a very challenging task. An example MANET is shown in Figure 1.
To overcome this problem, two strategies are proposed and evaluated in this paper, Location and Trust-based secure communication scheme (L&TS) and Angle and Context Free Grammar (ACFG) based precarious node detection and secure communication in MANETS.
Firstly, a Location and Trust-based secure communication scheme assigns algorithms for data integrity based on how far the nodes are located from one another. The next hop is selected based on the trust. A trust value is calculated based on the previous network operations for effective next hop selection, which makes this scheme work efficiently even under high mobility conditions. A design limitation identified in this scheme has motivated us in the design of ACFG scheme for MANETs.
In ACFG scheme, the next hop is selected based on a node's angle and a node's left most and right most derivations. There are three levels of assessment: first the node's location is assessed using the angle method, followed by the CFG to detect which node among the neighbors has faked the location; the last confirmation using an elliptic cryptography function is achieved to publish that a node is malicious. In this scheme, there is no requirement for extraordinary nodes for the localization process or for other special purposes. Hence, it provides better performance when compared to L&TS mechanism. The organization of the paper is, thus, related works following Introduction, the proposed methods, and simulation analysis.

Related Work
The works related to the mechanism proposed here are broadly classified based on security, location, and Angle and Context Free Grammar (CFG) used as estimation parameters while routing.

Security.
Many protocols have improved security using different aspects in the literature. The ad hoc networks are classified into three types: open, managed-open, and managed-hostile, dissimilar in the safety requirement. SPAAR is one protocol that aims to provide security in a managed-hostile environment, which is described as a MANET created using military nodes in a battle situation [1]. Secure Routing Protocol (SRP) [2], on the other hand, needs a security association across end nodes assuring that they can differentiate and drop reply messages giving any fake information or even stop receiving the same. This is achieved by employing and using a shared secret to the main routing protocol, for example, AODV. The trust based routing protocols [3,4] are assigned trusted values and the data are routed only through trusted nodes.
Selection of security scheme for every data packet and management of the same is a tedious and expensive process [5]. In the Authenticated Anonymous Secure Routing (AASR) [6] the RREQ packets are legitimated using group signatures and to preserve vigorous attacks from unveiling the node distinctiveness. The key-encrypted onion routing containing a route secret verification message prevents the nodes from avoiding misinterpretation of a genuine intention. Provision of high anonymity and security is considered an advantage. However, there is enormous packet delay during data transmission. The sensors' decision reports are used to discover the malicious nodes and estimate their attack behaviour. The detection procedure is analyzed using the entropy-defined trust model [7]. [8] depends on the received signal strength. A node confirms the truthfulness of the other node by predicting its next geographical localizations and checks the similarity to the actual localizations found. A node confirms the truthfulness of the other node by predicting its next geographical localizations and checks the similarity to the actual localizations found in Efficient Mobility Based Localization (EMBL) [9]. During the localization method, each node predicts its future mobility pattern according to its past known location information. However, there is poor accuracy in predicting the real and estimated node positions, and distances from a reference node. Ordinary nodes among anchor nodes and unknown nodes build a shortest path by greedy approach [10]. This shortest path is approximately a straight line between unknown nodes and reference nodes. The disadvantage of this algorithm is the poor accuracy when there are too many routers.

Location. Localization verification technique
In Modified Parametric Location Identification (MPLI) [11], location is identified separately using the and coordinates, angle of arrival, time, distance, and circular region quadrants. It also provides timely updates of positions to make the routing more robust and position aware to avoid data losses and connection termination due to mobility. Multihop Localization Algorithm (MLA) [12] has five steps as follows: (1) achieving neighbor distances, (2) calculating reference node distances (unidentified nodes can estimate the total distances to nodes with the data obtained from step 1, and they decide the shortest paths to anchor), (3) choosing the reference nodes, (4) acquiring angles, and (5) fitting the shortest path to straight line.

Angle.
Decoupled Maximum Likelihood (DEML) angle estimator determines the angle of arrival [13]. The DEML The Scientific World Journal 3 estimator is no longer asymptotically statistically proficient. Angular Routing Protocol (ARP) [14] based on position that uses an improved geographic forwarding to route packets to the destination. The geographic forwarding fails, at a time used by the angle-based forwarding method. It does not require establishing routes. The indefinite node estimates its angle to each of the three reference nodes, based on these angles, and the positions of the reference nodes (that form a triangle), and computes its own position using simple trigonometrical relationships [15]. The triangular zone [16] is used to reduce the route searching space. This mechanism avoids huge routing traffic and collision.
The angle is found based on slope of line. Slope values are found in all neighboring nodes [17]. The angles between unidentified node and several fixed nodes are used in the AOA (angle of arrival) [18] to evaluate the position, which is a little costly to perform. Orthomorphic Analyst -Nearest Neighbor method [19] detects the intrusion activity based on the traffic intensity at inner boundary instance within the communication MANETs. Angle based distance is measured between the node points for easy detection of traffic creating nodes. It measures how far each pair of mobile nodes is and evaluates correct angle of position within the inner boundary.

CFG.
One-time authentication information [20] discussed structured and unstructured techniques for generating strings and analyses of the difficulty of guessing strings in such a language. This authentication information is used for the generation of one-time passwords. This one-time authentication information is still inclined to operate in the middle attacks. Probabilistic Context Free Grammars (PCFGs) [21] recognized events from raw sensor network measurements. It derived a brief probabilistic Context Free Grammar from the known examining data. A metric depending on Bayesian formula for maximizing grammar, a posteriori probability given the training data, is used here. Advantages of the properties are the chunk and merge operations.
Translate natural language sentence into database query NLDBI (Natural Language Interface to a Database) structure [22] including its probabilistic Context Free Grammar, it is used to construct the parse tree, and this algorithm calculates the probabilities. CFG has a formalization capability in describing most sentence structures and so well formed that efficient sentence parser.
Trust management system enhances the protection in MANETs [18]; the trust model has trust from direct and indirect observations. In direct observation, the trust value is derived using Bayesian inference; it is a type of uncertain reasoning where the full probability model can be defined. In indirect observation, the trust value is derived using the Dempster-Shafer theory; it is another type of uncertain reasoning where the proposition of interest can be derived.
This method separates data packets and control packets and mitigates factors that cause packet losses. After examination of the trust value, there is a possibility for the inside attackers to conquer the other nodes. In such a situation, the Location and Trust-based secure communication scheme is used to provide security in MANETs.

Location and Trust-Based Secure Communication Scheme (L&TS)
The proposed scheme provides a technique to manage and use different security schemes in a single MANET simultaneously. It uses the security algorithms available as security providers based on how far the nodes are located from the corresponding destination nodes. The security schemes are known in prior to the nodes operating in the MANET. Each node chooses its own security algorithm based on how far the destination is located and sends the data to the destination. This is performed with an understanding that the farthest nodes or the nodes that require multihop transmission require higher security than nodes that are closer to each other and are capable of direct transmission.

3.1.
Working of the Scheme. The actual working of the scheme can be divided into the following processes: Data Collection, L&TS Management, Selection of Security Algorithm, and Data Transmission. The architectural working of the L&TS in MANETs is described in Figure 2.

Data Collection.
Each node in the MANET sends a route request RREQ message along with the location information in order to transmit data to its destination. In return, it receives a route reply RREP message that also contains the location information of the destination. The information about the most recent transmissions for that node is collected from every node as well.

L&TS Management.
An arbitrary manager called the L&TS manager processes the information collected. Based on the location information of the source and destination the distance between them is calculated dynamically and compared with threshold values th 1 , th 2 , and th 3 (in this case) and it can go up to th . The trust values ( ) are also assigned based on the most recent transmissions.

Selection of Security Algorithm.
A number of security algorithms (i.e., RSA + MD5; HMAC + MD5; and HMAC + SHA-1) are stored in a database and based on the comparison of the L&TS manager, a particular transmission is assigned Algorithm . For example, if value is less than th 1 then Algorithm 1 is selected; if it is less than th 2 , then Algorithm 2 is selected, and so on up to Algorithm . It is significant to mention that Algorithm 1 has lower security standard than Algorithm 2.

Data Transmission.
The data transmission is carried out based on the trust values ( ) of the nodes in the network through shortest path distance. If the source and destination are within the range of each other, then direct communication is performed. The threshold values are stable yet the mobility of the nodes alters the type of security algorithm used when the value switches from one threshold value to another. This makes the transmission security switch from Algorithm 1 to Algorithm 2. This is a well-informed process so the destination alone knows which algorithm is used and when. Figure 3 shows the Trusted Route obtained from the history of usage of a node for previous network operations. A  node that is newly introduced into the MANETs is assigned an optimum history value by authenticated persons. For a normal node, as the network operations are performed in the system, the value of ( ) is incremented relatively by the nodes that communicate to it. If the quality of service (QoS) of the node is diminishing then the value of ( ) is decremented. Based on the value of ( ) at the instant , the routing to the destination along with the selected security scheme is performed. Distrusted nodes are not preferred for the routing operations; this provides security during routing.

Result Notification.
In this phase, the security is provided based on the destination location from the source. The trust value is estimated from history of usage of previous network communication process. It works well under high mobility.

Limitation of L&TS.
The forwarding node is selected based on the history of previous transmission. There exists a drawback in L&TS that has been identified in this section. The cost of this system is considerably high.

Angle and Context Free Grammar (ACFG) Based Precarious Node Detection and Secure Data Transmission
Trust management using uncertain reasoning method has higher delay and packet loss. Even after the evaluation of the trust value, there is a possibility for the insider attackers to ruin the nodes. Therefore, there is an absolute need to introduce a novel method to improve the security. Pertaining to this concern, an Angle and CFG based precarious node detection and secure data transmission mechanism is proposed in MANETs. In this scheme, the precarious node detection uses Angle and CFG method (Levels 1 and 2) and secure data transmission after publishing malicious nodes using Elliptic Curve Cryptography (Level-3).

Neighbor Angle Computation.
The source selects the neighbor node and collects their surrounding neighbor nodes and then computes the angles of the neighbor nodes. Figure 4 shows that the node is a source, is a next hop node, and , , , , and are node 's neighbors. Source collects the angles that node makes with 's neighbors (shown as in Figure 4). Note that is an arbitrary value and varies from one node to another unlike in Figure 4. Figure 5 shows the nodes and belonging to 's neighbor list. In triangle, the distance of , , and is obtained from the RSS values of the acknowledgement received from node and node . The angle ∠ is represented as . The value of is computationally obtained by the equation given below in (2).
The distance is measured by where 1 and 2 are the coordinates of the two nodes between distances. The angle is calculated based on where → , → , → . Similarly, the algorithm computes every neighbor angle of the node . The source stores every neighbor node angle in a table. Source , next hop node , common neighbor of and = node form a triangle. The three interior angles are discovered and added up. Figure 6 shows that the 1 , 2 , and 3 are three interior angles. Mathematically, the addition of all three interior angles is 180 ∘ , where ∠ = 1 , ∠ = 2 , and ∠ = 3 : In Figure 5, the angle computed from the RSS for ∠ = replaces the interior angle ∠ = 1 . Now according to the property of a triangle, If the sum of the angles in the expression (4) adds up to make 180 degrees, then the nodes that make up the triangle are proved to be legitimate nodes. Hence, the source selects the next hop node only if the node is legitimate according to this method. Otherwise, one among the three nodes forming the triangle is said to be faulty and Level 1 test fails here. The source needs to identify which node is a precarious node and for that a novel Context Free Grammar verification method is proposed in the following section.

CFG Based Node Verification.
The CFG based node verification (Level 2 test) is only performed when the angle based detection mechanism detects a faulty node. Generally, all nodes of the network have a mapping variable. The Leftmost and Rightmost derivations are obtained based on this mapping variable. The source computes the leftmost derivation and the next node computes the rightmost derivation. Finally, the source checks whether these derivations are equal 6 The Scientific World Journal (1) Input Source , Destination , a new node and Common Near node (2) Output Legitimate Forwarder node (3) Begin procedure (4) While source not reach do (5) C o l l e c t neighbor node (6) Foreach neighbor node do (7) N e i g h b o r a n g l e (8) , , and to form a triangle then (9) compute the interior angles of , , and (10) Replaced corresponding interior angle by the neighbor angle (12) If == 1 then (14) S e l e c t n o d e i s a goto (4) (15) Else Let LM be the Leftmost Derivation Else To continue routing to same node and goto (4) (28) End procedure Algorithm 1 or not. If it is equal, then node is legitimate; otherwise, the node is precarious.

Leftmost and Rightmost Derivation.
A leftmost derivation chooses the leftmost nonterminal to expand and the right most derivation chooses the rightmost nonterminals to expand. Every node is assigned a mapping function in the proposed system and the leftmost and rightmost derivations are obtained based on this mapping function.
In Figure 7, is a source, is a next hop, and is a common node. Let node be a mapping function of , let be a mapping function of , and let be a mapping function of ; these mapping functions will be applied to the CFG. The source checks nodes and , which node of left most and right most derivation is equal so that it can be selected as the next forwarding node. For example, the leftmost and rightmost derivation of nodes and is given below. Consider Figure 7: the derivation is obtained among nodes , , and . The mapping functions are , , and . The leftmost and rightmost derivation between and is given below.
Consider the grammar with production: The leftmost derivation of source and next hop is given below: Rightmost derivation of source and next hop is the following: The leftmost derivation is obtained based on the mapping function and stores the string value in a table. Next node/common node is derived by the rightmost derivation. If the source checks leftmost and right most derivations are equals, that node is legitimate; otherwise it is a precarious node. The algorithm used to design the ACFG mechanism is given in Algorithm 1 that corresponds to the various steps illustrated in the flowchart of Figure 8.

Secure Data Transmission Using Reinforcement.
The reinforcement action of this scheme is to publish that a node is malicious to all other nodes so that the node can be excluded from the communication process. This comes under Level 3 (L-3) action of the proposed mechanism. To incorporate this, there is need to confirm that a node is totally illegitimate before broadcasting its label "malicious" to all nodes. Therefore, the node that fails the CFG test is further examined using the elliptical curve cryptography technique using the Weierstrass elliptic function. Consider the coordinate points of the source and the next node to be and , respectively; there is another point which forms a straight line as illustrated in Figure 9. The Weierstrass elliptic function is defined where ( , ) and ( , ) and ( , ) are the coordinates of the , , and points forming an elliptic curve. Therefore, the coordinates ( , ) can be obtained from the following expressions: where = ( − )/( − ).
The commutative property of this function states that The working of this Level 3 test for publishing the node as malicious is given by Algorithm 2. The algorithm shows that the node estimates and sends L3 REQ to the next node .

8
The Scientific World Journal sends L3 REQ to the next node (4) Source estimates KEY ← + ; (5) replies with estimated KEY ← + ; (6) If R e m o v e from neighbor list (8) B r o a d c a s t is "malicious" to all nodes (9) R e t u r n1 Set false alarm high (13) Return0 ( Meanwhile the KEY is estimated using (11) at the source end. The next node replies to the L3 REQ with KEY using (12): The source node compares its KEY with the KEY to conclude that the next node is a malicious node. When KEY is not same as KEY then the node is published as malicious to all other nodes and the next nearest node is considered for communication. Algorithm 2 is a part of the main Algorithm 1.

Performance Metrics
Five metrics are assessed in the simulation analysis of the network. They are Packet Delivery Ratio, Packet Loss Ratio, Throughput, Delay, and Detection Rate.

Packet Delivery Rate.
Packet Delivery Rate (PDR) is the ratio of the total number of packets successfully delivered to the total packets sent. It is obtained from (13) below, where represents the total number of nodes in the networks: Here V is the number of packets received by the destination and is the number of packets sent by the source.

Packet Loss Rate.
Packet Loss Rate (PLR) is the ratio of the packets lost to the total packets sent, estimated by

Throughput.
Throughput is defined as the rate at data is successfully transmitted for every packet sent, evaluated by

Delay.
Delay is defined as the time difference between the current packets received and the previous packet received, evaluate by (16) below, where is the number of nodes:

Detection Ratio.
In this paper, we observe the detection ratio and false detection ratio of AODV and ACFG routing protocols. The detection ratio and false detection ratio are defined as (17) follows: where pn is the number of precarious node detected by one or more normal nodes, pn is the total number of precarious nodes, pn is the number of normal nodes misidentified as the precarious node by one or more normal nodes, and nn is the total number of normal node.

Experimental Results and Discussion
The Network Simulator-2 is used to study the performance of our precarious node detection and secure data transmission in MANETs. We apply the IEEE 802.11. MAC with channel data rate 10 Mbps. Remaining parameters are available in Table 1.
The Scientific World Journal 9

Mobility Analysis.
Mobility in MANETs is a hindrance for the implementation of many security schemes since it affects the QoS of the system. The security of L&TS scheme increases as the mobility increases. Figure 10 indicates mobility versus the number of swaps between the algorithms used. Greater the number of swaps, greater the security of the system. There is a tradeoff between QoS and security in this scheme.

Comparison of TMUR, L&TS, and ACFG with CBR Traffic
Models. In order to validate the efficiency of the ACFG, we compare it with TMUR and L&TS protocol. The performance and metrics described in Section 5 are used here. Figures 11 and 12 show the Packet Delivery Rate and Packet Loss Rate of the TMUR, L&TS, and ACFG mechanisms, respectively. These two metrics are proportional to each other and indicate the successful communication among the mobile nodes in any MANET. Therefore, it can be observed from the graphs that L&TS performs better than TMUR and ACFG performs better than both the mechanisms due to secure communication and the three-level checks performed over the nodes in the MANET. Figure 13 shows the throughput obtained for the of TMUR, L&TS, and ACFG mechanisms. It can be observed that the maximum throughput obtained for ACFG is greater than the L&TS mechanism, which is in turn greater than the TMUR. Similarly, the delay observed in a MANET  operated using the three protocols is also plotted in Figure 14. The ACFG mechanism shows the least delay compared to the L&TS that is also lower than the TMUR protocol. The malicious nodes present in the network obstruct the communication in the network and therefore the ACFG mechanism both avoids and detects the best performance among the three protocols.
The detection ratio of TMUR, L&TS, and ACFG mechanisms is plotted in Figure 15. After modeling a 20% of the nodes as attack nodes, the three methods are tested whether they are able to efficiently identify and detect the malicious nodes. It can be observed from the figure that the detection rate of ACFG is greater than both L&TS and ACFG mechanisms. Also the false positive ratio is plotted for the three comparing mechanisms in Figure 16 to observe that the ACFG mechanism has the lowest false positive ratio.  that permits the nonstop packet stream, as opposed to using TCP that acknowledges a set of packets calculated by using the TCP window size and Round Trip Time (RTT). Figure 17 shows the throughput of ACFG with both CBR and TCP models. ACFG works better with CBR traffic model when compared with the TCP models. Figure 18 shows the throughput of the L&TS for CBR and TCP traffic models. The CBR generates slightly longer throughput than TCP. The CBR traffic model is better when compared to the TCP. Figure 19, it can be observed that the TMUR suffers more from the speed of motion compared with the ACFG and L&TS. The security in TMUR does not vary under mobility because the mobility is increased when security algorithm is increased. Hence, the throughput does not change based on the mobility. However, ACFG obtains better throughput rate, compared to TMUR.

Comparison of Throughput against Number of Nodes.
According to analysis performed, the scalability of the proposed mechanisms is achieved by obtaining the throughput varying the number of nodes from 25 to 150 within an area of 1000 × 1000 m simulation field. From Figure 20, it has been observed that ACFG performs better than L&TS with average throughput crossing 3000 kbps. A summary of the results shown in Figures 10-20 is tabulated in Table 2. The various parameters measured for TMUR, L&TS, and ACFG are tabulated to analyze the overall improvements.
The simulation results show that the dynamic estimation of the metrics improves throughput by 26% in L&TS when compared to the TMUR. ACFG achieves 33% and 51% throughput increase when compared to L&TS and TMUR mechanisms, respectively.

Conclusions
In this paper, we have proposed two new mechanisms for incorporating secure communication in MANETs. This paper contains two strategies: Location and Trust-based secure routing (L&TS) as well as Angle and CFG based precarious node detection (ACFG) with secure data transmission in MANETs. L&TS method uses various cryptography algorithms based on distance and includes trust based routing. ACFG method isolates the precarious node based on the Angle and Context Free Grammar and secures data transmission using the SHA-1 algorithm. The simulation results evaluate that both the ACFG and L&TS mechanisms offer improved throughput and reduced delay, more so the ACFG.
In future works, we intend to investigate the precarious node detection in Cognitive Networks.