The Xbox Ethernet subsystem

I've seen many posts about Ethernet problems. There are many tutorials out there that cover the logical side of networking the Xbox, but not many cover the physical side of the network. I think it's time to do something about that.

All examples in this tutorial are based on a revision 1.0 Xbox. Though part numbers and designations may change, the overall physical layout should remain fairly static, due to the cost of making changes to the design and the fact that this is not a target to thwart mod chips.

First lets look at a block diagram of what goes into making working network interface.

For this tutorial we are going to stop part way through the third level. This is the layer where IP addresses work.

Working from the bottom up:

What goes into layer one of the OSI model:
The network port:
The actual port is defined as a Registered Jack number 45 (thus: RJ45, or Everything about RJ's).
This port is made up of 8 conductors only 4 of which are used in 10/100Mbps Ethernet (pins 1,2,3,&6).
In the cable pins 1&2 are paired and twisted together, pins 3&6 are paired and twisted together.
Whether you need a straight or crossover cable depends on how your equipment is wired. To connect to Client nodes together (PC, Xbox, Ethernet web cam, etc.) you need a crossover (note that uplink ports are wired as a Client node would be). To connect two host nodes (switch, router, hub, etc) together you also need a crossover cable. To connect a client node to a host node (PC to switch for example) you need to use a straight cable. That is why many host nodes have one port wired the same as a client node (uplink port), this allows them to use an ordinary straight cable to chain two host devices together (like a switch to a router). More on this later (like why it does not matter what cable you use for gigabit Ethernet).
The magnetics (line isolation transformer)
Believe it or not most line connected equipment uses an isolation transformer. Your phone does, your POTS modem does, your DSL modem does. But what does it do and why is it there?
In a normal network port there is a small signal transformer that acts as a DC block and may also act as a doubler (i.e. a 2:1 transformer). The purpose of this transformer is twofold:
First: it acts as a DC block without adding a ton of capacitive loading to the signal.
Second: it helps reject common mode noise.
Next question: What is common mode noise?
There are 4 wires in two pairs used for 10/100Mbps Ethernet. one pair is for transmitting, the other is for receiving. Each pair carries a differential signal (the voltages on the two wires are always opposites of each other). If there is noise induced on the line (from say a fluorescent lamp) then it will be the same polarity, amplitude (voltage), and magnitude (frequency). The transformer is wound in such a way as to reject as much of this common mode noise as possible.
Direct links without a transformer are possible, but the impedance control requirements make it impractical at best for any length over a couple of inches (and staying on the PCB as well).
Normally the magnetics are a separate chip like package on the board, but the Xbox uses a higher end RJ-45 connector to save on board space. That connector has the magnetics built into it.
The Physical Layer device (PHY)
This is the actual chip that converts the digital logic to the differential analog signals used on the physical transmission line. In a nutshell this chip is a combination of a SerDes (Serializer / Deserializer) and a glorified ADC/DAC (Analog to digital / digital to analog converter). It always annoyed the engineering team when I trivialized a years worth of their work in a couple of lines. (I used to do the R&D testing on these kinds of chips)
What happens inside the chip is the following :
Outbound (from Xbox to switch)
data comes in on the Media Independent Interface (MII). The MII bus is four bits wide (plus control lines) and is clocked at 25MHz. The digital side of the PHY takes a nibble of data (1 clock cycle), converts the 4 bits into a 5 bit code word (read IEEE802.3 if you want to know how or why) and converts it into a serial bit stream running at 125MHz. This serial bit stream goes to the analog side of the PHY, where it is converted into an analog, differential bitstream. You may have noticed that this equates to a 125Mbps data-rate. The excess is used in framing (start and end of packet) and CRC checking (one of the PHY's other duties is to append a simple CRC onto the end of each packet to ensure errors in transmission are caught.).
Inbound (from switch to Xbox)
Basically this is done in the opposite fashion of the outbound communication. The PHY receives an analog signal, converts it into a digital bitstream, compares the CRC to one it calculates. If they match it converts the serial digital bitstream to parallel data (4 bits wide) at the MII bus. If the CRC it computes does not match the CRC it receives it sets a control line. What happens next is up to the application. For example a TCP session will request the data be re-sent, while a UDP session won't care and just keep going.
WOW! All that and we are just now done with the first layer of the OSI model.
Layer Two:
The Media Access Controller (MAC)
Just like your computer (or Xbox) has an IP address to identify where it is logically on the network, it also has a MAC address to identify its physical location on the network.

I will update this portion of the tutorial later when I have a good (non super techie) explanation of how MAC addresses work

The MAC in the Xbox is embedded into the MCPx chip. This particular MAC is programmable (meaning that you can change it's MAC address. (great for spoofing ;)
What a MAC does: In your Xbox, not much. All it does is provide a PCI device that the application (TCP/IP stack) can see and write data to. It converts the PCI signals to the MII bus interface.
In a high end Switch (Cisco Cat 6K for example) the MAC also may aggregate traffic. What that means is the following: It can take 10 ports of 1Gbps (gigabit Ethernet, fiber, or twisted pair) and package them into one fat 10Gbps pipe. This is very convenient for a system design point of view because you only have to control one device (the MAC) with your network processor, while the MAC does all the book keeping for the PHYs (which in turn do the book keeping for the twisted pair line, etc.).
Layer three:
At this point a piece of networking gear (switch or router) gets very expensive. All the cheap switches you buy at Best Buy, Fry's, or wherever use Layer2 switching. (they learn what MAC addresses are on what ports only) in order to switch and route based on layer three IP addresses and maintain full network speeds it's going to cost you pretty. Your home Linksys router can only perform these operations at a modest 2-3 Mbps for comparison.
This section is where you start having tutorials about how to setup your network IP addresses and subnet masks and all that good stuff. It's also where I end my tutorial on the physical layers of networking the Xbox. Cheers ;)