Skip to content
aclin edited this page Sep 14, 2010 · 6 revisions

Slink uses a simple connectionless protocol that works around five types of packets:

  • Inject
  • Introduce
  • Introduce Acknowledge
  • Slink List
  • List Known Slinks

Aside from Inject packets, each packet header is as follows:

enum PACKET_TYPE {
   INJECT,
   INTRODUCE,
   INTRODUCE_ACK,
   SLINK_LIST,
   LIST_SLINK_REQ,
   INVALID
};
struct slink_packet_header {
   uint32_t magic; // Always 0x12345678 in network byte order
   uint32_t type; // PACKET_TYPE in network byte order
};

The packet data immediate follows the packet header, and continues to the end of the packet.

Introduce/Introduce Acknowledge packets

Introduce and Introduce Acknowledge packets are members of a request response pair, that is, every received Introduce packet is responded to with an Introduce Acknowledge packet. The request-response serves two purposes, 1.) to verify the existence of the other party and 2.) to update the receiver’s external ip information.

Introduce and Introduce Acknowledge packets are both structured as follows:

struct slink_introduce_packet {
   struct slink_packet_header header;
   uint32_t receiverIp;
   uint32_t receiverPort;
};

Upon receiving an Introduce packet, Slink will immediately register the sender as a known Slink and respond with an Introduce Acknowledge packet. The Introduce sender will not update its list of known Slinks until an Introduce Acknowledge is received. This prevents the registration of non-responsive Slink addresses, possibly due to typos, or other malfunctions.

Slink List Packet

A received Slink list packet is handled by iterating over the given list of Slinks, and sending an Introduce to each one. Slink List Packets must not contain the receiver, the sender of the packet must filter out the receiver to prevent the receiver from introducing itself to itself.

Slink List Packets are structured as follows:

struct slink_list_entry {
  uint32_t ip; // ipv4 address in network byte order
  uint32_t port; // port in network byte order
};
struct slink_list_packet {
   struct slink_packet_header header;
   struct slink_list_entry[?]; // the number of entries is inferred from the packet size.
};

Slink List Request Packet

Simple packet that just requests the receiver to send its list of known Slinks in a Slink List Packet. The requestee is responsible for first filtering the response list so that the requester will not get introduced to itself.

Inject Packet

Inject packets are different from the other packet types due to the fact that it does not include the Slink Packet header. This means that it will fail the normal check for the magic number (0×12345678). It’s entire packet content is expected to be a fully formed xbox system link packet captured by another Slink.

Sending and Receiving Inject Packets are used as hooks to the packet routing process. When an Inject packet is received, its source xbox mac address is checked against the current routing table. If the mac address is new, the routing table is updated with an entry indicating that the given mac address is located at the Slink that sent the Inject packet. The routing table is referenced when sending an inject packet to determine where the Inject packet needs to be sent.

New Connection Exchange

When a Slink attempts to connect to another Slink, a handshake takes place to make sure the Slink networks represented by each Slink are successfully merged. The connector Slink, the Slink where the new connection is initiated, sends a series of three packets:

  • Introduce – Registers the connector and connectee with each other. Also updates each one’s external IP, if still unknown.
  • Slink List – Registers the connectee with each of the connector’s known Slinks
  • Slink List Request – Registers the connector with each of the connectee’s known Slinks.