a top-of-rack switch
A rack is a tall metal cabinet holding a stack of servers, like a bookshelf where each shelf is a computer. Those servers need to talk to each other and to the rest of the building. The neat way to wire that is to put one small network switch at the top of the cabinet and run a short cable from each server up to it. That box is the top-of-rack switch: the local hub for everyone in that one rack. Every server in the rack plugs into it, and it is the rack's single doorway to the wider datacenter network above.
Mechanically it is just an ethernet switch — typically a 1U box (about as tall as a thick book) with a few dozen downward ports, one per server in the rack, plus a handful of high-speed uplink ports going up to the aggregation layer. Two servers in the same rack communicate by sending their packets up to the ToR switch, which forwards them straight back down to the destination server — one hop, very low latency, full link bandwidth. To reach a server in a different rack, traffic goes up through the ToR's uplinks into the rest of the network tree. The ToR is therefore both the cheapest, fastest path (within the rack) and the chokepoint to everything beyond.
The top-of-rack design matters because it makes the rack the natural unit of locality. Bandwidth between servers under the same ToR is abundant and latency is tiny, while bandwidth out of the rack (through the uplinks) is far more limited. So schedulers try to pack tightly-communicating pieces of a job into one rack, keeping their traffic on the rich intra-rack fabric. The ToR is also a unit of failure and maintenance: if a ToR switch dies, every server in that rack is cut off from the network at once, even though the servers themselves are fine.
An honest caveat: a single ToR is a single point of failure for its rack, so important deployments either use dual ToR switches per rack or, more commonly, spread each service's replicas across many different racks so no one switch failure takes down a whole service. The convenience of one tidy hub per rack comes with the responsibility of not putting all your eggs behind one switch.
A rack holds 40 servers; each runs a 25 Gb/s cable up to one ToR switch with, say, four 100 Gb/s uplinks. Within the rack any pair can exchange data at full speed in one hop. But all 40 servers together share only the four uplinks to reach the rest of the building — that is where contention starts.
Cheap, fast, full-bandwidth inside the rack; scarce shared uplinks out of it.
A single ToR switch is a single point of failure for its whole rack. Resilient designs spread a service's replicas across many racks so one switch dying never takes the service down.