Say you had two networks connected via internet as seen below with significant labels and IPs provided
Boxes = Routers with external IPs
Rectangles = PCs with internal network IPs
- Code: Select all
192.168.0.1 172.16.0.1
----------- -----------
| A | ------- ----| B |
----------- | ------------ ----------- | -----------
|____| | | |___|
----------- | ROUTER A | | ROUTER B | -----------
| | ----------| |---------| |--------| C |
----------- ____| 12.34.5.7 | | 98.87.6.4 |___ -----------
| | | | | |
----------- | ------------ ----------- | -----------
| |------- -----| |
----------- ----------
Say computer A wants to connect to computer B (Ex: computer B puts up a game server and A must enter B's IP address to connect).
B opens port 8888 to listen for A's initial packet.
A, hoping to connect to B, sends a packet to 98.87.6.4:8888, Router B, the external address.
When the packet arrives at Router B, how does it know which computer the packet should be forwarded to?
Normally the Ethernet, or lowest level frame/packet, header contains the MAC address for the PC the packet is sent to but seeing as computer A doesn't know B's MAC address it can't fill in that field and Router B does not know what system the packet was originally destined for, how is the destination MAC address filled in?
I tried to word this best I could, I hope it's understandable what I'm asking

