Pia is a library developed by Nintendo to make implementing network features in games easier. It operates using a peer-to-peer network, and supports connections over the Internet, local wireless, and LAN. This page is current as of pia version 5.9.1.
Pia uses AES-128-GCM to encrypt messages and verify them on receipt.
|0x4||1||Encryption type||0 = not encrypted, 1 = encrypted|
|0xC||8||Unique data for IV|
A clone is something that pia will attempt to synchronize across all consoles connected to the session. For example, creating a clone object on an int will cause all subscribing consoles to be notified about any changes to that int. Splatoon 2's netcode works entirely off clones and does not use any other message format to transmit game data. The protocol ID for clone messages is
0x0074. There are three types of clones known so far:
- Unreliable (type
0x0001) - synchronization may fail
- Reliable (type
0x0002) - synchronization is guaranteed to succeed
- Event (type
0x0003) - synchronization is guaranteed to succeed and the order of data sent is preserved
The format for clone messages is not yet well understood. Some clone messages appear to have synchronization information (like the "clone clock") instead of actual data for one of the clone types. Messages that do contain actual data have a zlib header starting at 0xD or 0xE. The size field set in the decompressed data header may be larger than the payload actually contained within. It is currently unknown why this is occasionally the case.