Simulate networks in Android Automotive OS (AAOS)  |  Android Open Source Project Skip to main content Docs What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Android Code Search / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Documentation What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Docs More What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Android Code Search Overview What's new? What is Android Automotive? Terminology Software defined vehicle Overview Terminology Get started Overview Development environment Local development Cloud development Overview Organization setup Code location Download, build, and run IDE setup Access GitHub repositories Understand AAOS SDV System architecture SDV architecture Key concepts Logical architecture Service bundle naming conventions Configure the Orchestrator Service bundle identity Time sync Health monitoring Quality of service scheduling Control vehicle and power management Security concepts Authorization Overview Deployment Authorization policy Enforcement Debug permissions violations VM-level authorization policy VM identity and attestation Overview SDV profile for DICE vvmconfig and vvmtruststore Mesh status and provisioning Device trust Update concepts Service bundle updates A/B system updates Update Manager OEM AB partition updates Develop SDV services Quick start: Create and execute SDV service bundles Vehicle Services IDL (VSIDL) Overview Define messages and RPC services Define service architecture Generate middleware Implement business logic Build and deploy service bundles Automatic catalog updates and LSP integration Language specification SDV VSIDL compatibility guidelines VSIDL Provider for reflection Service bundle metadata Core code samples Handle suspend and resume Work with Automotive Services Overview Configuration and calibration Diagnostics User preferences architecture and implementation guide Asynchronous Rust Platform integration guides SDV Core integration Integration guide Guest system (VM image) requirements SDV Core bootloader APEX signing SDV Media integration Overview SDV Media requirements Graphics rendering on SDV Media SDV Media: Manage displays Use cameras SDV on hardware SDV on QNX QVM sample configurations QVM sample configuration for SDV Core QVM sample configuration for SDV Media QVM sample configuration for SDV IVI VM identity and attestation SDV bootloader Android HLOS CDI handover Configure identity for native services SOME/IP integration guide Overview Write a SOME/IP mapping file Write a SOME/IP type definition Implement the SOME/IP stack Integrate SOME/IP with SDV Optimize performance Use the SDV Gateway on IVI The Generic Kernel Image (GKI) project Partition layout Test, debug, and verify performance Debug SDV Troubleshoot middleware API failures Use tracing to gain insights into system performance SELinux policies for device tests Detect security violations SDV system tests SDV Test Framework library SDV system test creation Solution guides Display Safety Overview Get started Code structure DriverUI HAR camera view HAR platform abstraction layer HAR graphics pipeline Audio chimes Performance tracing for HAR Safety design toolchain Telemetry Overview SDK Overview Rust telemetry client library Overview Rust telemetry client library API Configurable Publisher Registry library Java protobuf descriptor generator tool Metrics Configuration Generator Overview Deployment Vehicle signal catalogs API reference Metrics configuration concepts Data sources Configurable Publisher Registry Metrics configuration generation request JSON format Cloud Telemetry Simulation Overview Deployment guide User guide In-vehicle Infotainment Overview Guidelines for development Car service feature control App compat Car display compatibility Audio Overview Audio focus Car audio configuration Configurable audio policy engine Audio control HAL Multi-zone audio routing Car audio plugin service Volume management Connect an input device in AAOS Microphone input Audio power management Manage audio resources during suspend Audio configuration AAOS flags Windowing with Scalable UI Overview Implement advanced windowing Consider the app ecosystem Maximize test compliance with WindowManager invariants Configure advanced windowing Configure a panel Configure a variant Configure a transition Configure an event Configure an action Implement heads up notification panels Customize system bars Integrate Setup Wizard Camera Overview Android Camera Service Overview Enable multi-client cameras Extended View System Overview Event and frame notification mechanism Program camera control parameters Changes to camera and system configuration Frame metadata Automotive display proxy service Multi-camera support Vehicle camera HAL Migrate to Camera2 Overview Migrate to Camera2 Camera2 API mapping Car framework core Car Settings Overview Add Car Settings Rearrange Car Settings Distraction optimization in Car Settings Car Settings search indexing Dual pane customization Preference subtitles Customize status bar system icons Connectivity Configure internal Ethernet networks Bluetooth Per-application network selection (PANS) Maintain hotspots between driving sessions Device management for Automotive Displays and input Overview Monitor status Key input Instrument Cluster API OEM custom inputs Multi-Display Communications API Automotive Window Layering Driver distraction Driver distraction guidelines Car User Experience Restrictions rules Consume car driving state and UX restrictions Flash wear management Location Automotive location bypass allowlist policy Automotive Location Bypass API Get coarse location Notifications Overview Set up notifications Heads-up notifications Notification access and notification listener policy Throttle and suppress notifications Performance analysis Power Overview Power policy Power management Manage boot time Garage Mode Radio Overview Broadcast radio HAL Radio control implementation Set up remote access Rotary controller Overview Develop apps Develop apps without the Car UI library Integration guide for OEMs Security Overview Secure developer options Enable MACsec for Ethernet features Debug Restriction Controller integration guide Use vehicle bound file encryption Manufacturer guide for long-term Android security Vehicle system isolation OTA updates System UI Implement the System UI SystemUIOverlayWindow management system SystemUIOverlayWindow codelab Time Overview Configure AAOS time sources Automatic time detection Time zone options Location time zone detection Unbundled apps Overview Release notes Integrate unbundled apps AOSP host integration guide Integrate the AOSP host Media apps with Car App Library OEM design tokens Control Center reference app Overview Customize the reference app Technical details Integrate AppCards Overview Create an AppCard Configure an AppCard host Try the AppCard codelab App Lock Car Messenger Car UI library Overview Integrate the Car UI library into apps Customize apps Car UI plugins List of packages containing car-ui-lib Add custom fonts Customize Car UI preferences Customize the toolbar with runtime resource overlays Customization options for CarUiListItem Customize CarUiRecyclerView Car UI library release notes Appendix A, work with RROs Appendix B, customization Appendix C, minimum compatible version for Car UI Plugin API Dashcam Dialer Overview Technical details Customization guidelines Global configurable values Toolbar Debug and test Media Overview System components and user flows Implement radio with Media Customize media Implement a media card Integrate deep links to Media apps Users and accounts Multi-user support Foreground and background user system handling Manage users and accounts Remove packages for the system user User HAL properties Vehicle hardware abstraction layer (VHAL) Overview VHAL interface Property configurations Supported system properties Special properties SEAT and STEERING_WHEEL properties ADAS vehicle properties Reference implementation Debug VHAL Use VHAL with the native client HIDL VHAL HIDL VHAL migration guide HIDL VHAL interface Virtualization Overview Architecture Tools Reference platform Voice Voice assistant Tap-to-Read OEM custom inputs Voice interaction integration guide About voice interaction Integration flows App development Fulfill commands Test and debug Watchdog Overview Monitor flash memory usage Collect performance data Monitor system health Development tools Overview Android Virtual Device Android Virtual Device as a development platform Build your own cloud emulator Extend VHAL property descriptions in the emulator Emulator USB passthrough integration guide USB Port Reset API Pixel devices as development platforms System performance tools Testing tools and infrastructure Overview System performance tools User interface frameworks Network simulation Complete Automotive Tests in a Box (CATBox) Enable fuzzers Spectatio Torq Release details Overview Android Automotive 26Q2 Android Automotive 25Q4 Android Automotive 25Q2 Android Automotive 25Q1 Android Automotive 24Q4 Android Automotive 15 Android Automotive 14 QPR1 Android Automotive 14 Android Automotive 13 QPR3 Android Automotive 13 QPR2 Android Automotive 13 QPR1 Android Automotive 13 Android Automotive 12L Android Automotive 12 QPR3 Android Automotive 11 Unbundled apps What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP. AOSP Docs Automotive Simulate networks in Android Automotive OS (AAOS) Stay organized with collections Save and categorize content based on your preferences. This page describes how to simulate different network conditions on Android Automotive hardware devices in a scalable, low-maintenance way. This environment agnostic network simulation uses commonly available Linux tools that can run on Android Automotive hardware devices. The following sections describe how to set up and run a network simulation on Android Automotive hardware devices. Kernel requirement To enable network simulation on a device under test (DUT), the Linux ifb and netem modules must be configured in the kernel config file, as shown below: # Network simulation config fragment start CONFIG_NET_SCH_NETEM=y CONFIG_IFB=y CONFIG_NET_ACT_MIRRED=y # Network simulation config fragment end Set up simulation All network simulations or throttling simulations must be conducted on a device under test (DUT). This simulation uses the Linux tc and NetEm utilities to control network traffic on the network interface controller (NIC) based on the control policy and rules. To set up the simulation, do the following: Connect the DUT and the host server to the internet. Create the NetworkSimulation.sh script by copying it from the code provided in the NetworkSimulation.sh script section and download it on the host server. Connect the host server to the DUT. Ensure that the DUT appears in the list of connected devices by running adb devices -l. For an illustration of the setup architecture, see the following figure: Figure 1. Setup architecture. NetworkSimulation.sh script The NetworkSimulation.sh script file contains adb commands that run the network simulation. Copy the following into a file named NetworkSimulation.sh: #!/bin/bash latency=$1 bandwidth=$2 packetloss=$3 # root device and set it to permissive mode adb root adb shell setenforce 0 #Clear the current tc control adb shell tc qdisc del dev ifb0 root adb shell ip link set dev ifb0 down adb shell tc qdisc del dev wlan0 ingress adb shell tc qdisc del dev wlan0 root # Create a virtual device for ingress adb shell ip link set dev wlan0 up adb shell ip link set dev ifb0 up adb shell tc qdisc del dev wlan0 clsact adb shell tc qdisc add dev wlan0 handle ffff: ingress adb shell tc filter add dev wlan0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0 # Throttle upload bandwidth / latency / packet loss adb shell tc qdisc add dev wlan0 root handle 1: htb default 11 adb shell tc class add dev wlan0 parent 1: classid 1:1 htb rate "$bandwidth" adb shell tc class add dev wlan0 parent 1:1 classid 1:11 htb rate "$bandwidth" adb shell tc qdisc add dev wlan0 parent 1:11 handle 10: netem delay "$latency" loss "$packetloss" # Throttle download bandwidth adb shell tc qdisc add dev ifb0 root handle 1: htb default 10 adb shell tc class add dev ifb0 parent 1: classid 1:1 htb rate "$bandwidth" adb shell tc class add dev ifb0 parent 1:1 classid 1:10 htb rate "$bandwidth" Execute simulation To execute a network simulation, the adb commands in the NetworkSimulation.sh script file use command line arguments to set values. To specify the latency, bandwidth, and packet loss you want to simulate, run the NetworkSimulation.sh script with the following command line arguments: Latency, specified in ms. Bandwidth, specified in kbit or mbit. Packet loss, as a percentage. For example, to set a 300ms latency, 100kbit bandwidth and 50% packet loss, run: bash NetworkSimulation.sh 300ms 100kbit 50% To set a 100ms latency, 1mbit bandwidth and 0% packet loss, run: bash NetworkSimulation.sh 100ms 1mbit 0% Verify simulation After executing the NetworkSimulation.sh script, verify that the network simulation is configured correctly and is running as expected using the Linux ping and curl commands. Use the ping command to verify the latency and the curl command to verify the bandwidth. For example, the following is the expected output of ping for a simulation executed with bash NetworkSimulation.sh 100ms 500kbit 10%: BUILD:/ # ping -c 20 www.google.com PING www.google.com (172.217.5.100) 56(84) bytes of data. 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=1 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=2 ttl=119 time=105 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=3 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=5 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=6 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=7 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=9 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=10 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=11 ttl=119 time=185 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=12 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=13 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=14 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=15 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=16 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=17 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=18 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=19 ttl=119 time=103 ms 64 bytes from sfo03s07-in-f4.1e100.net (172.217.5.100): icmp_seq=20 ttl=119 time=103 ms --- www.google.com ping statistics --- 20 packets transmitted, 18 received, 10% packet loss, time 19040ms rtt min/avg/max/mdev = 103.394/108.307/185.756/18.791 ms This example shows that ping reports a packet loss at 10% and average latency close to 108ms, which is as expected for the 100ms value specified in the simulation. It's normal for the reported latency to differ from the specified value by a small amount. For the same example, the following is the expected output of running the curl command. BUILD:/sdcard/DCIM # curl https://images-assets.nasa.gov/image/PIA15416/PIA15416~orig.jpg -o foo.jpg % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6598k 100 6598k 0 0 49220 0 0:02:17 0:02:17 --:--:-- 47574 This example shows that curl reports the average download speed at 49220 Bps, which is as expected for the 500kbit specified in the simulation. It's normal for the reported bandwidth to differ from the specified value by a small amount. Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. Last updated 2026-06-17 UTC. [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-17 UTC."],[],[]] Build Android repository Requirements Downloading Preview binaries Factory images Driver binaries Connect @Android on X @AndroidDev on X Android Blog Google Security Blog Platform on Google Groups Building on Google Groups Porting on Google Groups Get help Android Help Center Pixel Help Center www.android.com Google Mobile Services Stack Overflow Issue Tracker About Android Community Legal License Privacy Site feedback Manage cookies English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어