Destination MAC address?

mikejensen83mikejensen83 Posts: 22Member ■□□□□□□□□□
Hello,

I am confused as to what destination MAC will be in a layer 2 frame. In the below example:

PC1>>>SW1>>>>R1 e0/1 interface>>>>SW2>>>Server 1

If PC1 wants to send information to Server one on a different subnet with R1 in the middle, will the destination MAC in the frame leaving PC1 be the MAC for SW1 or the MAC for the e0/1 interface on R1?

Thank you.

Comments

  • fuz1onfuz1on Posts: 961Member
    I think the keywords here are MAC (physical address) and Layer 2 frame. Which device deals with Layer2?
    timku.com(puter) | ProHacker.Co(nsultant) | ITaaS.Co(nstultant) | ThePenTester.net | @fuz1on
    Transmosis | http://transmosis.com | LinkedIn | https://linkedin.com/in/t1mku
    If evil be spoken of you and it be true, correct yourself, if it be a lie, laugh at it. - Epictetus
    The only real failure in life is not to be true to the best one knows. - Buddha
    If you are not willing to learn, no one can help you. If you are determined to learn, no one can stop you. - Unknown
  • mikejensen83mikejensen83 Posts: 22Member ■□□□□□□□□□
    A "switch" deals with layer 2. But then again I could go on the router and do a "show ip arp 10.xxxx or use the MAC of the host xxxx.xxxx.xxxx and the router will show me a mapping of the MAC to IP.
  • mikejensen83mikejensen83 Posts: 22Member ■□□□□□□□□□
    I am still not sure if PC1 would use the destination MAC of the routers interface or the switch that sits between. Any help would be greatly appreciated. Thank you.
  • late_collisionlate_collision Posts: 146Member
    The switch is a transparent Layer2 device. The only time you send a frame with a destination MAC Address of a switch is when you want to send traffic "to" a switch.

    In the scenario above, the destination MAC address of the frame will be that of the Router's e0/1 interface. The frame is sent "through" the switch (not "to").

    Remember, when a device receives a frame with it's MAC Address as the destination, it will strip the frame header/trailer and inspect the packet for further forwarding. This is the desired behavior, we want the router to strip the frame and forward the packet based on Layer3 information. Had the switch de-encapsulated the frame, it wouldn't know what to do with the packet.
  • rob42rob42 Posts: 423Member
    I know that this thread is a little old, but I feel that it's a very good question. While I respect the answer that late_collision has provided, the detail for me, remains a little fuzzy, so I decided to run the scenario in CPT and document the results here, so that I and others may learn from it.

    The scenario is that PC1 requests a web page from the SERVER.
    The request travels... PC1 >> SW1 >> R1 >> SW2 >> SERVER.
    ARP Requests and Replies, aside.
    Looking at L2 operations only.



    PC1 forms an Ethernet Data Frame (the payload being a IP Packet), using the information contained in its ARP Table, and encapsulates it with...

    DEST MAC: 0006.2A58.0201
    SRC MAC: 0060.700B.38EA

    PC1 >> SW1

    SW1: Receives the Frame on its Inbound Stack and Decapsulates to read DEST & SRC MAC Addresses.
    SW1: Sees from its CAM Table that the DEST MAC is on its Gi0/1 port, transfers the Frame to its Outbound Stack, re-encapsulates and transmits. Note that the DEST & SRC MAC Addresses have not been changed.

    DEST MAC: 0006.2A58.0201
    SRC MAC: 0060.700B.38EA

    SW1 >> R1

    R1: Receives the Frame on its Inbound Stack and Decapsulates to read DEST MAC. It matches the receiving port, so the Frame has now reached its destination.

    R1: Decapsulates the IP Packet to read the DEST IP Address (at L3), finds the DEST IP and transfers over to its Outbound Stack.

    R1: Finds the corresponding MAC Address in its ARP Table, re-encapsulates with new DEST & SRC MAC Addresses, and transmits.

    DEST MAC: 00D0.58B8.578E
    SRC MAC: 0006.2A58.0202

    R1 >> SW2

    SW2: Receives the Frame on its Inbound Stack and Decapsulates to read DEST & SRC MAC Addresses.
    SW2: Sees from its CAM Table that the DEST MAC is on its Fa0/1 port, transfers the Frame to its Outbound Stack, re-encapsulates and transmits. Note that the DEST & SRC MAC Addresses have not been changed.

    DEST MAC: 00D0.58B8.578E
    SRC MAC: 0006.2A58.0202

    SW2 >> SERVER

    When the SERVER is ready to return whatever has been requested, it simply switches the DEST & SRC MAC Addresses around before the return Frame is encapsulated and transmitted.

    DEST MAC: 0006.2A58.0202
    SRC MAC: 00D0.58B8.578E

    The process is now run in reverse, back to PC1.

    I've certainly learned from doing this and I hope others will also learn from it also. I'd encourage others to duplicate this and study the ARP process also.
    No longer an active member
Sign In or Register to comment.