Effects of ICMPv6 on IKE and IPsec Policies


Abstract:

The ICMPv6 protocol provides many functions which in IPv4 were either non-existent or provided by lower layers. IPv6 architecture also makes it possible to secure all IP packets using IPsec, even ICMPv6 messages. IPsec architecture has a Security Policy Database that specifies which traffic is protected, and how. It turns out that the specification of policies in the presence of ICMPv6 traffic is hard. Sound looking policies may easily lead to loops: The establishment of security requires ICMPv6 messages which can't be sent since security hasn't been established yet. The purpose of this draft is to inform system administrators and IPsec implementers in which manner they can handle the ICMPv6 messages. Common understanding of the way that these messages are handled is also necessary for interoperability, in case vendors hardcode such rules in to products.


Introduction:

The ICMPv6 protocol provides many functions which in IPv4 were either non-existent or provided by lower layers. For instance, IPv6 implements address resolution using an IP packet, ICMPv6 Neighbor Solicitation message. In contrast, IPv4 uses an ARP message at a lower layer.

IPv6 architecture makes it possible to secure all IP packets using IPsec, even ICMPv6 messages and even to multicast addresses.
IPsec architecture has a Security Policy Database that specifies which traffic is protected, and how. It turns out that the specification of policies in the presence of ICMPv6 traffic is not easy.
For instance, a simple policy of protecting all traffic between two hosts on the same network would trap even address resolution messages, leading to a situation where IKE can't establish a Security Association since in order to send the IKE UDP packets one would have had to send the Neighbor Solicitation Message, which would have required an SA.

The purpose of this draft is to inform system administrators and IPsec implementers in which manner they can handle the ICMPv6 messages.
System administrators do not want to study the IPv6 specifications in order to understand how they shall configure their routers.
IPsec implementers want to understand what kind of policies they can offer with respect to the ICMPv6 messages.

Common understanding of the way that these messages are handled is also very much necessary for interoperability, as some vendors may be hardcoding some of the low-level policy operations in their products.
If the rules between two vendors' products are incompatible for a particular message we may end with the sender sending cleartext and the receiver requiring IPsec, causing the packet to be dropped and possibly all connectivity between the two nodes lost.


ICMPv6 Tasks:

In IPv6, ICMP has several tasks, and many of these tasks are overloaded on a few central message types such as the Neighbor Discovery message. In this chapter we explain the tasks and their effects in order to understand better how the messages should be treated.
  1. Path MTU Discovery:

    Path MTUs are dynamically determined by IPv6 in order to optimize the size of the packets sent to a particular destination.

    The ICMPv6 Packet Too Big messages are used as a part of the Path MTU Discovery procedure.

  2. Error Notification:

    ICMPv6 handles basic error situations of the IP layer, such as finding out that a particular destination isn't available.

    The Destination Unreachable, Packet Too Big, Parameter Problem, and Time Exceeded messages are a part of the error handling procedure.
    Note that the Packet Too Big message also plays a role in the Path MTU Discovery procedure.

  3. Informational Notifications:

    For debugging and network analysis purposes, ICMPv6 includes informational messages. These message are necessary also in IPsec contexts and over IPsec tunnels due to the complex nature of some tunnel setups.

    The Echo Request and Echo Reply messages are used solely for this purpose.

  4. Router and Prefix Discovery:

    Router and prefix discovery is a part of the Neighbor Discovery protocol, which in turn is a part of the ICMPv6.
    The main purpose of the router discovery is to find neighboring routers that are willing to forward packets on the behalf of hosts. Prefix discovery involves determining which destinations are local for an attached link.
    This information is used both by the address auto configuration process, and routing. Typically, address auto configuration and other tasks can't proceed at all until the router discovery process has run.

    The Router Solicitation and Router Advertisement messages are used for this and only this purpose.

  5. Address auto configuration:

    Address auto configuration is another part of the Neighbor Discovery protocol.
    It's purpose is to automatically assign addresses to interfaces.
    It comes in two variants, stateless and statefull. In this document we consider only the stateless auto configuration aspects. Obviously, no higher layer traffic can be sent until all participating nodes have addresses. This includes also IKE UDP traffic.

    The Neighbor Solicitation and Advertisement messages are used for this purpose, among other things. Furthermore, Router and Prefix Discovery and Duplicate Address Detection have an effect to the Address auto configuration tasks.

  6. Duplicate Address Detection:

    As a part of the stateless address auto configuration procedure, nodes check for duplicate addresses prior to assigning an address to an interface. This procedure uses the same messages as the Neighbor Discovery protocol. Since the rules outlined in [2] forbid the use of an address for both sending and receiving packets until it has been found unique, no higher layer traffic is possible until this procedure has completed.

    The Neighbor Solicitation and Advertisement messages are used also for this purpose.

  7. Address Resolution:

    In address resolution, nodes determine the link-layer address of a local destination given only the destination's IP address. Again, no higher level traffic can proceed until the sender knows the hardware address of the destination or the next hop router.

    The Neighbor Solicitation and Advertisement messages are used also for this purpose.

  8. Neighbor Reachability Detection:

    Hosts monitor the reachability of local destinations and routers in the Neighbor Unreachability procedure, which is a part of the Neighbor Discovery protocol. No higher level traffic can proceed if this procedure flushes out Neighbor cache entries after (perhaps incorrectly) determining that the peer is not reachable.

    The Neighbor Solicitation and Advertisement messages are used also for this purpose.

  9. Redirect:

    In the Redirect procedure, a router informs a host of a better first hop node to reach a particular destination. It is a part of the Neighbor Discovery protocol. As routers forward packets regardless of them being sent first to the wrong place, communications can still be established without the ability to process Redirect messages.

    The Redirect message is used solely for the Redirect procedure.

  10. Router Renumbering:

    This procedure allows address prefixes on routers to be configured and reconfigured in the similar manner as Neighbor Discovery and Address auto configuration works for hosts. Incorrect processing or blocking of messages related to this procedure may render a node's address sets invalid, thereby preventing further communications.

    The Router Renumbering message is used solely for the Router Renumbering procedure.


Factors Affecting the Policy Rules:

  1. Nature of the Addresses:

    ICMPv6 messages are sent using various kinds of source and destination address types. The source address is usually a unicast address, but during address auto configuration message exchanges, the unspecified address :: is also used as a source address.
    The destination address can be either a well known multicast address, a generated multicast address such as the solicited-node multicast address, or a unicast address. While many ICMPv6 messages use multicast addresses most of the time, some also use unicast addresses sometimes. For instance, the Neighbor Solicitation messages are usually sent to multicast addresses, but the Neighbor Advertisement messages are also sent to unicast addresses when sent as a response to a node that has an address.

    IPsec can be used for the protection of both unicast and multicast traffic. However, in order to automatically negotiate mutually acceptable security associations and to refresh keys, IKE needs to be used.IKE is only capable of negotiating SAs for unicast communications.

    Obviously, policies MUST be configured so that multicast traffic doesn't require dynamic SAs. However, while this is a necessary condition it is not sufficient to make sure that that IKE works. The policies MUST also exclude unicast traffic which is contains ICMPv6 messages required before UDP can work between the two nodes.

  2. Network Topology:

    ICMP traffic has different implications for hosts and security gateways.
    In general, security gateways SHOULD carry all ICMP traffic related to the protected traffic in the same tunnel as the traffic itself. For instance, when an ICMPv6 Packet Too Big message is generated on the unprotected segment of a packet's path, that message should relayed through the tunnel to ensure that the sender recognizes the MTU problem.

    Between hosts similar rules apply. However, messages related to the establishment of communication between the hosts - such as for address resolution - MUST NOT be passed through the tunnel at least when the tunnel does not exist yet and IKE would be needed to establish it.

    Note that the distinctions in network topology are more due to the actual network architecture than the selected IPsec mode, be it tunnel or transport.

    ICMPv6 messages can be classified according to whether they are meant for end-to-end communications or communications within a link. There are also messages that we classify as 'any-to-end', which can be sent from any point within a path back to the source, typically to announce an error in processing the original packet. For instance, the address resolution messages are solely for local communications, whereas the Destination Unreachable messages are any-to-end in nature. End to end and any-to-end messages MUST always be passed through tunnels.
    Local messages may be passed through IPsec process under certain conditions.

  3. Role in EstablishingCommunications:

    ICMPv6 messages can also be classified according to their role for establishing communications between two nodes. For the purposes of this discussion, the relevant issue is whether or not the messages must be passed through before IKE can use UDP packets to negotiate SAs. For instance, address auto configuration, duplicate address detection, and address resolution obviously MUST be completed before UDP packets can be passed.

    Neighbor reachability detection is also capable of disrupting IKE communications. The reference states the following:

    In some cases (e.g., UDP-based protocols and routers forwarding packets to hosts) such reachability information may not be readily available from upper-layer protocols.
    When no hints are available and a node is sending packets to a neighbor, the node actively probes the neighbor using unicast Neighbor Solicitation messages to verify that the forward path is still working.

    This means that unless the IKE implementation explicitly handles forward progress notifications towards the IPv6 stack, the stack can not know about the reachability towards the other host.
    Since the hosts may be using tunnel mode and other address in the inner packets than the regular addresses on the hosts, the stack can not learn of forward progress through regular IPsec AH or ESP packets.

    Therefore, Neighbor reachability MUST also be allowed to work independent of IKE SA establishment.

    As IKE messages may contain certificates, it is quite possible that an MTU limit may be exceeded somewhere within the network. If this is possible in a given network, the policies MUST allow ICMP Packet Too Big messages to be received. Note that these messages may well be received either in the clear, on manually configured SAs, or on dynamic SAs. If the router generating the Packet Too Big message does not yet have an SA with the original host, it can initiate IKE negotiations to create one. In case that this new negotiation fails due to reaching another MTU limit, other routers may be involved along the way. But ultimately the process reaches the closest router to which the MTU is known and will not cause any ICMP error messages.

  4. Protecting the Infrastructure versus Communications:

    IPsec can be used to protect the end to end communications or the underlying control messages (such as ICMPv6). It can even be used to protect both. Since many of the control messages are sent to multicast addresses, if IPsec is used then manual SA configuration MUST be performed instead of IKE-based SA negotiation.

    As we have talked about some messages in some situations having to be independent of IKE, it does not necessarily imply that they have to passed through in the clear. Instead, systems MAY use manually configured IPsec SAs to protect e.g. all ICMPv6 communications within one network.

    A plausible security policy configuration could therefore be one where all ICMPv6 messages within the local network must be protected by manual SAs, and all other communications must be protected by IKE-negotiated SAs.


Analysis of the ICMPv6 Messages:

  1. Destination Unreachable:

    The ICMPv6 type of this message is 1.

    This message is always sent between unicast addresses. It is an end to end message Destination Unreachable is never a relevant message for establishing dynamic SAs, unless advanced failover schemes rely on the knowledge to quickly determine unreachable IKE peers.

  2. Packet Too Big:

    The ICMPv6 type of this message is 2.

    This message is also always sent between unicast addresses even if might be sent as a response to a multicast message. It is an end-to-end message.

    Packet Too Big has, however, a role in establishing communications.
    End-to-end communications, that is. In order to pass through long IKE packets, Packet Too Big responses from the network MUST be considered.
    Therefore, it MUST be possible for policies to be configured so that such messages can be received. Note that as discussed previously, the Packet Too Big messages themselves can be protected in various ways.

  3. Time Exceeded:

    The ICMPv6 type of this message is 3.

    This message is also always sent between unicast addresses and is an end-to-end message. Like Packet Too Big, it too has a role in establishing end-to-end communications under certain special situations.

  4. Parameter Problem:

    The ICMPv6 type of this message is 4.

    This message is similar to Packet Too Big in the sense that it uses only unicast messages even if it could be sent as a response to a multicast packet.
    It's role is also end-to-end. While in theory its role in establishing communications is similar to Packet Too Big and Time Exceeded, in practice it is hard to see the kind of IKE and IPv6 stack version problem that could result in this message being sent.

  5. Echo Request:

    The ICMPv6 type of this message is 128.

    Echo Request uses unicast addresses as source addresses, but may be sent to any legal IPv6 address, even multicast and anycast addresses. Echo Requests run end-to-end but never have a role in establishing communications.

  6. Echo Reply:

    The ICMPv6 type of this message is 129.

    Echo Reply is similar to Echo Request in other respects, but uses only unicast addresses.

  7. Redirect:

    The ICMPv6 type of this message is 137.

    The Redirect message is always sent between unicast addresses. It is only used for local purposes, not for end-to-end communications. It isn't strictly necessary in order to establish communications.Nevertheless, it can be viewed as a logical add-on to the Neighbor Discovery messages such as Router Advertisement, and as such SHOULD be treated in a similar manner.

  8. Router Solicitation:

    The ICMPv6 type of this message is 133.

    This message uses either the unspecified address or an unicast address as a source address. The destination address is typically a multicast address.
    This message is always used only local. Since address auto configuration and routing depend on the ability of the routers and address prefixes to be found, this message is required before any communications can be established.
    Therefore, this message MUST be allowed to work independent of IKE SA establishment.

  9. Router Advertisement:

    The ICMPv6 type of this message is 134.

    This message has always a unicast source address, but the destination address can be either a unicast or a multicast address.
    Like the solicitation message, the advertisement is also link local only and required for establishing any communications. Therefore, this message MUST be allowed to work independent of IKE SA establishment.

  10. Neighbor Solicitation:

    The ICMPv6 type of this message is 135.

    The source address of this message is either a unicast address or (if Duplicate Address Detection is in progress) the unspecified address.
    The destination is either a multicast address, unicast address, or an anycast address.
    Neighbor Solicitation and Advertisement messages are used for multiple purposes: address auto configuration, duplicate address detection, and reachability detection.
    In all these roles they act only locally on the link, and getting them through is required before any communications can be established.
    Therefore, this message MUST be allowed to work independent of IKE SA establishment.

  11. Neighbor Advertisement:

    The ICMPv6 type of this message is 136.

    The source address of this message is a unicast address, and the destination is either a unicast or a multicast address.
    Like the solicitation message, this message is link local only and is required before any communications can be established.
    Therefore, this message MUST be allowed to work independent of IKE SA establishment.

  12. Router Renumbering:

    The ICMPv6 type of this message is 138.

    The code is 0 for a Router Renumbering Command, 1 for a Router Renumbering Result, and 255 for a Sequence Number Reset.

    These messages are sent from a unicast address to either a multicast or a unicast address.
    The message are not solely link local, they are used for end-to-end purposes such as having a central management station renumber all routers in a corporate network. As a result of the RR procedure, automatically configured addresses and prefixes may be changed.
    However, it is expected that a transition period exists where both addresses are still acceptable, making it possible to still proceed with IKE negotiations to create SAs for the RR procedure.
    We can therefore assume that the procedure MAY use manual or dynamic SAs as desired by the system administrators.


Summary:

Based on the above, the ICMPv6 messages can be classified as follows:

ICMPv6 informational messages

MESSAGE ROLE USE IKE?
Destination Unreachable Any-to-End MAY(1,2)
Packet Too Big Any-to-End MAY(1,3)
Time Exceeded Any-to-End MAY(1,3)
Parameter Problem End-to-End MAY(4)
Echo Request End-to-End MAY(4)
Echo Reply End-to-End MAY(4)
Redirect Link Local SHOULD NOT(5)
Router Solicitation Link Local MUST NOT(6)
Router Advertisement Link Local MUST NOT(6)
Neighbor Solicitation Link Local MUST NOT(6)
Neighbor Advertisement Link Local MUST NOT(6)
Router Renumbering End-to-End MAY(4)

Explanations:

  1. These error messages have an end-to-end nature but may be generated by intermediate routers as well.

  2. This MAY have to be considered by implementations that wish to base failover decisions on the Unreachable message.

  3. These messages have an impact on the success of IKE messages e.g. when certificates are passed in IKE packets.
    It MUST be possible for policies to be configured so that these messages can be received while the IKE negotiations are still ongoing. Different security policy configurations MUST be supported, including trusting cleartext messages or protecting the messages from intermediate nodes using other, new dynamic SA negotiations.

  4. These messages MAY be treated using regular IPsec and/or IKE processing.

  5. This message SHOULD NOT use IKE in order to make their treatment equal with the rest of the link local messages, but in theory Redirect MAY be handled differently, e.g. using dynamic SAs.

  6. These messages MUST NOT use dynamic SAs.

    These policy rules may be expressed in various ways on a particular host or a router.
    It is necessary to use the ICMPv6 type in making the policy decisions.
    As states, "This is consistent with, although not mentioned by, the Security Architecture specification".
    Only the following requirement for all implementations is stated here. Products that provide hardcoded security policies for ICMPv6 messages SHOULD enable user specified policies to be expressed at a higher priority level so that a possibility is still retained for modifying the rules due to e.g. interoperability problems.


HOME


Copyright © 2003 ALAS, Inc. All Rights Reserved.