Glossary: Virtual IP (Virtual IP Address)

VIP = Virtual IP Address , a virtual IP address is an IP address that is not connected to a specific computer or to a network interface card (NIC) in a computer . The virtual IP address is different from the real IP address of the proxy server. The proxy server gives a range of virtual IP addresses according to the number of clients in the Internet, and assigns a virtual IP address to each client according to certain regulations. In this way, the indirect .
Virtual IP Address (VIP) packets are sent to this VIP address, but all data still goes through the real network interface . VIPs are mostly used for connection redundancy; a VIP address may also be available in the event of a computer or NIC failure, leaving another optional computer or NIC to respond to the connection.
VIP is mainly used for switching between different hosts, mainly used for master-slave switching of servers. Enhance network management, give play to the advantages of VLAN, change the network structure, reasonably allocate network resources, balance network load, effectively reduce online broadcast information, and facilitate group management of users.
http://baike.baidu.com/link?url=r6U14NPTCGvlBkaYAsa02yQQUAFikY0SeJjSl0aY5YJxuIxcmoqtVl_F2hItM-gWtyNhgtQuH_oIoOqORXaTVEheHkgQBeznhw1TZJeEQ4_
http://baike.baidu.com/link?url=7m9z4Uf7yF7QVALO5vN71xTzYxbvGJ7DwmzrELEXcvDLCJzSp_8rBCF8VftJMu3jLZT5avsgYGwA2R8peR9uJa

Physical IP and Virtual IP
Physical IP: In the network world, in order to identify the location of each computer, there is a definition of a computer IP address. An IP is like a house number! For example, if you want to go to Microsoft's website, you have to go to the IP location "207.46.197.101"! These IPs that can communicate directly on the Internet are called "physical IPs". 
Virtual IP: However, as we all know, the IP address is only a data type of xxx.xxx.xxx.xxx, where xxx is an integer between 1 and 255. Due to the recent rapid growth of computers, physical The IP is already a bit insufficient. Fortunately, three network segments of IP have been reserved as the virtual IP of the internal network domain as early as when planning the IP.
The three reserved IPs are:
Class A: 10.0.0.0 - 10.255.255.255
Class B: 172.16.0.0 - 172.31.255.255
Class C: 192.168.0.0 - 192.168.255.255
The most commonly used of the above is 192.168.0.0. A group. However, because it is a virtual IP, when you use these addresses, of course, there are restrictions. The restrictions are as follows:
the routing information of private addresses cannot be disseminated externally. Packets that use private addresses as source or destination addresses cannot transmit reference records (such as DNS) about private addresses through the Internet, and can only be used in internal networks. Since computers with virtual IPs cannot be directly connected to the Internet, it is necessary to Special features to access the Internet. However, this makes it very convenient for us to set up an IP network. For example, even if your current company has not been connected to the Internet, there is no guarantee that it will not in the future. If you use a public IP, if you don't register it, when you actually want to connect to the Internet in the future, it is likely to conflict with others. As previously analyzed, if the IP is re-planned at that time, it will be a very headache. At this time, we can first use the private address to set up the network, and when we really want to connect to the internet, we can use IP translation protocols, such as NAT (Network Addresses Translation) and other technologies, to cooperate with the newly registered IP.

Fixed IP and dynamic IP : Basically, these two things are the product of the recent growth of network companies. For example, if you apply for a commercial ADSL line from China Telecom, he will give you a fixed physical IP. , this entity IP is called "fixed IP". And if you apply for time-based ADSL, because your IP may be shared by dozens of people, every time you restart the Internet, the IP of your computer will not be fixed! So it is called "dynamic IP" or "floating IP". Basically, both of these are " physical IPs ", it's just that the network companies use different methods to assign them to users, resulting in different names.
http://wenku.baidu.com/link?url=6cvd875KzLDVDwLEwsPr3BjThVAG86jmYN8yvUefCGnFgcalwvBzEuHHlqWRaQGYKEOlzn_xZUF0dbJrowKQ8UH2IANMGpvfTETfGNOVBHiHigh

Availability
High Availability (HA) refers to improving the availability of systems and applications by minimizing downtime caused by routine maintenance operations (planned) and sudden system crashes (unplanned). The HA system is currently the most effective means for enterprises to prevent the core computer system from being shut down due to failure.
The way to achieve HA is generally to use two machines to complete a function at the same time, such as a database server, usually only one machine provides services to the outside world, and the other machine is used as a hot backup. When this machine fails, it automatically and dynamically switches to another machine. A hot standby machine.
How to achieve failure detection that?
: Heartbeat , send a data packet at regular intervals, if the machine does not respond for a long time, it is considered a failure and automatically switches to the hot standby machine.
How to achieve automatic switching that?
: VIP , its realization principle mainly relies on the ARP protocol of TCP/IP. Because the ip address is only a logical address, the MAC address is the real physical address used for data transmission in Ethernet. Each host has an ARP cache, which stores the correspondence between the IP address and the MAC address in the same network. When the host in the Ethernet sends data, it will first query the MAC address corresponding to the target IP from this cache, and will send data to this MAC address. The operating system automatically maintains this cache. That's the crux of the whole implementation.
Below is the content of the arp cache on my computer.
(192.168.1.219) at 00:21:5A:DB:68:E8 [ether] on bond0
(192.168.1.217) at 00:21:5A:DB:68:E8 [ether] on bond0
(192.168.1.218) at 00:21:5A:DB:7F:C2 [ether] on bond0

192.168.1.217 and 192.168.1.218 are two real computers, and
192.168.1.217 is the host that provides database services to the outside world.
192.168.1.218 is a hot standby machine.
192.168.1.219 is the virtual IP.
Everyone pay attention to the red part, the MAC addresses of 219 and 217 are the same.

Look at the arp cache after 217 crashes
(192.168.1.219) at 00:21:5A:DB:7F:C2 [ether] on bond0
(192.168.1.217) at 00:21:5A:DB:68:E8 [ ether] on bond0
(192.168.1.218) at 00:21:5A:DB:7F:C2 [ether] on bond0
This is the secret. When 218 finds that 217 is down, it will send an ARP packet to the network, telling all hosts that the MAC address corresponding to the IP of 192.168.1.219 is 00:21:5A:DB:7F:C2, so that all packets sent to 219 will be Send to the machine whose mac address is 00:21:5A:DB:7F:C2, which is the machine of 218.
http://blog.csdn.net/whycold/article/details/11898249

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942758&siteId=291194637