1

A beginner question, I've recently read in Cisco CCNA R&S 200-125 official cert guide that the packet leaves the PC with a destination IP of PC2 (the target) but with the MAC of PC2 in case of PC2 is in the same subnet or with MAC of the router interface (default gateway), Am i right?

So why do we need IP's in router interfaces while IP address is always constant during the journey while MAC is changing? That leads to another question (they're two related and I'm sure that I have a misunderstand). why do we use default gateway IP when MAC is used like I mentioned above?

2
  • ICMP. The router needs a real address so you can tell where errors occur.
    – Ricky
    Commented Aug 6, 2018 at 4:56
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Commented Dec 25, 2018 at 9:13

2 Answers 2

3

why do we use default gateway IP when MAC is used?

It's perfectly true that it would make just as much sense to describe the next-hop router in terms of its link address. But just as a matter of history that's not how it was designed. In order to keep the concerns of each layer separate, it makes more sense to describe a next-hop router by IP address, and leave the lower layer to sort out any possible addressing or link to send it out of.

Remember that not all links are ethernet; indeed, most long-distance links are not ethernet of any kind. Many point-to-point technologies do not have addressing.

But

It is quite common to specify next hop by interface in routers:

ip route 0.0.0.0 0.0.0.0 Dialer1
ip route 172.30.20.0 255.255.255.0 Tunnel0

This is because it's quite common to have no IP address on a point-to-point link -- you really don't need any addressing at all on a point-to-point link.

And there are also "proxy ARP" situations where instead of telling a client what its router is, we lie to it and tell it that the destination IP address is to be sent to a local LAN address, rather like you're thinking about. It's not very elegant and the last time I saw it used in real life was in the 1990s. (Cisco doc)

2

You answer your own question:

... the packet leaves the PC with a destination IP of PC2 (the target) but with the MAC of PC2 in case of PC2 is in the same subnet or with MAC of the router interface

A sending node consults its local routing table to find out where to deliver an IP packet. This routing decision is based on IP addresses. The next-hop IP address is then translated to the next hop's MAC address for MAC-based L2 networks.

why do we use default gateway IP when MAC is used like I mentioned above

The (not necessarily default) gateway is the router hop leading towards the destination. It needs to receive the packet in order to forward it, so you need to instruct the local segment to take it there.

A remote destination's MAC is unknown to the sender and it has no meaning outside its own L2 segment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.