Switched only network? Layer 2

networkingnewbie

Honorable
Oct 19, 2012
16
0
10,520
What would be the purpose of using only a layer 2 switch in a network? Anymore doesn't everyone needs access to the Internet. Once a router is in place, then can't all subnets talk to each other, even if they are initially separated by a switch? After all the switches would all be plugged into a router. Trying to think of a scenario where one would only use layer 2 switches and no router. Seems like old technology, but perhaps I'm not thinking this through.
 
Solution
In an enterprise network, layer 3 switches can be appropriate. Home networks have no need for anything more complicated than a layer 2 switch. If more control is required in a home network then port based VLANs can be used to segregate.

There are many isolated networks in use. Not every device needs internet access. A set of IP based cameras which connect only to a DVR need nothing more than a layer 2 (POE) switch.
In an enterprise network, layer 3 switches can be appropriate. Home networks have no need for anything more complicated than a layer 2 switch. If more control is required in a home network then port based VLANs can be used to segregate.

There are many isolated networks in use. Not every device needs internet access. A set of IP based cameras which connect only to a DVR need nothing more than a layer 2 (POE) switch.
 
Solution


Switches are simple and very, very fast. Switching a frame does not require rewriting the frame, merely inspecting it, looking up the MAC address in CRAM, and redirecting the packet to the proper port. A switch has elements of the first two layers of the OSI model, it is both a physical layer and link layer device.

Routers on the other hand allow packets (the network equivalent of a frame) to cross from one network segment to another. Since subnets are a layer 3 concept, routers have to inspect more than just the MAC address, they also have to dig deeper into the packet and inspect the IP address as well. Then, they have to execute a routing policy to direct the frame to the appropriate network. Finally, they have to rewrite the source and destination MAC address because those are local to each network segment. A router has no less than two MAC addresses, one for each network segment to which it is joined. Routers work very well when the networks that they join are similar, such as when the lower 3 levels of the OSI model match. As such, a router has elements of the first three layers of the OSI model, it is a physical layer device, a link layer device, and a network layer device.

Unlike routers, gateways abstract the protocol of the far network(s) which makes them work well when joining dissimilar networks. From the perspective of the local network, gateways appear as devices to which all upstream traffic is sent and from which all downstream traffic originates. The state of each connection is tracked internally by the gateway and the gateway performs translation necessary to make communication between the local and wide networks compatible. Gateways have elements of the fourth and fifth layers of the OSI model, which makes them transport and session layer devices.

Most consumer "routers" are actually a combination of a switch, a router, and a gateway all in one. The switch exposes multiple ports for the consumer to connect devices to, the router routes data between the local area network and the wide area network, and the gateway performs Network Address Translation.