So I'm studying networking using the Head First Networking book. I was reading about CAT-5 cable and the RJ-45 connector. The book says that the green pair receives data and the orange pair transmits data. It also says that if you want to connect the RJ-45 connector then make sure both the ends of the cable uses same standard i.e. either 568A or 568B. But then I imagine it should also depend on the devices which use the cable. Like suppose if a device uses 568A and the cable uses 568B (ofcourse on both ends), then won't the purpose of the green and orange wire change. Won't the orange then be receiving and the green be transmitting?
The book says that the green pair receives data and the orange pair transmits data.
This isn't entirely true. The Green pair and the Orange pair provide two separate channels. Data can traverse either wire-pair, so long as data in one direction is traversing one wire-pair, and data in the other direction is traversing on the other wire-pair.
What determines what wire-pair is used comes down to the specification of the Network Interface Card (NIC).
First, a picture of the 568a and 568b wiring specifications:
There are two types of NIC standards, Media Independent Interface (MDI) and Media Independent Interface Crossover (MDI-X).
- A NIC using the MDI standard will Transmit on pin-pair 2 and Receive on pin-pair 3
- A NIC using the MDI-X standard will Transmit on pin-pair 3 and Receive on pin-pair 2 (the opposite of MDI)
Notice, that both NIC specification are able to Transmit and Receive on the Green and Orange wire-pair. Remember, the NIC doesn't care what color the wire is, it is simply applying voltage or reading voltage on a particular pin pair.
Either way, PCs, Routers, and L3+ devices typically use the MDI specification. And Switches, Hubs, and L2- devices typically use the MDI-X specification.
Which means when a PC is connected to a switch, the PC's Transmit channel which starts at pin-pair 2 can be connect straight through to a Switch's Receive channel which arrives at pin-pair 2:
But, if you had a PC connected directly to another PC (or router, or other L3+ device), you would have to cross the channels on the wire so that what the first PC transmits on pin-pair 2 would arrive and be received on the other PC on pin-pair 3:
You can read about that in more depth in this thread.
So in the end, remember that the device does NOT use T568b or T568a, the device simply transmits or receives on pin-pair 2 or 3 depending on whether the NIC is subscribing to the MDI or MDI-X specification.
The wire in between the two devices has two termination points (two ends), and those ends have 8 wires, grouped into 4 pairs, and are placed in an order that is governed by T568a or T568b -- hopefully to properly introduce a crossing of the pairs on the wire (crossover cable) or to ensure there is no crossing of the pairs on the wire (straight through cable).
First, the RJ-45 is not the connector used for networking. Many people call it that, but the real term is 8P8C.
If you are connecting two devices which are unalike, e.g. host-to-switch, you should use a straight-through cable (both ends are wired the same). It used to be that you had to have a crossover cable to connect two like devices, e.g. switch-to-switch or host-to-host, but most modern devices can auto-adjust, and you can use a straight-through cable to connect them.