Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
ESP is used to provide integrity check, authentication, and encryption to IP datagrams. However, some restrictions apply:
Integrity check and authentication are used together. Replay protection is selectable only in conjunction with integrity check and authentication. Replay protection can be selected only by the receiver.
Encryption can be selected independently of other services. It is highly recommended that, if encryption is enabled, integrity check and authentication be turned on. If only encryption is used, intruders could forge packets in order to mount cryptanalytic attacks.
Introduction
Although both authentication (with integrity check) and encryption are optional, at least one of them is always selected, otherwise you would not be using ESP. ESP is identified by protocol number 50, as assigned by the IANA. If both encryption and authentication with integrity check are selected, then the receiver first authenticates the packet and, only if this step was successful, proceeds with decryption. This mode of operation saves computing resources and reduces the vulnerability to denial of service attacks.
In this mode, the ESP header is inserted right after the IP header. If the datagram already has IPsec header(s), then the ESP header is inserted before any of those. The ESP trailer and the optional authentication data are appended to the payload. ESP in transport mode provides neither authentication nor encryption for the IP header. This is a disadvantage, since false packets might be delivered for ESP processing. The advantage of transport mode is the lower processing overhead. As in the case of AH, ESP in transport mode is used by hosts, not gateways. Gateways are not required to support transport mode.
A new IP packet is constructed with a new IP header and ESP is then applied, as in transport mode. Since the original datagram becomes the payload data for the new ESP packet, it is completely protected, if both encryption and authentication are selected. However, the new IP header is still not protected. The tunnel mode is used whenever either end of a security association is a gateway. Thus, between two firewalls the tunnel mode is always used. For example two security gateways may operate an ESP tunnel which is used to secure all traffic between the networks they connect together. Gateways often also support transport mode. This mode is allowed when the gateway acts as a host, that is in cases when traffic is destined to the gateway itself. For example, SNMP commands could be sent to the gateway using transport mode. In tunnel mode the outer header's IP addresses does not need to be the same as the inner headers' addresses. Hosts are not required to support tunnel mode. The advantages of tunnel mode are total protection of the encapsulated IP datagram and the possibility of using private addresses. However, there is an extra processing overhead associated with this mode.
The AH and ESP protocols can be applied alone or in combination. To make things more complicated, the AH and ESP SAs do not need to have identical endpoints. The combinations of IPsec protocols are realized with SA bundles. There are two approaches for an SA bundle creation:
Transport adjacency: Both security protocols are applied in transport mode to the same IP datagram. This method is practical for only one level of combination. Iterated (nested) tunneling: The security protocols are applied in tunnel mode, in sequence. After each application, a new IP datagram is created and the next protocol is applied to it. This method has no limit in the nesting levels. However, more than three levels are impractical.
These approaches can be combined. For example, an IP packet with transport adjacency IPsec headers can be sent through nested tunnels. When designing a VPN, one should limit the number of IPsec processing stages. In our view, three stages is the limit beyond which further processing has no benefits. Two stages are sufficient for almost all cases.
Two hosts are connected through the Internet (or an intranet) without any IPsec gateway between them. They can use ESP, AH or both. Either transport or tunnel mode can be applied. The combinations required to be supported by any IPsec implementation are the following:
Transport Mode
AH alone ESP alone AH applied after ESP (transport adjacency) AH alone ESP alone
Tunnel Mode
Although gateways are required to support either an AH tunnel or ESP tunnel, it is often desirable to have tunnels between gateways that combine the features of both IPsec protocols. The order of the headers is user selectable by setting the tunnel policy. A combined tunnel between gateways does not mean that iterated tunneling takes place. Since the SA bundle comprising the tunnel have identical endpoints, it is inefficient to do iterated tunneling. Instead, one IPsec protocol is applied in tunnel mode and the other in transport mode, which can be conceptually thought of as a combined AH-ESP tunnel. An equivalent approach is to IP tunnel the original datagram and then apply transport adjacency IPsec processing to it. The result is that we have an outer IP header followed by the IPsec headers in the order set by the tunnel policy, then the original IP packet.
This case is a combination of cases 1 and 2 and does not raise new IPsec requirements for the machines involved. The big difference from case 2 is that now the hosts are also required to support IPsec. In a typical setup, the gateways use AH in tunnel mode, while the hosts use ESP in transport mode. An enhanced security version could use a combined AHESP tunnel between the gateways. In this way, the ultimate destination addresses would be encrypted, the whole packet traveling the Internet would be authenticated and the carried data double encrypted. This is the only case when three stages of IPsec processing might be useful, however, at a cost; the performance impact is considerable.
This case applies to remote hosts that use the Internet to reach a server in the organization protected by a firewall. Between the remote host H1 and the firewall G2, only tunnel mode is required. The choices are the same as in case 2. Between the hosts themselves, either tunnel mode or transport mode can be used, with the same choices as in case 1. A typical setup is to use AH in tunnel mode between H1 and G2 and ESP in transport mode between H1 and H2. It is also common to create a combined AH-ESP tunnel between the remote host H1 and the gateway G2. In this case H1 can access the whole intranet using just one SA bundle, whereas it only could access one host with one SA bundle.
HVALA NA PANJI