Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Network Stack
Stay organized with collections
Save and categorize content based on your preferences.
Network Stack is an updatable Mainline module that ensures that Android can
adapt to evolving network standards and allows for interoperability with new
implementations. For example, updates to captive portal detection and login code
allow Android to stay up to date with changing captive portal models, and
updates to APF allow Android to save power on Wi-Fi as new types of packets
become common.
Included components
The Network Stack module contains the following components. On devices using the
module, these services were moved to a different process and are accessed
through a stable AIDL interface.
IP services. IpClient
(formerly IpManager
) is a component in charge of
IP layer provisioning and maintenance. In Android 9, it was already used
cross-process by components such as Bluetooth, and in-process by components
such as Wi-Fi. DhcpClient
obtains IP addresses from DHCP servers so they can
be assigned to interfaces.
NetworkMonitor. The NetworkMonitor
component tests for internet
reachability when connecting to a new network or upon network failures, when
detecting captive portals, and when validating networks.
Captive portal login app. A preinstalled app in charge of managing login
on captive portals. This has been a separate app since Android 5.0, but it
interacts with NetworkMonitor
to forward some user choices to the system.
Affected paths
The paths moved to the Network Stack module by the refactor are listed below.
The new location of the moved code is in packages/modules/NetworkStack
,
packages/modules/CaptivePortalLogin
and some other shared locations. The above
paths refer to the location of files before being moved there for Mainline.
Files in packages/modules/NetworkStack
and
packages/modules/CaptivePortalLogin
are part of the Mainline module and cannot
be modified.
The Network Stack module contains the following components in APK format:
- IP services
- Captive portal login (
com.google.android.captiveportallogin
)
This module is accompanied by the Network Stack Permission Config module,
which is a pre-installed APK file that defines the necessary permissions for the
Network Stack components.
Dependencies
The Network Stack module depends on the following:
Privileged @hide methods in the system server (e.g., in
IConnectivityManager.aidl
). These APIs have been made @SystemApi
and
appropriately protected so that they are accessible to the Mainline module but
not other privileged apps (e.g., using a new signature permission).
Binder IPCs to netd
defined in
INetd.aidl
.
This interface has been converted to stable AIDL and is subject to conformance
tests.
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 2025-06-18 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 2025-06-18 UTC."],[],[],null,["# Network Stack is an updatable Mainline module that ensures that Android can\nadapt to evolving network standards and allows for interoperability with new\nimplementations. For example, updates to captive portal detection and login code\nallow Android to stay up to date with changing captive portal models, and\nupdates to APF allow Android to save power on Wi-Fi as new types of packets\nbecome common.\n\nIncluded components\n-------------------\n\nThe Network Stack module contains the following components. On devices using the\nmodule, these services were moved to a different process and are accessed\nthrough a stable AIDL interface.\n\n- **IP services.** `IpClient` (formerly `IpManager`) is a component in charge of\n IP layer provisioning and maintenance. In Android 9, it was already used\n cross-process by components such as Bluetooth, and in-process by components\n such as Wi-Fi. `DhcpClient` obtains IP addresses from DHCP servers so they can\n be assigned to interfaces.\n\n- **NetworkMonitor.** The `NetworkMonitor` component tests for internet\n reachability when connecting to a new network or upon network failures, when\n detecting captive portals, and when validating networks.\n\n- **Captive portal login app.** A preinstalled app in charge of managing login\n on captive portals. This has been a separate app since Android 5.0, but it\n interacts with `NetworkMonitor` to forward some user choices to the system.\n\nAffected paths\n--------------\n\nThe paths moved to the Network Stack module by the refactor are listed below.\n\n- **IP services.** In `frameworks/base/services/net/java/android/net/`:\n\n - `apf`\n - `dhcp`\n - `ip`\n - `netlink`\n - `util` (partly)\n- **Captive portal detection and login.** In `frameworks/base/`:\n\n - `core/java/android/net/captiveportal/`\n - `services/core/java/com/android/server/connectivity/NetworkMonitor.java`\n - `packages/CaptivePortalLogin/*`\n\nThe new location of the moved code is in `packages/modules/NetworkStack`,\n`packages/modules/CaptivePortalLogin` and some other shared locations. The above\npaths refer to the location of files before being moved there for Mainline.\nFiles in `packages/modules/NetworkStack` and\n`packages/modules/CaptivePortalLogin` are part of the Mainline module and cannot\nbe modified.\n\nPackage format\n--------------\n\nThe Network Stack module contains the following components in APK format:\n\n- IP services\n- Captive portal login (`com.google.android.captiveportallogin`)\n\nThis module is accompanied by the Network Stack Permission Config module,\nwhich is a pre-installed APK file that defines the necessary permissions for the\nNetwork Stack components.\n\nDependencies\n------------\n\nThe Network Stack module depends on the following:\n\n- Privileged @hide methods in the system server (e.g., in\n `IConnectivityManager.aidl`). These APIs have been made `@SystemApi` and\n appropriately protected so that they are accessible to the Mainline module but\n not other privileged apps (e.g., using a new signature permission).\n\n- Binder IPCs to `netd` defined in\n [`INetd.aidl`](https://android.googlesource.com/platform/system/netd/+/android16-release/server/binder/android/net/INetd.aidl).\n This interface has been converted to stable AIDL and is subject to conformance\n tests."]]