Packet Travel Question

KMAN24KMAN24 ■■□□□□□□□□ Posts: 44Member ■■□□□□□□□□
I need to clarify my confusion about the information in a packet as it travels from source to destination.

If a packet from one computer has to pass through a switch and two routers to get to another computer, how does the information change in the packet ?

I think as the packet travels it will have the destination ip of the computer it is trying to get to and its own mac as the source. Then from switch to router it has same destination ip but now the mac of the switch as source. Then it has source ip of router and destinaton ip of computer. When it gets to the final router the packet has source mac of router and destination mac of computer ?

Is this kind of right ? If someone could explain how the information changes as a packet travels with clarity I would appreciate it.

Thanks

Comments

  • kplabkplab Posts: 101Member
    The values of the source and destination IP and MAC address fields of the packet should change as follows:

    ........ Host 1 ---> Router 1 ---> Switch 1 ---> Router 2 ---> Host 2

    Src.IP ...... Host 1 .......... Host 1 .......... Host 1 .......... Host 1
    Dst.IP ...... Host 2 .......... Host 2 .......... Host 2 .......... Host 2
    Src.MAC ... Host 1 ........ Router 1 ....... Router 1 ....... Router 2
    Dst.MAC .. Router 1 ...... Router 2 ....... Router 2 ........ Host 2

    A switch simply forwards a packet based on the packet's destination MAC address, without changing it.
    KPLAB
    www.kp-lab.com - Free CCNA, CCNP, and Network+ Study Guides
  • KMAN24KMAN24 ■■□□□□□□□□ Posts: 44Member ■■□□□□□□□□
    Appreciate the way you listed this. I understand now !
  • Sounds GoodSounds Good Posts: 403Member
    kplab wrote: »
    The values of the source and destination IP and MAC address fields of the packet should change as follows:

    ........ Host 1 ---> Router 1 ---> Switch 1 ---> Router 2 ---> Host 2

    Src.IP ...... Host 1 .......... Host 1 .......... Host 1 .......... Host 1
    Dst.IP ...... Host 2 .......... Host 2 .......... Host 2 .......... Host 2
    Src.MAC ... Host 1 ........ Router 1 ....... Router 1 ....... Router 2
    Dst.MAC .. Router 1 ...... Router 2 ....... Router 2 ........ Host 2

    A switch simply forwards a packet based on the packet's destination MAC address, without changing it.

    mega bump, but is this right? I haven't been able to get a clear answer on this.

    At the point between Router 1 and Router 2, would the src and dst IP not change to reach the next hop? The switch is pretty much irrelevant here so I'm going to eliminate it.

    ........ Host 1 ---> Router 1 ---> Router 2 ---> Host 2
    Src.IP ...... Host 1 .......... Host 1 ........ Host 1
    Dst.IP ...... Host 2 .......... Host 2 ........ Host 2
    Src.MAC ... Host 1 ........ Router 1 ....... Router 2
    Dst.MAC .. Router 1 ...... Router 2 ....... Host 2

    and the return trip would be as follows

    ........ Host 2 ---> Router 2 ---> Router 1 ---> Host 1
    Src.IP ...... Host 2 .......... Host 2 ........ Host 2
    Dst.IP ...... Host 1 .......... Host 1 ........ Host 1
    Src.MAC ... Host 2 ........ Router 2 ....... Router 1
    Dst.MAC .. Router 2 ...... Router 1 ....... Host 1

    Please confirm
    On the plate: AWS Solutions Architect - Professional
    Scheduled for: Unscheduled
    Studying with: Linux Academy, aws docs
  • pamccabepamccabe Posts: 315Member
    This is a post from 2005.
  • DoubleNNsDoubleNNs ■■■■■□□□□□ Posts: 2,013Member ■■■■■□□□□□
    lol he DID say mega bump.
    I'm too early in my CCNA studies to answer authoritatively, but based on my CCENT coursework so far that's how it explains it - that the source and dest IP addresses stay constant while the MAC addresses change, even when going from router to router.

    Edit: People complain if you don't search before you ask your question, and complain even if you do lol.
    Although personally, I've never been able to get the search function in the forums to work well for me.. I always have to use google's index of the forum.
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • xXErebuSxXErebuS Posts: 230Member
    Sounds good Sounds good! Sorry I had to...

    To answer your question bluntly no the IP address does not change. It will hit router 1 with host 2 dest IP which router 1 will look up to see next hop as router 2. It will then hit router 2 with dest ip of host 2 which router 2 will look up to see next hop as directly connected link.
Sign In or Register to comment.