Online Traffic Obfuscation Experimental Framework for the Smart Home Privacy Protection
Abstract
1. Introduction
- An online traffic obfuscation experimental network is established, which is an operational network link between smart home devices and their external router that enables real-time capture and dynamic obfuscation of traffic patterns (including packet size and timing characteristics) while maintaining normal device operation.
- The implemented platform supports three fundamental obfuscation primitives: fake traffic injection, packet padding, and packet segmentation. Additionally, it provides an extensible architecture for integrating and evaluating novel complex obfuscation methods through continuous online validation.
- Our evaluation confirms the framework’s ability to preserve device connectivity and functional integrity during obfuscation. While the basic techniques demonstrate partial effectiveness against traffic analysis (consistent with existing literature), the results highlight the need for developing advanced composite methods building upon these foundational approaches to achieve stronger protection.
2. Related Work
3. Online Traffic Obfuscation Experimental Network
4. Online Traffic Obfuscation Experimental Framework
- (a)
- Synthetic traffic injection/terminationBased on the interaction traffic (captured in PCAP files) between the server and smart home devices, synthetic packets are constructed and injected from node 2 (or node 7). Subsequently, these packets assist node 3 (or node 6) in completing the injection of fake traffic. Finally, the synthetic packets are terminated at node 7 (or node 2).
- (b)
- Traffic filtering and redirectionAt nodes 3 and 6, packets are filtered and redirected based on the specified source address or destination address. For instance, the following commands are used to filter and redirect traffic associated with IP address 192.168.2.175 to NFQUEUE queue 1:iptables -A FORWARD -s 192.168.2.175 -j NFQUEUE --queue-num 1iptables -A FORWARD -d 192.168.2.175 -j NFQUEUE --queue-num 1NFQUEUE is a target in the Netfilter framework that enables packets to be passed from the kernel space to user-space programs for processing. User-space programs can utilize the NetfilterQueue library in Python (version 3.10.13) to read packets from a specified queue and determine whether to accept, drop, or alter the packets as required. The structure of these packets is illustrated in Figure 4, where the numbers in parentheses represent the number of bits occupied by the corresponding field. The highlighted fields indicate where modifications occur. Green fields are modified during fake traffic injection, blue during packet segmentation, purple during both padding and segmentation, and yellow during all three operations. Since the data is transmitted over the Transport Layer Security (TLS) protocol, the TCP payload, also referred to as the TLS layer, consists of the “Type”, “Version”, “Length”, and “Fragment” fields. Here, the “Type” and “Version” fields record information about the TLS protocol, while the “Length” field specifies the length (in bytes) of the “Fragment”.
- (c)
- Traffic obfuscation/restorationAt node 3, the downlink traffic (from the server to the home device) is obfuscated, and its characteristics are randomized to decrease the recognition accuracy of specific device traffic. Prior to reaching the home device, the obfuscated downlink traffic is restored to its original content at node 6 as required. Similarly, the uplink traffic (from the home device to the server) undergoes the same process at nodes 6 and 3, respectively, ensuring efficient bidirectional obfuscation and restoration.
- (d)
- Traffic re-forwardingAfter the specified traffic is obfuscated or restored in user space, it is subsequently reinjected into kernel space and re-forwarded via the packet.accept() method of the NetfilterQueue library, ensuring normal communication.
4.1. Fake Traffic Injection
- Synthetic traffic injection/terminationSynthetic traffic is a foundational type of traffic specifically designed to emulate real device behavior, serving as a critical support mechanism for fake traffic injection strategies. At nodes 2 and 7, the Scapy library uses captured device traffic (PCAP files) to synthesize and inject network traffic, simulating realistic bidirectional communication. This approach circumvents the operating system’s TCP/IP protocol stack, enabling direct transmission of custom packets via Scapy’s send() function, thus enhancing controllability. In the packet injection process, various fields of IP and TCP layers can be modified flexibly as required. To ensure that the timing characteristics of the injected traffic closely resemble those of real traffic, it is necessary to minimize the discrepancy between the packet intervals of the synthetic traffic generated on nodes 2 and 7 and those of the actual traffic. Additionally, the ntpd -g -p ntp.aliyun.com command is employed to synchronize the system time of nodes 2 and 7 with standard time, ensuring temporal consistency and thereby further enhancing the accuracy and timing coherence of the injected traffic.Smart home devices perform the TCP three-way handshake only when establishing a network connection. The handshake process is not required during the subsequent remote control phase. Accordingly, the fake traffic injection method implemented in the experimental setup also excludes the handshake process, ensuring alignment with the communication behavior observed during the remote control phase. Although no actual transport-layer connection (e.g., a TCP three-way handshake) is established, key parameters such as timestamps, IP and port combinations, and sequence numbers can be utilized. These parameters enable the reconstruction of a seemingly legitimate and continuous bidirectional communication trace. The synthetic traffic constructed on node 2 eventually reaches the destination node 7, and vice versa, with the traffic from node 7 ultimately arriving at node 2, ultimately completing the termination process in the destination node.
- IP address modificationFor downlink traffic, the process of fake traffic injection and elimination is as follows. Firstly, traffic originating from node 2 and destined for node 7 is intercepted in user space from kernel space at node 3. Subsequently, the source address of the packet is modified from 192.168.2.2 to the IP address of the smart home server, while the destination address is modified to the IP address of a device within the smart home network (e.g., 192.168.2.175). The modified packet is then reinjected into kernel space for re-forwarding. At node 6, traffic with a source address corresponding to the smart home server IP and with a designated destination address (e.g., 192.168.2.175) is again intercepted in user space. The source and destination addresses of the packet are subsequently restored to 192.168.2.2 and 192.168.2.5, respectively. Finally, the modified traffic is reinjected into kernel space for further forwarding.For uplink traffic, similar to the aforementioned process, fake traffic injection and elimination operations are carried out at nodes 6 and 3, respectively.
4.2. Packet Padding
4.2.1. Implementation Principles of Packet Padding
- Packet paddingAt node 3, the packets destined for home devices are intercepted into the user space. The TCP payload of each packet is extended with a random-length padding. This padding is encrypted with the method agreed between nodes 3 and 6, and its length is stored in the IP header field. The padding consists of random characters and is appended to the end of the TCP payload. Several fields are modified, including the IP , , , and fields; the TCP (), (), and fields; as well as the TLS field. The positions of these fields are illustrated in Figure 4. Subsequently, the padded packet is re-forwarded.
- Packet restorationAt node 6, the packets destined for home devices are intercepted again into the user space. The packet is restored by removing a specific number of characters from the end of the TCP payload, where the number of characters to be removed is obtained from the IP header field. The relevant fields need to be modified. Subsequently, the restored packet is re-forwarded.
4.2.2. Key Algorithms for Packet Padding
Algorithm 1 Calculate , and at Node 3. |
Input: , , , , , l, , Output: , ,
|
4.3. Packet Segmentation
5. Performance Analysis
5.1. Continuous Connectivity and Functionality of Devices
5.2. Overhead
5.2.1. Node CPU and Memory Usage
5.2.2. Node Throughput
5.2.3. Network Performance
5.3. Traffic Statistical Characteristics
5.4. Device Event Recognition Rate
5.4.1. The Impact of Fake Traffic Injection on the Device Event Recognition Rate
- Data Preparation and Model Training: The on/off event fingerprint features of the Mijia LED bulb are extracted from a CSV file. Labels are uniformly appended, and the data are merged. Additionally, the direction and event types are encoded for further processing. Subsequently, the sequence of packets within these fingerprints (comprising combinations of packet size and direction) is utilized to train a random forest classifier, enabling accurate recognition of device types and their corresponding events.
- Traffic Analysis and Device Event Recognition: The size of TCP packets and their timestamp information are extracted from the PCAP file and matched with the features of the packet sequences in the training set in terms of timing to filter out the time segments that meet the requirements. After that, the matched data sequences are predicted using the trained model to recognize the device events corresponding to them. The recognition results for device on/off events before and after fake traffic injection are presented in Figure 13 and Figure 14, respectively.
5.4.2. The Impact of Packet Padding and Segmentation on the Device Event Recognition Rate
5.5. Device Recognition Rate
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Grand View Research. Smart Home Market Size, Share & Trends Analysis Report By Product (Security & Access Controls, Lighting Control), By Protocol (Wired, Wireless, Hybrid), By Application (New Construction, Retrofit), By Region, And Segment Forecasts, 2025–2030. 2025. Available online: https://www.grandviewresearch.com/industry-analysis/smart-homes-industry (accessed on 23 May 2025).
- Skowron, M.; Janicki, A.; Mazurczyk, W. Traffic Fingerprinting Attacks on Internet of Things Using Machine Learning. IEEE Access 2020, 8, 20386–20400. [Google Scholar] [CrossRef]
- Ahsan, M.S.; Islam, M.S.; Hossain, M.S.; Das, A. Detecting Smart Home Device Activities Using Packet-Level Signatures From Encrypted Traffic. IEEE Trans. Dependable Secur. Comput. 2025, 22, 1070–1081. [Google Scholar] [CrossRef]
- Apthorpe, N.; Reisman, D.; Feamster, N. Closing the Blinds: Four Strategies for Protecting Smart Home Privacy From Network Observers. In Proceedings of the 2017 IEEE Symposium on Security and Privacy (SP) Workshop on Technology and Consumer Protection (ConPro ’17), San Jose, CA, USA, 25 May 2017; pp. 1–6. Available online: https://www.ieee-security.org/TC/SPW2017/ConPro/papers/apthorpe-conpro17.pdf (accessed on 27 February 2025).
- Jmila, H.; Blanc, G.; Shahid, M.R.; Lazrag, M. A Survey of Smart Home IoT Device Classification Using Machine Learning-Based Network Traffic Analysis. IEEE Access 2022, 10, 97117–97141. [Google Scholar] [CrossRef]
- Datta, T.; Apthorpe, N.; Feamster, N. A Developer-Friendly Library for Smart Home IoT Privacy-Preserving Traffic Obfuscation. In Proceedings of the 2018 ACM Special Interest Group on Data Communication (SIGCOMM) Workshop on IoT Security and Privacy (IoT S&P ’18), Budapest, Hungary, 20 August 2018; pp. 43–48. [Google Scholar] [CrossRef]
- Apthorpe, N.; Huang, D.Y.; Reisman, D.; Narayanan, A.; Feamster, N. Keeping the Smart Home Private with Smart (er) IoT Traffic Shaping. In Proceedings of the 2017 Privacy Enhancing Technologies Symposium (PETS), Minneapolis, MN, USA, 18–21 July 2019; Volume 2019, pp. 128–148. [Google Scholar] [CrossRef]
- Wang, C.; Kennedy, S.; Li, H.; Hudson, K.; Atluri, G.; Wei, X.; Sun, W.; Wang, B. Fingerprinting Encrypted Voice Traffic on Smart Speakers with Deep Learning. In Proceedings of the 13th ACM Conference on Security and Privacy in Wireless and Mobile Networks (WiSec ’20), Linz, Austria, 8–10 July 2020; pp. 254–265. [Google Scholar] [CrossRef]
- Alshehri, A.; Granley, J.; Yue, C. Attacking and Protecting Tunneled Traffic of Smart Home Devices. In Proceedings of the Tenth ACM Conference on Data and Application Security and Privacy (CODASPY ’20), New Orleans, LA, USA, 16–18 March 2020; pp. 259–270. [Google Scholar] [CrossRef]
- Sivanathan, A.; Sherratt, D.; Gharakheili, H.H.; Radford, A.; Wijenayake, C.; Vishwanath, A.; Sivaraman, V. Characterizing and Classifying IoT Traffic in Smart Cities and Campuses. In Proceedings of the 2017 IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS), Atlanta, GA, USA, 1–4 May 2017; pp. 559–564. [Google Scholar] [CrossRef]
- Pinheiro, A.J.; de Araujo-Filho, P.F.; Bezerra, J.d.M.; Campelo, D.R. Adaptive Packet Padding Approach for Smart Home Networks: A Tradeoff Between Privacy and Performance. IEEE Internet Things J. 2021, 8, 3930–3938. [Google Scholar] [CrossRef]
- Sivanathan, A.; Gharakheili, H.H.; Loi, F.; Radford, A.; Wijenayake, C.; Vishwanath, A.; Sivaraman, V. Classifying IoT Devices in Smart Environments Using Network Traffic Characteristics. IEEE Trans. Mob. Comput. 2019, 18, 1745–1759. [Google Scholar] [CrossRef]
- Brahma, J.; Sadhya, D. Preserving Contextual Privacy for Smart Home IoT Devices With Dynamic Traffic Shaping. IEEE Internet Things J. 2022, 9, 11434–11441. [Google Scholar] [CrossRef]
- Ren, J.; Dubois, D.J.; Choffnes, D.; Mandalari, A.M.; Kolcun, R.; Haddadi, H. Information Exposure From Consumer IoT Devices: A Multidimensional, Network-Informed Measurement Approach. In Proceedings of the ACM Internet Measurement Conference (IMC ’19), Amsterdam, The Netherlands, 21–23 October 2019; pp. 267–279. [Google Scholar] [CrossRef]
- Alyami, M.; Alkhowaiter, M.; Al Ghanim, M.; Zou, C.; Solihin, Y. MAC-Layer Traffic Shaping Defense Against WiFi Device Fingerprinting Attacks. In Proceedings of the 2022 IEEE Symposium on Computers and Communications (ISCC), Rhodes, Greece, 30 June–3 July 2022; pp. 1–7. [Google Scholar] [CrossRef]
- Zhang, S.; Shen, F.; Liu, Y.; Yang, Z.; Lv, X. A Novel Traffic Obfuscation Technology for Smart Home. Electronics 2023, 12, 3477. [Google Scholar] [CrossRef]
- Alyami, M.; Alghamdi, A.; Alkhowaiter, M.A.; Zou, C.; Solihin, Y. Random Segmentation: New Traffic Obfuscation against Packet-Size-Based Side-Channel Attacks. Electronics 2023, 12, 3816. [Google Scholar] [CrossRef]
- Pinheiro, A.J.; Bezerra, J.M.; Campelo, D.R. Packet Padding for Improving Privacy in Consumer IoT. In Proceedings of the 2018 IEEE Symposium on Computers and Communications (ISCC), Natal, Brazil, 25–28 June 2018; pp. 925–929. [Google Scholar] [CrossRef]
- Hafeez, I.; Antikainen, M.; Tarkoma, S. Protecting IoT-environments against Traffic Analysis Attacks with Traffic Morphing. In Proceedings of the 2019 IEEE international conference on pervasive computing and communications workshops (PerCom Workshops), Kyoto, Japan, 11–15 March 2019; pp. 196–201. [Google Scholar] [CrossRef]
- Zhu, Q.; Yang, C.; Zheng, Y.; Ma, J.; Li, H.; Zhang, J.; Shao, J. Smart home: Keeping privacy based on Air-Padding. IET Inf. Secur. 2021, 15, 156–168. [Google Scholar] [CrossRef]
- Prates, N.; Vergütz, A.; Macedo, R.T.; Santos, A.; Nogueira, M. A Defense Mechanism for Timing-based Side-Channel Attacks on IoT Traffic. In Proceedings of the GLOBECOM 2020—2020 IEEE Global Communications Conference, Taipei, Taiwan, 7–11 December 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Kim, H.; Toh, W.X.; Hao, L.; Schulzrinne, H. Wital: A Whitelist-Based IoT Firewall for Mitigating Device Exploitation. In Proceedings of the 2024 IEEE International Performance, Computing, and Communications Conference (IPCCC), Orlando, FL, USA, 22–24 November 2024; pp. 1–2. [Google Scholar] [CrossRef]
- Pratt, J.W.; Gibbons, J.D. Kolmogorov-Smirnov Two-Sample Tests. In Concepts of Nonparametric Theory; Springer: New York, NY, USA, 1981; pp. 318–344. [Google Scholar] [CrossRef]
- Xiao, Y. A Fast Algorithm for Two-Dimensional Kolmogorov–Smirnov Two Sample Tests. Comput. Stat. Data Anal. 2017, 105, 53–58. [Google Scholar] [CrossRef]
- Trimananda, R.; Varmarken, J.; Markopoulou, A.; Demsky, B. Packet-Level Signatures for Smart Home Devices. In Proceedings of the Network and Distributed Systems Security (NDSS) Symposium, San Diego, CA, USA, 23–26 February 2020; pp. 1–18. [Google Scholar] [CrossRef]
- Qu, J.; Ma, X.; Li, J.; Luo, X.; Xue, L.; Zhang, J.; Li, Z.; Feng, L.; Guan, X. An Input-Agnostic Hierarchical Deep Learning Framework for Traffic Fingerprinting. In Proceedings of the 32nd USENIX security symposium (USENIX Security 23), Anaheim, CA, USA, 9–11 August 2023; pp. 589–606. Available online: https://www.usenix.org/system/files/usenixsecurity23-qu.pdf (accessed on 7 March 2025).
- Shen, M.; Ji, K.; Gao, Z.; Li, Q.; Zhu, L.; Xu, K. Subverting Website Fingerprinting Defenses with Robust Traffic Representation. In Proceedings of the 32nd USENIX Security Symposium (USENIX Security 23), Anaheim, CA, USA, 9–11 August 2023; pp. 607–624. Available online: https://www.usenix.org/system/files/usenixsecurity23-shen-meng.pdf (accessed on 23 April 2025).
No | IP Address | Equipment Name | Network Mode | Specifications |
---|---|---|---|---|
1 | 192.168.2.1 | Router | Ethernet | Ordinary home router (JD.com, Shenzhen, China) |
2 | 192.168.2.2 | Open-source router | Ethernet | Nanopi R5S OpenWrt OS 4 G Memory (JD.com, Shenzhen, China) |
3 | 192.168.2.21 | Industrial control computer | Ethernet | Ubuntu OS G590-Pentium 7505 CPU DDR4 8 G Memory (JD.com, Shenzhen, China) |
4 | 192.168.2.3 | Open-source router | Ethernet/WiFi | Nanopi R5S OpenWrt OS 4 G Memory (JD.com, Shenzhen, China) |
5 | 192.168.2.4 | WiFi repeater | Ethernet/WiFi | Tenda WiFi network repeater (JD.com, Shenzhen, China) |
6 | 192.168.2.22 | Industrial control computer | Ethernet | Ubuntu OS G590-Pentium 7505 CPU DDR4 8 G Memory (JD.com, Shenzhen, China) |
7 | 192.168.2.5 | Open-source router | Ethernet/WiFi | Nanopi R5S OpenWrt OS 4 G Memory (JD.com, Shenzhen, China) |
8 | 192.168.2.175 | Intelligent gateway | WiFi/Zigbee/ Bluetooth | Xiaomi intelligent multi-mode gateway (JD.com, Wuhan, China) |
9 | 192.168.2.149 | Camera | WiFi | Xiaomi intelligent camera (JD.com, Shenzhen, China) |
10 | 192.168.2.204 | Smart socket | WiFi | Xiaomi smart socket (JD.com, Shenzhen, China) |
11 | / | LED bulb | Bluetooth | Mijia LED bulb (JD.com, Shenzhen, China) |
12 | / | LED bulb | Zigbee | Aqara LED bulb (JD.com, Shenzhen, China) |
13 | / | Door/window sensor | Zigbee | Aqara door and window sensor (JD.com, Shenzhen, China) |
14 | / | Human body movement sensor | Zigbee | Aqara human body movement sensor (JD.com, Shenzhen, China) |
Metric | Node 2 | Node 3 | Node 6 | Node 7 |
---|---|---|---|---|
%CPU | 0.264 | 0.399 | 0.385 | 0.336 |
%MEM | 1.800 | 0.861 | 0.861 | 1.799 |
Metric (KBps) | Node 2 | Node 3 | Node 6 | Node 7 |
---|---|---|---|---|
Average Troughput Before Obfuscation | 770 | 788 | 928 | 941 |
Average Troughput After Obfuscation | 754 | 787 | 932 | 941 |
Metric | Not Obfuscated | Obfuscated |
---|---|---|
Average Delay (ms) | 5.743 | 6.251 |
Average Throughput (KBps) | 4.996 | 4.996 |
Average Jitter (ms) | 0.111 | 0.085 |
Average Packet Loss (%) | 0.000 | 0.000 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Huang, S.; Cao, J.; Chen, Z.; Zhong, Q.; Zhang, M. Online Traffic Obfuscation Experimental Framework for the Smart Home Privacy Protection. Electronics 2025, 14, 3294. https://doi.org/10.3390/electronics14163294
Huang S, Cao J, Chen Z, Zhong Q, Zhang M. Online Traffic Obfuscation Experimental Framework for the Smart Home Privacy Protection. Electronics. 2025; 14(16):3294. https://doi.org/10.3390/electronics14163294
Chicago/Turabian StyleHuang, Shuping, Jianyu Cao, Ziyi Chen, Qi Zhong, and Minghe Zhang. 2025. "Online Traffic Obfuscation Experimental Framework for the Smart Home Privacy Protection" Electronics 14, no. 16: 3294. https://doi.org/10.3390/electronics14163294
APA StyleHuang, S., Cao, J., Chen, Z., Zhong, Q., & Zhang, M. (2025). Online Traffic Obfuscation Experimental Framework for the Smart Home Privacy Protection. Electronics, 14(16), 3294. https://doi.org/10.3390/electronics14163294