Port rules
- All XBOX console ports that the title can bind to, with the exception of the preferred local User Datagram Protocol (UDP) multiplayer port, have the same behavior that matches PC behavior with the default firewall. These ports allow all outbound Transmission Control Protocol (TCP) and UDP traffic while blocking unsolicited inbound UDP and TCP packets.
- The preferred local UDP multiplayer port behaves the same way as the other ports but allows unsolicited inbound UDP packets. TCP can’t be used.
- For peer-to-peer in Microsoft Game Development Kit (GDK) titles, you should use UDP on the preferred multiplayer port. Additionally, you must perform firewall and NAT punching.
Port availability/reserve ports
The title can use any available port that it can bind to. If a port is already in use, the bind function returnsE_ADDRINUSE, just as it would on a PC.
There are a number of ports that are never available to the title. The list of reserved ports shows the current set of ports that are reserved by the system.
There’s no way for Microsoft Game Development Kit (GDK) titles to reserve ports ahead of time. It’s always possible that any port can already be in use at the point when the Microsoft Game Development Kit (GDK) title attempts to bind to it. Appropriate fallback and retry logic are necessary for when these port conflicts occur.
The single exception to this is the preferred local UDP multiplayer port, which is reserved for the title and is always guaranteed to be available.
Development ports
During development, it can be useful to allow unsolicited inbound TCP and UDP packets to facilitate tools and debugging flows. Ports that the Microsoft Game Development Kit (GDK) title intends to use for this purpose should be specified under theDevelopmentOnly node in the MicrosoftGame.config file. Any number of ports can be specified. Use of the port within the title is the same as any other port. Development ports only have this special behavior on development kits and revert back to the default behavior, blocking unsolicited inbound packets on retail consoles. The following example shows how to mark ports 4600 and 4601 as development ports in MicrosoftGame.config.
After making changes to the
DebugNetworkPortList in MicrosoftGame.config, you must in addition to redeploying your title run xbapp applyconfig for the changes to take effect.