## 1 Introduction
See Figure 1. For background on Core Layer, FRAN Layer, and IoT Devices Layer, see References [17; 22; 23; 24; 25; 26; 27; 28]. Figure 1: The network and architectural overview of UbiPriSEQ. UbiPriSEQ allows various IoT devices and other entities to fulfil their computing and data requirements while also managing their privacy and security needs. For example, a smartphone may need to offload a deep learning (DL) computation and associated data to FRAN Layer due to its low-latency constraints and the lack of computing resources to execute the computation on board. Larger and latency-tolerant jobs that require bigger resources are offloaded to Core Layer, which comprises clouds, high performance computing (HPC) clusters, big data analytics facilities, and other infrastructures. The data and computations may also be offloaded or migrated due to security and privacy reasons, or perhaps because the data required by a computational job at a device resides in FRAN Layer. Many other possibilities also exist. Device Module decides whether to offload computations to the fog or cloud, or run locally. This is done while managing privacy, priority, energy-efficiency, and QoS requirements of the computations. Network Module devises policies for data migration between fog nodes to preserve privacy. It also broadcasts dummy signals to confuse eavesdroppers to address privacy and security concerns. The two modules continuously learn from each other and adaptively optimize the ubiquitous environment. All in all, UbiPriSEQ devises policies and makes decisions related to a number of important parameters including local processing and offloading rates for data and computations, radio channel states, transmit power, task priority and selection of a fog node for offloading, data migration, and others. These decisions are made dynamically, adaptively, and holistically, as needed, and based on the environment to optimize QoS, energy efficiency, security and privacy. The operational intelligence in UbiPriSEQ is provided by Deep Reinforcement Learning (DRL). The UbiPriSEQ framework proposed in this paper is novel for several reasons. As mentioned above, the earlier works have focused on one or two of the network design parameters while we attempt to holistically optimize QoS, energy efficiency, security, and privacy (data privacy, user location privacy, and user pattern privacy). Secondly, UbiPriSEQ adaptively and dynamically deals with the environment by continuous learning, and does not need a priory complete specification of the environment, security attack models, and other design parameters. Thirdly, we use DRL to provide adaptive intelligence which has not been investigated before in 5G networks. Fourthly, most existing works use simulated data for performance evaluation while we have used SpMV, a real-life application to study UbiPriSEQ performance, and this has not been reported before. The SpMV operation is central to deep learning algorithms and this per se would create a significant impact. The rest of the paper is organized as follows. Section 2 reviews the relevant works. Section 3 discusses system design requirements. Section 4 describes the UbiPriSEQ framework and Section 5 evaluates the system. Section 6 concludes and gives future directions.