Both seem the same to me. I don't see how DHCP is different from Dynamic NAT. Can anyone please help?
- DHCP assigns (usually private) addresses, etc. NAT is literally 'Network Address Translation'. It's kind of "table", so the router can "translate" the address and rewrite the packet, e.g. a private address can be translated into a public address, and vice versa(It doesn't have to be a public address, but that's a typical case).starriet 차주녕– starriet 차주녕2022-03-01 14:13:58 +00:00Commented Mar 1, 2022 at 14:13
4 Answers
Missing from the current answers is
- DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date. The traffic is between the host and a DHCP server; typically both are on the same local network, but not always.
- NAT a process is for rewriting packets as they are forwarded across a router. Specifically it translates the addresses and sometimes the ports. The traffic is across a router, typically between an ISP and its client, or between two organisations.
DHCP and NAT have nothing in common (above "IP-related things"). I think you should elaborate what they actually do that you find similar.
DHCP assigns IP address (among other things), NAT mangles IP addresses (and higher level ports, like TCP/UDP), e.g. translates them to different address range.
- 2Dynamic NAT assigns available public IP's from a free pool to the privately connected hosts. DHCP, by what I've read also does the same.Asma Rahim Ali Jafri– Asma Rahim Ali Jafri2018-06-20 14:40:22 +00:00Commented Jun 20, 2018 at 14:40
- @AsmaRahimAliJafri, no, that is incorrect. NAT (Network Address Translation) is translating either the source, destination, or both, addresses in network packets. DHCP (Dynamic Host Configuration Protocol) is an off-topic (here) protocol for configuring a host network stack.2018-06-20 16:14:35 +00:00Commented Jun 20, 2018 at 16:14
DHCP is for helping new clients on the network get an IP address dynamically. (Without an IP address, they're helpless.) Dynamic NAT is for translating clients who are already on the network to different IP addresses dynamically. Using this, they appear to the outside world like they have a different address than they really do.
The only common thread between the two is the word "dynamic". When DHCP hands out addresses, it does so dynamically, which means you might get a different IP address next time. When NAT translates you, it does so dynamically, which means you might get translated to a different port number or IP address the next time.
- So DHCP, is basically done by the ISP?Asma Rahim Ali Jafri– Asma Rahim Ali Jafri2018-06-20 14:45:30 +00:00Commented Jun 20, 2018 at 14:45
- 1An ISP may use DHCP to assign your router a public IP, but that's all. It's then up to you to run DHCP on your router to assign private addresses to all of your household computers/devices.user3629081– user36290812018-06-20 14:57:41 +00:00Commented Jun 20, 2018 at 14:57
To put it simply, DHCP assigns IP addresses to hosts in a private network, while NAT converts private addresses into public addresses.
To elaborate, NAT does not assign IP addresses to devices. It does, however, keep a table of IP address conversions, which a router uses to ensure packets between a remote host and a local host are not lost.
NAT is typically used to allow multiple devices on a private network to share a single public IP address on a WAN interface.
DHCP uses a pool of private addresses, such as the 10.0.0.0/8 pool, and these addresses cannot be used on a public network such as the internet. Therefore, NAT must be used to convert a private address, such as 10.0.0.3, to a public address, such as 209.113.65.5, to allow a host on a private network to communicate with a remote host.
- 2DHCP is not restricted to private addresses in any way.jonathanjo– jonathanjo2018-06-21 07:59:13 +00:00Commented Jun 21, 2018 at 7:59
- You are right. NAT, too, is not restricted to my basic definition.Caine Kiewit– Caine Kiewit2018-06-21 08:13:33 +00:00Commented Jun 21, 2018 at 8:13