0

Let's say that a computer inside of a LAN wants to request a webpage from a Web Server. I have drawn this scenario in the following image:

enter image description here

So the request data will travel from the computer (for example: PC1) to the Switch and then the Switch will pass it to the Router, and now the Router will pass it to the next Router and so on and so forth until the request data reaches the Web Server.

But there is something that I am not sure of, is the Web Server also connected to a Switch (like the computers in the LAN are)? or is it connected directly to a Router (like I have shown in the image)?

Note that I am talking about a Web Server like the one that hosts Google.com and not some Web Server inside of a home LAN.

2 Answers 2

0

It really depends precisely what you mean by the terms "router" and "switch". Most likely, the server is connected to one or more devices that have both routing and switching capability and are typically using various combinations of them. It's usually called a "switch", but they typically have a vast array of routing features.

1
  • Is that actually true for the typical datacenter network? I've seen devices marketed as "L3 switches" with routing abilities, but to my knowledge most of them don't have those. Jun 3, 2016 at 11:28
0

A switch is just a device that connects multiple devices to the same layer 2 network, or broadcast domain. Your three PCs are on the same network so they can all talk directly to each other without the need for a router. Sometimes it is easier to regard this as a "subnet".

However, two devices that are connected directly to each other with a cable, such as the webserver and router in your diagram are also connected to each other at layer 2. A switch is only needed when a third or more devices need to be on the same subnet.

However, to answer your question, no a switch is not needed, however it is far more common to have a series of devices on the networks that routers are connected to, and so in most cases a switch would be present.

Update:

In this answer I am referring to a switch as being layer 2 only (ethernet packet switching), and a router as being layer 3 only (IP routing). As David points out in his answer, a router can have switching capabilities and a switch can have routing capabilities, but this confuses the situation because switching and routing are separate functions, regardless of whether they are housed inside a single box. A good example of this is a domestic router. It may connect to ADSL on one side and route to a series of LAN ports on the other. This series of lan ports is actually a switch.

8
  • If by "switch" you mean a device that does layer 2 only, then most real web servers are not connected to switches because switching only devices tend to be low end and the higher end devices that have the speeds and densities real datacenters need also have routing functions. Jun 3, 2016 at 7:47
  • Sure. Layer 3 switches are combinations of routers and switches. The switch portion of a layer 3 switch is still a switch, and the router potion is still a router. They are operating at different levels of the stack.
    – Paul
    Jun 3, 2016 at 9:32
  • He's asking about the physical devices that web servers are connected to. Not the function of some portion of those devices. The kind of terminology you're using, IMO, just adds confusion. If a switch is layer 2 only, then if the web server is connected to a device that is not layer 2 only, it is not connected to a switch. Since that conclusion seems really strange and confusing, I don't say a switch is layer 2 only. (And you shouldn't either, unless you want to confuse people.) Jun 3, 2016 at 9:38
  • The term "layer 3" switch is confusing imo, because it obscures the separate roles of routing and switching simply because they are in a single device. The role of switching packets is layer 2 and when a switch (whether it is a layer 2 or layer 3) does switching, it is layer 2 only. If it is moving packets between different broadcast domains it is routing. It doesn't help if you confuse the issue by suggesting that these functions are the same thing, regardless of the nature of the physical device they are housed in being a single box or multiple. The terminology is accurate.
    – Paul
    Jun 3, 2016 at 9:57
  • @David Schwartz "He's asking about the physical devices that web servers are connected to. Not the function of some portion of those devices." No actually I don't necessarily mean the physical devices that Web Servers are connected to. So if of a Web Server is connected to a single physical device that acts both as a Switch (layer 2) and a Router (layer 3), I'll consider the Web Server to be connected to a Switch and the Switch is connected to a Router.
    – John
    Jun 3, 2016 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .