Line 1,072: |
Line 1,072: |
| During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. | | During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. |
| | | |
− | Once connected, the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame, and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo]] array in [[#NetworkInfo]], the Station will throw an error if it can't find a matching [[#MacAddress]] for itself here. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well. | + | Once connected, the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo]] array in [[#NetworkInfo]], the Station will throw an error if it can't find a matching [[#MacAddress]] for itself here. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well. |
| | | |
| This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo]] array in [[#NetworkInfo]]. | | This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo]] array in [[#NetworkInfo]]. |
| | | |
| At this point standard sockets can be used over Data frames. | | At this point standard sockets can be used over Data frames. |
− |
| |
− | The custom Ethernet frames have the following structure:
| |
− | * "Type: IEEE 802a OUI Extended Ethertype (0x88b7)"
| |
− | * "IEEE802a OUI Extended Ethertype":
| |
− | ** "Organization Code: 00:22:aa (Nintendo Co., Ltd.)"
| |
− | ** "Protocol ID: 0x0102" (Depends on the frame, this ID is used for the Authentication frames)
| |
− | * The first byte of Data is value 0, then the [[#EthHeader]] follows this.
| |
| | | |
| The Action frames have the following structure: | | The Action frames have the following structure: |
Line 1,092: |
Line 1,085: |
| <fill this in> | | <fill this in> |
| | | |
− | === EthHeader === | + | === EthFrame === |
| + | The custom Ethernet frames have the following structure: |
| + | * "Type: IEEE 802a OUI Extended Ethertype (0x88b7)" |
| + | * "IEEE802a OUI Extended Ethertype": |
| + | ** "Organization Code: 00:22:aa (Nintendo Co., Ltd.)" |
| + | ** "Protocol ID: {...}" |
| + | *** Depends on the frame: |
| + | *** 0x0102: [[#Authentication]] |
| + | *** 0x0103: ? |
| + | * The first byte of Data is value 0, then the ProtocolID-specific data follows, see below. |
| + | ** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network? |
| + | |
| + | ==== Authentication ==== |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 1,109: |
Line 1,114: |
| | 0x4 || 0x1 || High u8 for the size. | | | 0x4 || 0x1 || High u8 for the size. |
| |- | | |- |
− | | 0x5 || 0x3 || | + | | 0x5 || 0x3 || Unused, zeros. |
| + | |- |
| + | | 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the |
| + | AccessPoint->Station frame, the Station verifies that this matches the data previously sent to the AccessPoint. |
| + | |- |
| + | | 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the |
| + | AccessPoint->Station frame, the Station verifies that this matches the data previously sent to the AccessPoint. |
| + | |- |
| + | | 0x38 || 0x10 || See below. |
| |- | | |- |
− | | 0x8 || 0x10 || | + | | 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size. |
| + | |} |
| + | |
| + | Station->AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled): |
| + | |
| + | The AccessPoint will not respond to frames where the source mac-address is unrecognized. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response. |
| + | |- |
| + | | 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint. |
| + | |- |
| + | | 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state. |
| + | |- |
| + | | 0x6A || 0x42 || Zeros, unused by the AccessPoint. |
| + | |- |
| + | | 0xAC || 0x300 || Authentication challenge data, only used in certain cases. If enabled, the total frame size must be >= {end offset of this data in the frame}. The frame data does not include this if it's not enabled. |
| + | |} |
| + | |
| + | AccessPoint->Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled): |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| |- | | |- |
− | | 0x18 || 0x10 || | + | | 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data. |
| |- | | |- |
− | | 0x28 || 0x20 || | + | | 0x48 || 0x84 || Only included in the frame if it's enabled. Unused by the Station. |
| |- | | |- |
− | | 0x48 || || Frame-specific data, with the above size. | + | | 0xCC || 0x100 || If enabled, Authentication challenge response data. Not included in the frame if it's not enabled. |
| |} | | |} |
| | | |