Method and apparatus for automatically detecting virtual circuit settings and encapsulation types in a DSL network

Automatic detection of the virtual circuit setting and encapsulation type of a DSL line. A DSL modem determines the correct virtual path identifier (VPI) and virtual channel identifier (VCI) by sending OAM loopback requests to different VPI/VCI pairs until a valid loopback reply is received. PPPoA encapsulation is detected when a valid reply is received to a PPP LCP configuration request or echo request. PPPoE encapsulation is detected when a valid reply is received to a PPP LCP termination request or a PPPoE discovery offer (a PADO packet) is received in response to a PPPoE discovery initiation request (a PADI packet).

FIELD OF THE INVENTION

The present invention relates to DSL networks and, more particularly, relates to automatic detection of the virtual circuit settings and encapsulation type being used on a DSL line.

BACKGROUND OF THE INVENTION

Digital subscriber line (DSL) technology permits high-speed data transmission and Internet connectivity over conventional copper telephone lines. Conventional POTS (“Plain Old Telephone Service”) telephone lines were constructed to transmit human voice signals having a frequency range of 0-3.4 kHz. This is only a small fraction, however, of the bandwidth that can be supported by a copper wire. DSL technology uses this excessive available bandwidth for high-speed transmission of data. One of the more commonly used forms of DSL is asymmetric DSL (ADSL). ADSL recognizes the fact that most Internet users receive (download) much more information than they send (upload), and reserves the majority of the available channels for downstream transmission. A typical ADSL system provides downstream bit rates of up to 9 Mbps and upstream bit rates of up to 1 Mbps.

In conventional DSL networks, a virtual circuit for data transmission is established between a customer premises equipment (CPE) modem and a central office (CO) modem. A virtual circuit is a communications link that appears to the user to be a dedicated point-to-point circuit. It is identified by two numbers: the VPI (virtual channel identifier) and VCI (virtual channel identifier). When a customer first installs and initializes a CPE modem, the first information that is needed is the permanent virtual circuit settings that the CPE modem will need to communicate with the CO modem. In known configurations, the VPI/VCI identifiers are either pre-configured in the modem or are provided to the user who must manually enter the numbers. It would be desirable if the CPE modem could automatically sense and determine the correct VPI/VCI settings upon initial installation and initialization of the modem.

In addition to establishing a virtual circuit between the CPE modem and CO modem, a protocol defining the rules for sending and receiving information over the circuit must be established. In the ISO (International Organization for Standards) model, which defines a layered division of communications between applications on two computers or hosts, this type of protocol is known as a data link layer (layer 2) protocol. The point-to-point protocol (PPP), as defined in RFC 1661, is a popular data link layer protocol for connecting hosts by phone line. PPP provides a method for transmitting data over serial point-to-point links and has three main components: a method for encapsulating data; a link control protocol (LCP) for establishing, configuring and testing the data link connection; and a family of network control protocols (NCPs) for establishing and configuring different network layer protocols.

A PPP frame or packet, once formed, is itself encapsulated or framed for transport over the DSL network. Two encapsulation methods are of particular importance to DSL: PPP over Ethernet (PPPoE) and PPP over ATM (PPPoA). The encapsulation type that will be used, as with the virtual circuit settings, is typically programmed in or must be manually entered in the CPE modem at initialization. It would be advantageous if the CPE modem could automatically detect the type of encapsulation being used on its associated DSL line.

SUMMARY OF THE INVENTION

One embodiment of the invention is a DSL modem having means for automatically detecting the correct virtual circuit settings when the modem is connected to a DSL line, and means for automatically detecting the encapsulation type being used on the DSL line.

Another embodiment of the invention is operating software for a DSL modem that detects the correct virtual circuit settings of a connected DSL line by sending loopback requests over different virtual circuits until a valid loopback reply is received.

Another embodiment of the invention is operating software for a DSL modem that determines that the encapsulation type being used by a connected DSL line is PPPoA when a valid reply is received in response to a PPP/LCP configuration or echo request; and determines that the encapsulation type is PPPoE when a valid reply is received in response to a PPPoE discovery initiation request or a PPP/LCP termination request.

Another embodiment of the invention is a computer readable medium having computer executable instructions for automatically detecting the correct DSL virtual circuit setting and encapsulation type. The correct virtual circuit setting is detected by sending loopback requests over different virtual circuit settings until a valid loopback reply is received. PPPoA encapsulation is detected when a reply to a PPP/LCP configuration request or echo request is received. PPPoE encapsulation is detected when a reply to a PPP/LCP termination request or a PPPoE discovery initiation request is received.

Another embodiment of the invention is a method for determining the correct virtual circuit settings for a DSL modem. The method comprises the steps of choosing a virtual circuit setting and sending a loopback request over the chosen virtual circuit setting. If a reply to the loopback request is received, the chosen virtual circuit setting is stored as the correct virtual circuit setting. If a reply to the loopback request is not received, different virtual circuit settings are chosen and loopback requests sent until a reply is received.

Another embodiment of the invention is a method for determining whether a DSL line is using PPPoA encapsulation. PPP/LCP configure-request and echo-request packets are sent over the line. If replies to either are received, the encapsulation type is stored as PPPoA.

Another embodiment of the invention is a method for determining whether a DSL line is using PPPoE encapsulation. A PPPoE fast connect recovery command and PADI packet are sent over the line. If a reply to either is received, the encapsulation type is stored as PPPoE.

DETAILED DESCRIPTION

FIG. 1is a block diagram of a typical DSL network100. Alternate network configurations are possible, but an exemplary network is described in order to illustrate the environment in which the present invention is used. Subscriber loop102, which is typically a POTS copper loop pair, carries traffic between a customer premises (CP)104and a telephone company “central office” (CO)106. Central office106is a telephone company facility or other DSL service provider that manages multiple subscriber loops. A customer premises equipment (CPE) modem108is located within customer premises104and conveys DSL data signals to and from loop102. In an ADSL context, CPE modem108may be referred to as an ATU-R (“ADSL Transmission Unit-Remote”). CPE modem108is connected to one or more computers110, servers or other customer equipment via an appropriate interface, such as an Ethernet interface. CPE modem108demodulates signals received from CO106via loop102and provides the demodulated signals to computer110, and modulates signals from computer110to be transmitted over loop102to CO106.

A network interface device (NID)112may optionally be deployed between subscriber loop102and the wiring inside customer premises104in order to isolate the customer's equipment from the telephone company network. NID112is typically placed at the side of the customer's home. Where a NID is used, it will typically contain a splitter or filter to segregate the signal received over loop102between CPE modem108and one or more standard telephones or other POTS equipment114. The lower voice band frequencies are passed to telephones114while the higher frequency data signals are passed to CPE modem108. Alternatively, in a “splitterless” configuration, a NID is not utilized and CPE modem108connects directly to loop102. Low pass filters are connected to telephones114to admit only the POTS voice signal. A splitterless configuration is advantageous in that installation can typically be done by the customer and no visit from a technician for NID installation is required.

CO modem116terminates the end of the ADSL link opposite CPE modem108and is located within CO106. In an ADSL context, CO modem116may be referred to as an ATU-C (“ADSL Transmission Unit-Central Office”). CO modem116is typically one of a bank of modems contained within a DSL access multiplexer (DSLAM)118in CO106. DSLAM118connects to multiple subscriber loops102via main distribution frame (MDF)120. DSLAM118, with its bank of CO modems, connects the subscriber loops, via appropriate switchers and routers, to outside broadband data networks122, such as the Internet. CO106also provides access to narrowband voice/analog networks124, such as the public switched telephone network (PSTN), to facilitate transmission of POTS signals over subscriber loops102.

In conventional DSL networks, a virtual circuit for data transmission is established between customer premises104and central office106. A virtual circuit is a communications link that appears to the user to be a dedicated point-to-point circuit. Most networks in use today use permanent virtual circuits (PVCs), as opposed to switched virtual circuits (SVCs). A PVC is a fixed network path between nodes on a network (in the case of a DSL system, the CPE modem and CO modem) that is always available. A PVC is typically identified by two numerical fields: a virtual path identifier (VPI) and a virtual channel identifier (VCI).FIG. 2is a conceptualization of a permanent virtual circuit130. Virtual path132can be thought of as a pipe, identified by a VPI, containing a plurality of virtual channels134, each of which is identified by a unique VCI. Thus, permanent virtual circuit130is described by two identifiers: a VPI indicating the virtual path132; and a VCI indicating the virtual channel134within that path.

When a customer first installs and initializes a CPE modem, the first information that is needed is the permanent virtual circuit settings that the CPE modem needs to communicate with the CO modem. Without knowledge of the VPI/VCI identifiers, a virtual circuit cannot be established for data exchange. In known configurations, the VPI/VCI identifiers are either pre-configured in the CPE modem or are provided to the user who must manually enter the numbers.

The present invention provides a virtual circuit autosense feature for automatically identifying the correct virtual circuit settings upon initial installation and initialization of the CPE modem. Key to identification of the virtual circuit settings is a “loopback request”, which is a diagnostic test method whereby a loopback request received by a receiving peer (in the present invention, a CO modem) is replicated and retransmitted to the sending peer (in the present invention, a CPE modem). In one implementation, the loopback request is an OAM (Operations, Administration and Maintenance) loopback request as specified in ITU (International Telecommunications Union) specification number ITU-T I.610. The intended usage for an OAM loopback request is to determine whether a DSL loop is working properly. In accordance with the present invention, the loopback request is used in a manner to determine the virtual circuit VPI and VCI numbers.

Essentially, OAM loopback requests are sent over potentially correct virtual circuits settings until a valid reply is received, indicating that the virtual circuit settings are correct.FIG. 3is a flow diagram illustrating a method140for determining the virtual circuit settings. In step142, a CPE modem is installed and initialized at the customer premises. In step144, the settings for a potentially operative virtual circuit are chosen. As described, the virtual circuit is identified by a VPI/VCI pair. In some circumstances, the modem manufacturer or ISP may have identified particular VPI/VCI numbers that are most likely to work. In such circumstances, step144preferably begins with the virtual circuit identifiers most likely to be correct.

In step145, a loopback request is sent using the chosen virtual circuit settings. In one implementation, the request is an OAM F5 loopback request. As will be described with reference toFIG. 4, the loopback request is implemented by sending an OAM loopback cell150containing the chosen VPI/VCI identifiers. Step146determines whether a valid reply to the loopback request has been received. A valid reply takes the form of a replica of the loopback cell that was sent in step145. Steps145and146may be repeated several times for each VPI/VCI pair. If a valid reply has been received, the correct virtual circuit has been identified and the corresponding VPI/VCI identifiers are stored (step148). Hence, method140needs to be carried out only the first time that the modem is turned on. Subsequent sessions simply use the stored VPI/VCI identifiers. If a valid reply was not received, indicating that the VPI/VCI pair was incorrect, the method returns to step144to choose a new VPI/VCI pair. Again, if likely virtual circuit identifiers are known, these are tried first.

FIG. 4depicts an OAM loopback cell150formatted in accordance with ITU-T I.610. Other loopback cell implementations are possible and are within the scope of the present invention. Loopback cell150implements the loopback request of method140. Loopback cell150comprises header field152, OAM type field154, function type field156, function specific field158and CRC-10 field160.

Header field152is a standard, 5-byte ATM cell header comprising GFC field170; VPI field172; VCI field174; PTI field175; CLP field176; and HEC field178. GFC (generic flow control) field170is a four-bit field for implementing flow control functions. VPI (virtual path identifier) field172is an eight-bit field identifying the virtual path over which cell150should be sent. VCI (virtual channel identifier) field174is a sixteen-bit field identifying the virtual channel over which cell150should be sent. Hence, the VPI/VCI identifiers chosen in method step144are inserted into VPI field172and VCI field174. PTI (payload type identification) field175is a three-bit field distinguishing the various types of ATM management and user cells. CLP (cell loss priority) field176is one bit indicating two levels of priority for ATM cells (0=higher priority; 1=lower priority). HEC (header error control) field178is the last byte of the header and is used for checking header integrity.

OAM type field154is a four-bit field indicating the cell's management function, such as fault management (0001), performance management (0010) or activation/deactivation (1000). Loopback is a fault management function, so field154would be set to “0001” to implement method140. Function type field156is a four-bit field indicating the actual function performed by the cell. Field156is set to “1000” for cell loopback. Again, it is noted that these particular settings, as well as the loopback cell format in general, are simply that which is specified in ITU-T I.610 and are not critical to the present invention. CRC-10 field160is a ten-bit cyclic redundancy check field that detects errors in all bits of cell150except for field160itself.

Function specific field158is a 45-byte field containing the body of the message. Field158has a unique format for each cell/function type.FIG. 4depicts the format for a loopback cell. Loopback location indication field162is an eight-bit field. The first bit of field162is set to zero or one depending on the direction: it is set to one for outgoing command cells, and is changed to zero for incoming response cells. In method140, the first bit of field162is set to one in step145when the loopback request is sent, and is changed to zero in step146when a response cell is received. Correlation tag field164matches outgoing command cells with associated incoming response cells. Loopback location ID field165identifies the VC segment where loopback is to occur, and source ID field166identifies the source of a loopback cell.

In one implementation of method140, a CPE modem sends a loopback cell150over a DSL line, with VPI field172and VCI field174set as discussed with respect to method140. If a replica of cell150is received in response, the VPI/VCI settings contained in cell150are the correct settings and are stored. If a reply is not received, a loopback cell with different VPI/VCI settings is sent and the method is repeated.

In addition to establishing a virtual circuit between the CPE modem and CO modem, a protocol defining the rules for sending and receiving information over the circuit must be established. In the ISO (International Organization for Standards) model, which defines a layered division of communications between applications on two computers or hosts, this type of protocol is known as a data link layer (layer 2) protocol. The point-to-point protocol (PPP), as defined in RFC 1661, is a popular data linke layer protocol for connecting hosts by phone line. PPP provides a method for transmitting data over serial point-to-point links and has three main components: a method for encapsulating data; a link control protocol (LCP) for establishing, configuring and testing the data link connection; and a family of network control protocols (NCPs) for establishing and configuring different network layer protocols.

A PPP frame180formatted in accordance with RFC 1661 is illustrated inFIG. 5. Protocol field182is one or two bytes in length and contains a value that identifies the data encapsulated in payload field184. Payload field184is a variable number of bytes in length and contains the data to be transmitted. A padding field186having an arbitrary length may also be provided.

PPP frame180, in turn, must be encapsulated or framed for transport over the DSL network. Two encapsulation methods are of particular importance to DSL: PPP over Ethernet (PPPoE) and PPP over ATM (PPPoA). The encapsulation type that will be used, as with the VPI/VCI identifiers, is typically not known and must be programmed or manually entered into the CPE modem at initialization. The present invention provides an encapsulation autosense feature that automatically identifies the type of encapsulation being used on a particular DSL line. Before describing the encapsulation autosense feature, one implementation of each encapsulation (PPPoE and PPPoA) format will be briefly described. It is important to note, however, that alternate implementations of the PPPoE and PPPoA protocols may be employed and are within the scope of the present invention.

In many access technologies, the most cost effective method for attaching multiple hosts to the customer premises equipment is via Ethernet. PPPoE, defined in RFC 2516, is a protocol for encapsulating PPP frames in Ethernet frames. Many Internet service providers use PPPoE to provide residential DSL broadband Internet access. To provide a point-to-point connection over Ethernet, the first step is a discovery stage in which each peer learns the MAC (medium access control) address of the other peer, and in which a unique session identifier is established. This discovery stage uses specially formatted PPPoE packets.

To initiate discovery, a PPPoE client sends a PPPoE active discovery initiation (PADI) packet to the broadcast Ethernet address. When an access concentrator receives a PADI packet, if it is willing to set up a session, it sends a PPPoE active discovery offer (PADO) packet to the unicast Ethernet address of the client that sent the PADI packet.

Since there can be more than one access concentrator within the broadcast range of the client, it may receive more than one PADO packet in response to its PADI packet. The client picks the access concentrator with which it would like to start a session, and sends a PPPoE active discovery request (PADR) packet to the unicast Ethernet address of the access concentrator. If the access concentrator agrees to set up a session, it assigns a unique session number and sends this number to the client in a PPPoE active discovery session-confirmation (PADS) packet.

Once each side knows the other's Ethernet address and a session number has been established, a PPPoE session can begin. PPPoE session frames consist of PPP frames encapsulated within Ethernet frames. A PPPoE frame200formatted in accordance with RFC 2516 is illustrated inFIG. 6. Other PPPoE frame formats are possible and are within the scope of the present invention. PPPoE frame200is an Ethernet frame in which the payload210is a PPP frame212with a PPPoE header220. As described with respect toFIG. 5, PPP frame212includes a protocol field214, a payload field216and an optional padding field218. PPPoE header220comprises four-bit version field222(set to 0x1 for the current version of PPPoE (RFC 2516)); four-bit type field224(set to 0x1 for the current version of PPPoE (RFC 2516)); an eight-bit code field225(set to 0x00 for the session stage and various values for the different discovery frame types); a sixteen-bit session ID field226containing the session ID number established during the discovery stage; and a sixteen-bit length field228indicating the length of PPP frame212.

PPPoE frame200, in addition to payload210, has an Ethernet header including destination field202, source field204and frame type field205. Destination field202contains a unicast Ethernet address in the session stage and either a unicast or broadcast address in the discovery stage. Source field204contains the unicast Ethernet address of the source (CPE) device. Ethernet frame type field205is set to 0x8863 for the discovery stage and to 0x8864 for the session stage. PPPoE frame200may also include a padding field206and a checksum field208.

PPPoA is an alternative encapsulation method to PPPoE. PPPoA is defined in RFC 2364 and governs the use of the PPP protocol over a DSL access circuit running the ATM protocol. ATM adaptation layer 5 (AAL5) is used to frame PPP encapsulated packets, and the AAL5 frame or “protocol data unit” (PDU) is then segmented into ATM cells for transport over a DSL line or reassembled from ATM cells received over a DSL line.FIG. 7illustrates a PPPoA frame230formatted and segmented into ATM cells250in accordance with RFC 2364. Other PPPoA frame formats are possible and are within the scope of the present invention. PPPoA frame230is an AAL5 frame in which the payload232is a PPP frame having a protocol field234, a payload field236and an optional padding field238(as previously described). Payload232may also be referred to as a CPCS-PDU (common part convergence sublayer-protocol data unit) payload, and may have a length of 0-65,535 bytes.

PPPoA frame (or CPCS-PDU)230is segmented into or reassembled from a plurality of 48-byte ATM payloads255to which are attached 5-byte ATM headers260to form a plurality of 53-byte ATM cells250. Padding field248pads frame230to fit exactly into ATM cells250such that the last 48-byte payload255created will have trailer240right-justified in the cell. The fields of ATM header260are the same as described with respect toFIG. 4: GFC field262; VPI field263; VCI field264; PTI field265; CLP field266; and HEC field268.

FIG. 8is a flow diagram illustrating a method270for determining whether a DSL network is using PPPoA encapsulation. In one embodiment of the present invention, method270is carried out after method140(FIG. 3) has identified the virtual circuit settings of the DSL line. Method270utilizes two types of link control protocol (LCP) packets recognized under the PPPoA protocol: configure-request packets and echo-request packets. Before proceeding with the description of method270, the general format of LCP packets will be described.

FIG. 9is a diagram illustrating the format of a LCP packet280under RFC 1661. Again, alternate formats may be used and still fall within the scope of the present invention. Both configure-request packets and echo-request packets are formatted as set forth inFIG. 9. Packet280includes code field282; identifier field284; length field286; and data field284. Code field282is a one-byte field that identifies the kind of LCP packet (i.e., configure-request, echo-request and so on). Identifier field284is a one-byte field that aids in matching requests and replies. Length field286is a two-byte field that indicates the length of the LCP packet, including the code, identifier, length and data fields. Data field288is a field having a length of zero or more bytes, as indicated by the length field, and having a format determined by the code field.

Exactly one LCP packet280is encapsulated in the payload of a PPP frame. With reference toFIG. 5, packet280is encapsulated in payload184of PPP frame180. Protocol field182is set to hex c021 to indicate that payload184contains a LCP packet. With reference toFIG. 7, PPP frame180(containing encapsulated LCP packet280) is encapsulated in payload232of a PPPoA frame230, which is then segmented into individual ATM cells250and sent from the CPE modem to the CO modem.

Referring again toFIG. 8, in step272, a LCP configure-request packet is sent from the CPE modem to the CO modem along the identified virtual circuit. LCP configure-request packets are intended for use by a CPE modem that wishes to open a connection. In one implementation, the LCP configure-request packet is configured as packet280inFIG. 9, with code field282set to “1” for configure-request, and data field288containing a list of zero or more configuration options that the sender desires to negotiate. Since the CPE modem is not actually attempting to negotiate a connection, but rather, is seeking only to determine whether PPPoA encapsulation is being used, the exact content of data field288is not important. In one implementation, field288contains the most widely supported configuration options.

Under the PPP LCP, a CO modem receiving a configure-request packet must transmit an appropriate reply. Hence, if some form of configuration reply packet is received (step273), the CPE modem knows that PPPoA encapsulation is being used (step274) since the configuration request was understood by the CO. In most circumstances, where all options and values in the configure-request packet are acceptable to the CO, a configure-ack packet will be sent in response. A configure-ack packet is essentially a replica of the configure-request packet, except that code field282is set to “2”. However, even if there is a problem with the configure-request packet and a configure-nak or configure-reject packet is received in response, this in itself is still enough to indicate to the CPE modem that the request was understood and hence that the encapsulation type is PPPoA.

If no reply to the configure-request packet is received, in step275, the CPE modem sends a LCP echo-request packet. The echo-request packet is a link management packet that is intended as an aid for debugging or testing an already-opened link. Method270uses an echo-request packet to address the scenario where there is a brief line loss after the configure-request packet is sent in step272. For example, a modem user may accidentally or intentionally power a modem off after its initial powering on, and subsequently power it on again. Or, there may be a very brief line loss or severe noise in the line. While this may seem to be an innocuous event, it can (without step275) prevent the CPE modem from properly ascertaining whether PPPoA encapsulation is being used.

When the CPE modem is initially powered on, a configure-request packet is sent in step272. A CO modem may receive the configure-request packet and send a configure-reply packet in response. If the CPE modem loses its connection immediately after sending its configure-request packet, however, the configure-reply packet sent by the CO modem may not be received (since the CPE modem lost its connection). Hence, the CPE modem still has not determined the encapsulation type. If the CPE modem quickly tries to re-establish a connection, the line loss may not have yet registered at the CO. This is because a server typically has a timeout period, which may last several minutes or longer, during which it continues to act as if there is a connection, even though none exists. When step272is repeated, the CO will refuse to answer the configure-request packet because it is operating as if there is already a connection (because of the first configure-request). Hence, on the second attempt to establish a line, no reply will be received to the configure-request, potentially leading to an incorrect determination that PPPoA encapsulation is not being used.

The use of an echo-request packet in step275addresses this potential problem. If the server is in a timeout period because of the aforementioned scenario, it will still be required to send an echo-reply packet in response to an echo-request packet (since it believes there is an open connection). If an echo-reply packet is received (step276), the CPE modem has confirmed that PPPoA encapsulation is being used (step277). The echo-request and echo-reply packets take the form of packet280inFIG. 9, with code field282being set to “9” for echo-request and “10” for echo-reply. If no reply packets are received in response to either the configure-request or echo-request packets, the CPE modem concludes that PPPoA encapsulation is not being used (step278).

Steps272/273(configure-request) and275/276(echo-request) may be performed in reverse order, if desired. That is, an echo-request packet may be sent initially to address the timeout scenario. If an echo-reply is received, the CPE modem knows that PPPoA encapsulation is being used. If no echo-reply is received, the CPE modem sends out a configure-request packet. Additionally (and preferably), the configure-request and echo-request packets can be sent out simultaneously or in either order, in rapid succession, and multiple times in order to minimize response time. A valid reply to any of the sent packets will indicate PPPoA encapsulation.

This novel use of configure-request and echo-request packets to determine whether PPPoA encapsulation is being used is further advantageous in that the method may be used before the user has set up his ISP account and billing information, or has received an ID and password required to establish a connection. The configure-request and echo-request packets do not require this information. So, the CPE modem can determine the encapsulation type without having established an actual PPP session.

FIG. 10is a flow diagram illustrating a method290for determining whether a DSL network is using PPPoE encapsulation. Method290for sensing PPPoE encapsulation is conceptually very similar to method270for sensing PPPoA encapsulation. Method290may be carried out after method140(FIG. 3) has identified the virtual circuit settings, and may be carried out before, after or concurrently with method270for detecting PPPoA encapsulation. Method290utilizes LCP terminate-request packets under the PPP protocol as well as PADT and PADI discovery packets under the PPPoE protocol.

As in PPPoA detection, the scenario of a lost connection leading to a timeout at the CO-side must be addressed. The present invention provides a function which has been termed “fast connect recovery” under which information about the last successful connection is saved in the CPE modem's memory. In step291, a LCP terminate-request packet is sent from the CPE modem to the CO modem using this stored information. LCP terminate-request packets provide a mechanism for closing (and re-establishing) an open connection. The LCP terminate-request packet is configured as packet280inFIG. 9, with code field282set to “5” for terminate-request. The terminate-request packet, in turn, is encapsulated along with a PPPoE header within an Ethernet frame, as described with reference toFIG. 6.

Under the PPP LCP, a CO modem receiving a terminate-request packet must transmit a terminate-ack packet in response. Hence, if a terminate-ack packet is received (step292), the CPE modem knows that PPPoE encapsulation is being used (step293) since the PPPoE-encapsulated terminate-request was understood by the CO. If a terminate-ack packet is not received, in step294, a PADT (PPPoE Active Discovery Terminate) packet is sent. A PADT packet is defined under the discovery stage of the PPPoE protocol and serves to make sure that, if a connection did exist, it is terminated. With reference toFIG. 6, for any Ethernet discovery packet, including PADT packets, frame type field205is set to 0x8863. For a PADT packet, destination field202is set using the address information stored in the CPE modem from the last connection. Code field225of the PPPoE header is set to 0xa7. Finally, although other types of discovery packets use TAGs (FIG. 11), no TAG is required for a PADT packet.

Together, the use of a PPP/LCP terminate packet (step291) and a PPPoE PADT packet (step294) comprises “fast connect recovery”—the CO modem is told to disconnect any connections that it thinks exists and prepare to accept a new connection. Moreover, if a PPPoE terminate-ack packet is received during this process, the CPE modem knows that PPPoE encapsulation is being used and the method needs to go no further. In step295, after fast connect recovery, the CPE modem sends a PADI (PPPoE Active Discovery Initiation) packet. For a PADI packet, destination field202is set to the broadcast address, code field225is set to 0x09 and the session ID field226is set 0x0000.

In one implementation, payload field216of the PADI packet must contain at least one TAG. A TAG300formatted as set forth in RFC 1661 is illustrated inFIG. 11. TAG300includes a sixteen-bit TAG_TYPE field302and a sixteen-bit TAG_LENGTH field304indicating the length in bytes of TAG_VALUE field306.

When a CO server receives a PADI that it can serve, it must reply by sending a PADO packet. In one PPPoE implementation, destination field202of the PADO packet is the address of the CPE modem that sent the PADI, code field225is set to 0x07 and session ID field226is set to 0x0000. It contains a TAG300indicating the CO server's name, as well as a duplicate of the TAG received in the PADI. If a PADO packet is received (step296), the CPE modem has confirmed that PPPoE encapsulation is being used (step297). If neither a PADO packet or a termination-ack packet is received in response to either the PADI or terminate-request packets, the CPE modem concludes that PPPoE encapsulation is not being used (step298).

Steps291-294(fast connect recovery) and295-297(PADI) may be performed in any order or simultaneously, in rapid succession, and multiple times in order to minimize response time. A valid reply to any of the sent packets will indicate PPPoE encapsulation. As with PPPoA detection, the use of these packets is advantageous as no established account or password information is required.

The methods of the present invention used to determine the virtual circuit settings and encapsulation types are implemented by software residing in the CPE modem or in a computer operating the modem. The software is preferably configurable and is written in a software language known to those of ordinary skill in the art, such as “C”.

While various embodiments of the invention have been described, it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible that are within the scope of this invention. Similar methods may be used, for example, to detect encapsulation types other than PPPoA and PPPoE.