03-13-2020 10:49 PM
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
Solved! Go to Solution.
03-14-2020 12:42 AM
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.
03-14-2020 12:42 AM
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.
03-14-2020 02:21 AM
03-14-2020 02:50 AM
Hi,
I'm not sure how it matters :), but I'm from Romania.
Regards,
Cristian Matei.
04-01-2020 06:36 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide