aimensaimens Member Posts: 14 ■□□□□□□□□□
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


  • TheFORCETheFORCE Senior Member Member Posts: 2,298 ■■■■■■■■□□
    I'll try and decipher your question and give you a hint. Look into OSI layer 2 and OSI layer 3. There is something going on between these layers that translates mac addresses into IP's and vice versa.
  • aimensaimens Member Posts: 14 ■□□□□□□□□□
    i searching and didn't find answer of my question , Thanks
  • OctalDumpOctalDump Member Posts: 1,722
    Your question seems to go right to the heart of the layered nature of TCP/IP. The thing to realise is that packets are routed based on their IP (layer 3), and packets are encapsulated in frames. Frames are only relevant to the current network segment (layer 2 network). The MAC address is only needed on the current segment, when it moves between networks (ie is routed) then it is re-encapsulated with a different MAC (or other layer 2) address.

    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.
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • aimensaimens Member Posts: 14 ■□□□□□□□□□
    idon't find my answer in this video , as switch used the mac-table to control in his network but when we want send anything outside network will we use router how router find the destination of message and he is didn't know whats mean mac address ?
  • ITNewbie2ITNewbie2 Member Posts: 53 ■■□□□□□□□□
    Here it goes, this is a broad overview of the logic on how packets are routed to different networks:

    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.
  • aimensaimens Member Posts: 14 ■□□□□□□□□□
    Thanks this is helped me
Sign In or Register to comment.