A kind of Dialing Method based on PPPOE network, dial system and routerTechnical field
The present invention relates to a kind of networking technology area, particularly relate to a kind of Dialing Method based on PPPOE network, dial system and router.
Background technology
What the network access of the up home gateway of passive optical-fiber network PON was conventional has three kinds: the online of dynamic host configuration protocol DHCP router, to dial up on the telephone based on the point-to-point protocol PPPOE router of Ethernet and bridge joint dials up on the telephone.Point-to-point protocol PPPOE router based on Ethernet dials up on the telephone: create network interface on a upstream router in the up home gateway of passive optical-fiber network PON, the network address is obtained by the point-to-point protocol PPPOE dial mode based on Ethernet, the up home gateway of passive optical-fiber network PON passes through this interface process up-downgoing network data, for the equipment for surfing the net being connected to home gateway is provided services on the Internet.
PPPOE (point-to-pointprotocoloverethernet, the point-to-point protocol based on Ethernet), can make the main frame of Ethernet be linked on the access concentrator of a far-end by a simple bridging device.By PPPOE agreement, remote access device can realize control to each access user and charging.Compared with traditional access way, PPPOE has the higher ratio of performance to price, it is widely adopted comprising in a series of application such as cell networking construction, broadband access method ADSL (AsymmetricDigitalSubscriberLine, Asymmetrical Digital Subscriber Line) popular at present employs described PPPOE agreement.
Existing router all supports that PPPOE dials up on the telephone function, but when linking appearance abnormal (such as break link), in the reciprocal process of i.e. PPPOE, one party does not normally exit, this session is caused to be in abnormal conditions, PPPOE client normally cannot be dialled fast and obtain address, and then cannot normally again link.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of Dialing Method based on PPPOE network, dial system and router, for solving the problem that cannot again normally link extremely appears in PPPOE link in prior art.
For achieving the above object and other relevant objects, the invention provides a kind of Dialing Method based on PPPOE network, dial system and router; Based on a Dialing Method for PPPOE network, said method comprising the steps of: S1, terminal receive the dial instruction that user sends; S2, judge whether to there is last session, rotate step S3 when being judged as YES, otherwise forward step S4 to, described session is the session between terminal and access server; S3, to send to described access server and stop packet message, make described access server stop the session with described terminal; S4, described terminal enter the session setup stage; S5, described terminal enter session stage.
In one embodiment of the present invention, described step S2 is specially: judge whether there is session variable in memory, if judge it is think to there is last session connection, if be judged as otherwise do not exist, the MAC Address of the session id recorded when described session variable comprises last session and corresponding access server.
In one embodiment of the present invention, described step S4 is specially: S41, described terminal broadcast initiation packet message; What S42, reception more than one access server fed back based on described packet message gives packet message; S43, terminal select an access server based on the received packet message that gives, and send unicast session request packet message to selected access server; S44, receive selected by access server feedback confirmation packet message.
In one embodiment of the present invention, described step S43 is specially: the time giving packet message that S431, analysis receive, and sorts to time of reception; S432, obtain time of reception the earliest corresponding give packet message, select access server corresponding to packet message give with this; S433, send unicast session request packet message to the access server of described selection.
In one embodiment of the present invention, described step S5 specifically comprises: S51, described terminal and selected access server conversate; S52, startup recording mechanism, recording conversation process data, described conversation procedure data comprise session variable.
In one embodiment of the present invention, also comprise after described step S5: S6, when described conversation end, described terminal sends to selected access server and stops packet message, and deletes the session variable recorded.
The present invention also provides a kind of dial system based on PPPOE network, and described dial system comprises terminal, and described terminal comprises: command reception module, for receiving the dial instruction that user sends; With the judge module of described command reception model calling, there is last session connection for judging whether, described session is the session between described terminal and access server; The termination conversation module be connected with described judge module, sends termination packet message to described access server during for there is last session, makes described access server stop the session with described terminal; The session setup module be connected with described judge module and described termination conversation module, for initiating a session request; With the conversation module of described session setup module, for conversating with access server.
In one embodiment of the present invention, described judge module specifically for: judge whether there is session variable in memory, if judge it is think to there is last session connection, if be judged as otherwise do not exist, the MAC Address of the session id recorded when described session variable comprises last session and corresponding access server.
In one embodiment of the present invention, described session setup module specifically comprises: packet message initiation module, for broadcasting initiation packet message; Give packet message receiver module, give packet message for what receive that more than one access server feeds back based on described packet message; Selecting module, for selecting an access server based on the received packet message that gives, and sending unicast session request packet message to selected access server; Selecting sending module, for selecting an access server based on the received packet message that gives, and sending unicast session request packet message to selected access server; Acknowledgment packet message receiver module, for receiving the confirmation packet message of selected access server feedback.
The present invention also provides router, comprises the dial system based on PPPOE network, and described dial system comprises terminal, and described terminal comprises: command reception module, for receiving the dial instruction that user sends; With the judge module of described command reception model calling, there is last session connection for judging whether, described session is the session between described terminal and access server; The termination conversation module be connected with described judge module, sends termination packet message to described access server during for there is last session, makes described access server stop the session with described terminal; The session setup module be connected with described judge module and described termination conversation module, for initiating a session request; With the conversation module of described session setup module, for conversating with access server.
Management method, management system and mobile phone that a kind of mobile terminal of the present invention is applied, at least have following beneficial effect:
When terminal needs to dial up on the telephone, when carrying out being connected session with access server, first judge that terminal is current and whether there is last session, when also there is last session, need to send to access server to stop packet message, ensure that terminal and access server normally disconnect, make currently to carry out connection session and can carry out smoothly, connection speed and efficiency can be improved.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of a kind of Dialing Method one embodiment based on PPPOE network of the present invention;
Fig. 2 is the idiographic flow schematic diagram of the step S3 of a kind of Dialing Method based on PPPOE network of the present invention;
Fig. 3 is the idiographic flow schematic diagram of the step S33 of a kind of Dialing Method based on PPPOE network of the present invention;
Fig. 4 is the structural representation of a kind of dial system one embodiment based on PPPOE network of the present invention;
Fig. 5 is the concrete structure schematic diagram of the session setup module 3 of a kind of dial system based on PPPOE network of the present invention;
Fig. 6 is the concrete structure schematic diagram of the selection sending module 33 of a kind of dial system based on PPPOE network of the present invention.
Element numbers illustrates:
1 command reception module
2 judge modules
3 stop conversation module
4 session setup modules
5 conversation module
41 packet message initiation modules
42 give packet message receiver module
43 select sending module
44 acknowledgment packet message receiver modules
431 analytic units
432 acquiring units
433 transmitting elements
S1 ~ S433 step
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Embodiment 1
Refer to Fig. 1, for the invention provides the schematic flow sheet of the Dialing Method based on PPPOE network, described Dialing Method comprises step:
Step S1, terminal receive dial instruction, and described dial instruction is the online dial instruction that user sends;
Particularly, this terminal can be Set Top Box, computer, ADSL Termination Unit etc. with dial feature, in one embodiment of the present invention, this terminal can be router, during normal startup, if user is by WEB webpage configuration PPPOE, the client process of router startup PPPOE.When user needs to surf the Net, send online dial instruction, terminal receives this instruction.
Step S2, judge whether to there is last session, rotate step S3 when being judged as YES, otherwise forward step S4 to, described session is the session between terminal and access server.
Wherein, when receiving online dial instruction, represent and need to go to dial the session connection carried out between terminal and access server, but conversate before connecting and need first to judge whether terminal exists last session, namely judge that whether with before access server terminal has session, and be that exception disconnects at conversation procedure, particularly, can judge whether there is session variable in the memory of terminal, if exist, illustrate to there is last session connection, and extremely disconnect.Described memory is NVRAM memory (Non-VolatileRandomAccessMemory, nonvolatile random access memory), therefore when judging to there is session variable, forward step S3 to, step S4 is forwarded to if be judged as NO, further, the MAC Address of the session id recorded when described session variable comprises last session and corresponding access server.
Step S3, to send to access server and stop packet message, access server is stopped and the session of terminal;
In the present embodiment, terminal, based on the information of described session variable, finds the address of corresponding access server, and the access server to correspondence sends and stops packet message, and access server terminates corresponding session according to session id.
In the present embodiment, judged before needs initiation session terminal whether exist on once session, when confirming store session variable, first send and stop packet message, last session between disconnected end and access server, guarantee it is normal off-state between terminal and access server, can ensure that terminal and access server can normally, fast couple together.
Step S4, terminal enter the session setup stage;
Guarantee be normal off-state between terminal and access server after, terminal can conversate mounting phase.
As shown in Figure 2, be the particular flow sheet of the step S4 of a kind of Dialing Method based on PPPOE network of the present invention, described step S4 specifically comprises:
Step S41, terminal broadcast initiation packet message;
Particularly, be now in the session setup stage, mainly select access server, therefore terminal needs broadcast initiation packet message (PADI), and each access server all can receive this packet message.Further, described packet message at least comprises the label (tag types field value is 0 × 0101) of a service name type, the information such as the service provided required by proposing to access server, described service comprises COS, service range etc., is not restricted this herein.
What S42, reception more than one access server fed back based on this packet message gives packet message;
Wherein, after access server receives described packet message, packet message (PADO) is given according to the service range feedback in described packet message, with response request, wherein, the described packet message that gives comprises the label (tag types field value is 0 × 0102) comprising an access server name type, and one or more service name type label, shows the information such as the COS that can provide to terminal.Further, packet message is given described in not receiving within the time of specifying when terminal, described terminal can resend described packet message, and double the stand-by period, with receive access server feedback give packet message, guarantee carrying out smoothly of session setup stage, and when the stand-by period exceedes threshold value, stop waiting for, the information of time-out is connected to user feedback, or described access server is based on received packet message, when finding that this message is abnormal after analyzing, what then feedback one was empty gives packet message, now terminal is according to giving packet message analysis, when judging that this gives packet message as time empty, then connect abnormal to user feedback, and the information of connection failure.
S43, terminal select an access server based on the received packet message that gives, and send unicast session request packet message to selected access server;
Terminal can receive multiple access server feedback give packet message, one can be selected in packet message suitable to give packet message giving of receiving, can according to name type label, in service name type label, perhaps service range content is selected, can also select according to other types, in the present embodiment, as preferably, select suitable to give packet message according to the received time order and function giving packet message, such as, the packet message that gives received the earliest is selected to be suitable, namely access server corresponding to packet message that give received the earliest is selected to be session object, and send unicast session request packet message (PADR) to the access server of described selection.
S44, receive selected by access server feedback confirmation packet message.
After selected access server receives described unicast session request packet message, to described terminal feedback acknowledgment packet message (PADS), described unicast session request packet message comprises session id (SESSION-ID), also comprise the label of the name type of an access server, the MAC Address of described access server, and the information such as the service that provides to terminal are provided, now access server feedback acknowledgment packet message, terminal is by the user name of configuration, the relevant configuration information such as password feed back to access server, this access server carries out certification, to information such as the addresses that terminal feedback distributes after authentication success.
In a preferred version of the present embodiment, as shown in Figure 3, be the particular flow sheet of the step S43 of a kind of Dialing Method based on PPPOE network of the present invention, the detailed process of described step S43 is as follows:
The time giving packet message that step S431, analysis receive, time of reception is sorted;
In the present embodiment, record receives the time point giving packet message, and sorts to time of reception, by arriving first laggard line ordering, also by rear to advanced line ordering, can not be restricted this herein.
Step S432, obtain time of reception the earliest corresponding give packet message, select access server corresponding to packet message give with this;
According to sequence after give packet message, obtain receive at first give packet message, selecting this to give access server corresponding to packet message is session object.
Step S433, send unicast session request packet message to selected access server.
After choosing access server, unicast session request packet message (PADR) is sent to selected access server, described unicast session request packet message must comprise a service name type label, determines the type service of asking to access server (or switch).
When the initiation session stage completes, namely PPPOE dial-up connection success (terminal and access server can normal conversation) is represented, normal conversation can be carried out, now the access server of described terminal and selection all carries MAC Address and the dialogue ID of described access server, then forwards step S5 to;
In step s 5, described terminal enters session stage;
When after successful connection, described terminal and access server carry out PPPOE session, can encapsulate PPP information by any PPP packing forms, not be restricted herein to this.
Particularly, described step S5 specifically comprises:
Step S51, terminal and selected access server conversate;
Step S52, startup recording mechanism, recording conversation process data, described conversation procedure data comprise session variable;
Particularly, when normal conversation can be carried out, start recording mechanism, be recorded in the process data in conversation procedure, comprising session variable, the information such as the MAC Address of namely selected access server and session id.
It should be noted that, above-mentioned steps S51 and step S52 has no time the restriction successively performed, and can carry out simultaneously, not be restricted herein to this.
In the present embodiment, in one embodiment of the present invention, also can comprise after described step S5:
S6, when conversation end, terminal sends to selected access server and stops packet message, and deletes the conversation procedure data that record.
It should be noted that, in any stage of conversation procedure, when need not be limited to conversation end, herein this can be restricted to selected access server transmission termination packet message This move in described step 6.Further, stop packet message and also send to access server without the need to being limited to terminal, also can be that access server is sent out to terminal, this is not also restricted herein.Further, when terminal and access server normally disconnect, can occur to stop packet message, represent that said two devices normally disconnects, stop dialogue, now need to delete described conversation procedure data, also can only delete described session variable, represent that said two devices normally disconnects.Can not affecting in subsequent process, when terminal needs again to conversate with access server, the problem of normal dialing cannot be carried out because normally not disconnecting.In the present invention, when terminal needs to dial up on the telephone, when carrying out being connected session with access server, first judge that terminal is current and whether there is last session, when also there is last session, needing to send to access server to stop packet message, ensureing that terminal and access server normally disconnect, carry out connection session prepare smoothly for current, connection speed and efficiency can be improved.
Embodiment 2
Refer to Fig. 4, for the invention provides a kind of structural representation of the dial system based on PPPOE network, wherein said system comprises terminal, and described terminal specifically comprises:
Command reception module 1, for receiving the dial instruction that user sends;
Particularly, described terminal can be Set Top Box, computer, ADSL Termination Unit etc. with dial feature, in one embodiment of the present invention, described terminal can be router, during normal startup, if user is by WEB webpage configuration PPPOE, the client process of router startup PPPOE.When user needs to surf the Net, send online dial instruction, terminal receives this instruction.
, there is last session connection for judging whether in the judge module 2 be connected with described command reception module 1, described session is the session between described terminal and access server;
Wherein, when receiving online dial instruction, represent and need to go to dial the session connection carried out between terminal and access server, but conversate before connecting and need first to judge whether terminal exists last session, namely judge that whether with before access server terminal also has not normally open session, namely be abnormal disconnecting at conversation procedure, particularly, can judge whether there is session variable in the memory of terminal, if exist, illustrate to there is last session connection, and extremely disconnect.Described memory is NVRAM memory (Non-VolatileRandomAccessMemory, nonvolatile random access memory), therefore when judging to there is session variable, need to send and stop packet message to stop this session, if be judged as otherwise start session request, further, the MAC Address of the session id recorded when described session variable comprises last session and corresponding access server, also can comprise other information, this is not restricted herein.
The termination conversation module 3 be connected with described judge module 2, stops packet message for sending to described access server when judgement exists last session, makes described access server stop the session with described terminal;
In the present embodiment, terminal, based on the information of described session variable, finds the address of described corresponding access server, and the access server to correspondence sends and stops packet message, and described access server terminates corresponding session according to session id.
In the present embodiment, judged before needs initiation session terminal whether exist on once session, when confirming store session variable, first send and stop packet message, last session between disconnected end and access server, guarantee it is normal off-state between terminal and access server, can ensure that terminal and access server can normally, fast couple together.
The session setup module 4 be connected with described judge module 2 and described termination conversation module 3, for initiating a session request;
Wherein, guarantee be normal off-state between terminal and access server after, terminal can conversate mounting phase.
With the conversation module 5 of described session setup module 4, for conversating with access server.
When after successful connection, described terminal and access server carry out PPPOE session, can encapsulate PPP information by any PPP packing forms, not be restricted herein to this.
In a preferred version of the present embodiment, when described termination conversation module 3 is also used in described conversation end, sends to selected access server and stop packet message, and delete the conversation procedure data recorded.
It should be noted that, described termination conversation module 3 sends termination packet message This move to selected access server in any stage of conversation procedure, when need not be limited to conversation end, can not be restricted this herein.Further, stop packet message and also send to access server without the need to being limited to terminal, also can be that access server is sent out to terminal, this is not also restricted herein.Further, when terminal and access server normally disconnect, can occur to stop packet message, represent that said two devices normally disconnects, stop dialogue, now need to delete described conversation procedure data, also can only delete described session variable, represent that said two devices normally disconnects.Can not affecting in subsequent process, when terminal needs again to conversate with access server, the problem of normal dialing cannot be carried out because normally not disconnecting.
Further, as shown in Figure 5, be the concrete structure figure of the session setup module 4 of a kind of dial system based on PPPOE network of the present invention, described session setup module 4 specifically comprises:
Packet message initiation module 41, for broadcasting initiation packet message;
Particularly, be now in the session setup stage, mainly select access server, therefore terminal needs broadcast initiation packet message (PADI), and each access server all can receive this packet message.Further, described packet message at least comprises the label (tag types field value is 0 × 0101) of a service name type, the information such as the service provided required by proposing to access server, described service comprises COS, service range etc., is not restricted this herein.
Give packet message receiver module 42, give packet message for what receive that more than one access server feeds back based on described packet message; Selecting module, for selecting an access server based on the received packet message that gives, and sending unicast session request packet message to selected access server;
Wherein, after described access server receives described packet message, packet message (PADO) is given according to the service range feedback in described packet message, with response request, wherein, the described packet message that gives comprises the label (tag types field value is 0 × 0102) comprising an access server name type, and one or more service name type label, shows the information such as the COS that can provide to terminal.Further, when terminal does not receive PADO within the time of specifying, described terminal can resend described packet message, and double the stand-by period, with receive access server feedback give packet message, guarantee carrying out smoothly of session setup stage, and when the stand-by period exceedes threshold value, stop waiting for, the information of time-out is connected to user feedback, or described access server is based on received packet message, when finding that this message is abnormal after analyzing, what then feedback one was empty gives packet message, now terminal is according to giving packet message analysis, when judging that this gives packet message as time empty, then connect abnormal to user feedback, and the information of connection failure.
Selecting sending module 43, for selecting an access server based on the received packet message that gives, and sending unicast session request packet message to selected access server;
Terminal can receive multiple access server feedback give packet message, one can be selected in packet message suitable to give packet message giving of receiving, can select according to COS or service range, can also select according to other types, in the present embodiment, as preferably, select suitable to give packet message according to the received time order and function giving packet message, such as, select the packet message that gives received the earliest to be suitable, namely select access server corresponding to packet message that give received the earliest to be session object.
Acknowledgment packet message receiver module 44, for receiving the confirmation packet message of selected access server feedback.
After selected access server receives described unicast session request packet message, to described terminal feedback acknowledgment packet message (PADS), described unicast session request packet message comprises session id, also comprise the MAC Address of the label of the name type of an access server, described access server, and the information such as the service that provides to terminal are provided.
Further, as shown in Figure 6, be the concrete structure figure of the selection sending module 43 of a kind of dial system based on PPPOE network of the present invention, described selection sending module 43 specifically comprises:
Analytic unit 431, for analyzing the received time giving packet message, sorts to time of reception;
In the present embodiment, record receives the time point giving packet message, and sorts to time of reception, by arriving first laggard line ordering, also by rear to advanced line ordering, can not be restricted this herein.
Acquiring unit 432, for obtain time of reception the earliest corresponding give packet message, select access server corresponding to packet message give with this;
According to sequence after give packet message, obtain receive at first give packet message, selecting this to give access server corresponding to packet message is session object.
Transmitting element 433, for sending unicast session request packet message to the access server of described selection.
After choosing access server, unicast session request packet message (PADR) is sent to selected access server, described unicast session request packet message must comprise a service name type label, determines the type service of asking to access server (or switch).
When the initiation session stage completes; namely PPPOE dial-up connection success (terminal and access server can normal conversation) is represented; can carry out normal conversation, the access server of now described terminal and selection all carries MAC Address and the dialogue ID of described access server.When after successful connection, described terminal and access server conversate.
Further, described conversation module 5 specifically for: realize terminal and selected access server conversates, and start recording mechanism, the process data of recording conversation, wherein said conversation procedure data comprise session variable, the information such as the MAC Address of such as described access server and dialogue ID.
In the present invention, when terminal needs to dial up on the telephone, when carrying out being connected session with access server, first judge that terminal is current and whether there is last session, when also there is last session, needing to send to access server to stop packet message, ensureing that terminal and access server normally disconnect, carry out connection session prepare smoothly for current, connection speed and efficiency can be improved.
The present invention also provides a kind of router, and described router comprises the dial system described in above-described embodiment, and the structure and working principle of wherein said dial system can refer to above-described embodiment, repeats no more herein.
In sum; a kind of Dialing Method based on PPPOE network of the present invention, dial system and router; when receiving the dial instruction of user; first judge whether terminal exists last session; namely judge that terminal is current whether normally to disconnect with access server; disconnect if abnormal, first send and stop packet message terminal and access server to be disconnected, be convenient to the follow-up terminal that realizes and be connected with the normal conversation of access server, connection speed and efficiency can be improved.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.