Summary
This chapter introduced you to an overview of IPsec, including its
Setting up and troubleshooting an IPsec connection is not
Next up is Chapter 4, "PPTP and L2TP," where I discuss an overview of PPTP and L2TP VPN implementations so that you have an understanding as to which VPN implementation, compared to IPsec, makes more sense for your particular network infrastructure. Following this chapter, Chapter 5 will cover the last type of VPN implementation I'll cover in this book: "SSL VPNs." |
Chapter 4. PPTP and L2TP
Even though IPsec is very popular in the
PPTP is a simple-to-implement VPN solution defined in IETF's RFC 2637. It allows for the use of user authentication (before IPsec included this with XAUTH) and the ability to be interoperable with NAT, making it, originally, a preferred remote access solution over IPsec, which lacked these features. IPsec was not designed as a remote access solution, originally lacking features such as user authentication, address assignment, and enforcement of user policies; nor does IPsec support the transport of multiple protocols (only IP is supported) or multicast transmissions. Therefore, PPTP had a lot of support from the
L2TP is, rather, a merging of two standards: PPTP and the Cisco Layer-2 Forwarding (L2F) protocol. L2TP is defined in IETF's RFCs 2661 and 3438. L2TP can work in conjunction with IPsec to leverage the remote access advantages that L2TP provides, but also the security that IPsec offers. In today's world, you'll typically see Microsoft
|
PPTPPPTP originally was developed by Microsoft to provide a secure remote access solution where traffic needed to be transported from a client, across a public network, to a Microsoft server (VPN gateway). One of the interesting items about PPTP's implementation is that it is an extension of the Point-to-Point Protocol (PPP). Because PPTP uses PPP, PPTP can leverage PPP's features. For example, PPTP allows the encapsulation of multiple protocols, such as IP, IPX, and NetBEUI, via the VPN tunnel. Also, PPP supports the use of authentication via PAP, CHAP, and MS-CHAP. PPTP can use this to authenticate devices. PPTP recently added support for the Extensible Authentication Protocol (EAP) to authenticate users. EAP was designed for wireless networks, but has been incorporated into PPTP. Even though PPP is used in dialup scenarios, PPTP doesn't require the use of dialup to establish remote access connections; you can use dialup or your local LAN connection.
Note
If you're in a pure Microsoft shop and using a Windows remote access server (RAS) to terminate remote access connections, you'll typically be using PPTP or L2TP/IPsec for your client connections. PPTP is typically used with the older Microsoft Windows platforms, Windows 95, 98, or ME. For the
Here is a quick review of some of PPTP's features:
To help you understand the inner workings of PPTP, the following sections cover these topics:
PPP Review
Because PPTP
PPP connections will go through four phases when establishing a connection:
The following sections discuss each in
PPTP Phase 1In phase 1, the Link Control Protocol (LCP) is used to initiate the connection. This includes the negotiation of Layer-2 parameters, such as the use of authentication, compression with MPPC, encryption with MPPE, protocols, and other PPP featuresthe actual compression or encryption algorithms are negotiated in phase 4. PPTP Phase 2In phase 2, the user is authenticated to the server. PPP supports four types of authentication:
The Password Authentication Protocol (PAP) provides clear-text authentication of a user's
The Challenge Handshake Authentication Protocol (CHAP), unlike PAP, doesn't send a password between the peers; instead, only the username is sent in clear text. The user's username and password must be listed on the server. The server sends back a random challenge string and a session ID number for the PPP session. Each side takes the challenge, the session ID, and the user's password and runs them through the MD5 HMAC function, producing a digital signature. The user sends the signature to the server, which
An extension of CHAP is the Microsoft Challenge Handshake Authentication Protocol (MS-CHAP). MS-CHAP allows the server to store the digital signature of a user instead of the user's password, providing an additional level of security. MS-CHAP has other enhancements, including password expiration notification, user password changing, additional error codes, and data encryption using MPPE. Therefore, CHAP and MS-CHAP are not compatible with each other. The first implementation of MS-CHAP is referred to as MS-CHAPv1. Microsoft developed an enhanced version of MS-CHAP called MS-CHAPv2. v2 updated the encrypted authentication process, in which each device needs to authenticate to the other. Through this process, two unidirectional data pipes are established, allowing for a different encryption key for each connection between the peers.
Note The server can store the user's credentials locally, or this can be found on an external server, such as an AAA RADIUS server product. PPTP Phase 3Phase 3, an optional phase, provides control of callback functions through the use of the Callback Control Protocol (CBCP). If callback is enabled, once the authentication phase completes, the server disconnects the client and calls the client back based on the phone number the server has in its database for the client. This can be used to provide an extra layer of security, restricting users to use a specific phone to make connections, and reducing the likelihood of access attacks. This phase is performed for dialup clients only. PPTP Phase 4In phase 4, the protocols used for the data connection, which were negotiated during phase 1, are invoked. These protocols include IP, IPX, data compression algorithms, encryption algorithms, and others. Once phase 4 completes, data can now be sent across the PPP connection. PPTP ComponentsAs mentioned in the last section, PPTP uses PPP. However, it doesn't change the PPP protocol; instead, PPP is used to tunnel packets through an IP backbone. PPTP is based on a client-server architecture for remote access connectivity involving two entities:
The PAC is responsible for initiating a connection to the PNS, using LCP for negotiation, and participating with the PPP authentication process. The PNS is responsible for authenticating the PAC, handling PPP Multilink for channel aggregation and bundle management, terminating the NCP protocols, and routing or bridging the PAC's encapsulated traffic to other locations. The use of multilink is unusual in this situation because it allows the use of multiple PACs to transmit the same data stream to a single PNS.
Note
Please note that I use the word "entities" to describe the PAC and PNS, and not "devices." This is because the PAC and PNS describe roles to be
Two connections are built between the PAC and the PNS:
How PPTP WorksThis section will provide an overview of how PPTP works. PPTP is a connection-oriented protocol in which the PAC and PNS maintain a state for their connection. This session is created when the PAC initiates a PPP connection to the PNS. Two connections are built for the session: a control connection and a data connection. Once the session is established, the PAC and PNS can use GRE across the data connection to transmit user traffic. Generically, the data connection is called a tunnel. The following sections will cover these two connections in more depth, and also will cover how a PPTP session is established and used. Control Connection
The control connection is responsible for establishing, maintaining, and
There are two basic types of PPTP messages that can be used in the control connection:
A magic cookie is included in each control message. It is used to ensure that the sender and receiver are synchronized on the TCP connection. If there is a loss of synchronicity between the PAC and PNS, the TCP connection terminates immediately. Setting Up the Control ConnectionThe setup of the control connection encompasses the exchange of two initial messages:
The initiator sends the first message while the receiver responds with the second one. Table 4-1 describes the results that can be included in the reply message. Besides initiating the connection, these messages allow the PAC to share capability information with the PNS. Each PNS/PAC pair requires a separate control connection. Table 4-1. Start-Control-Connection-Reply Results
Because both the PNS and PAC can initiate a control connection, there is a possibility of a collision if both try to do it simultaneously; only one control connection can exist between the PAC and PNS. A collision occurs when both the PAC and PNS
Because there are different control versions, there is a possibility that one peer has a higher version than the other. In this case, one of two things will occur on the receiver:
Maintaining the Control Connection
Both the PAC and PNS can initiate keepalives. Keepalive messages are generated if no type of control message is received from a peer in 60 seconds. If a PAC/PNS doesn't receive an Echo-Reply in response to its request, the control connection will be terminated. Terminating the Control ConnectionThe control connection is also responsible for terminating any data connections and for the control connection itself. To terminate the control connection, two messages are used:
Both the PAC and PNS can initiate the
Table 4-2. Stop-Control-Connection-Request Reasons
Note If an invalid or misconfigured control message is received, the correct information should be logged and the control connection is automatically terminated and rebuilt to recover from the error. Tunnel Connection
The tunnel carries all user session PPP packets. GRE is used as the transport protocol for the PPP packets. The control connection determines the actual rate and buffering parameters to use to ensure that the PAC/PNS do not create
Setting Up the Tunnel ConnectionOnce the Start-Control-Connection-Request and Start-Connection-Reply messages have been exchanged for the control connection, the setup of the tunnel (data) connection is next. The following messages are possibly involved in this process:
Note
I don't like the use of the term "call" in these messages, since most people would equate it with the use of telephone calls. Remember that PPP is being used here, which is normally a dialup solution, so a lot of PPP's implementation and
Outgoing calls are messages generated by the PNS to the PAC, telling the PAC to establish a tunnel to the PNS. This connection also provides information concerning the regulation of data transmitted across the tunnel from the PAC to the PNS, such as windowing information. The outgoing reply is sent from the PAC to the PNS, with the possible results in the reply listed in Table 4-3. An interesting point about the information for the result codes is that many of these are
Table 4-3. Outgoing-Call-Reply Results
Tip
According to the RFC, the outgoing call request is made from the PNS to the PAC; however, my experience with Microsoft's implementation is that it is the reverse: The PAC initiates the outgoing call request to the PNS. A key, called a caller ID value, is placed in the tunnel packet header to
The Incoming-Call-Request message is sent by the PAC to the PNS to indicate that an inbound call is to be established from the PAC to the PNS. This message allows the PNS to obtain information about the call before it is
Table 4-4. Incoming-Call-Reply Results
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %} The Incoming-Call-Connected message is sent from the PAC to the PNS in response to the reply. Therefore, incoming calls use a three-way handshake: request, reply, and connected. Encapsulating the PayloadGRE is used to carry the PPP packets between the PAC and PNS. Figure 4-1 shows an example of a PPTP packet. As you can see, the PPP packet is encapsulated in a GRE packet, which, in turn, is encapsulated in an IP packet. The PPP packet contains the actual user data which is some protocol packet such as IP, IPX, or another type. Figure 4-1. PPTP Tunnel Packet
The GRE header used to encapsulate the PPP packet is not a standard GRE header, but has been enhanced slightly for PPTP. The main difference between the standard GRE header and the PPTP GRE header is that the PPTP GRE header has a new acknowledgment number field, which is used to determine whether or not a GRE packet(s) has been received by the tunnel endpoint. This GRE acknowledgment process has nothing to do with the actual user data packets; instead, it is used to determine packet rates for packets transmitted via the tunnel. In other words, PPTP uses a sliding window protocol for flow control of the tunneled packets by using the sequence and acknowledgment fields. The window
Maintaining the Tunnel Connection
The tunnel connection parameters, such as windowing, are negotiated when the tunnel connection is built. Likewise, the parameters can be changed for the tunnel based on current network conditions. The PAC and PNS use a Set-Link-
Tearing Down a Tunnel ConnectionWhen a tunnel connection is no longer needed, it is torn down by the PPTP devices. Two messages are exchanged to handle the teardown process:
Both the PAC and PNS can initiate a teardown of the tunnel connection. The Call-Clear-Request message is sent from the requestor, signaling that the tunnel connection is being cleared (torn down). The receiver responds with a Call-Disconnect-Notify message, indicating the status of the tunnel clear request. Example PPTP Connection
Now that I've explained the basic process and messages used to set up a PPTP connection, I'll go through a simple example of a PPTP connection being built,
Here's a brief overview of the setup of a typical PPTP session:
If no messages are received on the control connection for 60 seconds, the PNS (typically) will send Echo-Request messages to the PAC; and
Eventually the tunnel connection is torn down. Some common reasons for tearing down a tunnel (and control connection) include:
Here is an example of a PAC terminating its PPTP session to a PNS:
Issues with the Use of PPTPAs in any VPN implementation, you'll have to deal with certain issues for PPTP to perform optimally and with minimal problems. Here are some common issues you'll need to deal with:
The following sections will address these issues. Fragmentation Problems
The MTU of the PPP information that is encapsulated in GRE is 1,532 bytes. On top of this, you have the GRE and the IP headers. The GRE header is 16 bytes in length and the IP header is between 20 and 60 bytes, depending on whether or not the IP Options field is used. Therefore, the total length of a PPTP tunneled packet could be 1,608 bytes. And this doesn't even count the outer Layer-2 header. If Ethernet II was used, you would need to add an additional 20 bytes,
Because most devices use an MTU size of 1,500 bytes, this can cause these devices to have to fragment each PPTP packet across two
More than 60 percent of the throughput problems I've dealt with concerning VPNs have dealt with fragmentation problems. Therefore, you'll definitely want to adjust your PAC's and PNS's MTU size to a better size. Many
Security ConcernsThere are three security concerns you should consider when using PPTP:
There is no security protection for the TCP control connection used by PPTP: the messages sent between the PAC and PNS have no authentication or data integrity check. Therefore, it is susceptible to data manipulation and session hijacking attacks. For example, an attacker could create fake control messages or alter valid ones while the messages are in transit between the PAC and PNS. Likewise, an attacker could execute a session hijacking attack, taking over the control connection and pretending to be the PAC, PNS, or both.
Another security concern is that the IP, GRE, and PPP header information is not protected in the tunnel connection. Therefore it is possible for an attacker to eavesdrop on the tunnel connection and modify these, or
Caution Be aware that only the PPP payload is encrypted with PPTP: any other information, such as the control connection and the headers of the tunnel connection, are not protected. Plus, MPPE supports RC-40 and RC-128 for encryption, both of which are known to be vulnerable. Address Translation IssuesAddress translation can pose a problem with the use of PPTP. There are two general types of translation: NAT and PAT. NAT poses no problems for both the control and tunnel connections because the headers in these are not protected by an HMAC function, and NAT changes only source or destination IP addresses.
However, PAT can create problems. Because the control connection uses TCP, and the TCP header isn't protected, the control connection easily can be established through an address translation device performing PAT. The same cannot be said about the tunnel connection. Because the tunnel connection uses GRE, a Layer-3 protocol, and GRE doesn't have port
Some vendors have implemented proprietary solutions to get around this problem. Most vendors will use the caller ID field in the GRE header to denote different connections. However, if more than one device was using the same caller ID in the tunnel header, the address translation device would have to translate the caller ID values to ensure uniqueness. This performs a similar function to what PAT does with TCP or UDP port numbers. Remember that not all address translation devices support this function, and your PPTP connections might break when going through address translation devices.
Note PPTP isn't used much anymore because of security concerns regarding MS-CHAPv1 and MS-CHAPv2 being needed as part of the MPPE generation process; moreover, its two encryption algorithms are known to be vulnerable.
|