07-15-2013 08:34 AM - edited 03-07-2019 02:24 PM
Folks,
a question to clear my understanding.
When a host send a packet to a destination host, then what it writes in its packet as destination address. It is the gateway or the destination host's IP/MAC address?
If it is gateway address of the host as destination address of the packet, then how the packet arrives to the destination host?
If the host writes destination host's address in the packet, then every hop rewrites MAC/IP during routing & switching. So how the packet arrives to the destination?
Solved! Go to Solution.
07-15-2013 08:52 AM
Hi Sugata,
If a host wants to send a packet to a host that is not on the local subnet, the destination IP address is the IP address of the destination host and the MAC address is set to the gateway MAC address.
Regards
07-15-2013 10:30 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
ok..so destination IP will be always the final destination hop's IP correct?
Normally yes, except for when the destination IP is "hidden", e.g. NAT. Even then, sender belives it has the destination's IP.
My another question here is how host know the destination IP? The application of the hop knows that?
The sending host does need to "know" the recipient for unicast (doesn't need to know the recipient for mulitcast or broadcast).
The sending host might have a destination IP or it might have a destination logical name, e.g. FQDN. If a logical name, it would need to be resolved to an IP address, e.g. DNS.
07-15-2013 10:31 AM
Hi,
The host does a a binary AND between its IP and mask and between the dest IP and its mask to know if the dst IP is on same subnet or not.
The dest IP is given by the application on the host and usually derived from a name by DNS.
Regards
Alain
Don't forget to rate helpful posts.
07-15-2013 12:11 PM
Hi,
The destination IP is not set to L3 next hop when the host sends its frame, it sends the frame to the dst MAC of the next-hop corresponding to next-hop IP( default gateway). The destination IP stays the same before and after traversing the router.
Regards
Alain
Don't forget to rate helpful posts.
07-15-2013 01:47 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Hi Joseph,I need little more clarification here. When a packet travers L3 hops then the IP header is rewritten and destination IP is set as the next hop IP. So how the final destination IP is retained in the packet?
Answered by Alain. As he noted, the packet's destination IP isn't changed.
Transit devices do use the destination IP to select their next hop (or final destination host). Again, though, the packet's destination IP is untouched.
Think of a snail mail envelope address. Destination address doesn't change on envelope as it transits different offices, but each office uses that address to select where to send the envelope next. The outer transit container (the bag/vehicle) the envelope is within, does change per hop. (The latter is the purpose of the L2 frame.)
07-16-2013 08:26 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
as Joseph said, I wonder what will be the destination IP in the packet if both the host are behind NAT Router?
Source or destination IPs will be changed by NAT. Packet will contain what appears to be "correct" IP based on what side of NAT the packet is currently on.
07-16-2013 09:59 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
NAT will rewrite IP source and/or destination IP. Normally this isn't "visible" to hosts.
e.g.
host A : 10.1.1.1
Nat A: 1.1.1.1
Nat B: 2.1.1.1
host B: 192.168.1.1
Host A sends packet to host B as source IP 10.1.1.1 dest IP 2.1.1.1
NAT A changes to: source IP 1.1.1.1 dest IP 2.1.1.1
NAT B change to: source IP 1.1.1.1 dest IP 192.168.1.1
i.e. Host A thinks host B's IP is 2.1.1.1 while host B thinks host A's IP is 1.1.1.1
07-16-2013 12:16 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Hi My last question is how the host application will know what is the destination IP? I think the application will generate the packet with IP destination address?
See my 2nd posting.
07-16-2013 05:10 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
ok.. so if the host application doesn't know the IP then it will know FQDN and resolve it to IP. So in this scenario a DNS help shall be required or NATing device also can work as a DNS?
Correct, the sending device has to somehow "know" the address of the recipient. It might be its IP or it might be by logical name (e.g. supportforums.cisco.com).
If NAT is involved, it may need to also NAT the DNS query and response, but that doesn't mean the NAT device, itself, is doing DNS.
07-15-2013 08:52 AM
Hi Sugata,
If a host wants to send a packet to a host that is not on the local subnet, the destination IP address is the IP address of the destination host and the MAC address is set to the gateway MAC address.
Regards
07-15-2013 08:56 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
If the sender and recipient host are on the same subnet, the MAC would be the recipient host's. If it's a transient L3 hop, the MAC would be for the next hop IP's (whose IP is not in the packet).
Destination IP is doesn't change. Destination MAC is either next (L3) hop's or final host MAC.
07-15-2013 10:00 AM
ok..so destination IP will be always the final destination hop's IP correct?
My another question here is how host know the destination IP? The application of the hop knows that?
07-15-2013 10:30 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
ok..so destination IP will be always the final destination hop's IP correct?
Normally yes, except for when the destination IP is "hidden", e.g. NAT. Even then, sender belives it has the destination's IP.
My another question here is how host know the destination IP? The application of the hop knows that?
The sending host does need to "know" the recipient for unicast (doesn't need to know the recipient for mulitcast or broadcast).
The sending host might have a destination IP or it might have a destination logical name, e.g. FQDN. If a logical name, it would need to be resolved to an IP address, e.g. DNS.
07-15-2013 12:04 PM
Hi Joseph,
I need little more clarification here. When a packet travers L3 hops then the IP header is rewritten and destination IP is set as the next hop IP. So how the final destination IP is retained in the packet?
07-15-2013 12:11 PM
Hi,
The destination IP is not set to L3 next hop when the host sends its frame, it sends the frame to the dst MAC of the next-hop corresponding to next-hop IP( default gateway). The destination IP stays the same before and after traversing the router.
Regards
Alain
Don't forget to rate helpful posts.
07-15-2013 01:47 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Hi Joseph,I need little more clarification here. When a packet travers L3 hops then the IP header is rewritten and destination IP is set as the next hop IP. So how the final destination IP is retained in the packet?
Answered by Alain. As he noted, the packet's destination IP isn't changed.
Transit devices do use the destination IP to select their next hop (or final destination host). Again, though, the packet's destination IP is untouched.
Think of a snail mail envelope address. Destination address doesn't change on envelope as it transits different offices, but each office uses that address to select where to send the envelope next. The outer transit container (the bag/vehicle) the envelope is within, does change per hop. (The latter is the purpose of the L2 frame.)
07-16-2013 07:15 AM
Hi,
as Joseph said, I wonder what will be the destination IP in the packet if both the host are behind NAT Router?
07-16-2013 08:26 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
as Joseph said, I wonder what will be the destination IP in the packet if both the host are behind NAT Router?
Source or destination IPs will be changed by NAT. Packet will contain what appears to be "correct" IP based on what side of NAT the packet is currently on.
07-16-2013 08:40 AM
ok..so you mean in this case also destination IP in the packet will be the actual destination host IP. When the packet reach the NAT router, it will rewrite the IP header?
07-16-2013 09:59 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
NAT will rewrite IP source and/or destination IP. Normally this isn't "visible" to hosts.
e.g.
host A : 10.1.1.1
Nat A: 1.1.1.1
Nat B: 2.1.1.1
host B: 192.168.1.1
Host A sends packet to host B as source IP 10.1.1.1 dest IP 2.1.1.1
NAT A changes to: source IP 1.1.1.1 dest IP 2.1.1.1
NAT B change to: source IP 1.1.1.1 dest IP 192.168.1.1
i.e. Host A thinks host B's IP is 2.1.1.1 while host B thinks host A's IP is 1.1.1.1
07-16-2013 10:05 AM
Hi My last question is how the host application will know what is the destination IP? I think the application will generate the packet with IP destination address?
07-16-2013 12:16 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Hi My last question is how the host application will know what is the destination IP? I think the application will generate the packet with IP destination address?
See my 2nd posting.
07-16-2013 01:13 PM
ok.. so if the host application doesn't know the IP then it will know FQDN and resolve it to IP. So in this scenario a DNS help shall be required or NATing device also can work as a DNS?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: