LDN services: Difference between revisions

(3 intermediate revisions by the same user not shown)
Line 734: Line 734:


This is essentially the same as <code>struct in_addr</code>, except this is little-endian.
This is essentially the same as <code>struct in_addr</code>, except this is little-endian.
This is generally "169.254.XXX.{...}", where XXX is random per created network.


= SubnetMask =
= SubnetMask =
Line 1,063: Line 1,065:
| 1 ||  
| 1 ||  
|}
|}
= Network protocol =
== ldn ==
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0).
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.
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.
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:
* "Fixed parameters":
** "Category code: Vendor Specific (127)"
* The Data starts with the [[#ActionHeader]].
<fill this in>
=== EthHeader ===
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x1 || Type? Must be 0x1-0xF.
|-
| 0x1 || 0x1 || Low u8 for the size.
|-
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.
|-
| 0x3 || 0x1 || bool flag
|-
| 0x4 || 0x1 || High u8 for the size.
|-
| 0x5 || 0x3 ||
|-
| 0x8 || 0x10 ||
|-
| 0x18 || 0x10 ||
|-
| 0x28 || 0x20 ||
|-
| 0x48 || || Frame-specific data, with the above size.
|}
=== ActionHeader ===
== lp2p ==
<fill this in>
The DHCP server thread can be started by the "nn.lp2p.StateMachine" thread eventually in certain cases.


[[Category:Services]]
[[Category:Services]]