3

I have the following routing table:

Routing Table Snapshot

say I get packet with dest IP 10.5.89.34 and the next hop IP is that of a logical VLANIF94 interface.

please explain what all steps will happen here like MAC rewrite, VLAN tagging etc.

7

A layer 3 switch will do both routing and switching. In this case:

  1. The packet arrives on some layer 3 interface. The destination IP is 10.5.89.34, and the MAC address on the incoming frame is the MAC address of the receiving interface.
  2. The routing table says packet should go out to a directly connected subnet on VLANIF94. A new ethernet frame has to be built containing the same dest IP, but with the dest MAC address set to the address of 10.5.89.34, which needs to be found through ARP.
  3. An ARP request "Who has 10.5.89.34?" is broadcasted from the VLANIF94 interface. Since this is a vlan-interface, it will be sent out of all ports in vlan 94. The copies of the frame will be vlan tagged if they go out of a tagged port, and untagged if they go out of an access port.
  4. An ARP reply will be received informing the router of the MAC address for 10.5.89.34, and the original packet can be sent out VLANIF94 in a frame using this MAC address as its destination.
  5. The frame will be sent out the switch port in vlan 94 which is listed with that dest MAC address in the MAC address table (this entry was learned in step 4).

So, as a router, your layer 3 switch will forward the IP packet in a frame with different MAC addresses. As a switch, it will do vlan tagging if needed when sending the packet on the switchport. The same is true for the incoming packet, it could have been tagged or untagged.

2
  • hi Gerben,but the next hop is 10.5.88.1, so should it not be the MAC of the next hop rather than the MAC of dest IP?? Dec 24 '14 at 12:05
  • 1
    Your layer 3 switch is directly connected to 10.5.88.0/22 and can talk to 10.5.89.34 directly. I'm guessing you are using a Huawei, and the column is indeed called Nexthop, but in the case of a directly connected subnet, that Nexthop is the IP address of the router's interface in that subnet. (Have a look at lines in the table that do not contain 'Direct'. There will be a next hop pointing to an IP outside of the destination network, exception if it is the default route to 0.0.0.0/0)
    – Gerben
    Dec 24 '14 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.