Transcript for:
Understanding NAT and IPv4 Limitations

on the internet it's estimated there are over 20 billion different devices that are communicating and we are increasing the number of devices all the time but ipv4 only supports 4.29 billion addresses and we're certainly well over that particular number the ip address space for ipv4 is also exhausted if you wanted to get a new ipv4 address that was public and on the internet you would not be able to easily obtain one so how are we able to have all of these devices communicating on the internet without actually having enough ip addresses we're able to use a technique called network address translation or nat this isn't the only reason we might want to use network address translation but it is one of the most common reasons that people implement nat on their local devices we're able to use network address translation to increase the number of available devices because we set aside some very specific ip address ranges as what we call private ip addresses this comes from rfc or request for comment number 1918 and it specifically defines what these private ip address ranges would be this is a very big chart that includes the range the number of addresses the classful description the subnet mask for the range and the host id size but if you're planning to memorize any part of this it's this first column that is the most important these are the private ip addresses that you need to know the first range is 10.0.0 through 10.255.255.255. the second range is 172.16.0.0 through 172.31.255.255. and the last private ip address range is 192.168.0.0 through 192.168.255.255. if the ip address of your device is an ip address that is in any of these ranges then you are using a private ip address or what you might hear called an rfc 1918 ip address very simply network address translation is when a device changes an ip address as it's communicating through the network this is commonly done using a router and in this particular example this router is providing that translation functionality on the left side is our private network and you can see a private address range of 10.10.20.0.24 which means your router and vala the device on the left side are all communicating using these private ip addresses but vala would like to talk to the professormesser.com web server and you can see that professor messer has a public ip address we need to find some way to have our private addresses communicate to these public addresses and back again so we'll use our router to perform that translation vala will send an ip packet to the professor messer website which means the source address is vala's ip which is 10.10.20.50 she's sending this message to 104.20.19.63 which matches the public ip address on professormesser.com when this packet is sent to a local router the router recognizes that a private ip address is in use and makes a change to that ip address or translates that ip address to a public ip address that has been previously configured inside of that router it then sends the rest of that information to the destination ip and we're able to do that because we change that source ip to a public ip address this becomes especially important when we need to send information back to vala obviously we can't send it to the original 10.10.20.50 private ip address so the professor messer website is simply going to reverse the ip addresses it's received this means that professormesser.com will now be the source and the destination ip will be the translated address that was created by this router this packet is then sent to router 1 and router 1 has a previous configuration inside of it that says if anything is received on 94.1.1 then it needs to be translated to the internal ip address used by vala that router then makes that network address translation and sends the packet to its final destination on vala's internal ip address of 10.10.20.50 well that process works fine if there is a single ip address on the inside that needs to be translated but what if you have multiple ip addresses or even tens hundreds or thousands of devices that need to communicate in that situation you'll perform a special kind of network address translation called a source network address translation a nat overload or a port address translation let's take this same situation of vala who needs to communicate to the professormesser.com server you can see that the source ip address is 10.10.20.50 that is vala's ip address and bala will be communicating to 104 104.20.19.63 which is the professormesser.com server you can also see that we've added the port numbers that are in place vala has chosen a random port number as the source port number and it's added to the end of this ip address as port number 3233 and vala is communicating to this web server over port 80 and that port 80 has been added to that destination ip address when this information is received by the router the router recognizes that the internal ip address needs to be changed to a public ip address but it also needs to not only change the ip address but the port number that's in use as well it creates a table inside of the router that translates between the private ip address and what's available as a public ip address and this router has determined that we will use 94.1.1.1 as the public ip and a port number of one zero five five it then makes that change to the traffic and sends it on to the professor messer web server as with our previous example when the professor messer web server wants to send this information back to vala it will change these ip addresses around when those addresses are received by the router the router looks up what address has been received over that port number translates it back to our internal ip address and sends that traffic to vala's workstation this is a process that occurs millions of times a day across all of the routers that we have connected to the internet and if you're using a router at home or at your place of business then it's performing this nat overload or port address translation to be able to provide this network communication