Ok, so lets start from OSI model in order to understand the L2 and L3 switches
In 1977, the International standard organization (ISO) established a committee to develop architecture for computer to communicate with each other and the OSI model was the result of this committee. The OSI model describes the process by which for example, your email or any other data from your computer makes its way from your desktop application such as outlook/excel/word through a network medium (wire) to your neighbors outlook program application program located on another network.
The process starts from Bob’s pc at layer 7 down to 1, then through the network medium and finally to Franks pc, where it begins its journey, climbing from layer 1 up until, frank is able to receive and read it through his mail client application, Outlook. You can read up on OSI model to understand it better.
L2 & L3 Switches
The OSI model divides the email process above into SEVEN layers. L2 stands for layer 2 and L3 stands for layer 3 of OSI model; normally, L3 will refer to routers but because we now have switches that can do routing, those switches are therefore referred to as L3 Switches.
Switches reside at At layer 2 (L2) of the OSI model while Router are at layer 3 (L3).
Role of L2 Switches
The devices at L2 include the following: Bridges, Modems, Network cards, 2-layer switches.
The L2 switches performs switching and forwarding of information and it uses the mac addresses table in making the forwarding decisions, the unit of data at this stage is called FRAMES, so frames are transmitted at this level. Switches generally are what we call, “A BROADCAST DOMAIN”, meaning, when a broadcast is received on one port, it is sent out all other ports except the one on which it was received. Therefore, a Large layer 2 broadcast domain can be susceptible to unintended problems, like a broadcast storms, which eventually can cause a network outage.
Therefore, a switch at layer 2 has the following three distinct functions:
- Learning MAC addresses
- Filtering and forwarding frames
- Preventing loops on the network
In network architecture, Ethernet Layer 2 switches are usually placed at the access level with the end-users, phones, and printers connected to them. Most of the Cisco Ethernet switches have 24 or 48 ports.
Role of L3 Switches
L3 switches also do exactly what L2 switches do but in addition, L3 switches are also capable of routing. in fact, a layer 3 switch is both a switch and a router and can be regarded as a router with multiple Ethernet ports and with switching function. Layer 3 switches are thus able to segregate ports into separate VLANs and perform the routing between them, a function which a layer 2 switch cannot perform.
L3 switch forwarding is performed by specialized hardware called ASICs (Application Specific Integrated Circuit) – it is faster than routers in performance , but lack some of the advanced functionalities of routers. Unlike routers, a layer 3 switch is less likely to experience network latency since packets don’t have to make additional steps through a router and because L3 switches perform both layer 2 and layer3 functions, they are also called “Multilayer switch”.
L3 switches can only perform routing on ethernet ports and they are depicted in the network environment with the icon as shown.