nn::ndm Namespace

Description

Namespace for the network daemon control library.

A daemon is a static module that processes autonomously in the background of the application. CTR has a number of daemons for network processes.
ndm (Network Daemon Manager) is a special daemon that manages the daemons performing network processes. The ndm library is a library for controlling this special daemon.

The Need for Daemon Control

The application runs on the CPU's application core, while the daemons run in parallel on the CPU's system core. Accordingly, the daemons do not directly take away from the application's CPU time.
On the other hand, the application and the daemons share the network and NAND. For this reason, the activities of the daemons can in some cases impact the performance of the application.

If a decline in network or NAND performance is fatal to the application, the ndm library can halt the operations of the various communication modules.
(For example, when a network multiplayer mode requiring low latency is started or when the scene switches to a scene that loads a large volume of data from NAND.)

When switching to local communications or another communications mode, the various communications libraries control the daemons automatically via the ndm library.
The application developer does not have to worry about anything other than performance.

Daemons Under Control of the ndm Library

Daemons can be freely stopped, but the different daemons all have their roles to play, so there are various restrictions on the stopping of daemons. It is therefore important to understand how the stopping of any given daemon will impact the system.

StreetPass Daemon (nn::ndm::CTR::DN_CEC)

This daemon carries out StreetPass communication (nn::cec). Stopping this daemon completely shuts down StreetPass communications being carried out in the application background. Operations where the application does something like access the StreetPass message box can be performed as usual.

SpotPass Daemon (nn::ndm::CTR::DN_BOSS and nn::ndm::DN_NIM)

This daemon carries out SpotPass communication (nn::boss). Stopping this daemon completely shuts down SpotPass communications being carried out in the application background.
Operations by the application such as registering tasks, immediate execution, and acessing storage can be performed as usual.

nn::ndm::CTR::DN_NIM is a supplemental module for executing system processes. We recommend that when you stop nn::ndm::CTR::DN_BOSS, you also stop nn::ndm::DN_NIM along with it.

Friend presence daemon (nn::ndm::CTR::DN_FRIENDS)

This daemon manages the friend presence feature (nn::friends). Stopping this daemon halts autonomous login in the application background. Operations by applications such as accessing friend information, or explicit login processes can be performed as usual.

Note that autonomous login is not carried out during sleep, either, and behavior may appear the same as when a stop command has been issued.

Reference Predicted Impacts of Daemons on Applications
Daemon
(nn::ndm::CTR::DaemonName)
Impact on NetworkImpact on NAND
nn::ndm::CTR::DN_CEC None
(Infrastructure communications not used)
Moderate
(Approximately 10 KB to 10 MB of NAND is accessed when StreetPass is being established)
nn::ndm::CTR::DN_FRIENDS Low
(UDP communications occur when disconnecting)
Low
nn::ndm::CTR::DN_BOSS High
(HTTP communications occur when task executes)
High
(NAND write occurs when task executes)
nn::ndm::CTR::DN_NIM High
(HTTP communications occur when task executes)
High
(NAND write occurs when task executes)

Operations During Sleep

Daemon operations cannot be controlled during sleep. Even if the application issues a stop command, behavior will be exactly the same as during sleep while the daemon has not been stopped. When the system recovers from sleep, it returns to the state before sleep. You must therefore take into account the fact that the daemon state, such as receiving new data, has changed when recovering from sleep even if the daemon is stopped.

Namespace

nn::ndm::CTR Namespace for the network daemon control library. (This can also be written with "CTR" omitted.)

Functions

Initialize Initializes the network daemon control library.
Finalize Finalizes the network daemon control library.
SuspendDaemons Suspends autonomous operation of all network daemons.
ResumeDaemons Resumes autonomous operation of all network daemons.
Suspend Suspends autonomous operation of a network daemon.
Resume Resumes autonomous operation of a network daemon.
SuspendScheduler Suspends the daemon manager that handles scheduling for all network daemons.
ResumeScheduler Resumes daemon scheduling.
SetupDaemonsDefault Reverts network daemon operating permissions to the SDK defaults.

Revision History

2010/12/10
Updated and added information about daemons.
2010/09/17
Initial version.

CONFIDENTIAL