cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1304
Views
5
Helpful
4
Replies

router

Hi, Is is true that router is a device that by looking at layer 3 header, in every station, changes layer 2 header? If yes, what does it mean?

 

Regards,

David

1 Accepted Solution

Accepted Solutions

Cristian Matei
VIP Alumni
VIP Alumni

Hi,

 

   The router looks at the IP header, specifically at the destination IP address, in order to find by looking in its routing table, out which interface should it route/forward the packet further in order to reach its destination (identified by the destination IP address). Once it detects the egress interface, it needs to send the packet to the next-hop router (which will do the same process, and so on router by router till the packet reaches its destination). So a router, without NAT implemented, does NOT change the source/destination IP addresses. Now, in order to send the packet to the next-hop and the next-hop to accept it, it clearly needs to change the layer 2 header for this(the layer 2 header is how we send the packet towards a specific next-hop on multi-access/broadcast transport where there can be multiple possible next-hops):

      - if the packet came inbound on a PPP link and the router sends it outbound on an Ethernet link, the layer 2 header needs to be changed, as those two layer 2 technologies use a different layer 2 header (PPP vs. Ethernet)

    - if the packet came inbound on a Ethernet link and the router sends it outbound another Ethernet link, the layer 2 header still needs to be changed; it came inbound with a destination MAC address of the router in order to be accepted, when it goes out another Ethernet link, the router puts its own MAC address of that interface as source MAC and the next-hop router MAC address (learned through ARP for IPv4) as the destination MAC address

 

Regards,

Cristian Matei.

View solution in original post

4 Replies 4

Cristian Matei
VIP Alumni
VIP Alumni

Hi,

 

   The router looks at the IP header, specifically at the destination IP address, in order to find by looking in its routing table, out which interface should it route/forward the packet further in order to reach its destination (identified by the destination IP address). Once it detects the egress interface, it needs to send the packet to the next-hop router (which will do the same process, and so on router by router till the packet reaches its destination). So a router, without NAT implemented, does NOT change the source/destination IP addresses. Now, in order to send the packet to the next-hop and the next-hop to accept it, it clearly needs to change the layer 2 header for this(the layer 2 header is how we send the packet towards a specific next-hop on multi-access/broadcast transport where there can be multiple possible next-hops):

      - if the packet came inbound on a PPP link and the router sends it outbound on an Ethernet link, the layer 2 header needs to be changed, as those two layer 2 technologies use a different layer 2 header (PPP vs. Ethernet)

    - if the packet came inbound on a Ethernet link and the router sends it outbound another Ethernet link, the layer 2 header still needs to be changed; it came inbound with a destination MAC address of the router in order to be accepted, when it goes out another Ethernet link, the router puts its own MAC address of that interface as source MAC and the next-hop router MAC address (learned through ARP for IPv4) as the destination MAC address

 

Regards,

Cristian Matei.

Thanks sir, your answer was perfect! Can I know where you're from please?

Hi,

 

   I'm not sure how it matters :), but I'm from Romania.

 

Regards,

Cristian Matei.

Hi,

 

I attached my topology. I wanna know what config I should do on multilayer switches 0 & 2, so that I can ping from one switch the other one.

Regards,

David

Review Cisco Networking for a $25 gift card