## 1 Introduction
As for vehicle density, due to the randomness of driving behavior and the influence of traffic lights or traffic accidents, the vehicle density of the street segment is unevenly distributed, for example, as shown in the Figure 1, where case A may be caused by a red traffic light, traffic accidents can lead to case B, and case C is that the street segment is relatively smooth. Therefore, accurate modeling of the network connectivity quality of street segments is a challenging problem. Recently, bio-inspired approaches have been used for the routing protocol due to their ability to solve hard, np-hard and np-complete optimization problems [20; 21]. Among bio-inspired optimization techniques, ant colony optimization (ACO) has received a great deal of interest [6; 22]. These papers regard the network connectivity quality of the whole street as a black box, regardless of internal factors such as the density and distribution of vehicles, and uses the ant pheromone to evaluate the network connectivity quality of the street, so as to calculate the corresponding weights of network connectivity quality. However, most of these routing methods for VANET are distributed, which can not effectively use the global network information, resulting in local optimum and network congestion problems [23]. Lately, software-defined VANET (SDVN) has attracted much attention, which has the advantage of centralized control by combining software-defined network (SDN) ar  
Figure 1: Distribution of different vehicle densities. Case A: traffic light influence, case B: traffic accident influence and case C: smooth street  
chitecture with VANET [23; 24; 25; 26; 27]. SDN is an emerging programmable network architecture developed to simplify the architecture of traditional networks, and it uses a centralized control plane and a distributed forwarding plane, which are separated from each other. The control plane centrally controls the network devices on the forwarding plane and provides programmability, which greatly improves the flexibility and scalability of the network. In [23], the central controller maintains a routing table. Fuzzy logic and reinforcement learning are used to initialize and update the routing table, and then calculate the best route according to the link stability in the routing table. PT-GROUT [26] regards the vehicular network as a temporal graph, uses Hidden Markov Model (HMM) to predict temporal information, and calculates the optimal route path under the SDVN architecture. This paper proposes a routing protocol that combines topology-based routing and position-based routing, where topology-based routing is used at the RSU level, and position-based routing works at the vehicle level. The ant colony optimization algorithm is introduced to calculate the optimal route path under the SDVN architecture. The main contributions of this paper can be summarized as follows. Firstly, a neighbor RSU discovery protocol is proposed, through which each RSU can find all its neighbor RSUs and prepare for sending ant packets between adjacent RSUs. Secondly, the ant colony algorithm is applied to two adjacent RSUs of a street segment, and ant packets are periodically sent between the adjacent RSUs to calculate the evaluation value of the connectivity quality of the street segment. Finally, SDN is applied to VANET, and the RSU sends the evaluation values of the relevant street segments to the SDN server, which holds the connectivity quality information of all street segments and calculates the optimal route in the global scope according to the routing request. The remainder of this paper is organized as follows. In Section 2, the proposed routing scheme is presented, mainly including neighbor RSU discovery protocol and SDN-based routing protocol. The simulation tools, scenario, parameters, an evaluation of the results, and a comparison against the GSR and GPSR are described in Section 3. Finally, Section 4 concludes this paper.