Difference between revisions of "NWM Services"

From 3dbrew
Jump to navigation Jump to search
Line 5: Line 5:
 
=NWM local-WLAN service "nwm::UDS"=
 
=NWM local-WLAN service "nwm::UDS"=
  
=NWM service "nwm::INF"=
+
=NWM infrastructure service "nwm::INF"=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x00070742
 +
| [[NWMINF:ConnectToAP|ConnectToAP]]
 +
|}
  
=NWM service "nwm::SOC"=
+
=NWM socket service "nwm::SOC"=
  
 
=NWM service "nwm::SAP"=
 
=NWM service "nwm::SAP"=

Revision as of 03:49, 12 July 2013


These NWM services are used for local-WLAN communications, NWM module handles regular wifi APs as well. These services are used for creating/connecting to networks, and for sending/receiving data over the network etc. NWM module uses the wifi SDIO hardware via the IO registers for this.

NWM local-WLAN service "nwm::UDS"

NWM infrastructure service "nwm::INF"

Command Header Description
0x00070742 ConnectToAP

NWM socket service "nwm::SOC"

NWM service "nwm::SAP"

NWM local-WLAN StreetPass service "nwm::CEC"

NWM service "nwm::EXT"

NWM service "nwm::TST"

Local-WLAN

UDS is used for 3DS<>3DS local-WLAN communications, and for 3DS<>Wii U communications. The latter is mainly only used for multi-player in games.

All UDS local-WLAN communications have the CCMP key for data encryption generated via NWM module. The CCMP key passed to nwm::CEC commands(stored in a 0x44-byte input structure) for StreetPass is generated by the CECD module. The input data used with EncryptDecryptAes with keytype1 is a MD5 hash over an input passphrase. This input passphrase is fixed for Download Play, it's unique per local-WLAN protocol. The CTR is a MD5 hash over the below 0x10-byte structure. The output from encrypting that data with AES-CTR is the final CCMP key.

Structure used for generating the CTR

Offset Size Description
0x0 0x4 Little-endian local-WLAN communication ID, normally this is the user process' UniqueID from the titleID. For Download Play, this is always 0x2810 on retail.
0x4 0x4 Little-endian u32 networkID, randomly-generated when creating the network. The network SSID used when a client connects to the network is sprintf(out, "%08X", networkID).
0x8 0x6 Host MAC address.
0xE 0x2 Little-endian ID, for Download Play this is 0x55.

UDS Beacons

The UDS host broadcasts a beacon containing at least two Nintendo-vendor tags, normally the data stored in these tags are static. The second tag contains the big-endian u32 networkID, used by the clients when connecting to the host and for the above CCMP key generation. The Nintendo-vendor tag(s) following the first two are unique to the process using UDS, these tags are used for broadcasting metadata regarding the host.