Knowing source and destination IP/MAC addresses for INTRO

Tricon7Tricon7 Inactive Imported Users Posts: 238
As this is somewhat confusing for me, and considering that I'll almost certainly get a question like this on my INTRO test, could someone let me know if I have this right?

-When an IP packet leaves host A to go to host B across the country, the Layer 3 source address is the IP of the sending host.
-When an IP packet reaches host B from host A, the Layer 2 source address is the MAC address of the outgoing interface of the closest router.
-After leaving host A, the layer 2 destination address going to host B will be the MAC address of the interface of its gateway router.

Is this right? It's what I've gleaned from my Sybex notes. Thanks tons.

Comments

  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    CORRECTAMUNDO!!!

    Ya the layer 2 source/dest. MAC gets changed everytime the packet traverses a Link. When a datagram comes in on a router's interface, it will have a layer 2 header. This will be shucked off to view the contents of layer 3. When the router sees the destination IP, it says OK I now how to get to this network, out this local interface to this next hop. but before it sends that datagram, it is encapsulated with new source and destiantion MAC. I like to think of a router as a box of NICS. The packet goes from nic to nic. So just like a nic on a PC, the nic on the router will put that layer 2 info in there.

    Do you have any gear? If so bust out Ethereal.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • PashPash Member Posts: 1,600 ■■■■■□□□□□
    Tricon7 wrote:
    As this is somewhat confusing for me, and considering that I'll almost certainly get a question like this on my INTRO test, could someone let me know if I have this right?

    -When an IP packet leaves host A to go to host B across the country, the Layer 3 source address is the IP of the sending host.
    -When an IP packet reaches host B from host A, the Layer 2 source address is the MAC address of the outgoing interface of the closest router.
    -After leaving host A, the layer 2 destination address going to host B will be the MAC address of the interface of its gateway router.

    Is this right? It's what I've gleaned from my Sybex notes. Thanks tons.

    Spot on sir. Just remember the layer 3 address doesnt change host to host, even when crossing broadcast domains.

    Cheers,
    DevOps Engineer and Security Champion. https://blog.pash.by - I am trying to find my writing style, so please bear with me.
  • tech-airmantech-airman Member Posts: 953
    Pash wrote:
    Tricon7 wrote:
    As this is somewhat confusing for me, and considering that I'll almost certainly get a question like this on my INTRO test, could someone let me know if I have this right?

    -When an IP packet leaves host A to go to host B across the country, the Layer 3 source address is the IP of the sending host.
    -When an IP packet reaches host B from host A, the Layer 2 source address is the MAC address of the outgoing interface of the closest router.
    -After leaving host A, the layer 2 destination address going to host B will be the MAC address of the interface of its gateway router.

    Is this right? It's what I've gleaned from my Sybex notes. Thanks tons.

    Spot on sir. Just remember the layer 3 address doesnt change host to host, even when crossing broadcast domains.

    Cheers,

    Pash,

    Unless NAT is involved. :)
  • PashPash Member Posts: 1,600 ■■■■■□□□□□
    Pash wrote:
    Tricon7 wrote:
    As this is somewhat confusing for me, and considering that I'll almost certainly get a question like this on my INTRO test, could someone let me know if I have this right?

    -When an IP packet leaves host A to go to host B across the country, the Layer 3 source address is the IP of the sending host.
    -When an IP packet reaches host B from host A, the Layer 2 source address is the MAC address of the outgoing interface of the closest router.
    -After leaving host A, the layer 2 destination address going to host B will be the MAC address of the interface of its gateway router.

    Is this right? It's what I've gleaned from my Sybex notes. Thanks tons.

    Spot on sir. Just remember the layer 3 address doesnt change host to host, even when crossing broadcast domains.

    Cheers,

    Pash,

    Unless NAT is involved. :)

    I stand corrected :)
    DevOps Engineer and Security Champion. https://blog.pash.by - I am trying to find my writing style, so please bear with me.
  • StoticStotic Member Posts: 248
    In a simple sentence, the layer 3 address doesn't change, but the layer 2 address changes after each hop.
  • baldychokobaldychoko Member Posts: 23 ■□□□□□□□□□
    Thanks Stotic you just helped me understand that topic, and all in one sentence.
Sign In or Register to comment.