Shiva Logo

Encapsulation

There are two types of encapsulation available with Shiva VPN products. The first is Shiva Smart TunnelingTM (SST) encapsulation. The second, called Encapsulating Security Payload (ESP) encapsulation, is an emerging standard as defined by IPSec. ESP (both 32- or 64-bit versions) should be used when you communicate with another non-Shiva VPN device (such as a firewall or router) that has implemented the ESP portion of the IPSec standard.

Encapsulation works in the following manner: when a packet is encrypted, a brand new packet is created. This new packet contains the entire original packet (including the header) that has been encrypted, a new header, and some information required by the device that will finally decrypt the packet. The original packet is said to be encapsulated.

For more information, see the following topics:

SST Encapsulation

ESP Encapsulation

Secure Profiles

Packet Handling

Packet Keys

SST Encapsulation

When the encapsulation is set to Shiva Smart Tunneling (SST), the following information must be specified to fully define the security profile.

Authentication Method

The authentication method must be set to either certificates, challenge phrases, SecurID, or RADIUS. Challenge phrases are often referred to as authentication keys. Sometimes challenge phrases are called passwords, but this is not a good synonym.

Public Key Length

The public key length must be set to 512 bits, 1024 bits, or 2048 bits. Note that public keys are used during the authentication and session key exchange processes. The longer the public key length, the more secure the session negotiation will be.

Crypto Period Length

The crypto period length defines how long a session key will be used. The default value for the crypto period is 1 month, although it can be set to as low as three hours. Given that a packet encrypted with a 90-bit key will require about 20 years of effort by a well-funded dedicated adversary to crack, it is often sufficient to use the default value for crypto period length.

ESP Encapsulation

When the encapsulation is set to Encapsulating Security Payload (ESP), tunnel mode, the following information must be specified to fully define the security profile.

IV Length (Encapsulation)

The iv (initialization vector) length must be set to either 32 bits or 64 bits. This value is used during the outer cipher block chaining operation to ensure that the same packet encrypted multiple times will not generate the same cipher text. Both 32-bit and 64-bit iv's offer the same level of randomness, but 32-bit iv's use more system CPU and less bandwidth while 64-bit iv's use less CPU and more bandwidth. The actual difference in CPU usage and bandwidth usage is very small, and the industry tendency is to use a 64-bit iv length.

Authentication Header

This value can be set to keyed MD5, HMAC MD5, keyed SHA1, HMAC SHA1, or none. An authentication header (AH) is added to an ESP encapsulated packet (either version) to ensure that the packet is not altered during transmission, and is constructed by hashing the entire encrypted packet.

Setting the AH type specifies which algorithm to use for hashing. The SHA1 hashing algorithm is slightly more secure than MD5, but also slightly slower. MD5 adds 16 bytes of overhead to each packet, while SHA1 adds 20 bytes overhead. HMAC MD5 and SHA1 are slightly more secure than keyed MD5 and SHA1 respectively. Once again, the differences are marginal.

Ensure that the device on the other end (the firewall or router) conforms to the IPSec standards to ensure its interoperability with a Shiva VPN component.

AH Key Length

If you select either keyed MD5 or keyed SHA1 for your authentication header type, the value must be set between 0 and 55 bytes. If you select either HMAC MD5 or HMAC SHA1 for your authentication header (AH) type, the value must be set between 0 and 64 bytes. This value specifies the length of the key to be used when hashing the packet to produce the authentication header. The longer the key, the more secure the authentication, but the more time-consuming to manually enter.

Secure Profiles

Secure profiles are used to define how packets are encrypted when passing through a tunnel and how the establishment of the communication session is authenticated. Secure profiles must contain the following information to be complete.

Name

The name is a descriptive alphanumeric string used to reference the secure profile when it is applied to a tunnel. Although no naming convention is imposed, it is wise to define one prior to creating your profiles. Suggested naming conventions indicate either the intended use of the profile (for example, Interoffice or Dial-up user), the relative strength of the profile (for example, Strict or Very Strict), or the contents of the profile (for example, ESP-3DES-K1024-C12HRS for ESP encapsulation, 3DES, authentication key with 1024-bit public keys, and a crypto period of 12 hours).

Algorithm

The algorithm can be set to Data Encryption Standard (DES), Triple Pass DES, 3DES, or 40-bit DES for ESPv2 (IPSec) tunnels.

Keepalive

The keepalive interval can be set between 1 and 299 seconds or disabled (0). The keepalive feature is usually specified in profiles that are applied to remote links and has two main uses. The first is to ensure that the link status displayed on the remote Shiva VPN component will accurately reflect the status of the tunnel. The second is to ensure that other Shiva VPN components can sense that a remote device has dropped its connection and therefore the tunnel must be renegotiated. Note that setting the keepalive to a small value will cause many keepalive packets to be sent. This may impact the responsiveness of the remote connection.

Timeout

The keepalive timeout can be set between 2 and 300 seconds. This specifies how long a Shiva VPN component should wait for a packet from an opposing Shiva VPN component before declaring the session terminated and attempting to renegotiate the tunnel. If you specify a timeout on one end of a tunnel, you must specify a keepalive on the other end of the tunnel.

Encapsulation

The encapsulation can be set to either Shiva Smart Tunneling (SST) Encapsulation or to Encapsulating Security Payload (ESP) Encapsulation. ESP is the security portion of the IPSec standard. SST encapsulation is recommended for data exchange between Shiva VPN components, as it is stronger than ESP encapsulation.

ESP (either version) should be used when you communicate with another non-Shiva VPN device (such as a firewall or router) that has implemented the ESP portion of the IPSec standard.

The ESP implementation in all Shiva VPN Gateway products is tunnel mode. However, you can use transport mode by selecting ESP (either version), setting the ESP authentication to none, and selecting a value for the Authentication Header (AH). Transport mode encrypts only the payload.

Packet Handling

When a computer or network device communicates over a network (either a LAN or a WAN such as the Internet), the devices all perform similar functions. The application program (for example, a mail program) formulates a message, which is then passed to a set of functions collectively known as the TCP/IP stack. The TCP/IP stack looks at the message to determine if it needs to be sent out of the computer and then breaks the message into small packets and adds some header information to each packet.

The header information includes the following information:

  • The destination address of the packet (the IP address of the mail server)

  • The application port on the destination computer (for example, port 25 indicates that a SMTP mail server should be the application listening at the destination address)

  • The source address of the sender (the IP address of the computer where the e-mail client is running)

  • The application port that the sending machine used (usually randomly assigned)

  • The protocol used (for SMTP mail, the protocol is TCP)

The maximum size of these packets including the header is usually 1500 bytes. Therefore, if your e-mail message is longer than 1500 bytes (1500 characters), it will be broken into several packets before being sent to the network layer and finally being transmitted onto the network. A simplified packet as released by the TCP/IP stack is shown next.

Click graphic to enlarge the image.

Simplified Packet

Packet Keys

The key (or keys in the case of triple pass DES or 3DES) used to encrypt a packet in SST encapsulation is called a packet key. A new packet key is randomly generated for every packet. This step, along with the outer-CBC technique, ensures that no matter how many identical original packets are sent, the new encrypted packets are significantly different each time. A simplified packet as released by a LanRover VPN Gateway is shown next.

Click graphic to enlarge the image.

Encrypted Packet

This new packet has many interesting features. Note that the destination and source IP addresses of the original packet are different from the destination and source IP addresses of the new packet. The new IP addresses are the IP addresses of the LanRover VPN Gateway device that encrypted the packet. In many cases, these addresses are the IP addresses of the WAN interfaces of the LanRover VPN Gateway that secure the communication.

In a typical network configuration, a packet traveling from the Web server at the main office to a PC on the Branch office network has the IP addresses set to the WAN side IP addresses of the VPN Gateways at the gateways to these networks. The IP address of the Web server and the PC are hidden from anyone intercepting the packet and the interceptor gains no knowledge about the LANs.

Note also that the destination and source ports are both set to 2233. This application port number is registered to Shiva Corporation and indicates only that the packet is encrypted. The source port in the original packet would be set to port 80 to indicate that this is World Wide Web traffic. Therefore, the nature of the packet is hidden from anyone intercepting the packet.

The protocol has been modified and set to UDP. The original packet, if it was an http (www) packet, has its protocol set to TCP and indicates to an intruder that an acknowledgment packet is expected. Trapping acknowledgment packets is a good way to gain some knowledge of the contents of an encrypted packet, which can be used to help break the encryption. Setting all the encrypted packet protocols to UDP removes this bit of knowledge and further secures the communication.

The entire original packet is encrypted. Some other solutions only encrypt the payload data and expose a wealth of information about the nature of the packet and the source and destination networks.

Finally, the packet keys are encrypted with session keys and appended to the new packet. Remember that DES, triple pass DES, and 3DES are symmetric algorithms. Therefore, both the device encrypting the packet and the device decrypting the packet must know the same keys. The packet keys, however, are randomly generated for each packet. Assuming that both the encryptor and the decryptor know the same session keys, this technique makes the encryption more secure in two ways. Attempts to break the packet keys are not practical since it changes with every packet. The most that can be gained is about 1400 bytes of data from an operation that will take years. The session keys are used to encrypt a very small amount of data (only the packet keys), which is random. If the session keys are changed periodically, then even this small target is moving and attacks are made more difficult. The frequency with which session keys are changed is called the crypto period.

Related Information

Virtual Private Networking (VPN)

[ Top of Page... ]

[ Back to Shiva Configurator Directory ]