| | | |
(IP A) (IP A) (IP B) (IP B)
| | | |
+--+--+ +--+--+ +--+--+ +--+--+
| H1 | | H2 | | H3 | | H4 |
+-----+ +-----+ +--+--+ +--+--+
Legend:
---+---+---+-- = Ethernet, Token Ring, or FDDI
H = Host computer
MR = Master Router
BR = Backup Router
* = IP Address
(IP) = default router for hosts
In the example above, half of the hosts have configured a static
route through Rtr1’s IP A and half are using Rtr2’s IP B. The
configuration of virtual router VRID=1 is exactly the same as in the
first example (see section 4.1), and a second virtual router has been
added to cover the IP address owned by Rtr2 (VRID=2, IP_Address=B).
In this case Rtr2 will assert itself as Master for VRID=2 while Rtr1
will act as a backup. This scenario demonstrates a deployment
providing load splitting when both routers are available while
providing full redundancy for robustness.
5. Protocol
The purpose of the VRRP packet is to communicate to all VRRP routers
the priority and the state of the Master router associated with the
Virtual Router ID.
VRRP packets are sent encapsulated in IP packets. They are sent to
the IPv4 multicast address assigned to VRRP.
5.1. VRRP Packet Format
This section defines the format of the VRRP packet and the relevant
fields in the IP header.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Type | Virtual Rtr ID| Priority | Count IP Addrs|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Auth Type | Adver Int | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IP Address (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| . |
| . |
| . |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IP Address (n) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication Data (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication Data (2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5.2. IP Field Descriptions
5.2.1. Source Address
The primary IP address of the interface the packet is being sent
from.
5.2.2. Destination Address
The IP multicast address as assigned by the IANA for VRRP is:
224.0.0.18
This is a link local scope multicast address. Routers MUST NOT
forward a datagram with this destination address regardless of its
TTL.
5.2.3. TTL
The TTL MUST be set to 255. A VRRP router receiving a packet with
the TTL not equal to 255 MUST discard the packet.
5.2.4. Protocol
The IP protocol number assigned by the IANA for VRRP is 112
(decimal).
5.3. VRRP Field Descriptions
5.3.1. Version
The version field specifies the VRRP protocol version of this packet.
This document defines version 2.
5.3.2. Type
The type field specifies the type of this VRRP packet. The only
packet type defined in this version of the protocol is:
1 ADVERTISEMENT
A packet with unknown type MUST be discarded.
5.3.3. Virtual Rtr ID (VRID)
The Virtual Router Identifier (VRID) field identifies the virtual
router this packet is reporting status for. Configurable item in the
range 1-255 (decimal). There is no default.
5.3.4. Priority
The priority field specifies the sending VRRP router’s priority for
the virtual router. Higher values equal higher priority. This field
is an 8 bit unsigned integer field.
The priority value for the VRRP router that owns the IP address(es)
associated with the virtual router MUST be 255 (decimal).
VRRP routers backing up a virtual router MUST use priority values
between 1-254 (decimal). The default priority value for VRRP routers
backing up a virtual router is 100 (decimal).
The priority value zero (0) has special meaning indicating that the
current Master has stopped participating in VRRP. This is used to
trigger Backup routers to quickly transition to Master without having
to wait for the current Master to timeout.
5.3.5. Count IP Addrs
The number of IP addresses contained in this VRRP advertisement.
5.3.6. Authentication Type
The authentication type field identifies the authentication method
being utilized. Authentication type is unique on a Virtual Router
basis. The authentication type field is an 8 bit unsigned integer.
A packet with unknown authentication type or that does not match the
locally configured authentication method MUST be discarded.
Note: Earlier version of the VRRP specification had several defined
authentication types [RFC2338]. These were removed in this
specification because operational experience showed that they did not
provide any real security and would only cause multiple masters to be
created.
The authentication methods currently defined are:
0 - No Authentication
1 - Reserved
2 - Reserved
5.3.6.1. Authentication Type 0 - No Authentication
The use of this authentication type means that VRRP protocol
exchanges are not authenticated. The contents of the Authentication
Data field should be set to zero on transmission and ignored on
reception.
5.3.6.2. Authentication Type 1 - Reserved
This authentication type is reserved to maintain backwards
compatibility with RFC 2338.
5.3.6.3. Authentication Type 2 - Reserved
This authentication type is reserved to maintain backwards
compatibility with RFC 2338.
5.3.7. Advertisement Interval (Adver Int)
The Advertisement interval indicates the time interval (in seconds)
between ADVERTISEMENTS. The default is 1 second. This field is used
for troubleshooting misconfigured routers.
5.3.8. Checksum
The checksum field is used to detect data corruption in the VRRP
message.
The checksum is the 16-bit one’s complement of the one’s complement
sum of the entire VRRP message starting with the version field. For
computing the checksum, the checksum field is set to zero. See RFC
1071 for more detail [CKSM].
5.3.9. IP Address(es)
One or more IP addresses that are associated with the virtual router.
The number of addresses included is specified in the "Count IP Addrs"
field. These fields are used for troubleshooting misconfigured
routers.
5.3.10. Authentication Data
The authentication string is currently only used to maintain
backwards compatibility with RFC 2338. It SHOULD be set to zero on
transmission and ignored on reception.
6. Protocol State Machine
6.1. Parameters per Virtual Router
VRID Virtual Router Identifier. Configurable item
in the range 1-255 (decimal). There is no
default.
Priority Priority value to be used by this VRRP router
in Master election for this virtual router.
The value of 255 (decimal) is reserved for
the router that owns the IP addresses
associated with the virtual router. The
value of 0 (zero) is reserved for Master
router to indicate it is releasing
responsibility for the virtual router. The
range 1-254 (decimal) is available for VRRP
routers backing up the virtual router. The
default value is 100 (decimal).
IP_Addresses One or more IP addresses associated with this
virtual router. Configured item. No
default.
Advertisement_Interval Time interval between ADVERTISEMENTS
(seconds). Default is 1 second.
Skew_Time Time to skew Master_Down_Interval in seconds.
Calculated as:
( (256 - Priority) / 256 )
Master_Down_Interval Time interval for Backup to declare Master
down (seconds). Calculated as:
(3 * Advertisement_Interval) + Skew_time
Preempt_Mode Controls whether a higher priority Backup
router preempts a lower priority Master.
Values are True to allow preemption and False
to prohibit preemption. Default is True.
Note: Exception is that the router that owns
the IP address(es) associated with the
virtual router always preempts independent of
the setting of this flag.
Authentication_Type Type of authentication being used. Values
are defined in section 5.3.6.
Authentication_Data Authentication data specific to the
Authentication_Type being used.
6.2. Timers
Master_Down_Timer Timer that fires when ADVERTISEMENT has not
been heard for Master_Down_Interval.
Adver_Timer Timer that fires to trigger sending of
ADVERTISEMENT based on
Advertisement_Interval.
6.3. State Transition Diagram
+---------------+
+--------->| |<-------------+
| | Initialize | |
| +------| |----------+ |
| | +---------------+ | |
| | | |
| V V |
+---------------+ +---------------+
| |---------------------->| |
| Master | | Backup |
| |<----------------------| |
+---------------+ +---------------+
6.4. State Descriptions
In the state descriptions below, the state names are identified by
{state-name}, and the packets are identified by all upper case
characters.
A VRRP router implements an instance of the state machine for each
virtual router election it is participating in.
6.4.1. Initialize
The purpose of this state is to wait for a Startup event. If a
Startup event is received, then:
- If the Priority = 255 (i.e., the router owns the IP address(es)
associated with the virtual router)
o Send an ADVERTISEMENT
o Broadcast a gratuitous ARP request containing the virtual
router MAC address for each IP address associated with the
virtual router.
o Set the Adver_Timer to Advertisement_Interval
o Transition to the {Master} state
else
o Set the Master_Down_Timer to Master_Down_Interval
o Transition to the {Backup} state
endif
6.4.2. Backup
The purpose of the {Backup} state is to monitor the availability and
state of the Master Router.
While in this state, a VRRP router MUST do the following:
- MUST NOT respond to ARP requests for the IP address(s) associated
with the virtual router.
- MUST discard packets with a destination link layer MAC address
equal to the virtual router MAC address.
- MUST NOT accept packets addressed to the IP address(es) associated
with the virtual router.
- If a Shutdown event is received, then:
o Cancel the Master_Down_Timer
o Transition to the {Initialize} state
endif
- If the Master_Down_Timer fires, then:
o Send an ADVERTISEMENT
o Broadcast a gratuitous ARP request containing the virtual
router MAC address for each IP address associated with the
virtual router
o Set the Adver_Timer to Advertisement_Interval
o Transition to the {Master} state
endif
- If an ADVERTISEMENT is received, then:
If the Priority in the ADVERTISEMENT is Zero, then:
o Set the Master_Down_Timer to Skew_Time
else:
If Preempt_Mode is False, or If the Priority in the
ADVERTISEMENT is greater than or equal to the local
Priority, then:
o Reset the Master_Down_Timer to Master_Down_Interval
else:
o Discard the ADVERTISEMENT
endif
endif
endif
6.4.3. Master
While in the {Master} state the router functions as the forwarding
router for the IP address(es) associated with the virtual router.
While in this state, a VRRP router MUST do the following:
- MUST respond to ARP requests for the IP address(es) associated
with the virtual router.
- MUST forward packets with a destination link layer MAC address
equal to the virtual router MAC address.
- MUST NOT accept packets addressed to the IP address(es) associated
with the virtual router if it is not the IP address owner.
- MUST accept packets addressed to the IP address(es) associated
with the virtual router if it is the IP address owner.
- If a Shutdown event is received, then:
o Cancel the Adver_Timer
o Send an ADVERTISEMENT with Priority = 0
o Transition to the {Initialize} state
endif
- If the Adver_Timer fires, then:
o Send an ADVERTISEMENT o Reset the Adver_Timer to
Advertisement_Interval
endif
- If an ADVERTISEMENT is received, then:
If the Priority in the ADVERTISEMENT is Zero, then:
o Send an ADVERTISEMENT
o Reset the Adver_Timer to Advertisement_Interval
else:
If the Priority in the ADVERTISEMENT is greater than the
local Priority,
or
If the Priority in the ADVERTISEMENT is equal to the local
Priority and the primary IP Address of the sender is greater
than the local primary IP Address, then:
o Cancel Adver_Timer
o Set Master_Down_Timer to Master_Down_Interval
o Transition to the {Backup} state
else:
o Discard ADVERTISEMENT
endif
endif
endif
7. Sending and Receiving VRRP Packets
7.1. Receiving VRRP Packets
Performed the following functions when a VRRP packet is received:
- MUST verify that the IP TTL is 255.
- MUST verify the VRRP version is 2.
- MUST verify that the received packet contains the complete VRRP
packet (including fixed fields, IP Address(es), and Authentication
Data).
- MUST verify the VRRP checksum.
- MUST verify that the VRID is configured on the receiving interface
and the local router is not the IP Address owner (Priority equals
255 (decimal)).
- MUST verify that the Auth Type matches the locally configured
authentication method for the virtual router and perform that
authentication method.
If any one of the above checks fails, the receiver MUST discard the
packet, SHOULD log the event and MAY indicate via network management
that an error occurred.
- MAY verify that "Count IP Addrs" and the list of IP Address
matches the IP_Addresses configured for the VRID
If the above check fails, the receiver SHOULD log the event and MAY
indicate via network management that a misconfiguration was detected.
If the packet was not generated by the address owner (Priority does
not equal 255 (decimal)), the receiver MUST drop the packet,
otherwise continue processing.
- MUST verify that the Adver Interval in the packet is the same as
the locally configured for this virtual router
If the above check fails, the receiver MUST discard the packet,
SHOULD log the event and MAY indicate via network management that a
misconfiguration was detected.
7.2. Transmitting VRRP Packets
The following operations MUST be performed when transmitting a VRRP
packet.
- Fill in the VRRP packet fields with the appropriate virtual router
configuration state
- Compute the VRRP checksum
- Set the source MAC address to Virtual Router MAC Address
- Set the source IP address to interface primary IP address
- Set the IP protocol to VRRP
- Send the VRRP packet to the VRRP IP multicast group
Note: VRRP packets are transmitted with the virtual router MAC
address as the source MAC address to ensure that learning bridges
correctly determine the LAN segment the virtual router is attached
to.
7.3. Virtual Router MAC Address
The virtual router MAC address associated with a virtual router is an
IEEE 802 MAC Address in the following format:
00-00-5E-00-01-{VRID} (in hex in internet standard bit-order)
The first three octets are derived from the IANA’s OUI. The next two
octets (00-01) indicate the address block assigned to the VRRP
protocol. {VRID} is the VRRP Virtual Router Identifier. This
mapping provides for up to 255 VRRP routers on a network.
8. Operational Issues
8.1. ICMP Redirects
ICMP Redirects may be used normally when VRRP is running between a
group of routers. This allows VRRP to be used in environments where
the topology is not symmetric.
The IP source address of an ICMP redirect should be the address the
end host used when making its next hop routing decision. If a VRRP
router is acting as Master for virtual router(s) containing addresses
it does not own, then it must determine which virtual router the
packet was sent to when selecting the redirect source address. One
method to deduce the virtual router used is to examine the
destination MAC address in the packet that triggered the redirect.
It may be useful to disable Redirects for specific cases where VRRP
is being used to load share traffic between a number of routers in a
symmetric topology.
8.2. Host ARP Requests
When a host sends an ARP request for one of the virtual router IP
addresses, the Master virtual router MUST respond to the ARP request
with the virtual MAC address for the virtual router. The Master
virtual router MUST NOT respond with its physical MAC address. This
allows the client to always use the same MAC address regardless of
the current Master router.
When a VRRP router restarts or boots, it SHOULD not send any ARP
messages with its physical MAC address for the IP address it owns, it
should only send ARP messages that include Virtual MAC addresses.
This may entail:
- When configuring an interface, VRRP routers should broadcast a
gratuitous ARP request containing the virtual router MAC address
for each IP address on that interface.
- At system boot, when initializing interfaces for VRRP operation;
delay gratuitous ARP requests and ARP responses until both the IP
address and the virtual router MAC address are configured.