1 Introduction

In a traditional fixed spectrum allocation method, most of the licensed radio spectral bands are under-utilized in time and space domains, leading to a low utilization efficiency of the frequency spectrum. Cognitive radio (CR) is an effective technology that can improve the utilization of the spectrum. It can help take wireless sensor networks to the next level of technology [1]. Cognitive radio (CR) is an efficient next generation radio technology that can dynamically initiate the use of the idle spectrum. CR can easily adapt to the radio configuration based on the radio environment and the spectrum [2]. Spectrum sensing is carried out to identify the use of the channel by a primary user (PU). This is carried out by the secondary users which perform this task to detect the primary users’ presence or absence in the network [3]. The most common detection methods used for sensing the spectrum include

  • Energy detection

  • Cyclostationary—based detection

  • Matched filter

These methods can be collaboratively used by the secondary users to detect the PUs in the Channel [3]. The SUs use the above mentioned methods to detect the unused holes in the spectrum [4]. The primary user is a legally licensed user while the secondary user can be looked upon as a temporary user of the spectrum. A cognitive radio network can be looked upon as a network containing one primary user (PU) and many secondary users (SU). Just as a wired network, the secondary users may act as intermediate nodes to deliver the packets transmitted by other secondary users. Relatively, the network transmission is carried out in multihops [5]. In order to facilitate this transmission, there are two well-known approaches of CR, namely, underlay and overlay. In underlay CR, unlicensed users can simultaneously use the spectrum with the licensed users, while in overlay CR, the unlicensed users can access the licensed spectrum when not in use by the primary users [6, 7]. At any time, PU can access the spectrum regardless of the transmission carried out by the SU. Due to this, PUs may experience stern interference till the transmission ends. So, an important issue for CRN to work successfully is to determine the precise location of PUs. This can facilitate SUs to locate PUs and switch to free frequency if a PU is detected [8]. Further, a pair of secondary users can only establish communications when common available spectrum bands existed between them. For instance, consider a scenario where the spectrum is being utilized by a secondary user. If, at any instance, the primary user wishes to use the channel, the secondary user has to relinquish the channel to the primary user. It then has to look for other idle spectrums to use. Dynamic allocation of the spectrum is a major challenge that needs to be incorporated into the design of the cognitive radio networks [9, 10]. Power consumption is inevitable when the spectrum is in use. The effective utilization and consumption of power needs to be monitored in the network. If the power consumption goes beyond an acceptable range, this may result in the degradation of the network’s performance [11].

Additionally several problems exist in the cognitive radio network which include

  • Fading

  • Shadowing

  • The hidden layer problem [12]

All these serve as the major drawbacks of the CRN. These issues need to be resolved in cognitive radio networks. The issues that need to be addressed are

  • An improved sensing scheme and utilization of the spectrum by eliminating the shortcomings of periodic sensing. This scheme must not be dependent on the primary user utilization pattern

  • Idle band allocation effectively among the individual secondary users of the spectrum, and at the same time, trying to maximize the overall spectrum utilization

  • Conflict resolution among the secondary users when they compete for the same spectrum band [13]

However, irrespective of all these issues in Cognitive Radio Networks (CRN), implementation of the network coding involves several uses. Many secondary users may wish to use the spectrum at the same time. Network coding assists the secondary users in utilizing the unused spectrum otherwise owned by the primary users [14]. Due to these advantages, CR has numerous applications in various fields. The vehicles enabled with CR could utilize the idle channels to forward data among its neighbor vehicles for sensor data communication. This would enable high bandwidth communication, which further reduces the delay of sensor information to reach the sink node and thus allows them to respond quickly. Hence, CR is a promising solution to handle channel scarcity problems and efficiently manage spectrum utilization in vehicular transmissions [15]. So CRN with improved techniques might enhance its applications in numerous fields.

2 Literature Survey

Radio communication is the new form of communication on which the world now relies on. In an era where Internet of Things (IoT) has started to rule the world, communication is a major aspect of taking technology to the next level. Devices of the future will definitely demand better radio technologies and network architecture to cater to the demands of technology. Efficient spectrum utilization and bandwidth usage will be the major goals of these newer architectures. Opportunistic radio resource utilization such as the one used in cognitive radio, is being continuously addressed in order to resolve the minor issues prevalent in this technology. Frequency spectrum allocation and utilization is a major aspect of cognitive radio technology.

IoT can be further made efficient by implementing Cognitive radio technology, which helps in efficient communication even during bursty traffic. Problems like collision and contention is very common in wireless networks. These issues can be resolved by cognitive radio. Apart from this several issues need to be addressed before implementing cognitive radio into IoT. Research challenges related to cognitive radio when collaborated with Internet of Things was discussed by Rawata et al. [16]. Potential applications related to these two technologies were discussed in this paper.

The efficiency of multi hop networks depends on the hop count between the source and the destination nodes. Most of the research work conducted in cognitive radio environment has not touched upon the hop count characteristics. Dung et al. [17] has used geometric random graphs to study the hop count distribution. They further focused on the correlated connectivity between arbitrary nodes with shadow fading. Their proposed algorithm incorporated a specific methodology designed for this purpose. The purpose of the algorithm was to find the possible paths that could exist between two random nodes and return the hop count of the shortest possible paths between these random nodes. This is made possible by utilizing the node information pertaining to primary and the secondary users. The active states of the Primary users were supplied as the input. The methodology proposed was responsible for returning the distribution of the hop count and the connection status between the arbitrary nodes. The evaluation scenario in this approach, studied the distribution of the hop count and the connectivity level. It also studied their correlating relationship in CRAHNs teamed with shadow fading. The evaluation of performance between AHNs and CRAHNs was studied by them.

Wideband spectrum sensing is a major challenge in cognitive radio networks. Analog digital converter using the Nyquist rate was so far used for sampling in the spectrum sensing procedures. The shortcoming of this technique is that, it is capable of sensing only one band at a time. This is due to the limitations in the hardware. To sense a wideband spectrum, it is advisable to divide the band into narrower bands. Secondary users usually sense the band by utilizing the frontends in the radio frequency. This usually leads to an extended processing time, cost, overheads and high complexity. Signal sampling needs to be very fast in order to address these problems. Compressive sensing can be used to resolve these issues, so that, the processing time is reduced and the scanning process is sped up. This helps in the reduction of samples for good dimensional signal acquisition without losing out on the important information. Compressive sensing techniques have been proposed over the last decade. Most of the proposed techniques focus on only one process (inclusive of sparse representation, sensing matrix and recovery). Salahdine et al. [18] has studied several compressive sensing techniques. They have categorized these techniques based on their efficiency to process the target such as sparse representation, sensing matrix, or recovery algorithms.

Bandwidth, power, throughput, resource utilization, frequency, timeslot, rate and spectrum in wireless networks need to be used or allocated fairly. Fairness is an important aspect of cognitive radio networks where resources are scarce and precious. The stability of Cognitive radio networks depends on the fair usage of these resources. CRNs provide an intelligent and a dynamically autonomous sensing environment, which helps even the unlicensed secondary users benefit from the usage of the licensed spectrum. CRNs performance is highly dependent on important network entities like throughput, efficiency, power consumption, bandwidth, QoS, scheduling policies and spectrum utilization. Khan et al. [19] has taken up the issue of fairness in CRNs. They have surveyed the issue of fairness which includes measuring parameters, models based on fairness and have analysed the different schemes proposed with respect to fairness. They also discussed the issues and challenges related to fairness and also discussed future research prospects in this context.

The legal users need to share their spectrum details (if idle) with the other temporary users in CRNs. A dedicated SSP (Spectrum Service provider) can be involved to carry out this process. Wang et al. [20] have investigated an effective strategy for pricing the usage of the spectrum. A three level gaming process using backward induction was analyzed by them. The three levels include spectrum acquiescence, selection of a suitable SSP and to meet the demands of the spectrum users. A sub game Nash equilibrium was demonstrated successfully between the SSP and the end users. Two categories of spectrum service scenarios were also taken for discussion, namely a monopoly SSP and dual competitive SSPs. When two or more SSPs tried to acquire end users, it helped to maintain an optimum spectrum price to meet demand and competition. The simulation result discussed the important parameters that maximized the utility value of the two SSPs.

Cognitive radio networks service multiple users. There are no clear models that analyze the metrics of system performance. Amini et al. [21] analyzed a continuous time framework for a multi user CRN. In this network, the secondary users use a common channel to communicate. Renewal theory was taken for discussion in the proposed method. Their work emphasized on the fact that the spectrum usage by the secondary users with respect to the licensed user behavior formed the crux of the renewal process. The sequence of the renewal cycle was derived and important metrics like collision probability and interference time due to the effect of sensing errors and primary user reoccupation were also incorporated into this renewal cycle. The continuous time analysis improved the transmission efficiency in the second network. Numerical analysis was applied and the optimum transmission time for secondary users was derived using suitable equations and derivations. The simulation results also corroborated the numerical analysis.

The spectrum can be shared opportunistically by incorporating co-existence protocols. The protocols universally assume that all spectrum bands give the same throughput levels. Since channel conditions and licensed usage of the allocated channels tend to vary with time and space. The CRNs need to select from the available channels. This may lead to contention for channels which may lead to a decrease in QoS and underutilization of the spectrum. Amjad et al. [22] used game theory to model CRNs in a heterogeneous spectrum. They modeled a non-cooperative, spectrum repetitive sharing game. Three solutions for the game were derived namely (i) pure (ii) mixed strategy Nash equilibrium and (iii) a centralized and distributed correlated equilibrium. A linear programming strategy combined with a channel selection learning algorithm was utilized to derive these. Fairness and efficiency were studied while analysing each of these solutions. The concept of price of anarchy to measure the efficiency of these solutions was studied. They also analyzed the network behavior when the CRNs behaved selfishly.

WVANET is a recent wireless communication [23] model and an enhancement in VANETs. Web technology is integrated into the VANET architecture in order to enable the transfer of web signals to the vehicles. It also helps in extensible messaging which helps in improvising the workings of a VANET. The WiMAX tower and the authentication center combined work together in order to implement the authentication mechanisms into the VANET. The responsibility of the authentication center is to provide each node with an authentication parameter. Simultaneously, the vehicles are authenticated at regular intervals of time [24]. The wireless inter-vehicle communication [25] assists the vehicular nodes to exchange messages between vehicles. Further, it helps in preventing the nodes from being hacked by malicious users. The Manhattan model combined with clustered vehicular based network architecture is analysed and compared to the proposed model based on the different routing protocols. The results of the analysis show that the clustered Manhattan mobility model is capable of providing reliable communication [26]. The three tier filtering approach in a cluster is capable of reducing the transmission time of the messages [27, 28]. The vehicles on the road [29] require a traffic control system to guide the mobile vehicular nodes on the road. The traffic system patterns are static by nature. This ultimately results in the vehicle waiting for a long time at the intersections [29]. It is obvious that a dynamic traffic pattern is required to reduce the waiting time of the vehicles at the intersection points. This is achieved by the communication between the cars that helps in adjusting the timing patterns of the traffic control systems [29]. Routing is a difficult and challenging task since the nodes have a high mobility [30]. The safety of the vehicular nodes is another issue to be tackled in VANETs. Various safety measures have been proposed and researched in order to improve the safety of the passengers and drivers of the vehicles. The vehicle to vehicle infrastructure is adapted in VANET communication. In fact many of the existing work in VANETs are based on this model. This model uses an On board Unit (OBU), which is embedded into each vehicle. This OBU is used to periodically transmit the vehicular position to the server [31]. A road side Unit (RSU) is used to test the authenticity of the vehicular position that is transmitted by the OBU [31]. Cluster based architecture can be used in V2V communication for improving the transmission efficiency [32]. Based on the vehicular movement, the communication range is divided into clusters [32]. The cluster head is selected from the vehicles, which will be in the communication range of all the other clusters. The other vehicles that fall within the cluster range are connected to the cluster head [32]. 802.11 and 802.11p are the standards commonly adapted in VANETs [33]. These standards use DSDV, AODV and DSR which have been effectively tested in the highway mobility model [34]. AODV yields a good performance in the highway model [35]. GSM based communication among the vehicles helps in developing reliable communication between vehicles, mobile phones and home telephone networks. In fact, GSM gives the added advantage of providing additional safety to vehicles by tracking the vehicular location [36]. The clustering technique in a VANET efficiently minimizes the transmission time of the data packets [38]. Fuzzy logic helps form an efficient cluster, which drastically reduces the delay and improves the transmission efficiency [39, 40].

3 Problem Definition

As of late, Vehicular Sensor Network (VSN) has drawn wide interest in research with its capacity to exchange information between vehicular interchanges, and correspondence between roadside sensors and the vehicles. Sensors are introduced along the roadside to assemble ecological information. The increase in demand has also raised a lot of problems in the field of VSN as it has various drawbacks for transmission of data.

  • Frequent network partitions are not possible.

  • Reduces delay in finding the best link in case of link failure.

  • Rapid mobility of nodes results in repeated spectrum fluctuations.

  • Increase in complexity of allocating the best channel among available multiple channels.

4 Proposed Methodology

Vehicular Sensor Network (VSN) emerged because of the latest advancements in Wireless Sensor Network (WSN). It works as a path for watching metropolitan situations and empowering vehicles to share pertinent sensor information to help security, comfort and business applications. Data distribution is a critical part of these systems and requires effective conveyance of vital sensor data. In our proposed system, the Vehicular Sensor Network uses cognitive radio with the help of an enhanced optimal link state routing (MMPR-OLSR with GSA-PSO) protocol. In this paper, we have suggested a data communication scheme using the cognitive radio enabled vehicular sensor network. The optimal link state routing protocol is refined by applying an optimization technique for node selection. A hybrid optimized GSA-PSO algorithm is used in our method. The MMPR-OLSR with GSA-PSO protocol works by the propagation of the control packets by a chosen set of neighbor nodes. This helps in reducing the control overheads in the network. To transmit data between the vehicular nodes, a chosen subset of MMPR nodes (vehicles) access the two hop vehicular nodes. These second hop nodes acts as the intermediate forwarders. The implementation of CR technology in MMPR-OLSR with GSA-PSO helps the protocol to detect the idle frequency bands and use them. MMPR-OLSR with GSA-PSO protocol combined with CR technology helps reduce the delay involved in routing. A proper channel allocation technique becomes necessary in MMPR-OLSR with GSA-PSO. This helps the MMPR-OLSR with GSA-PSO protocol to find the next feasible hop which would be capable of improving the link transmission time. The overall process of the recommended technique is described in further sections. Figure 1 depicts the block diagram of our proposed method.

Fig. 1
figure 1

The architecture of proposed method

Initially, the VANET is combined with the cognitive radio scheme in addition to the Optimal Link State Routing (MMPR-OLSR with GSA-PSO) protocol. An enhanced Optimal Link State Routing (MMPR-OLSR) protocol is used for calculating the routes for vehicles and the protocol is optimized using a hybrid GSA-PSO algorithm for the selection of the appropriate member nodes. Finally, the subset of the neighboring vehicles nearer to each source vehicle, access the second hop vehicular nodes (which will act as forwarders). The overall description of the proposed method is as follows (Fig. 2).

Fig. 2
figure 2

Data flow of hybrid GSA-PSO process

4.1 Cognitive Radio (CR)

Cognitive Radio (CR) is a conceivable answer for controlling MMPR-OLSR with GSA-PSO to find unused frequency groups and use them opportunistically. It eases the problem of channel shortage and leads to a high data transmission correspondence in VSNs. The CR empowered vehicles are utilized as information forwarders to forward detected data to their neighbor vehicles by utilizing the spectrum gaps that constitute the unused channels. CR is a promising answer for handling channel shortage issues and effectively oversees spectrum usage in vehicular transmissions. CR detects the wireless spectrum licenses to primary users (PUs) and distinguishes unused channels which are referred to as spectrum gaps. With information correspondence, secondary users (SUs) are permitted to procure the unused part of spectrum for transmission without creating any obstruction to the PU. The vehicles empowered with CR could use the idle channels to forward information among its neighbor vehicles for sensor information correspondence. This would empower high data transmission correspondence, which additionally lessens the deferral of sensor data to achieve the sink node and permits them to react rapidly. In this manner, MMPR-OLSR with GSA-PSO helped CR-VSN is permitted with a legitimate spectrum. In fact, the trouble of MMPR-OLSR with GSA-PSO to ascertain dynamic routing paths with reference to the shifting spectrum conditions is settled. The short depiction of MMPR-OLSR with GSA-PSO is presented in Sect. 4.1.

4.2 Enhanced Optimal Link State Routing (MMPR-OLSR with GSA-PSO) Protocol

The MMPR-OLSR with GSA-PSO protocol derives its stability from the link state routing protocol. It is proactive by design and has the routes readily available when needed. In the pure form of link state protocol, flooding is inevitable as all the links between all the adjacent nodes are declared. MMPR-OLSR with GSA-PSO protocol is an extension of the pure link state protocol designed specifically for mobile ad hoc networks. This protocol guarantees non-generation of extra control traffic apart from the regular control oriented messages. Even for the usual link connections and breakages, this protocol does not lead to flooding. The route information for all the destinations is maintained within the network. This is very useful for studying patterns in traffic, especially when a number of nodes are trying to communicate with each other. This technique is also useful when the source and the destination pairs are also constantly changing periodically with time. MMPR-OLSR with GSA-PSO protocol can be applied for dense networks too. This protocol can be designed to work in distributed networks without being dependent on a central entity. Collisions and packet loss is quite common in radio networks. As a result, the nodes are capable of handling packet loss. Control messages come with a sequence number thus enabling perfect reordering at the receiving end. Old and redundant information can be eliminated with the help of these sequence numbers. Every node utilizes its recent information to route packets successfully to the destination. Therefore, delivery of data happens via multiple hops. Even with the mobile nodes, successful delivery of data packets is possible because of this. The mobility of the nodes can be traced with the help of the local control messages by this protocol. This is dependent on the frequency of these messages. The optimal link state routing protocol is further refined by implementing the optimization technique for node selection. The hybrid GSA-PSO algorithm is deployed here for increased optimization. A chosen set of neighbor nodes propagates the control packets and also takes care to reduce the control overheads of the network. The main reason for performing optimization in link state protocol is as follows,

  • The control packets’ size are reduced considerably

  • Only a subset of links with the neighbor nodes are declared

  • Multipoint relay sectors are used

  • Reduces flooding due to the presence of control messages

  • A selected set of nodes called multipoint relay sectors (MRS) are used

  • MRS is responsible for message diffusion in the network

  • Reduces the overhead due to retransmissions

A detailed explanation of the optimal node selection using hybrid GSA-PSO algorithm is illustrated in the following section.

4.2.1 Mathematical Notation of Hybrid GSA-PSO Algorithm

Gravitational search Algorithm (GSA) is a metaheuristic optimization algorithm, which depends on the Newton’s law of gravity and the law of motion. In GSA, the fitness of the result is deliberated by the weight. The weight of an entity is predictable by parameters like, location, inertial weight, dynamic gravitational weight and inactive gravitational weight. Similarly, in the PSO (Particle Swarm Optimization) algorithm, the GSA also modernizes the existing location by the finest fitness result during the velocity estimate. Additionally, the quickening value is calculated by exploiting the Newton’s Law of Motion earlier than the velocity updation.

The step by step procedure about the GSA algorithm is detailed in the following section.

  • Step 1: Initialization:

The preliminary result is the location of the input entity (agent), is specified by Eq. (1) as,

$$T_{y} = (t_{y}^{1} , \ldots ,t_{y}^{p} , \ldots ,t_{y}^{m} )$$
(1)

where \(y = 1,2, \ldots ,M\), \(t_{y}^{p}\) Position of \(y\)th agent in \(p\)th dimension, \(m\) Space dimension

  • Step 2: Fitness Evaluation:

The fitness function is evaluated as illustrated below.

$$fitness = \,\hbox{min} \,overhead$$

It is estimated for the initial solution sets. Subsequent to the assessment of the solutions, the producer of the group is found out.

4.2.1.1 For Minimization Problems

The finest and nastiest fitness is assessed for the minimization problems are specified by Eqs. (2) and (3)

$$B(x) = \mathop {\hbox{min} }\limits_{{z\xi \left\{ {1, \ldots ,M} \right\}}} FF_{z} (x)$$
(2)
$$W(x) = \mathop {\hbox{max} }\limits_{{z\xi \left\{ {1, \ldots ,M} \right\}}} FF_{z} (x)$$
(3)
4.2.1.2 For Maximization Problems

Additionally, the finest and nastiest fitness is assessed for the maximization problems are specified by Eqs. (4) and (5)

$$B(x) = \mathop {\hbox{max} }\limits_{{z\xi \left\{ {1, \ldots ,M} \right\}}} FF_{z} (x)$$
(4)
$$W(x) = \mathop {\hbox{min} }\limits_{{z\xi \left\{ {1, \ldots ,M} \right\}}} FF_{z} (x)$$
(5)

where \(FF_{z} (x)\) Fitness of the \(z\)th agent for \(x\) iteration

The Fitness of the \(z\)th agent for \(x\) iteration can also be computed by means of reducing the Mean Square Error (MSE) values.

$$FF_{z} (x) = \hbox{min} \,\,(MSE)$$
(6)
  • Step 3: Compute Gravitational constant:

In step 3, the gravitational invariable will be modernized. The Gravitational invariable updation is completed by the subsequent equation:

$$H(x) = H_{0} \exp \left( { - \beta \frac{x}{X}} \right)$$
(7)

where \(X\) Maximum number of iteration, \(\beta ,\,H_{0}\) Constants

  • Step 4: Update Gravitational mass and Inertial mass

The Gravitational mass and the inertial mass will be updated through Eqs. (8) and (9):

$$G_{Ay} = G_{Py} = G_{yy} = G_{y} \quad {\text{for}}\quad y = 1,2, \ldots ,M$$
(8)
$$G_{y} (x) = \frac{{g_{y} (x)}}{{\sum\nolimits_{z = 1}^{M} {g_{z} (x)} }}$$
(9)

where \(g_{y} (x)\) is represented by Eq. (10)

$$g_{y} (x) = \frac{{FF_{y} (x) - W(x)}}{B(x) - W(x)}$$
(10)
  • Step 5: Compute Force:

The force is calculated by the following equation:

$$F_{y}^{p} = \sum\limits_{z\xi sbest \ne y} {rand_{z} F_{yz} (x)}$$
(11)

Moreover, the acting force on \(y\)th agent by the \(z\)th agent is determined by the following equation:

$$F_{yz}^{p} (x) = H(x)\frac{{G_{Py} (x) \times G_{Ay} (x)}}{{E_{yz} (x) + \xi }}\left( {t_{z}^{p} (x) - t_{y}^{p} (x)} \right)$$
(12)

\(E_{yz} (x)\) Euclidean distance between \(y\)th agent and \(z\)th agent, \(\xi\) Constant

The Euclidean distance between \(y\)th agent and \(z\) th agent is understood by the following equation:

$$\,E_{yz} (x) = \,\left( {\,\,\left\| {T_{y} (x),T_{z} (x)} \right\|_{2} } \right)$$
(13)
  • Step 6: Estimate Acceleration:

Due to the laws of gravity, the acceleration of \(y\)th mediator is predictable. The acceleration is signified by the subsequent equation:

$$A_{y}^{p} (x) = \frac{{F_{y}^{p} (x)}}{{G_{yy} (x)}}$$
(14)
  • Step 7: Estimate Velocity:

Additionally, the velocity determined is intended by the laws of motion. The velocity is signified by the subsequent equation:

$$V_{y}^{p} (x + 1) = rand_{y} \times V_{y}^{p} (x) + A_{y}^{p} (x)$$
(15)
  • Step 8: Update Position:

The updation phase in the GSA is modified by incorporating the update phase of Particle Swarm Optimization algorithm for better optimization.

In the PSO technique, randomized velocity is assigned along with each possible solution. This is used to constitute a particle. With respect to the best solution, each particle follows the coordinate positions in the problem space. The fitness value is also taken into consideration. The fitness value is represented by “pbest”. The position of these solutions is referred by “gbest”. Our proposed technique utilizes a modified version of the PSO technique. In the PSO technique, we have considered both the worst case and the best case scenario. A cross over operation is also considered after the fitness selection. This helps in increasing the possibility of selecting the best particle.

For implementing the PSO, the following steps have to be considered

  1. i.

    Initialize the particle population (solution set) with randomly selected velocity and position for n-variables in the problem space

  2. ii.

    Evaluation of the functions for fitness in n-variables for each of the randomly generated particles

  3. iii.

    Comparison of the particle values (i.e., fitness value with pbest value). If the present fitness value is better than the particle’s “pbest” value, then the present fitness value is set as the new “pbest” value for further processing

  4. iv.

    The values of fitness are evaluated against the previous overall best values. If the present value is better, and then the “gbest” value of the current particle array index is updated. The current value is chosen as the new “gbest” value

  5. v.

    The velocity and position of the particles is changed. The steps are repeated until the fitness criterion is reached. The particle velocity and position is varied by using a sequence of equations

    $$V_{j} (i + 1) = \,\,V_{j} (i) + \,c_{1} r_{1} (\,G_{j} (i) - p_{j} (i))\, + \,c_{2} r_{2} (\,G_{j}^{'} (i) - p_{j} (i))$$
    (16)
    $$p_{j} (i + 1) = \,\,p_{j} (i) + \,V_{j} (i + 1)$$
    (17)
  6. vi.

    The process gets repeated until a solution with a better fitness value is obtained.

c1 and c2 from Eq. (16) represents the acceleration constants that are required for pairing each particle with pbest and gbest. Equation (18) represents the updation of the best position of a particle,

$$G_{j} (i + 1) = \,\left\{ \begin{aligned} G_{j} (i),\quad \quad Z(p_{j} (i + 1)) \ge Z(G_{j} (i)) \hfill \\ h_{j} (n + 1),\quad Z(p_{j} (i + 1)) < Z(G_{j} (i)) \hfill \\ \end{aligned} \right.$$
(18)

At each dimension the particle velocity is limited to the interval \([ \pm V_{\hbox{max} } ]\).

It is then evaluated and is compared with the \(V_{\hbox{max} }\). \(V_{\hbox{max} }\) is an essential parameter. This parameter helps determine the resolution with which the region between the present location and the target location are searched for. Based on the \(V_{\hbox{max} }\) values a better solution becomes achievable. The equations (discussed above) are used to determine the fitness of the solution. The fitness values are used to arrive at a better solution.

  • Step 9: Repeat:

Reiterate the procedure up to the greatest iteration possible.

  • Step 10: Terminate:

Once the greatest iteration is accomplished, the procedure will be completed.

When the whole procedure comes to an end, the fitness of the modernized solution is estimated. The best solution is achieved, if the procedure is replicated for ‘s’ number of iterations. In accordance with these, the selected nodes are used for the data transmission. Then the MMPR-OLSR with GSA-PSO optimizes the control overhead in the network via Minimal Multi Point Relay and its description is as follows.

4.3 Pseudo-code for Efficient Hybrid GSA-PSO algorithm

figure c

4.4 Multi Point Relay (MPR) with Minimum Overlapping

Multi Point Relays (MPR) is a major strategy utilized in the MMPR-OLSR with GSA-PSO protocol. The nodes which are chosen as MPRs transmit information while the information overloads [37]. This method helps in drastically decreasing the information overload in contrast to traditional overloading techniques, where retransmission of information occurs for every single reception of new messages by the nodes. The nodes which are chosen as MPRs produce link state information in MMPR-OLSR with GSA-PSO. By diminishing the amount of control information overloading in the network, topology optimization is accomplished then and there. Thus, the optimization is achieved by establishing links just for the nodes elected as MPR along with its electors. In contrast to the conventional link state protocol, partial link state information is supplied to the network. This data is then utilized for computation of the routes. Optimal routes with respect to hops are given by using MMPR-OLSR with GSA-PSO. This protocol is applicable for huge networks and the method of multipoint relay is used to diminish the amount of replicating retransmissions during a broadcast. This method limits the arrangement of nodes retransferring information via every node, to a subset of every other node. The situation is represented in Fig. 3. Node A chooses the black nodes to be its MPRs. Along these lines, every one of the two hop nodes can be visited via a MPR node. Node B won’t retransfer packets from A.

Fig. 3
figure 3

Node A has selected the black nodes are its MPRs

The MMPR-OLSR with GSA-PSO nodes alone report their ability to perform as MPRs for neighbors. 8 levels of eagerness are characterized from the most minimal WILL_NEVER (0) which demonstrates that this node should never be picked as a MPR, to the most elevated WILL_ALWAYS (7), which represents that this node ought to dependably be picked as a MPR. The eagerness information is spread via HELLO messages and this data must be noted while computing MPRs. The nodes which are chosen as MPRs transmit information while the information is overloaded. This method helps in drastically decreasing the information overload. Hence by using MPRs the vehicles reach the destination without any overloading problems. The significance of the proposed technique with respect to its performance is evaluated in Sect. 5.

4.4.1 Enhanced Algorithm for MPR Selection with Minimum Overlapping

  • MMPR—Minimum Multi Point Relay

  • EC—Minimum Exact Cover

  • \(d^{c} \left( v \right)\) Covered Current number of 2 –hop nodes

  • \(d^{u} \left( v \right)\) Uncovered Current number of 2 –hop nodes

  • \(d^{c} \left( {v'} \right)\) Covered Current number of 2 –hop nodes

  • \(d^{u} \left( {v'} \right)\) Uncovered Current number of 2 –hop nodes

  • \(N^{2} \left( u \right)\) 2-hop neighbor of node ‘u’

  • \(N\left( u \right)\) 1-hop neighbor of node ‘u’

  • ∆—Maximum degree of nodes

  • ω—Weighted in degree of nodes

  • $$d_{\upsilon }^{ + } \left( v \right)\;Number \;of\; neighbors\; of \;neighbor\; v \;of\; u \left( { 2 - hop \;away\; from\; u} \right)$$
  • $$d_{u}^{ - } \left( \omega \right) \,Number\; of\; neighbors\;of\;2 - hop\; neighbor\; \omega \; of\; u \left( { also\; neighbors\; of\;u} \right)$$
    figure d

5 Results and Discussion

This section gives a detailed view of the results that are obtained using our proposed hybrid GSA-PSO algorithm and MMPR technique. For route calculation, MMPR-OLSR used and for the selection of nodes in the route, hybrid GSA-PSO algorithm is applied. MMPR vehicles are used for reducing overheads and thereby act as data forwarders. The proposed method is implemented in NS2. The number of packets used for the transmission is 512. The performance of the proposed technique is analyzed and clearly explained in the following section. NS2, a simulation software, tailor made for vehicular sensor network is used to simulate the network environment. The data rate is set to 0 kps for all the simulations. The protocol used is IEEE 802.11 for MAC layer. The two rays Ground propagation model is used for our simulation. For our simulation, we have considered a communication range covering a total of sixty nodes. The communication range is defined as a 1500 m × 90 m area. The source and the destination node pairs are scattered randomly over the network. The constant bit-rate traffic generator of NS2 is used to set up the connection patterns with varying random seeds. Every node has one CBR traffic connection with exactly one unique destination. The source initiation time is uniformly distributed over a 50 s time period of the simulation time. The simulation settings and parameters used for our analysis are tabulated in Table 1.

Table 1 Simulation parameters

5.1 Evaluation Metrics

The proposed OLSR-MMPR with GSA-PSO optimization is analysed with OLSR-MPR with GSA-PSO technique. The main reason in doing so is to ensure a fair analysis. We have applied the GSA-PSO technique to the OLSR- MPR technique so that the performance of both the methods could be analysed equally. By using the evaluation metrics end to end delay, packet delivery ratio, throughput, packet drop and channel utilization, the performance of both the techniques are evaluated.

  1. (a)

    End To End Delay

End-to-end delay or one-way delay (OWD) refers to the time taken for a packet to be transmitted across a network from source to the destination.

$$d_{end - end} = m[d_{trans} + d_{prop} + d_{proc} + d_{queue} ]$$
(19)

where \(d_{end - end}\) = end-to-end delay; \(d_{trans}\) = transmission delay; \(d_{prop}\) = propagation delay; \(d_{proc}\) = processing delay; \(d_{queue}\) = Queuing delay; \(m\) = number of links (Number of routers—1).

  1. (b)

    Packet Delivery Ratio (PDR)

The overall ratio of the packets successfully delivered to the destination compared to the number of packets initiated by the sender defines the packet delivery ratio.

  1. (c)

    Throughput

The throughput is defined by the amount of data sent between the source and the destination.

  1. (d)

    Packet Drop

Sometimes packet loss may occur because a router may decide not to pass it on to the next intermediate hop. This deliberate loss of a packet is termed as a packet drop.

  1. (e)

    Channel utilization

Efficient utilization of the Channel is defined as the capability of the MMPR-OLSR with GSA-PSO protocol to maintain a balanced load at all times on each one of the error-free channels. The channel utilization is denoted by \(\lambda\) given as,

$$\lambda = [(t_{busy} ) \div (t_{simulation} )]*100$$
(20)

where \(t_{simulation}\) = Total simulation duration; \(t_{busy}\) = Total duration for which the channel was busy transmitting

5.2 Comparison Analysis

This section provides a comparison of the proposed method with existing methods with respect to delay, delivery ratio, throughput, and packet drop and channel utilization efficiency. The detailed description of this is given as follows.

5.2.1 Packet Drop

For 50 nodes, the packet drop value obtained using the MMPR with GSA-PSO scheme is 66.66% lesser than that of the MPR-OLSR with GSA-PSO scheme. The packet drop value obtained using the proposed MMPR with GSA-PSO scheme is 25% lesser than the existing MPR-OLSR WTH GSA-PSO technique for 75 nodes. For 100 nodes, the packet drop value obtained using the proposed technique is 37.5% lesser than the existing method. The packet drop value obtained using the proposed method is 50% lesser than that of the existing OLSR-MPR with GSA-PSO method for 125 nodes. Similarly for 150 nodes, the value of packet drop using the proposed technique is 75% lesser than that of the existing scheme. The graphical representation of the packet drop values are plotted in Fig. 4. The proposed OLSR-MMPR with hybrid GSA-PSO has a better performance mainly due to the inclusion of the optimization scheme. This helps optimize the nodes such that only the best MMPR nodes are selected. This helps in optimizing the member nodes and the packets need to include fewer hops than before. This helps in the successful delivery of the packets. OLSR-MPR with GSA-PSO does not select MPR nodes or any optimization scheme to support it. Hence the number of dropped packets is more in the OLSR-MPR with GSA-PSO scheme.

Fig. 4
figure 4

Packet drop comparison

Hence, from Fig. 4, it is evident that the number of packets dropped reduces with the increase in the number of nodes for the proposed OLSR-MMPR with GSA-PSO method while the drop in the packets increases using the existing MPR-OLSR with GSA-PSO method (Table 2).

Table 2 Packet drop comparison

5.2.2 Throughput

For 50 nodes, the throughput value obtained using the proposed MMPR-OLSR with GSA-PSO method is 4847 kbps. While using the existing MPR-OLSR with GSA-PSO method, the throughput value is 2847 kbps. 5743 kbps of throughput value is obtained using the proposed MMPR-OLSR with GSA-PSO method for 75 nodes and 3243 kbps of throughput value is obtained using the existing MPR-OLSR with GSA-PSO method. The value of throughput obtained using the proposed method is 6066 kbps, while the value of throughput obtained using the existing method is 4216 kbps for 100 nodes. The throughput value for 125 nodes using the proposed and existing methods are 6356 kbps and 4756 kbps respectively. For 150 nodes, the throughput value using the proposed MMPR-OLSR with GSA-PSO method is 6691 kbps. Using the existing MPR-OLSR with GSA-PSO method, the throughput value obtained is 4991 kbps respectively. The values in Table 3 are plotted in a graph shown in Fig. 5. The increase in the throughput for the MMPR-OLSR scheme using the Hybrid GSA PSO optimization helps in reducing the packet drop ratio which subsequently helps in increasing the PDR of the network. The MPR-OLSR scheme does not use any optimization and the routing table information tends to grow as newer routes are discovered. These results in a steady increase in the number of dropped packets, subsequently leading to a drastic decrease in the PDR. This affects the throughput of the network.

Table 3 Throughput comparison
Fig. 5
figure 5

Throughput comparison

From the graph in Fig. 5, we can observe that the throughput value is more for the proposed MMPR-OLSR with GSA-PSO method even when the numbers of nodes are increased. For MPR-OLSR with GSA-PSO, we can see that with the increase in the node count, the throughput shows a steady decrease.

5.2.3 Delay

For 50 nodes the value of delay obtained using the proposed MMPR with GSA-PSO scheme is 72.74% lesser than the existing MPR-OLSR with GSA-PSO technique. The value of delay obtained using the proposed MMPR with GSA-PSO scheme is 9.295% lesser than that of the existing MPR-OLSR with GSA-PSO scheme for 75 nodes. For 100 nodes the delay value obtained using the proposed technique is 25.24% lesser than that of the existing method. The delay value obtained using the proposed technique is 41.33% lesser than the existing MPR-OLSR with GSA-PSO scheme for 125 nodes. For 150 nodes, the delay value obtained using the proposed MMPR with GSA-PSO scheme is 32.07% lesser than that of the existing MPR-OLSR with GSA-PSO scheme. The values are plotted in the graph shown in Fig. 6.

Fig. 6
figure 6

Delay comparison

From Fig. 6 we can observe that the value obtained for the delay metric is more using the existing MMPR-OLSR with GSA-PSO technique for varying nodes. For the proposed MMPR with GSA-PSO scheme, we can observe a lesser delay while varying the node count (Table 4).

Table 4 Delay comparison

5.2.4 Packet Delivery Ratio (PDR)

For 50 nodes, the delivery ratio obtained using the proposed MMPR with GSA-PSO scheme is 68.04%, which is more than that of the existing MPR-OLSR with GSA-PSO technique. The delivery ratio obtained using the proposed MMPR with GSA-PSO technique is 56.95% higher than the existing method for 75 nodes. For 100 nodes, the delivery ratio obtained using the proposed scheme is 51.11% greater than that of the existing MPR-OLSR with GSA-PSO method. The delivery ratio obtained using the proposed method for 125 nodes is 30.55% higher than the existing scheme. Similarly for 150 nodes, the delivery ratio obtained using the proposed MMPR with GSA-PSO scheme is 20.44% more than that of the existing technique. The graphical representation of the delivery ratio values are given in Fig. 7.

Fig. 7
figure 7

Delivery ratio comparison

Hence from the graph in Fig. 7, we can observe that the delivery ratio is high using the proposed MMPR with GSA-PSO method for varying nodes while the value is lower using the existing method (Table 5).

Table 5 Packet delivery ratio comparison

5.2.5 Channel Utilization

For 10 channels, the channel utilization using the proposed MMPR-OLSR with GSA-PSO method is 95%. While using the existing MPR-OLSR with GSA-PSO method, the channel utilization is 90%. 90% and 85% of channel utilization is obtained using the proposed and existing methods respectively for 20 channels. The value of channel utilization using the proposed and existing method is 85% and 80% respectively for 30 channels. For 40 channels, the value of channel utilization is 75% using the proposed MMPR-OLSR with GSA-PSO method. The value of channel utilization is 70% using the existing MPR-OLSR with GSA-PSO method. 70% and 65% of channel utilization value is obtained using the proposed and existing methods for 50 channels. Hence, our proposed MMPR with GSA-PSO method has a better channel utilization capacity than the existing MPR-OLSR with GSA-PSO scheme. Hence, from Fig. 8, it is clear that our proposed technique has a low delay, high delivery ratio, low packet drop ratio and a higher throughput and maximum channel utilization value when compared to an existing technique like MPR-OLSR with GSA-PSO. The MMPR-OLSR with GSA-PSO scheme has a better channel utilization, since it focuses on spectrum sensing initially even before a transmission starts. The MPR-OLSR with GSA-PSO scheme focuses only on selecting the routes and does not involve any spectrum sensing procedure. The channels are fully utilized in the proposed scheme, while there is absolutely no scheme for utilizing the channels in the MPR-OLSR with GSA-PSO protocol. Hence our proposed method has better channel utilization capacity then the existing scheme as shown in Fig. 8. It is evident from the analysis that our proposed MMPR-OLSR with GSA-PSO technique has a low delay, high delivery ratio, low packet drop ratio and a higher throughput and maximum channel utilization value when compared to an existing technique like MPR-OLSR with GSA-PSO (Table 6).

Fig. 8
figure 8

Channel utilization comparison

Table 6 Channel utilization comparison

6 Conclusion

A cognitive radio based vehicular sensor network that incorporates the OLSR protocol with a hybrid GSA-PSO scheme using MMPR is proposed. The proposed scheme focuses on channel utilization initially in order to allocate the channels fairly among all the users. This ensures that the channels are never idle. The spectrum sensing process is performed even before a transmission is initiated. This ensures that the packets need not wait for transmission. This scheme also uses a hybrid GSA-PSO technique that helps in choosing appropriate member nodes. This initiates transmission in a relay based manner through multiple vehicular nodes. The optimal nodes thus selected helps in improving transmission and also reduce the overheads usually generated with the transmission of control packets. The selected MPR nodes are the only nodes allowed to retransmit. This ensures that no retransmissions of duplicate packets occur in the network. Furthermore, the MMPR nodes selected by the OSLR protocol are further optimized to carry out the transmission in a refined manner so that the packets do not have to endure more than the number of hops than is necessary. The proposed technique is simulated in the NS2 platform and the performance is measured in terms of

  • The Delay incurred

  • Packet drops involved

  • Channel utilization

  • Throughput of the network

  • Delivery ratio of the packets

The numbers of nodes are varied in order to understand the behavior of the network when the traffic is high or low. Our technique (cognitive radio with GSA-PSO technique) is compared and evaluated with the MPR-OLSR protocol with GSA-PSO technique in order to understand the benefits of the proposed technique.