You need to use a straight type of connection. 568A or 568B depending which type your network is using.
To connect a PC to a switch you should use a straight through UTP cable.
To connect two devices of the same type together. e.g. You would use a crossover cable to connect a router to another router, a switch to another switch or a computer to another computer. If you are connecting diferent devices together, such as a router to a switch, a straight through cable should be used.
straight-through cable
You need a crossover cable for that.
crossover cable
Straight Cable is used to connect a device to a different type of devices Eg: PC to a Switch PC to a Hub Switch to a Router E.t.c. Cross Cable is used to connect a device to a similar type of devices Eg: PC to PC Switch to Switch E.t.c.
cat5,cat5e $ cat6
To the switch the router is just another host, so it connects with a straight Cat 5 or Cat 6 cable.
Typically you would use a CAT-5e or CAT-6 UTP (Unshielded Twisted Pair) network cable.
Most switches and routers these days allow for a standard straight through cable to connect each other. (So any CAT 5e or 6 cable you find at Best Buy will be fine) Older devices (Such as a Cisco 2900xl switch) require a cross over cable to connect like devices such as a switch to switch. These cables can also be found at Best Buy and will be clearly labeled "Cross Over". There are two different standards of straight through cables if making your own. See the related link. To make a cross over cable, wire one end with the A standard and the other with the B standard.
connect it with a crossover cable connect both end to same type port either two gigabit port or two fast ehternet port
To create a switch loop in an electrical circuit, you need to run a cable from the power source to the switch, and then another cable from the switch to the light fixture. Connect the wires according to the wiring diagram for the specific type of switch you are using. This setup allows you to control the light fixture from the switch.