Imagine you have some network configured like this
+-----+ +------+ +------+ +-----+
|comp.|---|bridge|---|router|---|comp.|
| A |---| B |---| C |---| D |
+-----+ +------+ ^ +------+ +-----+
|
-- Here!
If computer A sends an ethernet packet to computer D…
- The source IP is going to be A and the destination IP is going to be D.
- What are going to be the MAC addresses on it at the marked segment?
I think I narrowed it down to two possibilities:
- Possibility 1:
- Source MAC is B
- Destination MAC is C
- Possibility 2:
- Source MAC is A
- Destination MAC is D
Which — if any — is correct?
Thanks for your time?
PS: I expect to be commended on my ASCII art skills. Be sure to leave a comment below.
Best Answer
Source MAC = A
Destination MAC = C
Why: When A needs to send data to another host it first determines whether or not the detination host is on the local network. Upon determining that the destination is not local, A sends the data to it's configured default gateway, which is C.
Why not B? Because switches (bridges) when operating at layer 2 don't modify the source or destination MAC address. A router on the other hand, will modify the source MAC address, substituting the original source MAC address with it's own MAC address.
Why not D? Because A knows that D is not on the local network and that it is not directly reachable. A knows that it needs to send the data to it's DG and will ARP for the DG rather than ARP'ing for D.