Architecture forResourceAllocation in the Internet ofVehicles for Cooperating Driving System

Department of CS and IT, Mirpur University of Science and Technology (MUST), Mirpur-10250, AJK, Pakistan University of Malaya, Faculty of Computer Science and Information Technology, Kuala Lumpur, Malaysia Department of Computer Science, College of Computers and Information Technology, Taif University, P. O. Box 11099, Taif 21944, Saudi Arabia Department of Information Technology, Bahauddin Zakariya University, Multan 60000, Pakistan Faculty of Computing and Engineering, University of Kotli, AJK, Kotli, Pakistan


Introduction
e fifth generation (5G) desires to be a generation that is not extended only to meet the needs of mobile operatives and consumer infrastructures and opens up new paradigms and support for societies, health, vehicles, media, manufacturing, and the transport industry [1]. 5G is seen as the underlying technology allowing self-driving cars to talk with each other. Cooperative driving plays a vital role in traffic efficiency. e new development of information and communication technologies allows auspicious cooperative driving, which has been meditated to enhance traffic efficiency and traffic safety [2] expressively.
Cooperative driving systems (CDS) are primarily based on wireless communication between vehicle-to-vehicle (V2V) and among vehicles to infrastructure (V2I). Human behavior is modelled in CDS that helps vehicles while travelling on roads [2]. e exchange of information among vehicles enables them to make cooperative decisions regarding driving [3].
IoVs prepared with 5G interfaces are complex but give additional features because of D2D communication. e base station plays a role by directing vehicles with control information to schedule the resources as per priority. In this way, base station guarantees the available resources to meet the latency and data rate required for typical vehicles [4].
Resource allocation procedures in most fourth-generation telecommunication networks require continuous monitoring of channels but do not provide required resources to every vehicle as per their needs [5]. Although 5G is quite capable of the service requirement of V2V, its use must be controlled to make it cost-effective [6]. e main motive is the efficient utilization of the radio resources as per increasing QoS demand for CDS.
High vehicle density that shares a common channel for communication QoS is not filled in CDS. So, clustering for 5G users is better for efficient resource utilization and allocation. CDS for 5G-based V2V communication is necessary to provide better resources like bandwidth to improve QoS requirements [7]. Due to extreme automobile density and limited bandwidth of current network infrastructure, sometimes a better channel that meets the requirements of cooperative driving is not available that causes network congestion. Simultaneously, the ever-changing topologies of communicating vehicles are a big hurdle while allocating appropriate resources at the right time and place. ese things can directly impact the overall QoS performance of the CDS. For better V2V communication to improve service requirements, it is necessary to develop a network infrastructure that improves the QoS of cooperative driving with a greater throughput.
is paper proposed a resource allocation scheme for a cooperative driving system for IoVs. First, an architecture of the cooperative driving system (CDS) is proposed based on 5G networks. en, a clustering algorithm is proposed for resource allocation. Consequently, proposed architecture entities, how these entities work, and their functionalities for our proposed solution are outlined. Secondly, a clustering algorithm for IoVs to allocate resources for better transmission in CDS is formulated. e proposed scheme is implemented, and the results are validated against the existing scheme. Section 2 discusses the related work, and Section 3 presents the proposed CDS architecture in detail. Section 4 presents the proposed solution's implementation, and the performance evaluation is presented in Section 5. Finally, Section 6 presents the conclusion of the paper.

Related Work
e automation of vehicles is increasing over time. Simultaneously, technological advancement in telecom networks increases the number of interactions among vehicles and between vehicles and other road users. As a result, the communication system's reliability and capability become significant for improved performance of autonomous driving and road safety [8].
ree usual multivehicle cooperative scenarios, formation control, convoy-driving, and connection management are studied in [9]. A communication resource allocation solution was brought forth for these three scenarios. e concentration was on just one convoy when it crosses the intersection. A self-organized resource allocation scheme for V2V communication is suggested in [10]. To lessen the overhead dynamic, zone formation-based resource algorithm is proposed. is scenario's problem is that multiple vehicle zones are connected with only one roadside units (RSUs). It causes transmission overhead for the base station and reduces the channel state quality. e problem here is that every V2I links bonds spectrum with multiple V2V associations.
e BS has only access to gentle decreasing certificate status information (CSI) of vehicular associations, except those who are dismissing at the BS [11,12].
A cooperative allocation strategy for bandwidth against each link is presented in [13] to achieve better communication performance among vehicles on the move. CAVDO and MA-DTR-based clustering approaches are used to organize network organization and resource allocation [14,15]. It performs fine in clustering by dropping the number of clusters when there is very high vehicle density. However, if clustering is not appropriately done, resource optimization is mislaid.
Höyhtyä et al. [16] analyzed the ird-Generation Partnership Program (3GPP) standards for power consumption management regarding 5G. Release 14 presents two types of innovative communication modes that are specified for V2V communications. In mode three, the cellular networks choose and achieve the cars' radio resource for their direct V2V communication. In mode 4, vehicle automatically chooses the radio resources for their direct V2V communications. Mode 4 could function without cellular coverage. It has a different scattered scheduling system for vehicles that choose their radio resources and provides functioning for distributed congestion control [17,18].
A comprehensive analysis of 5G [19] related to road traffic management is presented with different problems that occur during the resource allocation. Two main challenges for D2D communication are first interference for D2D links. Secondly, it improves QoS requirements using RRM and RRM scheduling algorithms in the neural Q-learning-based approach [20]. An ACORA [21] scheme (ant colony optimization-based resource allocation algorithm) is proposed, which promises the efficient use of accessible resources helping users by conferring their QoS parameters. A swarm intelligence algorithm is adopted to reduce computational complexity while understanding suitable performance. RRM [22] for V2X based on D2D communication is proposed which promises reliability and latency while allocating resources to vehicles.
A clustering scheme based on cooperation among vehicles is presented in [23], which is dependent on GPS. Performance is a lack in case of GPS signal interruptions. Another LTE-dependent clustering scheme is presented in [24]. It relies on the LTE network for location-based information required by the vehicles while travelling on the road, whenever the need to make driving-related decisions.
ere is no localized mechanism that helps vehicles in the absence of GPS signals. A Fermi learning model based on the prospect theory is developed in [25], which calculates the distribution density and the distance between the taxis. e authors in [26] proposed an optimal beacon transmission rate allocation for cluster control. An adoptive rate is defined for efficient intracluster communication that is useful in avoiding cluster congestion.
A 5G network-based control framework [27] is proposed and deployed in Sweden that minimizes communication delay in managing intersections.
is framework works cooperatively but no focus on radio resources management. A comprehensive review presented in [28] radio resource management schemes proposed for LTE/LTE-A networks is still relevant. However, these schemes should be adaptive and futuristic that meets the user's demands.
Most of the research done in IoVs for resource allocation that we find in literature used the Knap Sank algorithm [29] and the greedy algorithm. ere is a large "network load" during communication that causes "traffic congestion," thus the reason for trouble in large data handling. "Dynamic topology" of both communicating vehicles may reduce network performance [3]. We need such a system that allows vehicles to communicate in dense areas with fewer transmission delays and a better resource allocation system.

CDS Architecture
A resource allocation architecture and its entities for CDS are proposed in this section, as presented in Figure 1. Symbols and abbreviations used in our proposed design are described in Table 1.
A CDS-based V2V communication helps vehicles to cooperate and communicate with each other on the road to improve traffic efficiency. QoS providence is important for efficient communication. It is necessary to provide proper resources like bandwidth to improve QoS for CDS. To enhance CDS for V2V communication, we proposed a clustering algorithm that is DBSCAN for resource allocation in IoVs.
is system's constraints are that devices used in communication should perform in a real-time scenario. If the system does not perform real time, the system working does not handle it. Our system should meet the computational time. e details of the proposed architecture and its algorithm are described below in Sections 3.1 to 3.7.

Channel State and Mobility Management Entity.
In 5G networks, the mobility management entity (MME) covers 5G user location servers connected with the ENodeB access interface. It collects the vehicle's location data. It checks how many vehicles are moving on the road, how many resources are available for each vehicle, and how much additional is needed. e channel state entity, along with the mobility management entity, collects channel state quality information of each ENodeB and exchanges channel state quality information with TES. It updates the information on available resources and the number of resources needed for each vehicle using the banker's algorithm. It checks the resource availability (in our scenario bandwidth), how much resource is needed, how many resources available on each ENodeB, and how much each ENodeB request. e working of channel state entity is as follows: need � need − request. (3) In equation (1), for availability of bandwidth, a resource is subtracted from the requested resources, and then, in (2), an allocated resource is added to the requested resource. To avoid network congestion (3), we apply the formula in which the resource's need is subtracted from the requested resource. e mathematical formulation of equations (1)-(3) is represented in equations (4)-(6) and explained as follows. LTE standards presented a new D2D interface that allows LTE to provide traffic efficiency and a traffic safety communication system. In the system architecture of LTE, the D2D communication interface is called the side link. For resource allocation, a resource pool is created, in which the number of subframes and the number of resource blocks are defined. Let us create a resource pool R P in which the number of subframes is denoted by S, and the resource blocks are represented by e allocated resource in our scenario is bandwidth represented by n.
e range of resources is found by a comparison value in which bandwidth is less than the total resource block. For that total resource, blocks are subtracted by 1 and then divided by 2: To allocate resources and to calculate the availability and need of resources, we formulated an equation in which log 2 is taken. Resource allocation is represented by R a , and resource availability is denoted by R av. : R av � log 2 n Rp− RB + 1 .
To find a need (N) of resources, available resources are subtracted from allocated resources. So, from equations (8) and (9), we get Journal of Advanced Transportation Controlled and shared resources define the resources in the resource pool. Controlled are the available resources, and the shared resources are the allocated resource. When the resource allocation process is completed, this information is sent to TES for further processing.

Traffic Efficiency Server (TES)
. TES receives vehicle location and updates vehicle location messages received from vehicles with a mobility management entity. It stores and updates data exchanged form channel state entity. Based on the channel state information exchanged from the channel state entity, TES allocates resources to the ENodeB for V2V communication [30]. Due to the CDS' strict latency and reliability requirements for V2V communication, a traffic efficiency server must manage and accept the network promptly [31,32], so TES and ENodeB must establish their connection in real time without delay.

Macrobase Station and ENodeB.
Macrobase stations are fundamental elements in any heterogeneous network wireless infrastructure to provide coverage and support capacity. A small cell that is ENodeB is a major infrastructure part of the 5G network architecture. In our scenario, macro-BS, ENodeB, and TES are interconnected. Resources like bandwidth are assigned to different ENodeBs. In our scenario, the resource is bandwidth. ese base stations (ENodeB) handover resources to vehicles. If the requested resource is not available in the base station, it can currently request TES for a particular service. TES server requests a macrobase station. From the macro-BS, these resources are handed over to ENodeB using LTE-A.

Clustering.
Vehicular clustering is a technique of grouping nodes in several clusters. Each cluster has two components: CH and cluster member (CM) [33]. In V2V communication, CH's role is to lead the group, and all the participants in the group are its members called CM [34]. In our proposed architecture, the closest to ENodeB is the clustering head, and all neighbor nodes are its members.
ese are active clusters that are involved in V2V communication.

Zone Formation.
To cater to interference, each cluster forms its zone for V2V communication [10]. For D2D communication, we set the radius, which is the communication zone. e purpose of creating a zone is that each CM communicates within its range. When the nodes (vehicles) are in the radius range, the data transmission is high. As soon as they go away from the base station radius, their throughput decreases. Each vehicle communicates in its zone. When a vehicle moves from one zone to another, it makes its new cluster.
A problem arises when many clusters are in communication within their radius. Some intermediate nodes cause interruption because they are connected with both ENodeB.  A value is set for each zone so that each node communicates within its specific range of ENodeB. It helps to avoid overlapping of the node between the clusters. In Figure 2, the vehicle in the middle of two cluster cause overlapping between the two zones and cause signal interruption for both clusters results in the wastage of the resources during communication.

Density-Based Spatial Clustering Algorithm for Resource
Allocation. In V2V communication, mostly k means clustering technique is used in which the central node is considered as clustering head. We use the DBSCAN algorithm [35]  is is real data gathered from Monte Carlo simulation [36], which is used to get data for D2D communication in Matlab [37]. e clustering algorithm is applied to a dataset that contains labelled data. When the cluster formation is done, the resource allocation process is started. Equation (11) shows the DBSCAN algorithm's working for distance calculation: 3.7. Pseudocode of Proposed Algorithm. For mode selection and transmission point for resource allocation for CDS is given in (Algorithm 1).

Implementation Scenario
In our implementation, the first resource pool is created, and then, the DBSCAN algorithm is implemented on the dataset. is dataset is created by taking the data from the D2D simulator. D2D throughput is calculated using Monte Carlo simulation. As per our system requirements, we design system architecture, two nodes, two base stations with TES, and MME-based V2V communication. Vehicle clustering using the DBSCAN algorithm is incorporated with system architecture.
We create a resource pool in which subframes and resource blocks are created. To allocate resources, equations (1), (2), and (3) are defined as presented in Section 3.1. Figure 3 illustrates the V2V resource pool for our resource allocation. Figure 3 shows that the V2V -controlled resource pool is dark blue, and the shared resource pool is yellow. e light blue color shows synchronization time. e brown color shows the baseband and the green color for bandwidth. After the simulation is done in Matlab, the results are compared with the D2D communication model [38].

Implementing the DBSCAN Algorithm.
After creating a resource pool, we create a dataset for resource allocation and implement the DBSCAN algorithm for that dataset, as shown in Figure 4. e dataset is used for the clustering of data. It is a well-known clustering algorithm used in machine learning and data mining. It consists of Eps that tells how close the points should be to each other in clusters.
Min points show the minimum number of points to form a dense region. e points which are near the border are included as noise. is is a labelled dataset. Each label shows the functionality of every point. (12) shows N_R B is the number of resource blocks and N_USER is the total number of users, where n is used for one user value. Equation (13) is used to calculate the total number of subscribed users (N_SC) per resource blocks:

roughput Calculation. Equation
Equation (14) calculates throughput, and the first SNR is calculated. In the following equation, BW is the bandwidth, and BOLTZ is a Boltzmann constant that is (1.3806488e-23). It is used when we calculate SNR with bandwidth: To calculate the D2D throughput, sum of the log is multiplied with the SNR value and then add one in it, as shown in the following equation:

Performance Evaluation
We measure the performance of the proposed CDS against the D2D communication [38] scheme for vehicular networks. roughput is measured against the number of RBs, various radius sizes, and the number of users. In the end, SNR against throughput is also presented for performance check. e parameter setting for the calculation of throughput is shown in Table 2. Figure 5 shows the average throughput against the allocated number of radio RB. At the lower number of RBs, there is not much difference in the throughput of the existing D2D scheme and proposed scheme. However, this difference increases with the increase in the RBs at RB of Journal of Advanced Transportation 5 100.
e throughput of the proposed scheme is almost double the existing D2D schemes. One of the reasons is that, in the D2D scheme, an increase in the network's communication area involves more latency or packet drop.
Average throughput is calculated to find the QoS for V2V communication. For the D2D communication scheme, average throughput is calculated for several resource blocks, for the radius size, and the number of users. From the results, it is shown that our proposed algorithm has better results as compared to the existing D2D scheme. e average throughput increases with an increase in the RBs. e increase in the proposed scheme's throughput is higher than the existing D2D schemes. is is because increase in RBs increases the chances for the mobile node to get more required resources on time.  Figure 6 shows an average throughput against various network radius sizes for both the D2D scheme and the proposed scheme. e average throughput decreases as the radius size is increasing. An increase in the signal rang increases the cluster size as more vehicles are added, affecting overall communication among vehicles. By increasing radius and size, there is a negative impact on both protocols' performance. However, our proposed protocol's performance is still greater at each of the radius size values. e decrease in the performance is because of the increase in transmission failures and an end-to-end delay. is is also evident in Figure 7, which shows an increase in the number of users decreases the throughput as more radius size allows more vehicles to become part of the communication. us, (1) Initialize transmission point setting for RB and PDSSCH (2) FOR each CSI set resource configuration and transport block size (3) CREATE subframes for Resources allocation (4) For Each D2D Transmitter d (5) IF Orthogonal resource block x is available (6) IF link gain in D2D mode is higher DO (7) D2D Transmitter d transmits in D2D mode on RB x (8) End (9) D2D Transmitter d transmits in UE mode on RB x (10) ELSE (11) Update the counter x (12) END (13) FOR calculate throughput DO (14) Allocate  Journal of Advanced Transportation as the network's scalability is concerned, the proposed scheme has shown better performance. e average throughput remains almost double of the D2D scheme at radius sizes of 30, 40, and 50 meters. Figure 7 shows the average throughput against the number of users. Our proposed algorithm's average throughput is much higher than a simple D2D-based communication scheme. For the D2D communication scheme, when the number of users increases, the average throughput decreases because all users want to get all resources. In our case, the throughput is good, which provides better QoS for CDS.
SNR directly affects the performance of throughput. When SNR's value is high, it means that the signal's strength is also more robust relative to the noise levels; it allows higher data rates and fewer retransmissions. e lower the SNR value, the lower is the data rate, which decreases throughput. Figure 8 shows the SNR concerning the throughput of our proposed schemes. In our scenario, the average SNR is high, which increases throughput; thus, the QoS for the CDS increases, which helps traffic efficiency applications. e increase in throughput against various metrics shows that our proposed architecture for resource allocation for CDS performed well against the existing D2D scheme. roughput increases because of the efficient resource allocation that positively impacts data rate and reduces overall transmission delay.

Conclusion
IoVs is a trend of the IoTs, used for communication among vehicles. Better V2V communication that meets the QoS requirements is essential for efficient road traffic management. A QoS CDS based on V2V communication helps vehicles communicate and cooperate reasonably to improve traffic efficiency over the road as there is a significant increase of more than 50 percent (on average) in the throughput of the proposed CDS than the existing D2D schemes. e results adequately appropriate the main motive of the efficient use of radio resources to meet CDS's QoS requirements.
is technique may help in the future to improve QoS for CDS by better allocation of resources.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.