Jump to content

how do ethernet switches work?

Jessentis

lets say i have the following setup [1 router > switch > 2 pcs]. if send a file from pc 1 to pc 2. does the file go [pc 1 > switch > router > switch > pc 2] or directly [pc1 > switch > pc2]?

im just wondering with bandwidth, say my switch is gigabit but my router is only 100mbps local will it be bottle necked?

Link to comment
Share on other sites

Link to post
Share on other sites

I assume the switch is a dummy switch, but the files with go as you described, PC1, SW, RT, SW, PC2 since the switch is basically only forwarding the packets to the router which has to look up the routing table and see where to send the packets then sends them. You will be bottlenecked by the router at only 100mbps, yes. 

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Skiiwee29 said:

I assume the switch is a dummy switch, but the files with go as you described, PC1, SW, RT, SW, PC2 since the switch is basically only forwarding the packets to the router which has to look up the routing table and see where to send the packets then sends them. You will be bottlenecked by the router at only 100mbps, yes. 

holy crap thats a lot of knowledge, but it all makes sense and i appreciate it. thank you sir, keep up the hard work and kindness 🙏

Link to comment
Share on other sites

Link to post
Share on other sites

Switch learns what computers are connected to each port on the switch, and whenever there's data coming on a port, the switch looks at the destination computer of that packet, and sends that packet of data through the connector that last reported a computer with that address connected to it.

Short ... it just passes the packets between connectors.

 

So your data will go directly between the ports on the switch, without router even seeing that traffic.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Since there is a lot of misinformation here, this is a full list of things your computer A actually does when sending a package/file to another computer B:

  1. Computer A checks the subnet mask of the target computer B with a logical bitwise AND to see if it's in the same network as computer B. In your case, they are
  2. Computer A checks its ARP table for the MAC address of computer B
    1. It didn't find the MAC address and sends an ARP request for the MAC address to the whole network on the broadcast IP (the last IP in the network)
    2. ALL computers in the network receive said request and ignore it, if wasn't meant for them
    3. Only computer B answers with and ARP response
    4. Computer A receives the ARP response and updates its local ARP table with computer Bs MAC and IP address
  3. Computer A found the address of Computer B in its ARP table and its respective (local) IP
  4. Computer A starts to send IP packages DIRECTLY to computer B. Computer B is not referenced by its local IP, but its MAC address
  5. The switch receives the package and sees computer Bs MAC address as recipient and checks its switch table for computer Bs MAC address
    1. If the switch does not find computer Bs MAC address, it send the package to ALL devices (flooding) that are plugged into it
  6. The switch found computer Bs MAC address in its switching table and therefore knows, on which port computer B is connected and then forwards the package to it
  7. Computer B receives the package. Done!

 

Used terminology: 

MAC address: The physical address of the devices' net work adapter. If youa re conencted over cable AND WiFi, you have one MAC address for each connection.

ARP table: A list, in which a computer maps IP addresses to MAC addresses

Switching table: A list the switch stores (as long as it powered on) with the MAC addresses and ports all devices are connected on

 

What @zhnuand @mariushmsaid is true, so I thought I'd go into a bit more detail.

What @Skiiwee29said on the other hand is 100% wrong. Local data transfer is NEVER routed, but switched. The terminology is very important here. Therefore, since it's switched, the router is NOT involved at all. It might receive, or rather, it will receive, some packages along the way when a broadcast or a flood happens, but it will completely ignore those packages/requests. The router is only involved, when the first check with the subnet mask shows, that the target comptuer is NOT in the same network. This case would now involve the router by routing the package as default gateway of said network to wherever the target computer is. The router would never limit the bandwidth from computer to computer B, if both are on the same network!

Gaming Rig: Ryzen 9 5950x | 2x16GB DDR4 3200MHz | XFX Reference 6800 XT | MSI Unify X570 | Corsair MP600 2TB, Samsung 850 Evo 500GB | bequiet 850W Straight Power 11

Server: Ryzen 5 3600 | 4x32GB DDR4 ECC 2400MHz | Asrock Rack X470D4U | Samsung EVO Plus 250GB, 6x Seagate Exos 8TB, Samsung 850 Pro 1TB | bequiet 550W Straight Power 11

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×