Summary of the invention
The object of the invention is to provide a kind of PPPoE protocol message transfer method, can use same MAC Address and BAS to carry out session according to a plurality of clients under the network equipment of this method realization.
A kind of PPPoE protocol message transfer method, comprise: a) find the stage at PPPoE, up direction, PPPoE protocol massages source MAC from some clients is set to this machine MAC Address, and client-side information is carried in the PPPoE protocol massages, down direction is according to relative client information configuration PPPoE protocol massages in the PPPoE protocol massages that returns; And set up the conversation recording table for each client PPPoE; B) at the PPP session stage, carry out up PPPoE data message source MAC according to the conversation recording of being set up and replace, descending PPPoE data protocol message target MAC (Media Access Control) address is replaced, and transmits the PPPoE data message.
Preferably, described conversation recording table comprises at least: client-side information, pppoe session sign.
Preferably, described conversation recording table further comprises the PPPoE MAC address of server.
Preferably, described conversation recording table further comprises the relaying conversation tag, and described PPPoE protocol message transfer method further will be kept at the conversation recording table from the relaying conversation tag value of client protocol message and be replaced in corresponding returned packet.
Wherein, described client-side information can be a client mac address.
Preferably, during described PPPoE protocol massages was transmitted, client-side information was carried on PPPoE protocol massages relaying conversation tag.
Preferably, during described PPPoE protocol massages is transmitted, when described PPPoE message is when effectively finding the termination message, further to delete the conversation recording of being set up between corresponding client of this message and the PPPoE server.
By the foregoing invention method, network access equipment can be to all PPPoE messages of being transmitted by using limited MAC Address, thereby needed tabling look-up the time when having reduced the Ethernet switch among the EMAN and carrying out data forwarding improved forward efficiency; In addition, fewer at the mac address table quantity of existing BAS and Ethernet switch, as to be unfavorable for extensive PPPoE/PPPoA user access has solved above-mentioned limitation well by the present invention; In the present invention's realization, be example with DSLAM, by the subscriber equipment MAC Address is replaced with this machine MAC Address, as the MAC Address of access line card, thereby avoided the subscriber equipment MAC Address to clash at the neutralize MAC of other network equipments of EMAN.
Embodiment
Below in conjunction with accompanying drawing, preferred implementation of the present invention is described in detail.
Fig. 2 is the pppoe session flow chart between a kind of typical subscriber's main station 11 and the BAS 15, and it comprises PPPoE and finds stage and two stages of PPP session.
(1) PPPoE finds the stage: purpose is the MAC Address that obtains the PPPoE server of PPPoE terminating end BAS, and sets up unique PPP Session ID (SESSION_ID) between and this PPPoE server.Discovery stage session step comprises:
PADI of subscriber's main station broadcasting (effectively finding initial) message is sought BAS, and the PADI message must comprise the label of a service name type (Service Name) at least, is required the service that provides to show subscriber's main station.
One or more BAS (only illustrating among the figure) of subscriber's main station requirement that can provide send PADO (effectively finding provides) message.
Subscriber's main station is selected a suitable BAS, sends PADR (unicast session request) message to inform selecteed BAS, must state to BAS requested service kind among the PADR.
Selecteed BAS begins to subscriber's main station distributes a unique Session_ID after receiving the PADR message, starts the ppp state machine with preparation beginning PPP session, and sends a PADS (session confirmation message).
In addition, PPPoE also has a PADT (effectively find stop) message, and whenever it can being sent by subscriber's main station or BAS after session is set up, to stop pppoe session.
(2) PPP session stage: after subscriber's main station was received the PADS message, both sides entered the PPP session stage.At the Session_ID of session stage must be the value of being distributed in the discovery stage, and the loading zone of PPPoE data (PPP Data) message comprises a PPP frame, carries out the process such as link configuration, negotiation, exchanges data of PPP layer.
In conjunction with illustrated in Figure 1, the Network Termination Type 12 between subscriber's main station and the BAS, network access equipment 13, too network switch 14 etc. will provide the forwarding of PPPoE protocol massages.
Fig. 3 is the frame format of PPPOE, and its detailed description can only be done simple declaration here with reference to relevant ietf standard:
Type 31: represent during for 0x8863 that PPPoE finds the stage; Represent the PPP session stage during for 0x8864.
Code 32: be used to represent the type of message between subscriber's main station and the BAS, represent a PADI message during for example for 0x09; Represent a PADO message during 0x07, represent the PPP session stage during for 0x00 ...
SESSION_ID33: be the no value of symbol of a network bytes preface, this value is a fixed value concerning a given PPP session, and has defined a PPP session practically with client address and destination address.
Tag types 34: be used for other agreement purposes definition, for example: for 0x0101 represents the service name type label of (type service that can provide to subscriber's main station is provided); The label of representing a BAS Broadband Access Server title for 0x0102; For 0x0110 represents a relaying conversation tag ... above-mentioned every kind of label also has tag length, label value except tag types 34.
Below, we are that example is described further PPPoE protocol message transfer method between client and the BAS with DSLAM in conjunction with Fig. 4.
Find the stage at PPPoE, DSLAM notes the pairing client-side information of this message, as client mac address when obtaining from client PADI (perhaps PADR) message; DSLAM further is encoded to client-side information in PADI (perhaps PADR) message that mails to BAS, and PADI ' (perhaps the PADR ') message after will change then with the source MAC that this machine MAC Address (as the MAC Address of active user's ply-yarn drill) is replaced PADI (perhaps PADR) message is delivered to the PPPoE Server that BAS holds.Behind the PADO ' (perhaps PADS ') that receives from PPPoE Server response, client-side information according to slavish copying in this message finds former client mac address, after DSLAM replaces the target MAC (Media Access Control) address of PADO ' (perhaps PADS ') message with the former client mac address that obtains then, and further the client-side information coding in this message of deletion and will change after PADO (perhaps PADS) message pass to client.
DSLAM can set up the conversation recording table for each client pppoe session of setting up or setting up, as shown in Figure 5, its conversation recording structure needs to comprise client-side information at least, SESSION_ID thinks unique PPP session of definition between each client and the PPPoE server; When having a plurality of PPPoE server among the EMAN, this conversation recording structure also needs further to comprise the PPPoE MAC address of server.
Preferably, described client-side information both can be aforementioned client mac address, also can comprise port numbers or other relevant information or their combination among the DSLAM that links to each other with this client, as long as it can represent this client PPPoE protocol massages uniquely.So, the customer information of carrying in the PPPoE message can be a pppoe session recording indexes of this client of unique identification, and DSLAM can determine the client-side information that PADO ' (perhaps PADS ') needs configuration to transmit according to this recording indexes.
Preferably, up PPPoE message forwarding can be used PPPoE protocol massages relaying conversation tag carrying client client information to client; But be not precluded between DSLAM and the BAS new tag types of agreement and carry above-mentioned client-side information, as long as the client-side information of slavish copying from PADI (perhaps PADR) is provided in the PPPoE message (PADO ' or PADS ' as described above) that BAS returns.
Preferably, there has been the relaying conversation tag if find in the stage protocol message, according to agreement among the RFC 2516, or else forwarding unit must increase new relaying conversation tag, but we can increase a relaying label option in the client session record sheet, transmit after the relaying conversation tag recorded and stored of the PPPoE message (PADI or PADR as described above) before will transmitting from client is replaced in the conversation recording table and to PPPoE message (PADO ' or PADS ' as described above) the corresponding relay label that BAS returns again.
After receiving PADS ', it records the SESSION_ID in the message in the corresponding client session record of conversation recording table, so, DSLAM can be unique PPP session of definition between each client and the PPPoE server. as previously mentioned, when having a plurality of PPPoE server among the EMAN, this conversation recording structure also needs further to write down the MAC Address of PPPoE server, certainly, record to the MAC Address of PPPoE server can be record when receiving PADO ' message (when having a PPPoE server among the EMAN), also can be to receive that PADS ' carries out record.
At the PPP session stage, if receive PPPoE data (PPP Data) message from client, then with this machine MAC Address, replace original source MAC as the MAC Address of active user's ply-yarn drill, and the PPP Data ' message after will changing according to the conversation recording that the discovery stage is determined mails to purpose BAS.Equally, at the PPP Data ' message of receiving from BAS, MAC Address according to the PPPoE server of SESSION_ID in the message and BAS can be determined client-side information uniquely at conversation recording, as client mac address, and the PPP Data message after replacing the target MAC (Media Access Control) address in this message and transmit conversion with it.
In addition, when DSLAM received the PADT message of client or BAS transmission, it further deleted conversation recording between this client and the PPPoE server after executing this message forwarding.
Although carrying out the PPPoE message to pppoe client, transmits the foregoing description, but inventive concept can be used for transmitting to the message of PPPoE for the PPPoA client provides PPPoA equally, different is DSLAM record PPPoA client-side information difference, for example: DSL wire size, Vpi and Vci, and need finish the transfer process of PPPoA protocol massages to the PPPoE protocol massages.
By above-mentioned PPPoE protocol massages conversion method, DSLAM can use single source MAC and BAS for a plurality of PPPoE/PPPoA clients and carry out pppoe session, thereby saved the MAC Address space of follow-up equipment, reduce it and carried out tabling look-up the time in the data exchange process, thereby improved forward efficiency.
Do not break away from design of the present invention and scope and can make many other changes and remodeling.Should be appreciated that to the invention is not restricted to specific execution mode, scope of the present invention is defined by the following claims.