Layer 2/3 Routing Question

James Bond

Diamond Member
Jan 21, 2005
6,023
0
0
I've been confused about this forever.

When one host is sending info to another host, I'm confused about the layer 2 and 3 addressing.

SETUP:
Host_A MAC: AAAA-AAAA-AAAA NIC IP: 192.168.102.2
Host_B MAC: BBBB-BBBB-BBBB NIC IP: 192.168.101.2
Router_1 MAC: 1111-1111-1111 SERIAL0 IP: 192.168.1.1 ETHERNET0 IP: 192.168.101.1
Router_2 MAC: 2222-2222-2222 SERIAL1 IP: 192.168.1.2 ETHERNET1 IP: 192.168.102.1

So as you can see, it goes:

HOST_A ===Ethernet=== ROUTER_1 ---Serial--- ROUTER_2 ===Ethernet=== HOST_B

I know that the layer 2 frame is stripped on each hop and replaced. What I'm not sure about is when does the Layer 2 destination/source address change? When does the Layer 3 destination/source address change?

Could someone give me a play by play please? Assuming a packet was being transferred from HOST_A to HOST_B?
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
layer3 source and destination address do not change. (before anybody corrects me, let's just keep it simple ;) )

layer2 address are only signficant on a single segment.

So in your example router one replaces the layer2 information with it's outgoing interface layer2 address, looks up the route and sends it out the serial interface (i'm keeping it simple, because normally there isn't a mac address on a wan circuit, they use different layer2 addressing). router 2 picks it up and then puts it's layer2 address of it's outgoing interface and then puts the frame onto the wire.

to make it simple, layer2 addresses only change when they cross a layer3 boundary (a router)
 

James Bond

Diamond Member
Jan 21, 2005
6,023
0
0
And when you say "puts its layer 2 address of its outgoing interface", you mean, the Layer 2 source address is being updated to the outgoing interface of that router, right?
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
yes. think about what is happening...a frame is being delivered. that's layer2. packet remains the same.

so since the interface of the router is really just a NIC - it uses the layer2 address of that interface.
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
Wait.. Given the host and router interface IP's wouldnt it go like this instead?

HOST_A ===Ethernet=== ROUTER_2 ---Serial--- ROUTER_1 ===Ethernet=== HOST_B
 

James Bond

Diamond Member
Jan 21, 2005
6,023
0
0
So the destination MAC in the frame is ALWAYS the NEXT hop, and the source MAC in the frame is ALWAYS the PREVIOUS hop.

Just making sure, is that correct?
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
hops are normally associated with layer3 devices.

but if you're talking about mac addresses as packets move from router to router, you're correct.