Set up a test network
Network simulation is controlled with xbstress.exe, the command-line stress tool in the Microsoft Game Development Kit (GDK). Use this tool to configure various console stressors, including network simulation. For complete details, see xbstress (NDA topic). For networking purposes,xbstress controls a specialized driver on XBOX One. This driver drops packets, injects latency, and limits throughput.
When you use network simulation, provide a clean network environment to ensure that the only network issues are those caused by xbstress. A clean network environment should meet the following criteria.
- Higher available bandwidth than that of the simulation target.
- Reliable connectivity with negligible packet loss.
- The smallest possible latency. Put all the nodes on the same link to minimize the effect of external sources of latency.
Run a basic simulation of a network
xbstress (NDA topic) has four preconfigured simulation profiles to easily simulate important network scenarios: minimum, average, excellent, and broken. These profiles are based on figures from various sources that monitor the ongoing quality of internet connections. Like other command-line tools,xbstress interprets the /X: command-line flag as the IP address or host name of the console. The simulation command executes the following:
- To simulate poor connectivity, run
xbstress simulate network=min. - To simulate average connectivity, run
xbstress simulate network=avg. - To simulate excellent connectivity, run
xbstress simulate network=exc. - To simulate broken connectivity, run
xbstress simulate network=broken. - To simulate a physical ethernet disconnect, run
xbstress simulate network=disconnect. - To stop network simulation, run
xbstress stop.
Latency is injected in both directions of the console’s network flows. To simulate the average profile, we implement an effective latency of 50 ms by injecting a 25-ms delay on inbound and outbound packets. If you simulate the average profile on two consoles on the same link, their effective peer-to-peer latency would be 50 ms in both directions.
Run a simulation of complex network conditions
To verify that your network code is robust and ready for certification, test it when it’s confronted with complex network conditions. In addition, test it in situations where a console can reach some of the endpoints that it uses but where other endpoints are unavailable or connection bandwidth is limited. You can simulate such complex network conditions by using thechannel feature of xbstress (NDA topic).
For example, you would use channels to simulate conditions such as the following:
- The user can’t access the XBOX network (also known as XBOX Live), but all other network resources are available.
- The user can’t access one of the servers that a studio uses to host custom services.
- Access to XBOX services seems fine, in general, but access to a particular service (such as Achievements) is very slow.
- The user has set up a multiplayer session, but now they can’t access another user’s console.
- Specify a channel for the address or range and the connection profile to be simulated over the channel.
- Define a separate channel for each address or address range where you want to specify a different connection profile.
- Specify all the channels that apply to a simulation scenario.
- Use the
xbstress simulate network=channelscommand to begin simulating the network conditions that have been specified by your channels.
- Channel: Identified through an arbitrary number from 0 to 100. Channel descriptions are processed in numerical order, from lowest to highest. As a result, if you specify two rules that apply to a particular address, the higher-numbered channel is applied to that address.
- Network: The profile name to be applied to an address or address range.
- Addresses: Can be specified individually, in a semicolon-delimited list, or as a range by using subnet masks.
Run a fine-grained simulation of a network
Usexbstressto individually control inbound bandwidth, outbound bandwidth, packet loss, and latency. Use these controls when you want more fine-grained control of the simulation parameters. For details, see xbstress (NDA topic).
Exempt network traffic
Network simulation doesn’t affect all traffic that’s coming from XBOX One. Traffic that’s associated with tools is exempted from network simulation. This ensures that the tools work properly while you’re debugging the issues that arise when you’re challenging your network code with a simulated connection. If network simulation causes a console to become unusable, despite these exemptions, you can deactivate network simulation. Unplug the console’s power supply, wait ten seconds, plug the console in, and then turn the console on.Default port exemptions
The following kinds of traffic aren’t affected by network stress limitations. This list isn’t exhaustive. In some circumstances, other traffic that’s used for system functionality might also be allowed to evade network stress limitations.-
IPv4 network configuration:
- Address Resolution Protocol (ARP)
- Dynamic Host Configuration Protocol (DHCP): User Datagram Protocol (UDP) ports 67 and 68
-
IPv6 network configuration:
- SLAAC: ICMPv6
- DHCPv6: UDP port 546
- XTF and PIX: Transmission Control Protocol (TCP), ports 4201 and 4221-4223
- Telnet: TCP, ports 23, 24, 2302, and 2303
- XStudio: TCP, port 2375
- Server Message Block (SMB): TCP 445
Custom exemptions for ports
To exempt additional ports from network simulation and use them for your own custom tools, usexbstress to set up custom exemptions. Your tools can then use those ports to communicate across the network.
To set up an exemption, use the tcpportexemptions or udpportexemptions arguments in xbstress. Both arguments are followed by a semicolon-separated list of the ports to be exempted. The following examples demonstrate the use of these commands.
- The
xbstress set tcpportexemptions 49152;49153command creates exemptions for TCP ports 49152 and 49153. - The
xbstress set udpportexemptions 49153;49154command creates exemptions for UDP ports 49153 and 49154.
