help
hi ..
i want some help i have qustion .
we know every pc have mac address and when he connected with swtich he will be in the mac table ..
when pc sender any message to another pc in the another network how mac address go in this network and we know the mac the router doesn't know mac address
i want some help i have qustion .
we know every pc have mac address and when he connected with swtich he will be in the mac table ..
when pc sender any message to another pc in the another network how mac address go in this network and we know the mac the router doesn't know mac address
Comments
The concepts you need to know are:
encapsulation - how data is wrapped up in the different network layers
OSI model - the different layers in networking
Data Link Layer - layer 2 or the 'local' network
Network Layer - layer 3 or the inter-network
Router - the device that moves packets between networks and is responsible for re-encapsulation at layer 2
This video might shed some light.
1. The PC that's sending the message first sends an ARP (Address Resolution Protocol) request to obtain the destination host's MAC address, based on the known IP address (or web address, DNS takes care of the name resolution and turns domain name into IP address for you if you are going to a website)
2. The default gateway(router) attached to the sender's network responds to the ARP request with it's own MAC address. At this point, the sending PC assumes the default gateway is the host it wants to communicate with, and knows nothing more. The sending PC will cache the gateway's MAC address in the MAC table for future use.
3. The gateway begins processing the packet received by comparing the destination IP in the frame against its own routing table. When a match cannot be found, it forwards the packet to the next closest router, or to the gateway of last resort(usually the ISP's router) depending on the how the network is configured, for further processing, until the packet finally reaches the destination's network/router based on comparing the routing table of each router along the way.
There are a bunch of other things involved in the process, this is only a simplified way of explaining it. There are many routing protocols involved in the routing decision across different networks, but the idea is still based around layer 3 IP address after the frames leaves it's own local area network. MAC address is a layer 2 concept and will only communicate within the same Local Area Network, and whenever you are communicating with someone outside of your LAN, IP routing takes over.
Hope this helps.