12-08-2010 12:45 AM - edited 03-06-2019 02:24 PM
Hello Guys,
I was going through Layer 3 switch. From that I have understood that, layer 3 switch consists of FIB and adjacancy tables. From FIB its gets the next hop info and from adjacancy its get mac address info.
Consider the situation, there is layer 3 Switch A have vlan 1 and vlan 2 and 3,configured several ports. If vlan 1 wants to talk to vlan 3 . Now in this case from FIB it gets the next hop address that is the address of the directly connected destination host in vlan 3 and its gets the mac address of destination from the adjacancy table. Now layer three switch A creates new packet with new source and dest mac addresses. But how switch comes to know whats the source mac address or how it comes to know from which port it should forward the packet as vlan 3 is configured on the different switch ports. Does it use mac address table for it
12-08-2010 12:51 AM
Yes a L3 switch is also a L2 switch so it is using a CAM table for L2 ports.
Regards.
12-08-2010 12:58 AM
Thanks for your immidiate response. I was confused as everyone was saying that layer 3 switch only uses FIB and adjacany and dont use mac address table or CAM table.
12-08-2010 01:00 AM
He's using fib and adjacency table when doing routing and CAM table when doing switching.
Regards.
12-08-2010 01:15 AM
Thank you very much
Namrata
12-08-2010 01:18 AM
Hi,
The layer-3 Switch uses the Mac-address table for layer-2 Switching and uses the CEF table to determine the next hop address and the layer 2 information.
However, after it determines the next hop address and Mac address using the CEF table, it preserves and Copy the Source and Destination Mac address and the TTL value from the layer-3 header, and performs Switching at layer-3, at this point , no Source and Destination IP addresses are used to forward the packet, thats why it performs Switching at layer 3.
HTH
Mohamed
12-08-2010 02:30 AM
Mohammad
As far as I know switch only gets Destination Mac address from adjacancy table and for the source mac address it has to go to CAM table. Consider vlan 1 wants talk to vlan 3 on layer 3 . Valn1 and 3 are configured on the different ports . How Laoyer three switch comes to know from which port it has to forward and the mac address of that port is the mac address of switchport from whcih it is sending out packet to destination. Hence to get source mac address it has to look up through CAM table. This is my understanding. Is it correct?
Thanks
Namrata
12-08-2010 03:24 AM
Hi,
Looking at this example , VLan 1 need to communicate with Vlan 3 at layer-3, here is the process.
The Switch takes the Source Mac address and Source IP address of vlan 1 ,the Source Mac address is surly in the Cam Table. the Switch performs Routing lookup to determine the next hop Ip address and the destination Mac address using its CEF table, Once the Source IP address/mac address and the Destination Mac/IP are known , then it preserves / Copies the Source and Destination Mac Addresses which was encapsulated with the IP header, and it also preserves the TTL value from the IP header, then it performs Switching at layer - 3.
If you examine this process, you will notice a layer 3 switch also performs normal routing lookup, however, in the end it uses the Source and Destination mac addresses (Which encapsulated in a alyer-3) along with the TTL copied from the IP header to forward the Packet to the destination.
Let me know if you have any other inquiries,
Regards,
Mohamed
12-08-2010 04:14 AM
Yes,
when communicating on the same vlan, then it will just use layer 2 when communicating across vlans then you will require routing so layer 3.
12-08-2010 05:47 AM
Mohmmad,
I am still consfused. The process you described is coorect but I think finding source mac address will be the last thing switch will do. As the source mac address will be found only when switch found out from which switch port it has to forward the packet. After getting the destination mac address it will know from which port it is forwarding the frame and will get the mac address of that port (which is source mac address) from the CAM table.
Stuart: Thats correct. But my question is while forwarding the packet at layer 3, layer 3 switch updates source and destination mac address. Layer 3 switch obtains destination mac address by going through FIB and adjacancy table . does switch obtain the source mac address from CAM table? Thats my question. Suppose vlan 1 and wants talk to vlan2. Both these vlans are configured on the several ports of the switch. Through FIB switch obtains nest hop that is vlan2 interface and from adjacancy it obtains the mac address of destination. Now it has destination mac address and vlan.. But as vlan 2 exists on several ports on the switch how does it know on which exact port it should forward the packet. does it obtain this inforamtion from CAM table ?
12-08-2010 05:53 AM
does switch obtain the source mac address from CAM table?
CAM table is used for finding which port to forward frame based on dst mac and src mac is used to build this CAM table per VLAN.
12-08-2010 06:29 AM
Hello namratakadam,
The Switch uses the Source Mac it learnes from specific ports with the destined mac it learned from the Cam table for layer 2 forwarding , however , In a layer-3 it takes the Source Mac address of the vlan interface or a layer-3 routed port which found on the ARP table , and then performs normal routing lookup by using the adjacency table and fib to determine the Destination Mac and next-hop IP address.
The Swith then copies and preserves the Source and Destination Mac and the TTL values from the Layer-3 header (which encapsulated with layer-3) and forwards the packet to the destination.
Regards,
Mohamed
12-08-2010 09:32 PM
Mohamed
In layer 3 if swtich gets source mac address from arp table then how it determines which port it should use to forward the packet ?
Thanks
Namrata
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide