# Design and Implementation of Virtual Security Function Based on Multiple Enclaves
## 2 Related Work  
Some research efforts have been devoted to building trusted VNFs. [PERSON] et al. [11] provide a summary of current techniques for establishing trusted NFVs, and summarize two approaches to protecting NFVs in terms of cryptographic or trusted hardware-based mechanisms. ESTI [2] proposes to provide trusted protection based on HSM (hardware security module), TPM (trusted platform module) [12], and vTPM (virtual trusted platform module) [13]. NetBricks [14] leverages a safe language (Rust) and LLVM [15] to build a zero copy soft isolation. It provides memory isolation software by using type safe language and achieves high performance by adopting LLVM as an optimization back-end of compilers. NetBricks can also ensure that only a single NF can access a packet, so as to guarantee the packet isolation in common cases. OpenNetVM [16] runs NFs in lightweight Docker containers based on the NetVM architecture. It provides NF isolation through container mechanisms, such as namespace and capability.  
In recent years, with the rise of SGX technology, using SGX to protect VNF has also become a hot research direction. SGX can isolate network functions and sensitive data into a secure container called enclave.  
[PERSON] et al. [8] first proposed a new idea of using SGX to protect a virtual network function. The article proposed to put Click elements into an enclave to provide run-time isolation and compare the performance overhead of using SGX. [PERSON] et al. [17] analyzed the security challenge of using SGX to protect VNF. To improve system performance, a lightweight trusted implementation framework for protecting VNF was proposed based on SGX and Click, and a fine-grained state migration mechanism was presented. In order to verify the feasibility of the framework, the article implements a DDoS detection system based on their architecture. [PERSON] [6] proposed to put all VNFs into an enclave and use the security features of the Rust language for memory isolation of the VNF, thereby avoiding the performance overhead between multiple enclaves. S-NFV [9] uses SGX to design a new architecture to provide integrity protection for NFVs outsourcing. It ensures the stateful security of NFVs and proposes a remote attestation approach to allow remote parties to confirm the security of the VNF. [PERSON] [18] proposed a secure middleware framework for deploying high-performance VNFs on untrusted commercial servers. Slick designs and implements various VNFs based on Click and runs on top of the Scone architecture. Scone [19] is a secure Docker container based on SGX that supports user-level threads and asynchronous system calls to reduce the performance overhead caused by thread synchronization and system calls in enclaves. Slick also optimizes its performance to keep the system's native throughput and latency.  
In a word, these solutions combine the security features of NFV technology and SGX in all aspects and provide a solution for protecting VNF. However, the above work puts VNFs into a single enclave that affects the scalability of NFVs because users cannot scale in/out a single VNF. In addition, none of the above work supports the dynamic reconfiguration at run-time when the original VNFs need to be modified.  
Compared with the previous work, we propose a virtual security function architecture based on multiple enclaves to ensure the security and scalability of VNFs. In our system, the sensitive modules of VNF can be put in different enclaves and communicate by local attestation so as to improve the scalability of the system while providing run-time security protection for VNFs. In addition, we present a new hot-swapping mechanism to enable the system to be reconfigured at run time without stopping the whole system.