When do I use a switch, and when do I use a router?

In summary: The port number?The router and switch can also be combined into a "network router" which has multiple "external" ports and can handle multiple networks.
  • #1
peevemagpie
10
2
Sorry for the stupid question but I already forgot or a bit confused. When do I use a switch, and when do I use a router? Thanks!
 
Computer science news on Phys.org
  • #2
Routers are typically connected to a cable modem provided by the cable company aka your service provider like Time Warner or Comcast. You can then connect one or more wired computers to the router upto 4 devices and if it has wireless capability many more wireless devices like 100 or so although I think there'd be a big slowdown if they were all using services at the same time.

Network switches are used to connect many computers together to form a network.

Check Wikipedia for more details.
 
  • #3
Often the modem/router/switch is one device.
 
  • #4
For a home network, you need one router. If you already have a functioning network, you probably already have a router somewhere, either in your cable or DSL modem, or as a separate device. If you want to add more devices to your network, and don't have enough Ethernet ports on the modem, or on a separate router if you have one, all you need is a switch.

If you use a wireless adapter that is separate from your modem+router, it may also be acting as a router, which should be unnecessary and may actually decrease the performance of your network. I discovered this a year or two ago when a new version of Apple's AirPort Utility warned me that I had a "double NAT" situation. It turned out that both my DSL modem and Apple AirPort Express wireless adapter were acting as routers. I turned it off in the AirPort Express by putting it in "bridge mode", and my wireless throughput increased.

The four functions (modem, router, switching, and wireless) can be handled by separate devices or combined into fewer devices in various ways.
 
Last edited:
  • #5
I don't have a router on my home network (my ethernet is "external" network, and I use 1394 for "local" network).

Cable modems can act as routers or switches. Standard DSL modems are routers, while the ones that support multiple static ip's are switches. Modems acting as routers interface between an internal local area network, assigning local ip addresses to the devices connected to the router side of the modem, then use a common external ip, but with a separate set of "port numbers" for each device connected to the modem. In the case of modems acting as switchers, what would be a local area network instead is treated as an extension of the externel internet, and each device connected to such a modem get's it's own external ip address with no port changes made to packets.

I have a multiple ip setup (2 computers, 2 external ips, max with my ISP is 3). My cable modem only has one ethernet port, so I use a standalone switcher to connect the 2 computers to the cable modem. If the cable modem is disconnected from the internet (cable), then it acts as a local DHCP, creates a local area network and assigns local ip's to allow local area network type operations. In my case, in addition to the ethernet used with the cable modem, I use the 1394 interface on my two computers for a local area network, so I have both a local and external network between my two computers.

A standalone switcher connects multiple ethernet devices, and can change the transfer rate between devices, but does not change the packets that go through it.

A standalone router acts similar to the modem router mentioned above. "Local devices" are assigned local ip's, while the "internet" port of the router uses a single external ip, changing the packet port number content to distinguish between devices.
 
Last edited:
  • #6
Ohhhhh, okay. I think I get it. So question then, when it comes to a home network and you need to connect multiple devices what should I use to do that without using the signal strength, or is this even possible (the signal strength part at least)? Is there something other than a https://www.curvature.com/Cisco/Routers/switch/modem?
 
  • #7
peevemagpie said:
Is there something other than a router ... switch?
There's a hub:

hub - connects multiple network devices, no change in packet content or transfer rate, provides power (signal strength) to its ports. Sometimes a hub is used simply to extend the length of a connection between two devices.

switch - connects multiple network devices, no change in packet content, but can change transfer rate so that each port can run at a different transfer rate, and it can buffer data. Sort of an "enhanced" hub.

router - connects multiple network devices to some "external" device (usually a modem). Has a set of "internal" ports used to create a local area network. Has one "external" port,usually labeled as "internet" port. Assigns local ip address to the devices connected to the "internal" ports. Maps packets between the "internal" ports and the external port by adjusting the port numbers in packets. May be able to change transer rates.

modem - converts between an inernal protocol (serial port, ethernet, ...) to an external protocol (dial up, dsl, cable, satellite, ...). Assigns one or more external ip addresses (DHCP), depending on the modem type, and ISP (internet service provider) options (if multiple ip's are being used).
 
Last edited:
  • #8
Hubs don't exist anymore since switches are so cheap to make. So below you can see the main differences:

Switch
  • Works with MAC addresses
  • Connects computers in a LAN (Ethernet)

Router
  • Works with IP addresses
  • Connects computers in a WAN (Internet). An other way to put it: connects different type of LANs

The router at your home is a router-switch. When you transfer a file from your desktop to your laptop you are using the switch. When you open your browser to access a webpage, you use the router since the webpage request has to go outside your LAN.
 
Last edited:
  • #9
If the modem is setup to assign external ip's to each device connected to the modem:

Switch
  • Works with external ip addresses
  • Connects computers to an extension of a WAN
 
  • #10
peevemagpie said:
So question then, when it comes to a home network and you need to connect multiple devices what should I use to do that without using the signal strength, or is this even possible (the signal strength part at least)?

It looks like what you need is a switch.

Here's my situation as an example. My DSL modem+router has only a single LAN port. Originally I connected that port to my Apple Airport Express wireless adapter, and connected wirelessly to all my devices. As stage 1 of a network upgrade, I bought a 5-port switch and connected the modem, wireless adapter, computer and printer to it. Now all the devices near my desk have a wired connection, and the wireless adapter served the rest of the devices in my house (MacBook, iPad, TiVo, Apple TV).

This was followed by a stage 2 upgrade which uses powerline adapters to improve the signal to those other devices.
 
  • #11
I am afraid there is some misinformation in this thread.

The difficulty is that the devices we use at home to obtain Internet connectivity are a lot more complex than a true "router", a "modem" or a "switch" is, even though they are very frequently referred to as one of those names. "Router" is probably the one misleading most, because in a typical home setup the "Internet connectivity device" functions as a NAT firewall, not as a true router.

@peevemagpie Unless you are knowledgeable about IP networking (which does not seem to be the case), you need one "router" (Internet connectivity device) and zero or more "switches" for your home network. If you also need wireless connectivity, the simplest solution would be to have that built into the "router", to avoid the problem described by jtbell. If your house is large and one WiFi access point is not enough, things can easily get complicated, at which stage you might want to hire a professional - or bite the bullet and study the subject thoroughly.
 
  • #12
Some of your consternation at understanding the differences are that these items have changed over time, particularly among consumer grade equipment. Switches at one time were "dumb" and merely avoided packet collisions, a sort of time-sharing device, Now they are intelligent and the line between them and routers is less distinct.

Regarding wifi and house size a great deal can be accomplished by improved antennae but by far the most effective choice to make is the wifi hub's location. Keeping distances short with the fewest intervening walls/floors can save one considerable cash and/or reduced connectivity/bandwidth. Some wifi routers, especially with replacement software like DD-WRT can increase the power output of the transceiver but knowledge and caution here are especially important.
 
  • #13
These networking names are pretty confusing to someone trying to learn about them. A switch should really be called a multiple-plug or something like that. It's just a way for more devices to get physical connectivity to the network.

The "router" is generally provided to you by your internet service provider. It is the device which assigns IP addresses to your local computers/tablets/phones, and it is the box which is the gateway to the internet.

To add more devices to a network, you don't mess with the router, but instead add a switch. Or possibly, you add a special box which acts as a wireless access point, which allows wireless devices to reach the router (and hence the internet). Once things can reach the router, the router can connect them to the internet. Switches and hubs and WAP's just provide connectivity to the router.
 
  • #14
Actually it can be rather important to "mess with the router" for security as well as performance reasons. For this reason most people, including me, prefer to add a commercial router rather than a switch in a SOHO system. This allows for much higher performance and security as well as the ability to configure permissions and accessibility from certain nodes such as the Kids' computers or an internal media streaming device.

By default most routers come with the same default password by brand which should be changed to a unique password immediately. Some have services like UPnP turned on by default and no less than Homeland Security has asked that this be disabled for security reasons since 10's of millions of systems are already compromised through this service.
 
  • #15
enorbet said:
Actually it can be rather important to "mess with the router"...

For beginners who don't know what they are doing, I recommend NOT messing with the router. If you know what you are doing, that is another matter. For someone who is still trying to figure out what a switch is, a hub is, and a router is, messing with router settings might not be a good idea.
 
  • #16
enorbet said:
...
By default most routers come with the same default password by brand which should be changed to a unique password immediately...
If you weren't granted access to their computers or able to use their ISP's delivered IP address, how could you log on their router to change its settings ? External IP after passed through the modem router will be NATted, right ?
I am looking for a tool or ways to not even use router credentials but I can access the router settings to forward particular ports (e.g an application like WOL of a LAN natted computer from a remote one that's not on the same network)
 
  • #17
@Medicol To be clearer, I was not referring to what equipment has become popularly distributed by ISPs that while usually called a "modem" is much more than that. Today these devices combine modem, router (and NAT firewalling on some) and wifi access point, and a few also have phone service hardware built in. I was referring to standalone commercial routers and homebrew systems such as made possible by software like http://en.wikipedia.org/wiki/FREESCO[/PLAIN] [Broken] .

ISPs vary a lot but most even with DHCP enabled refresh to the same addy you had before in my experience. It's just not guaranteed as it is when you purchase a static IP plan. I'm not sure what you're asking in the last sentence but if it is similar to Tunneling or Syncing of course that's possible and made easy by a number of applications that exist for any OpSys.
 
Last edited by a moderator:
  • #18
By definition a router works at the network level, which means that it connects to two (or more) different networks that may have different protocols and different interfaces.

A switch in the current usage of the word works at the data link level, connecting different devices in the same subnet. This means that the devices connected have the same protocols (and interfaces).

An access point is a hybrid - it connects two different networks, so it should therefore be a router. In reality the wireless network is presented to the wired network at the data link level.
 

1. When should I use a switch instead of a router?

A switch is used to connect devices within a local network, such as computers, printers, and servers. It allows these devices to communicate with each other using MAC addresses. Therefore, a switch is best used when you need to connect multiple devices within a small network.

2. When is a router more suitable than a switch?

A router is used to connect different networks, such as a home network to the internet. It directs traffic between these networks using IP addresses. Thus, a router is more appropriate when you need to connect networks that use different protocols, such as the internet and a local network.

3. Can I use a switch and a router together?

Yes, you can use a switch and a router together in a network setup. A switch is typically connected to a router, and the router is then connected to the internet. This allows for efficient communication within the local network and access to the internet.

4. What are the main differences between a switch and a router?

A switch operates at the data link layer of the OSI model, while a router operates at the network layer. This means that a switch uses MAC addresses to direct traffic within a network, while a router uses IP addresses to direct traffic between networks. Additionally, a router can perform network address translation (NAT), which allows multiple devices to share a single IP address, while a switch cannot.

5. Are there any situations where a switch and a router can be used interchangeably?

While a switch and a router have different functions, there are some situations where they can be used interchangeably. For example, if you have a small network with only a few devices, a router can be used instead of a switch. However, using a switch in this scenario would provide better performance and network management capabilities.

Similar threads

  • Computing and Technology
Replies
25
Views
938
  • Computing and Technology
Replies
11
Views
1K
  • Computing and Technology
Replies
24
Views
3K
  • Computing and Technology
Replies
27
Views
2K
  • Computing and Technology
Replies
7
Views
2K
  • Computing and Technology
Replies
5
Views
1K
  • Computing and Technology
Replies
1
Views
1K
  • Computing and Technology
Replies
2
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • Computing and Technology
Replies
7
Views
2K
Back
Top