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 ?