1. What is P2P:
P2P is the abbreviation of peer-to-peer. Peer has the meanings of "peer-to-peer", "peer", and "peer" in English. In this way, P2P can be understood as "peer-to-peer", or "Peer-to-Peer Networking. At present, people think that it has a bright future in strengthening the communication, file exchange, and distributed computing among others on the Internet ....
See http://www.kuqin.com/p2p/20080411/6476.html for details
What we usually call peer network is a P2P network. The concept of P2P weakens the status of servers on the Internet, making every computer a server and a user, share the resources you need.
2. What is Nat:
To understand P2P, you must understand Nat. When writing a general socket program, you must know that when a TCP connection is established, if the connection is on the Intranet, its Intranet IP address is 192.168.0.2 and the gateway is 192.168.0.1, how does the server send information to 192.168.0.2 on the Intranet when it requests the 61.155.8.220 public IP server?
To understand this, you must first learn about Nat?
NAT (Network Address Translation) provides a simple solution for LAN Internet sharing. When an intranet user connects to the Internet, Nat converts the user's internal IP address into an external public IP address. Otherwise, when data is returned from outside, Nat reversely replaces the destination address with the address of the initial internal user. In fact, Nat hides the internal IP address and forms a natural firewall.
Return to the preceding example. The vro itself has two IP addresses, one Intranet IP Address: 192.168.0.1 and one public IP Address: 127.123.3.37. For the Intranet machine 192.168.0.2 (the initiator port is 4000) connect 61.155.8.220 (Port 6000). The process is as follows:
192.168.0.2: 4000-> route Nat to the internet side 127.123.3.37: 60000-> 61.155.8.220: 6000;
Same feedback
61.155.8.220: 6000-> route Nat Translation: 192.168.0.1: 60000-> 192.168.0.2: 4000;
Nat converts IP addresses and ports to adapt to the Intranet and Internet environments. Of course, different routes may have different NAT forms. The following describes four main Nat methods.
1. Full cone NAT:There is a NAT device in front of the host. The Nat rules are as follows: Packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, packets sent from any external address to UDP port B of the NAT device will be forwarded to host port.
2. Restricted cone NAT:There is a NAT device in front of the host. The Nat rules are as follows: Packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, however, only the packet sent from the destination IP address of the previously sent packet to the UDP port B of the NAT device will be forwarded to host port.
3. Port restricted cone NAT:There is a NAT device in front of the host. The Nat rules are as follows: Packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, however, only the packet from the destination IP address/port of the previously sent packet from the host to the UDP port B of the NAT device will be forwarded to host port.
4. Elastic Ric NAT:There is no NAT device at the host exit, but there is a firewall, and the firewall rules are as follows: Keep the source address of the packet sent from host UDP port, however, only the packets sent from the destination IP address/port of the previously sent packet to port a of the host can pass the firewall.
Currently, the low-end routes are all full cone.
Nat is also the best support for P2P network drilling.
1. What is P2P:
P2P is the abbreviation of peer-to-peer. Peer has the meanings of "peer-to-peer", "peer", and "peer" in English. In this way, P2P can be understood as "peer-to-peer", or "Peer-to-Peer Networking. At present, people think that it has a bright future in strengthening the communication, file exchange, and distributed computing among others on the Internet ....
See http://www.kuqin.com/p2p/20080411/6476.html for details
What we usually call peer network is a P2P network. The concept of P2P weakens the status of servers on the Internet, making every computer a server and a user, share the resources you need.
2. What is Nat:
To understand P2P, you must understand Nat. When writing a general socket program, you must know that when a TCP connection is established, if the connection is on the Intranet, its Intranet IP address is 192.168.0.2 and the gateway is 192.168.0.1, how does the server send information to 192.168.0.2 on the Intranet when it requests the 61.155.8.220 public IP server?
To understand this, you must first learn about Nat?
NAT (Network Address Translation) provides a simple solution for LAN Internet sharing. When an intranet user connects to the Internet, Nat converts the user's internal IP address into an external public IP address. Otherwise, when data is returned from outside, Nat reversely replaces the destination address with the address of the initial internal user. In fact, Nat hides the internal IP address and forms a natural firewall.
Return to the preceding example. The vro itself has two IP addresses, one Intranet IP Address: 192.168.0.1 and one public IP Address: 127.123.3.37. For the Intranet machine 192.168.0.2 (the initiator port is 4000) connect 61.155.8.220 (Port 6000). The process is as follows:
192.168.0.2: 4000-> route Nat to the internet side 127.123.3.37: 60000-> 61.155.8.220: 6000;
Same feedback
61.155.8.220: 6000-> route Nat Translation: 192.168.0.1: 60000-> 192.168.0.2: 4000;
Nat converts IP addresses and ports to adapt to the Intranet and Internet environments. Of course, different routes may have different NAT forms. The following describes four main Nat methods.
1. Full cone NAT: There is a NAT device in front of the host. The Nat rules are as follows: Packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, packets sent from any external address to UDP port B of the NAT device will be forwarded to host port.
2. Restricted cone NAT: There is a NAT device in front of the host. The Nat rules are as follows: the packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, however, only the packet sent from the destination IP address of the previously sent packet to the UDP port B of the NAT device will be forwarded to host port.
3. Port restricted cone NAT: There is a NAT device in front of the host. The Nat rules are as follows: Packets sent from host UDP port a will correspond to port B of the NAT device's egress IP address, however, only the packet from the destination IP address/port of the previously sent packet from the host to the UDP port B of the NAT device will be forwarded to host port.
4. symmetric NAT: There is no NAT device at the host exit, but there is a firewall, and the firewall rules are as follows: Keep the source address of the packet sent from host UDP port, however, only the packets sent from the destination IP address/port of the previously sent packet to port a of the host can pass the firewall.
At present, the low-end routes are basically full cone Nat, which is also the best support for P2P network drilling.