A switch will allow you to connect two or more computer equipments together; however, it does NOT have a WAN port and DHCP like a router.
WAN port will connect to the modem and receive the public IP from ISP.
DHCP will provide the equipment with a local IP which with the help of NAT will allow more then one PC to connect to the internet.
So a switch alone, would not be able to let both computers get on the internet and play game onlines. It only can connect 2 computers together to play games like locally between the two?
So a router would be what i want , correct? Cuz my friend and I would like to both be able to surf the internet, and we like to play a game called Call Of Duty , and want to be able to play online with others, instead of just having matches between the two of us.
The basic functions of each device are as follows:
Switch: Passes traffic from one physical port to another on the same network simply by looking at the address that the traffic is destined for.
Router: Passes traffic from one network to another. For instance, your ISP's network to your internal network. Routers generally ( but do not always ) have services such as DHCP and NAT which allow the router to manage the entire network autonomously without the need for the user to configure IP addresses and address translation.
In order to connect two or more devices to a single modem, you will need a router capable of both DHCP and NAT (all home routers have this capability and is enabled by default, so no need to worry).
Switches are good for connecting more devices to the network than your router has room for. You can use a single port on your router, plug that into the switch, and connect up to 23 devices with that single port, assuming you have a 24 port switch.