Current location - Quotes Website - Collection of slogans - What does router NAT mean?
What does router NAT mean?
This is the network address translation protocol of IPV4.

The explanation in Baidu Encyclopedia is that NAT (Network Address Translation) was put forward by 1994. When some hosts in the private network have been assigned local IP addresses (that is, private addresses used only in this private network), but now they want to communicate with hosts on the Internet (without encryption), NAT method can be used. "

Simply put, it is a protocol (rule) that converts your computer's private IP address into a public IP address and then accesses it on the Internet.

Then you must ask again, what is an IP address, and what are public and private networks? Why are you doing this?

As a network major student, if you are interested, take your time.

First of all, what is an IP address? IP is equivalent to the ID number of the computer. Under normal circumstances (why do you want to say normal and what is abnormal will be discussed below), each computer has its own unique ID number. How can you see it? On the computer, press the start key +R key (the start key is

)

Different keyboards may be a little different, then type CMD, ok, type ipconfig in the black box and you will see a bunch of things.

This is the IP address of your computer. At present, most of us use IPv4, the fourth version of IP, which consists of 32-bit addresses (you said I lied to you,192.168. 10.50), obviously only10. Even with the decimal point, it is 14 digits. Where do you come from? 32-bit binary calculation, computer display 10. What is binary ... you can understand it yourself) In short, it is 0.0.0.0 to 255.255.255.255, which are all IPv4 addresses. Why not 0.0.0.0-999.999.999.999? This is the wonder of binary. Actually, the address range of binary display IPv4 is 0000.0000.0000.0000 to11.1165438.

Ok, look, how many IPv4 addresses are there? 2 to the 32nd power =4294967296. Does it look a lot? In fact, some of these IPS are unusable. Why? It's too profound. Anyway, you just know he won't use them. Then you can really use 4 billion. Well, 4 billion IP, more than 4 billion people. A person can't even get half an IP address. Moreover, everyone has more than one network device. Your mobile phone, tablet, Internet TV, set-top box, and even air conditioners and refrigerators that can connect to Wifi need to use IP addresses. What should I do if the IP address is not enough, so there is an exception.

Everyone in the world has made a standard, taking some IP addresses as private network addresses (you can plan them yourself) and the other as public network addresses (not to mention any multicast addresses). In the Internet, only public network addresses can access each other, and private network addresses need to be converted into public network addresses to access the network. The specified private network address is10.0.0/8172.16.0.0/12/92.168.0.0//kloc. So you will. Because this is a private network address, you can use it at will, and you don't need money. Public IP needs to be purchased from network operators.

How to convert a private network address into a public network is this NAT. In addition to the IP address, there is another thing called the port number. In fact, every time you open a web page, you have a communication. The communication process is your IP address: port number-> server IP address: port number. Then NAT uses this port (the port number is 1-65535, some port numbers are fixed, and 1024-65535 can be used randomly).

Network communication is like this.

So using NAT is like this:

When 192. 168. 1 needs to access the server, the operator will convert your IP into a public IP and send it to the server with the port number, but after you access it, take the port number back to other hosts for use. Then, a public IP can be used by multiple private IPS, and the available amount of IPv4 is increased by n times. But that's not enough ... so IPv6, 128 address appeared later.

You see, now you have to talk about me. Isn't this NAT made by operators? It's not about my router ... it's about the router. The operator's router is bigger, but it also contains all the basic functions of the home router, even worse! ! ! The operator will not give you a public IP. Turn on your router and see if the IP address you get by dialing starts with 10 or 172. 16. Yes, this is the private IP we mentioned above. Your computer is the IP starting with 192.438+068, and it can be converted to ~NAT in multiple layers. If you are not a telecom operator, Unicom operator or mobile operator, you may have to go through several such conversions. If there are too many conversions, it may affect the network speed and so on. This is the operator's Sao operation, which makes a public network IP widely used by users. Then how do you know what your IP is and how many times it has been converted?

The IP on your computer has been described above. If you want to see your public IP, you can see it by typing it in Baidu (public IP will change regularly, and operators generally have many public IPS for a large number of users).

Then I want to know how many NATs I passed. In the little black box where I just entered ipconfig, I entered 223.5.5.5's TACE RTD-D (this command is route tracing, and I want to know which nodes you sent to the destination address, and 223.5.5.5 is Ali DNS).

You see 1 is my router, 2 is optical cat (optical cat has PPPOE automatic dialing, and it can't be cancelled after trying), 3 is operator's equipment, and 4 is public network. So I went out of the public network after three NAT sessions.

Well, having said that, I believe you should know what NAT is. Some things are too professional for you to understand, so they are simplified. They are not very accurate, but they have similar meanings.