Lets consider TCP/IP stack.

If host A want to send a packet to host B in another IP network

  • Host A will send a frame with src MAC its address and destination next hop (router) MAC address
  • The payload of the frame will contain IP src A and IP dest B

I do not understand how this works a the Data link layer. Let's say A and B are on the same LAN BUT they are separated by two switches. Here is what I think will happen :

  • Host A will send a frame to the next hop (switch 1) with dest MAC address the address of switch 1
  • Now I'm stuck here. How does switch 1, from its CAM table, will be able to decide to with interface it should send the frame since it cannot decide, based on IP dest information to whcih interface to forward the frame ?
  • There are multiple question here that have answers that explain how this works. For example, the above-linked question, this one, this one, and this one, among others.
    – Ron Maupin
    Commented Mar 8, 2020 at 21:27
  • Mac address table, which maps mac-address of end host to connected switch ports .. frame reached to L2 switch verifies mac -address table to destine packet to end host Commented Nov 22, 2020 at 14:35


Browse other questions tagged or ask your own question.