A Novel Resource Allocation and Spectrum Defragmentation Mechanism for IoT-Based Big Data in Smart Cities

People’s demand for high-traffic applications and the need for Internet of Things (IoT) are enormous in smart cities. The amount of data generated by virtual reality, high-definition video, and other IoT applications is growing at an exponential rate that far exceeds our expectations, and the types of data are becoming more diverse. It has become critical to reliably accommodate IoT-based big data with reasonable resource allocation in optical backbone networks for smart cities. For the problem of reliable transmission and efficient resource allocation in optical backbone networks, a novel resource allocation and spectrum defragmentation mechanism for massive IoT traffic is presented in this paper. Firstly, a routing and spectrum allocation algorithm based on the distance-adaptive sharing protection mechanism (DASP) is proposed, to obtain sufficient protection and reduce the spectrum consumption. The DASP algorithm advocates applying different strategies to the resource allocation of the working and protection paths. Then, the protection path spectrum defragmentation algorithm based on OpenFlow is designed to improve spectrum utilization while providing shared protection for traffic demands. The lowest starting slot-index first (LSSF) algorithm is employed to remove and reconstruct the optical paths. Numerical results indicate that the proposal can effectively alleviate spectrum fragmentation and reduce the bandwidth-blocking probability by 44.68% compared with the traditional scheme.


Introduction
As the foundation of smart cities, Internet of Things (IoT) has become the cornerstone for deepening the construction of the "urban brain", in which numerous intelligent sensors, devices, and vehicles are connected to realize continuous coverage of urban areas and high-capacity coverage of key scenes [1,2]. In smart cities, people's demand for mobile Internet high-traffic applications and the need for IoT are enormous. This big-data-driven IoT would be the main driving force for the fifth-generation (5G) infrastructure deployment in smart cities, and also the industry believes that 5G can provide comprehensive support for ubiquitous IoT applications [3,4]. It is estimated that by 2021, there will be 28 billion mobile devices connected, of which 16 billion will be IoT-based sensors [5]. The amount of data generated by numerous sensors is growing at an exponential rate that far exceeds our expectations, and the types of data are becoming more diverse. The backbone infrastructure must meet the high requirements of high-speed, real-time, massive, stable, and other communication networks in mobile services such as virtual reality, high-definition video, and other IoT applications in smart cities [6,7].
The frequently-changing big data produced by numerous sensors has posed a great challenge to resource allocation, network optimization, multimedia data sensing and processing, etc. This IoT-based big data traffic requires optical backbone networks to carry reliably and efficiently [8,9]. However, spectrum resources are frequently reconstructed and released, resulting in severe spectrum fragmentation. Those unaligned, isolated, small-sized frequency slots (FS) blocks are difficult to use by the path, which reduces service admissibility and thus affects the quality of network operation [10]. It has become critical to reliably accommodate the IoT-based big data with a reasonable resource allocation method. Moreover, it would be better to make a trade-off between additional spectrum consumption, due to establishing protection paths, and increase of congestion probability, caused by excessive spectrum utilization in optical backbone networks for smart cities.
Researches on existing resource allocation approaches in optical backbone networks are mostly concerned about the working path to defragment, with little regard for the protection path to be defragmented. Focusing on the efficient spectrum allocation for reliable transmission, we propose a novel resource allocation and spectrum defragmentation (DF) mechanism for IoT-based big data. The main contributions of this paper can be listed as follows: (1) The distance-adaptive modulation (DAM) technology is employed to assign different modulation formats and different numbers of FS to the working and protection paths in optical backbone networks. In particular, a routing and spectrum allocation algorithm based on the distance-adaptive sharing protection mechanism (DASP) is proposed, which can reduce the spectrum consumption of the protection path while providing protection for services. (2) For network congestion caused by spectrum fragmentation under massive IoT-based big data, the online spectrum defragmentation algorithm based on OpenFlow is designed to reconfigure the protection paths. Furthermore, the spectrum resource utilization with reliability constraint is also optimized.
The rest of the paper is organized as follows: Section 2 reviews the research progress of the routing and spectrum allocation (RSA), and DF methods. Design of the network framework and function model based on software-defined networking (SDN) are then presented in Section 3. Section 4 describes the DASP algorithm for meeting the big data needs of massive IoT traffic. The strategy for spectrum defragmentation of the protection paths is described in Section 5. In Section 6, we make a comparison of our proposed scheme with the traditional schemes and evaluate their bandwidth-blocking probability (BBP) performance. The last section is the conclusion of this paper.

Related Works
Recently, many different resource allocation and spectrum defragmentation approaches have been proposed to achieve efficient resource utilization in optical backbone networks. In this section, we shall review the existing work of the RSA and DF schemes.

Routing and Spectrum Allocation
In recent years, to find a solution that can improve network transmission capacity and spectrum utilization in optical backbone networks, the elastic optical networks based on orthogonal frequency division multiplexing (OFDM) has emerged [11]. The entity of resource allocation changes from wavelength to spectrum, and the allocation strategy of resource management and regulation problems becomes complicated [12,13]. For the RSA issue in optical backbone networks, it can be extended to multiple issues such as routing, modulation level, and spectrum allocation. The authors in [14] considered distance-adaptive dynamic routing and spectrum assignment (RSA) for elastic optical networks with shared backup path protection (SBPP). Their efficient heuristic algorithms based on spectrum window planes were proposed for implementing distance and modulation format-adaptive RSA, so as to maximize spare capacity sharing among multiple protection paths. The authors of [15] proposed two dynamic RSA algorithms based on K shortest path (KSP); the algorithm needs to determine the candidate path in advance. In [16], the improved shortest path (MSP) algorithm and the spectrum constrained path vector search (SVP) algorithm were addressed, which can further improve network performance. To some degree, it will be at the expense of higher complexity. The authors of [17] proposed a dynamic RSA algorithm based on multi-path routing, which allows a demand to be divided into multiple requirements and transmitted on multiple paths. In [18,19], the authors investigated a novel method to evaluate clustering algorithms for hierarchical optical networks, they also presented a novel framework and the application mechanism with cooperation of control and management. The authors in [20] designed a simulator that can run and compare the performance of various RSA algorithms for studying RSA problems in optical backbone networks.

Spectrum Defragmentation
For the spectrum defragmentation (DF) issue in optical backbone networks, several defragmentation approaches have been presented. A.N. Patel et al. proposed two algorithms, namely "greedy-defragmentation" and "shortest path-defragmentation algorithm" [21]. In order to describe the basic idea of traffic splitting strategy in one-way resource allocation, the authors in [22] proposed a mathematical model with heuristic algorithm to accelerate resource allocation. In [23], the first-fit (FF) allocation strategy is used to assign light paths to partitions defined according to links used by particular connections. With most of the reactive approaches leading to traffic disruption and the proactive ones often providing no reactive measure to counter additional fragmentation induced by expired connection, hitless defragmentation was considered in [24]. The authors in [25] designed a defragmentation-based load balancing technique, which efficiently undertakes routing and spectrum assignment (RSA) and minimizes the fragmentation problem in an elastic optical network. In [26], the influence of different defragmentation parameters on network performance were analyzed.

Survivability in Optical Backbone Networks
For the dynamic optical communication requests, a dynamic distance-based adaptive shared-protection path strategy was proposed in [27]. The heuristic algorithm can effectively reduce the BBP of network services. In [28], pre-configured polyhedron-based protection was proposed to aid against multi-link failures in optical mesh networks. Shao et al. in [29] proposed a shared path-protection (SPP) based on the routing strategy of K shortest path and the spectrum allocation strategy of first-fit (FF). The task scheduling and resource allocation strategy is formulated in [30] as a joint optimization problem to maximize users' quality of experience (QoE). The authors in [31] proposed a defragmentation scheme using path switching in an optical network based on 1 + 1 path protection. Content-aware filtering for security services in centric networks was proposed in [32,33], it can realize the virtualization of network functions and better adapt to the needs of the future Internet. The above research results indicate that shared protection can achieve high free-capacity-sharing efficiency and improve spectrum utilization.

SDN based Approaches
Software-defined networking (SDN) decouples the control plane and data plane of the network, making the network programmable, adaptive, and application aware. The authors in [34] presented a new approach for comprehensive monitoring of a software-defined 5G mobile network by using an IoT (Internet of Things)-based framework. The proposed framework provides mobile network operators with an easier implementation of monitoring systems. SDN support centralized the control of network control and management, giving service providers greater freedom to dynamically define network devices [35]. The authors in [36] proposed a new interoperability backup model to improve the survivability of the control plane in SDN. However, in order to consider survivability, the allocation of spectrum resources needs further research.

Overall Network Architecture and System Model
In optical backbone networks, to efficiently and intelligently manage network spectrum resources and improve spectrum utilization, the control plane can be used for defragmentation. One of the candidate control plane schemes is the SDN, which manages the global information of the network, including the network topology and spectrum usage on each link. As one of the most promising implementations of SDN, OpenFlow (OF) is a key protocol proposed by researchers at Stanford University for SDN architecture, which utilizes stream-based transformation and uses a centralized controller to facilitate software-defined routing, transformation, and network management.

Design of SDN-Based Network Architecture
The SDN-based network architecture shown in Figure 1 consists of the data plane and control plane. The data plane includes an edge router (ER) and a bandwidth-variable wavelength selective switch (BV-WSS). When serving the traffic demands, the bandwidth-variable transponder (BV-T) in the ER allocates appropriate spectrum resources for client traffic, and the BV-WSS performs data forwarding according to the corresponding frequency band. Above the data plane, the OpenFlow-based control plane is responsible for centralized and efficient resource management of the entire data plane. The control plane consists of a centralized OpenFlow controller (OF-C) and several OpenFlow agents (OF-AG), which communicate with each other through the extended OpenFlow protocol. Each data plane device has an OpenFlow agent connected to it locally to control the dynamic optical path establishment and deletion of the data plane.  Figure 2 shows the functional design of the OF-AG and the OF-C. The OF-AG is a bridge between the control plane and the data plane. The data plane device needs to be configured according to the flow table from the OF-C. The OpenFlow client (OF-Client) uses the extended OF to communicate with the OF-C. The local traffic database (LTD) stores the flow table, and the device controller implements the flow table of the data plane device. As the "brain" of the SDN, the OF-C needs to intelligently determine the optical path configuration strategy according to the network status. In the OF-C function module, the resource provision module (RPM) communicates with the OF-AG and the resource calculation module (RCM) to process the OF information. The resource computation module (RCM) receives computing tasks from the RPM or the DF-AG and calculates the corresponding RSA solution. When the OF-C receives the request from the OF-AG, the RPM receives the request message, parses it and hands it to the RCM for processing. In addition, the RCM also receives requests from the defragmentation agent (DF Agent) for spectrum defragmentation operations. The DF-AG invokes the DF operation to select the optical path in the current service for reconfiguration, instructing the RCM to calculate a new RSA solution for it. Both DF-AG and TED are externally connected to an external network management system (NMS). DF-AG can accept NMS defragmentation requests, and TED can accept NMS content reading and monitoring. The network abstraction module (NAM) is responsible for communicating with each OF-AG, collecting topology information in the network, and abstracting all data plane device information into the TED.

Design of DASP Mechanism
In order to improve spectrum utilization, this paper proposes a routing and spectrum allocation algorithm based on the distance-adaptive sharing protection mechanism (DASP) in optical backbone networks for smart cities. For each traffic demand, Dijkstra's shortest path algorithm is used to search for working and protection routes, the first-fit (FF) strategy and the least shared cost (LSC) strategy are applied to allocate spectrum resources for the working and protection paths, respectively. Considering the case where the spectrum of the optical transceiver is adjustable, the frequency slots on the working path and the protection path can use different index values.
A summary of the notations used in this paper is presented in Table 1. Table 1. Summary of notations.

Notation Description
The source node of C i D i The destination node of C i R i The traffic request bandwidth of C i F Number of FSs required ME The carrying capacity per FS of the modulation format f j The cost of the j th frequency slot m j Number of protection paths sharing the i th FS in a contiguous FSs block k The k th link in set E P Set of links through which the protection path established for C i passes L WP The list of the available WP(S i , The list of the available PP(S i , D i , R i )

Distance-Adaptive Modulation (DAM)
Network survivability is a critical networking problem in optical backbone networks. Establishing a protection path for services can effectively improve network survival performance, but it is not conducive to efficient use of spectrum resources. In order to alleviate this problem, in the process of establishing work and protection paths, the DAM technology is used to adaptively select the modulation format suitable for the transmission distance for the working and protection paths [37]. Specifically, when a low-order modulation format (such as binary phase shift keying, that is, BPSK) is used for transmission, the bandwidth of the signal is increased, and the anti-interference capability is also enhanced. As shown in Table 2, for every 1-bit modulation format added in the backbone network, the amount of traffic information that can be carried by the unit frequency slot will be doubled, and the transmission distance will be reduced to half. (The subcarrier load capacity in the table indicates the FS capacity under the corresponding modulation format, Quadrature Phase Shift Keying (QPSK), Quadrature Amplitude Modulation (QAM)). Due to transmission loss and physical distance limitations, working and protecting paths may use different modulation formats. The modulation format is determined by the actual length of each connection path. Since low modulation levels result in more spectrum consumption, we try to choose a high modulation level. In order to describe the DASP algorithm in detail, the decision of the modulation level in the RSA is first illustrated. We can use an eight-node graph to represent the network topology. Here we uses G(V, E) to represent an elastic optical network, where V represents a collection of physical nodes and E represents a collection of fiber links. A service connection request is represented as C i (S i , D i , R i ), S i is the source node, D i is the destination node, R i is the traffic demand transmission rate, and the unit is Gbit/s. Assuming that the bandwidth per FS is 12.5 GHz, the capacity of one traffic demand is an integer multiple of the FS size. To achieve the required bandwidth R for the traffic demand, the required number of FSs can be calculated according to formula F = R/ME for a certain modulation format, where ME represents the carrying capacity per FS of the modulation format, corresponding to BPSK, QPSK, 8-QAM, and 16-QAM, which are 12.5, 25, 37.5, and 50 Gbit/s, respectively.
We use an example to illustrate the application of DAM technology in spectrum resource allocation, which considers an eight-node network as shown in Figure 3, with the current state of network spectrum resources as shown in Figure 4. When the first request C 1 (A, C, 100) arrives, the working path assigned to this request is the shortest path A − B − C calculated by the Dijkstra's shortest path algorithm, with a physical distance of 500 km. Since the working optical path distance of C 1 is short, the more efficient modulation format 16-QAM can be selected, and the spectrum resources of [100/50] = 2 frequency slots are needed. The distance of its protection path A − H − G − C is 500 km, and we select 16-QAM and allocate two frequency slots for the protection path. Similarly, when the second request C 2 (A, D, 100) arrives, its working path is A − B − C − D, the distance is 1000 km, the appropriate modulation format is 8-QAM, and the required number of FS is [100/37.5] = 3. Its protection path is A − H − G − F − D, the distance is 1300 km, the modulation format is QPSK, and the required number of FS is 4. When the third request C 3 (C, E, 50) arrives, the working path is A − H − G − F − D, the distance is 1500 km, we need to select the modulation format QPSK for it, and the number of FS is [50/25] = 2. The length of its protection path C − G − F − E is 2040 km, the modulation format is BPSK, and the required number of FS is 4.

Shared Protection Principle
Protection technologies in optical backbone networks are mainly divided into dedicated protection and shared protection technologies. The DASP algorithm considers shared backup path protection-a path-oriented protection technique. We need to preset the protection path and protection capacity in advance. When a failure occurs, the service will be switched to the corresponding protection path for transmission [38,39].
The shared protection allows spare capacity sharing among multiple protection paths so long as their corresponding working paths cannot share capacity with other services. In the 1 + 1 dedicated protection technology, the protection capacity of each optical path is dedicated to protecting its corresponding working optical path. Compared with the 1 + 1 dedicated protection technology, shared backup path protection can more effectively utilize protection resources and improve spectrum utilization. As shown in Figure 3, the CG segments of C 1 and C 3 can share spectrum resources because their protection paths do not intersect. The spectrum resource usage status under shared protection is shown in Figure 5. Compared with Figure 4, the maximum index occupying FS is changed from 13 to 10, and two FSs are saved. This shows that shared protection achieves high free-capacity-sharing efficiency and improves spectrum utilization.

Routing and Spectrum Allocation Strategy
In the SDN framework, OF-C controls the entire networks. When a traffic demand arrives, an RSA scheme is calculated for the request and an optical path is established. In this paper, the RCM adaptively selects the modulation level and calculates the RSA scheme by using the DASP algorithm when processing the RSA task. In the DASP algorithm, the distance-adaptive modulation (DAM) technology is employed to adaptively select the appropriate modulation format for the services. For each traffic demand, the DASP algorithm advocates applying different strategies to the resource allocation of the working and protection paths. Specifically, we use the first-fit (FF) strategy for the working path and the least shared cost (LSC) strategy for the protection path. The DASP algorithm makes the services tend to use sharable spectrum resources, which can reduce the waste of spectrum resources caused by establishing the protection paths.
In the routing step, the route with the lowest cost is considered the one with the fewest hops. The available frequency slot of the protection path may be an unoccupied FS, or an FS that is used by the protection path of other services but whose working links do not intersect. The DASP algorithm advocates applying different algorithms to the resource allocation of the working and protection paths in spectrum allocation. Specifically, we use the first-fit (FF) strategy for the working path and the least shared cost (LSC) strategy for the protection path, with the aim of reducing fragmentation and improving spectrum utilization. Under the FF strategy, we will select the first available path and continuous frequency slot blocks. In order to obtain the best network performance, this section proposes a novel LSC strategy for allocating spectrum resources for the protection path. The LSC strategy compares all candidate continuous frequency slots and selects the lowest sharing cost case for establishing the optical path.
The LSC strategy considers the sharing state of each FS to set the cost value, so that the more times of sharing, the smaller the cost value. The cost of the j th frequency slot f j in a continuous FS block is defined in Equation (1): Then, to find a continuous FS block established for the traffic demand C i with the lowest cost, the cost is calculated in Equation (2): where m j is the number of protection paths sharing the i th FS in a contiguous FS block, F is the number of FSs in a continuous FS block, k is the k th link in set E, and P is the set of links through which the protection optical path established for the traffic demand C i passes. In order to achieve better network performance, the LSC strategy will make the upcoming traffic demands more inclined to use FS blocks with smaller cost values. Based on the above introduction, the pseudo-code for DASP algorithm details are described as Algorithm 1.
if it is successful then 6: for (j = 0; j < L WP ; j + +) do 7: Determine the modulation format for WP(S i , D i , R i ); 8: Calculate F i ;//according to F = R/ME; 9: Run FF to allocate spectrum resources for WP(S i , D i , R i ); 10: if it is successfully allocated then 11: Update the spectrum resource usage status; 12: Remove Run Dijkstra on G to calculate PP(S i , D i , R i ); 21: if it is successful then 22: for (k = 0; k < L PP ; k + +) do 23: Determine the modulation format for PP(S i , D i , R i ); 24: Calculate F i ;//according to F = R/ME; 25: Run LSC to allocate spectrum for PP(S i , D i , R i );//according to Equation (2)  26: if it is successfully allocated then 27: Update the spectrum resource usage status; 28: break;//the RSA of WP(S i , D i , R i ) and PP(S i , D i , R i ) is completed 29: else remove PP(S i , D i , R i ) from L PP ; 30: end if 31: if L PP = φ then 32: Release the spectrum resources occupied by WP( end if 37: end for 38: else C i (S i , D i , R i ) is for releasing an old connection then Remove C i (S i , D i , R i ) from the network; 39: Release the remaining spectrum resources; 40: end if 41:} The algorithm ends.

Protection Path Spectrum Defragmentation Scheme
In order to alleviate spectrum fragmentation, we propose an online protection path spectrum defragmentation algorithm LSSF based on OpenFlow. The LSSF algorithm first attempts to remove and reconstruct the protection paths with a lower start index value of the FSs. When performing spectrum rearrangement, the algorithm selects the lowest starting slot-index available spectrum resources that satisfy the traffic demand. The LSSF algorithm can effectively alleviate the problem of spectrum fragmentation and further improve spectrum utilization.
Under the dynamic traffic demands in optical backbone networks, the continuous establishment and removal of optical paths and the continuous evolution of the spectrum can cause severe spectrum fragmentation. In order to alleviate spectrum fragmentation, defragmentation must be done frequently. The purpose of spectrum fragmentation is to concentrate the spectrum resources occupied by the services, and keep the unoccupied spectrum resources continuous to reduce the situation whereby requests are blocked due to fragmentation. In this section, based on the DASP algorithm, the OpenFlow is used to manage the protection optical paths, and the lowest starting slot-index first (LSSF) algorithm is used to remove and reconstruct the optical paths. Specifically, the OF-C actively collects and analyzes the spectrum usage on each link. When defragmentation is required, the OF-C evokes a defragmentation operation to notify all the corresponding OF-AGs to change the working state of the data plane equipment. To reconfigure the light path, the LSSF algorithm is described as Algorithm 2. Compared with the FF algorithm, the LSSF algorithm has great advantages, this is because the LSSF algorithm can utilize any frequency slot block wider than the required spectrum, and the utilization rate is greatly increased. The LSSF algorithm first attempts to remove and reconstruct the protection optical paths service with a lower start index value of the FSs. The currently established protection optical paths are arranged in ascending order according to the FS starting index, and each protection optical path service is sequentially removed and reconstructed. When reconstructing the optical path, we make the new spectral position of an optical path more forward. When an optical path cannot be reassigned to a lower allocation index, the defragmentation operation is abandoned. The LSSF algorithm maintains an index list of available frequency slots, scanning one by one from the lowest indexed spectrum resources, and selecting the lowest starting slot-index available spectrum resources that satisfy the traffic demand. By selecting the spectrum in this way, the current connection request is allocated to the frequency slot resources with a small number of index values, which allows the optical paths allocated on the higher spectral index to be reallocated to the unoccupied spectrum left by them. Figure 6 shows the spectrum resource state after the defragmentation of the three services C 1 , C 2 , C 3 . According to the LSSF scheme, we should first assign C 1 and C 3 with lower frequency slot start index values, and then assign C 2 .

Simulation Parameter Settings
The BBP performance of the proposed RSA and defragmentation algorithms is evaluated via simulations. We usethe high-performance server of the laboratory to build the SDN control plane experimental platform, including a centralized controller OF-C and multiple OF-AGs. We consider the NSFNET network of 14 nodes and 21 links and the USNET network topology of 24 nodes and 43 links to interconnect them. Assume that there is a dynamic optical path service model with a total bandwidth of 5000 Hz available in each fiber, each FS has a bandwidth of 12.5 GHz and there are 400 FSs per fiber link. The service arrival rate of each node obeys the Poisson distribution with the parameter λ. The hold time of each service follows the negative exponential distribution with the parameter 1/µ. The traffic load is the product of the service arrival rate and the average service duration λ/µ. The bandwidth requirements of each rate service are 25, 50, 50, and 75 GHz, respectively. The number of FSs required for each request is determined adaptively based on distance. In order to verify the advantages and disadvantages of the proposed algorithm, the bandwidth-blocking rate is taken as the main evaluation index of network performance. A total of 10 5 light-path arrival events are simulated to calculate BBP. BBP is defined as the ratio of the amount of blocked service bandwidth to the total amount of arriving services bandwidth, we calculate it in Equation (3) as follows: where R i represents the bandwidth requirement of the i th service, C represents the set of all arriving traffic demands, and C B represents the set of all blocked traffic demands.

Simulation Results and Analysis
For performance comparisons, we evaluate the results for different situations. "1 + 1-FF" means that the FF strategy is used to allocate the dedicated protection optical path spectrum without considering the distance constraint, and "DASP-FF" is an algorithm for assigning the protection optical path spectrum by using the FF strategy in consideration of the distance constraint. "DASP-LSC" means an algorithm that uses the LSC policy to allocate the spectrum of the protection optical paths in consideration of the distance constraint. Figures 7 and 8 show how the BBP performance changes with the increase of traffic load per node pair. As more traffic demands arrive, there are not enough free spectrum resources in the network to provide for subsequent arriving services. The shared protection RSA algorithm considering the distance constraint can outperform the case "1 + 1-FF". In addition, compared to the FF strategy, the LSC strategy improves the performance of BBP better. This is because the more FSs that are shared by the protection optical path, the smaller the cost value is, and the future protection optical paths tend to use these low-cost FSs under the LSC strategy. However, the strategy comes at the cost of more computing time.  Next, we compare the situation before and after defragmentation of the protection paths. Figure 9 shows the comparison of BBP without defragmentation and defragmentation with the LSSF algorithm in the NSFENT network. Figure 10 is an experimental result of the USNET network topology. Although the USNET has a larger topology size, more network nodes, and a larger number of links, the simulation results are similar to those of the NSFENT network. As can be seen in the two figures, the LSSF scheme has an obvious reduction in BBP, it can significantly outperform the "Before-DF" case. The defragmentation of the protection paths will not affect the established optical transmission of the working paths while improving the spectrum utilization.

Conclusions
In smart cities, all the intelligent things including billions of sensors, devices, and vehicles are generating massive data calculated in ZettaBytes, and the types of data are becoming more diverse. The big data generated by virtual reality, high-definition video, and other IoT applications has posed a great challenge to efficient resource allocation in optical backbone networks for smart cities. For the problem of reliable transmission and efficient resource allocation in optical backbone networks, this paper focuses on the study of resource allocation and the spectrum defragmentation mechanism to relieve network congestion and improve spectrum utilization. Firstly, a routing and spectrum allocation algorithm based on distance-adaptive sharing protection is proposed. To improve spectrum utilization while providing protection for services, an online defragmentation algorithm for protecting paths is then designed. The simulation results indicate that the proposal has a 44.68% reduction in bandwidth-blocking probability compared to the traditional scheme.