Ethernet cables are used to connect several pieces of a local area network together. Ethernet cables typically come in two varieties: crossover cables and patch cables.
Since crossover cables and patch cables are fundamentally different, each cable has a different function in a local area network.
A crossover cable should be used when connecting hardware directly to a computer. A standard (straight through) cable should be used when connecting hardware to a computer through an Ethernet hub or switch. A standard CAT 6 cable has a 1-to-1 mapping of pins from one connector to another. A crossover cable connects the transmission pins from one end to the receive pins on the other end (crosses them over, hence the name).
If you do not know whether your cable is a crossover cable or standard Ethernet cable, this can be verified by sight. Most of the time you will be able to see the color of the individual wires through the connectors. You can then use the table and figure below to determine if the cable is a crossover cable or a standard Ethernet cable. You can also use a multimeter to probe the connections. Connect the positive end of the multimeter to a pin on one end of the cable and probe the pins on the other end of the cable to figure out if two ends have the same pin connections. If they are the same on both ends, it’s a straight through cable. Otherwise, it’s a crossover cable.

Details:

When performing Ethernet communication, the transmit pins on one device need to be connected to the receive pins on the other device. A router or hub will perform this crossover function internally, thus standard Ethernet cables should be used with them, or any device that performs this internal crossover function.
When connecting two devices directly, there is no intermediate device to perform the needed crossover function, so you will need to use the cable itself to do the job. Standard Ethernet ports are also referred to as MDI (Medium Dependent Interface) ports. The ports on a router, hub, or switch will have an internal crossover connection configuration known as MDIX (Medium Dependent Interface Crossover).

                                                      568B                         568B                       568A                                                        

What are the Differences Between a Standard Category 5 Ethernet Cable and a Crossover Cable
What are the Differences Between a Standard Ethernet Cable and a Crossover Cable
Figure 1: Detail of connector showing wire position