Technology of Virtual IP Address

Larus Team 2020-10-05 07:19:57 virtualip

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). HA system is currently the most effective means for enterprises to prevent the core computer system from shutting down due to failure. To achieve HA, two machines are generally used to complete a function at the same time, such as a database server. Usually, only one machine provides external services, and the other machine serves as a hot backup. When this machine fails, it will automatically switch to the other standby machine dynamically.

Principles of Virtual IP Technology

1. How to realize fault detection?

Send a data packet regularly. If the machine does not respond for a certain period, it will be considered as a failure and automatically switch to the standby machine.

2. How to realize automatic switchover between active and standby?

We can get this from the virtual IP technology. A virtual IP is an IP that is not assigned to a real host, which means that the host that provides the database server to the outside has a virtual IP also a real IP. You can connect to this host using either of these two IPs. The virtual IP is configured for the database link in all projects. When the server fails to provide services to the outside world, the virtual IP is dynamically switched to the standby host. Its realization principle mainly relies on TCP/IP's ARP protocol. Since the IP address is only a logical address, the MAC address in the Ethernet is the physical address that is actually used for data transmission. Each host has an ARP cache that stores the correspondence between the IP address and the MAC address in the same network Relationship, when the host in the Ethernet sends data, it will first query the MAC address corresponding to the target IP from this cache, and send data to this MAC address. The operating system will automatically maintain this cache. This is the key to the entire implementation, such as the following ARP cache example:

( at 00:21:5A:DB:68:E8 [ether] on bond0
( at 00:21:5A:DB:68:E8 [ether] on bond0
( at 00:21:5A:DB:7F:C2 [ether] on bond0

Among them, and are two real computers, is the host that provides database services to the outside world, is the hot standby machine, and is the virtual IP. Pay attention to the MAC addresses of 219 and 217 Are the same. 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 this IP is 00:21:5A:DB:7F:C2, so that all packets sent to 219 will be Send to the machine with the MAC address 00:21:5A:DB:7F:C2, which is the machine with 218.

3. Configure and Delete virtual IP

If the host has a network card eth1, its corresponding IP is, now set a virtual IP for it:

ifconfig eth1:1 netmask

Delete the virtual IP:

ip addr del dev eth1

However, in network operation and maintenance, it is more common to use keepalived to configure virtual ip (vip) to achieve dual-system hot backup and automatically switch between active and standby.

IP address is important to our internet activities, we hope that you have learned through our articles. If you are interested to know more, feel free to read our blog or follow us on LinkedIn.

(Source: Internet)

Hot Reading

What is a Dedicated Server?

infrastructure service 2020-10-12 02:00:33

A dedicated server will actually gives you maximum output for all your applications because it enables your owner to have direct access to it and its resources.

Benefits of Using Dedicated Server Hosting

serverhosting dedicatedserver dedicatedserverhosting 2020-10-16 08:22:49

Some corporations are facing with a wide range of choices for hosting their website, web application, or mail server.

Why you need an IP address?

IPv4 2022-07-28 08:39:57

An IP address is a critical piece of your online presence. It's how your device is identified and connected to the internet.

IPv4 lease price 2023

leaseipv4 2022-02-24 06:48:12

It's important to recognize that IPv4 lease prices vary across the market. Here, we delve deeper into the details.

Related Reading

How does VPS hosting work

VPS 2023-12-07 09:35:57

Virtual Private Server (VPS) hosting has emerged as a versatile and efficient solution for businesses and individuals seeking greater control, flexibility, and performance for their websites in the ever-changing web hosting landscape.

How secure is a VPS

VPS 2023-11-30 14:11:56

Exploring the security features of a VPS is critical to understanding its dependability in protecting your data and operations.

What is the use of VPS

VPS 2023-11-23 04:45:51

A virtual private server (VPS) is a virtualized server that is produced by splitting a real server into many isolated virtual environments.

What is APNIC

APNIC 2023-11-16 13:06:10

The Asia-Pacific Network Information Centre (APNIC) is a critical pillar in the realm of Internet infrastructure, serving as the Asia-Pacific region's regional Internet address registry (RIR).

IP Address Blacklisting

IP address 2023-11-09 13:37:27

IP address blacklisting, or IP banning, is a way to manage access to websites and content on the internet. It involves preventing requests from certain IP addresses. This usually happens to IP addresses that have a history of spamming or illegal activities.

A Guide to Buy IPv4 Subnets Safely

Buy IPv4 Subnets IPv4 2023-11-03 06:50:39

Unlock the Secrets of Safely Buying IPv4 Subnets: Explore Our Comprehensive Guide to Secure Transactions and Maximize the Value of Your Internet Resources. Larus Network's Expert Insights Await.