Wednesday, March 23, 2011

Is it possible to convert a Layer 2 switch to a Layer 3 switch?

 
It's very important to understand what a Layer 2 and Layer 3 switch is. Once we define them, the differences will become evident.
 
Taking into consideration the OSI model, a Layer 2 switch will forward packets to their destination using Layer 2 information embedded within the packet(s) it is forwarding. This information contains the source and destination MAC (Media Access Control) address, 48 bits long -- or 6 bytes. A layer 2 switch will temporarily store this information in its MAC address table so it is aware of the location of each MAC address.
 
A Layer 3 switch on the other hand will forward packets to their destination using Layer 2 and Layer 3 information of the packets it's forwarding. As you might recall, Layer 3 of the OSI model contains the IP Header information -- in other words, the source and destination IP Address of the two hosts exchanging information (packets).
 
Because of this additional functionality, Layer 3 switches are usually able to direct packets between different IP networks, essentially performing a router's role. Routing packets between different IP networks is usually desired when we've implemented VLANs in our network. This allows all VLANs to communicate with each other, without additional routers.
 
It is clear that the architecture between Layer 2 and Layer 3 switches is totally different. This is also evident in the price differences between the two, where Layer 3 switches are considered a big investment while you can pickup a small Layer 2 switch for less than $50 these days! Large Layer 3 switches such as Cisco's 4500 and 6500 series are able to perform as Layer 2 and Layer 3 switches by simply entering a series of commands, but keep in mind that we are talking about switches whose cost is in the thousands of dollars.
 
Summing up, if we are talking about large expensive switches, it might be possible to have them work as either Layer 2 or Layer 3 switches -- this depends on the switch's features and in your case -- your interviewer's knowledge :)

No comments:

Post a Comment