CARP协议详解

2009-05-13 11:47:18来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


今天整理资料,关于OpenBSD的
CARP
,google了一下,找到了如下资料:
The Common Address Redundancy Protocol manages failover at the intersection of Layers 2 and 3 in the OSI Model (link layer and IP layer). Each CARP group has a virtual MAC (link layer) address, and one or more virtual host IP addresses (the common address). CARP hosts respond to ARP requests for the common address with the virtual MAC address, and the CARP advertisements themselves are sent out with this as the source address, which helps switches quickly determine which port the virtual MAC address is currently "at".
The master of the address sends out CARP advertisement messages via multicast using the CARP protocol (IP Protocol 112) on a regular basis, and the backup hosts listen for this advertisement. If the advertisements stop, the backup hosts will begin advertising. The advertisement frequency is configurable, and the host which advertises most frequently is the one most likely to become master in the event of a failure.
A reader who is familiar with VRRP will find this is somewhat familiar, however there are some significant differences:
· The CARP protocol is address family independent. The OpenBSD implementation supports both IPv4 and IPv6, as a transport for the CARP packets as well as common addresses to be shared.
· CARP has an "arpbalance" feature that allows multiple hosts to share a single IP address simultaneously; in this configuration, there is a virtual MAC address for each host, but only one IP address.
· CARP uses a cryptographically strong SHA-1 HMAC to protect each advertisement.
Besides these technical differences, there is another significant difference (perhaps the most important one, in fact): CARP is not patent encumbered. See
this page
for details on the history of CARP and our reasons for avoiding a VRRP implementation.
CARP协议详解
--CARP协议原理及结构
/*作者:xie_minix*/
 
CARP ---通用地址冗余协议
源代码:(OpenBSD系统) src/sys/netinet/ip_carp.h, Revision 1.8
在核心配置文件/sys/arch/i386/conf/GENERIC中.定义为:
pseudo-device carp [count]
其中count 为支持虚拟设备carp的数量
描述:
carp接口为一虚拟设备.(注:虚拟设备即在机器中不真实存在).此种设备一般是使用通用
接口的克隆技术来生成.比如在carp程序中的挂接设备函数(一般设备的挂接都是使用"设备名
+attach")carpattch只是简单调用通用接口文件(if.c)中的通用设备克隆挂接函数
if_clone_attach(源代码:753行).实际上是在所有的使用克隆产生的设备列表中插入该carp
设备到表头(全局变量if_cloners是所有克隆设备的链表头.源代码:if.c第135行).
CARP协议是在IP之上的一种协议.请注意carp和CARP的不同.即carp表示的是一种虚拟设备
.此设备提供对CARP协议的支持.关于CARP协议将在以下介绍.先来看看carp的作用.carp接口允
许本地网络的(注意是同一网段,不能跨越路由器)多个机器来共享一个(一组)IP地址.实际上的
结果就是当一台该IP地址的主机在出现意外事故的情况下不能工作.其它的机器能够立刻自动

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:配置一个安全的chroot DNS

下一篇:升级到FreeBSD7.0release的方法