1. straight-through cable

A straight-through cable has connectors on each end that are terminated the same in accordance with either the T568A or T568B standards.

Use straight-through cables for connecting:
Switch to router
Computer to switch
Computer to hub

2. Crossover cables

A crossover cable has connectors such as one end should be of T568A and the other end should be T568B.

Use crossover cables for connecting:
Switch to switch
Switch to hub
Hub to hub
Router to router
Computer to computer
Computer to router