Computer Network (xviii) NAT and IP tunneling

NAT

1.NAT defined

NAT is a private address in the local network, instead using techniques global IP address when connecting to the Internet.
IP address conversion, the conversion can also appeared TCP, UDP port number NAPT technology, whereby communication with a global IP address and the plurality of hosts may be achieved.
NAT (NAPT) is actually the technology is facing depletion of IPv4 addresses and development.
In order to increase the IPv6 security network also using NAT, NAT-PT is often used in the mutual communication between the IPv4 and IPv6 them.

2.NAT working mechanism

NAT
Inside the NAT (NAPT) router, there is a table used to convert automatically generated addresses.
When multiple machines simultaneously within the private network must communicate with the outside, only the IP address conversion, people can not help but worry about whether global IP address is not enough.
Uses include conversion mode with port number (NAPT) can solve this problem.
Naft
In the communication using TCP or UDP, only the destination address, source address, destination port, source port, and protocol type (TCP or UDP) five elements are considered to be consistent if the same communication connection. NAPT used at this time.
Conversion table generated automatically on the NAT router.

3.NAT-PT(NAPT-PT)

Now many Internet services are based on IPv4. If these services can be used normally can not do in IPv6, then build IPv6 network environment, the advantage does not arise.
NAT-PT is a technique to convert IPv6 header to the IPv4 header.
NAT-PT
NAT-PT has many forms, most people expect the combination comes as DNS and IP header replacement DNS-ALG.

The potential problem 4.NAT

Because NAT (NAPT) are dependent on their own conversion tables, so there will be few restrictions as follows:
1. The connection can not be established from the outside to the inside of the NAT server.
2. The conversion table is generated with the switching operation will have some overhead.
3. The communication process needs to be restarted once the abnormality encountered NAT, all TCP connections are reset.
4. Preparation of even two opposing NAT do disaster recovery, TCP connection will still be disconnected.

5. solve potential problems with NAT NAT traversal

The first method is to switch to IPv6. Available in a range of IP addresses IPv6 environment has been greatly expanded, so that a company or family among all devices can be configured with a global IP address.
Another method is that even without a NAT environment, produced according to the application, the user can completely ignore the existence of the NAT communicate.
NAT application running on the inner side (the side of the private IP address) in order to generate a host NAT translation table, need to send a packet to virtual network outside the NAT.
The NAT do not know what this virtual package what is, or will it still read the contents of the packet header and automatically generate a conversion table.
If reasonable conversion table construction, it can achieve Hosts outside and inside NAT establishing a communication connection. You can make those hosts at different NAT between the inside can also communicate with each other.
Application may also communicate with the generated NAT NAT router table, by a certain method on the NAT router attached global IP address to the application.
NAT can communicate outside and the inside, this phenomenon is called "NAT traversal."
This method is compatibility with existing IPv4 environment is very good, even if not migrate to IPv6 can communicate freely.
NAT-friendly application also has its problems. For example, NAT norms more complex, application implementation becomes more time-consuming.

IP tunnel

Sandwiched between two IPv4 network IPv6 network
Shown above in the network environment, the network A, B use IPv6, if the network is in the intermediate position C supports IPv4, between network A and network B can not communicate directly.
To make proper communication between them, then we have to adopt IP tunnel function.
IP tunnel that can be sent from the network A over IPv6 packets to a system and data before whom an additional IPv4 header of a later forwarded to the network C.
Communication methods continue to append the header of the network layer in the back of the head of the network layer is called "IP tunneling."
IP tunnel
Construct a branch to be both IPv4 and IPv6 networks to be supported is a very large project.
Backbone network typically use IPv6 or IPv4 transmission.
Those routers do not support the use of technology can forward packets IP tunnel, and the corresponding IP addresses can also be unified management side.
Since the device only in the side of the backbone to deal with IP tunnels can be, it also can significantly reduce the cost of investment.
Application:
1.Mobile IP
broadcast multicast packet 2. More
transport 3.IPv4 IPv6 packet network (6to4)
packet transmitted in an IPv4 network 4.IPv6
The data link frames transmitted by the IP packet (L2TP)
Multicast tunnel
now many routers on no multicast packet routing control information, a multicast message will not be able to send information through a router.
Using IP tunnel, to make the router contract in the form of unicast, multicast will be able to forward messages to distant link.

Guess you like

Origin blog.csdn.net/NEUChords/article/details/91394773