Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of chain circuit detecting method and system based on the ARP agreement, makes it be applicable to that medium are transmitted the link detecting between the veneer and the external bearer network switch in the media server.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention provides a kind of chain circuit detecting method based on the ARP agreement, this method comprises:
ARP link detecting module is sent the link detecting request to the database configuration module, to obtain the configuration information of the outer network interface of storing in the database configuration module;
The configuration information calculated address analysis protocol ARP request message of the said outer network interface of ARP link detecting module foundation, and send to the switch that is connected with said outer network interface;
After said switch receives said ARP request message, return the arp reply message to said ARP link detecting module;
ARP link detecting module detects the link between said outer network interface and the said switch according to said arp reply message.
The configuration information of said outer network interface comprises at least: medium access control (MAC) address of internet interconnection protocol (IP) address of said outer network interface, said outer network interface and the IP address of said switch.
This method further comprises: said ARP request message is periodically sent to said switch.
Said link is detected, is specially:
Said outer network interface is received said arp reply message in preset time after, judge that the link between said outer network interface and the said switch is normal; Otherwise, judge that said link is unusual.
After the detection of said link accomplished, this method further comprised: the state information of said outer network interface is set in global variable, and according to the state information of said outer network interface in media server deploy business.
The present invention also provides a kind of link detecting system based on the ARP agreement, and this system comprises: media server and switch, wherein:
Said media server is used for transmitting according to medium the configuration information generation ARP request message of the outer network interface of veneer, and sends to the switch that is connected with said outer network interface; Also be used to receive the arp reply message that said switch returns, and the link between said outer network interface and the said switch detected according to said arp reply message;
Said media server comprises: ARP link detecting module and database configuration module, wherein,
Said ARP link detecting module is used for sending the link detecting request to said database configuration module, to obtain the configuration information of said outer network interface; Also be used to generate the ARP request message, and periodically send to said switch; Also be used to receive the arp reply message that said switch returns, and the link between said outer network interface and the said switch detected, obtain testing result according to said arp reply message;
The database configuration module is used to store the configuration information of said outer network interface, and offers said ARP link detecting module;
Said switch is used to receive the ARP request message that said media server sends, and network interface returns said arp reply message outside said media server said.
Said ARP link detecting module is further used for judging that the link between said outer network interface and the said switch is normal after network interface is received said arp reply message in preset time outside said; Otherwise, judge that said link is unusual.
Said media server further comprises: system control module, be used for detecting the result of link according to said ARP link detecting module, in global variable, be provided with said outside the state information of network interface; And it is professional in said media server deploy according to the state information of said outer network interface.
The present invention is based on the link detecting scheme of ARP agreement; The special ARP study message of transmission between outer network interface through transmitting veneer at the medium of media server and the coupled switch, comprise ARP request message and arp reply message, whether the link that detects between said outer network interface and the switch is normal.Because ARP study message is only as link detecting, therefore, transmit veneer because to handle flow big and icmp packet is carried out speed limit when handling when medium, can not influence reception to ARP study message yet; In addition; Since among the present invention to ARP study message adopt periodically send mode, as every at a distance from ARP request message of 2s timed sending; If do not receive the arp reply message in the 10s, think that then link is obstructed, so can reach the effect of the real-time detection network the same with heartbeat mechanism.
Because the ARP study message of the present invention's transmission is followed the TCP/IP standard protocol stack, its essence is to obtain the purpose ethernet address through known purpose IP address; The purpose ethernet address that gets access to is used for encapsulating the Ethernet data bag, therefore can correctly transmits, be applicable to the link detecting between the medium forwarding veneer and the external bearer network switch at link layer.
Embodiment
Below in conjunction with accompanying drawing and specific embodiment technical scheme of the present invention is further set forth in detail.
The present invention is based on the link detecting scheme of ARP agreement; Transmission ARP study message between outer network interface through transmitting veneer at the medium of media server and the coupled switch, comprise ARP request message and arp reply message, whether the link that detects between said outer network interface and the switch is normal.
The chain circuit detecting method that the present invention is based on the ARP agreement is as shown in Figure 1, comprising:
Step 101, the configuration information of transmitting the outer network interface of veneer according to medium in the media server generates the ARP request message, and sends to the switch that is connected with outer network interface.
After step 102, switch received the ARP request message, outwards network interface returned the arp reply message.
Step 103 detects according to the link between external network interface of arp reply message and the switch.
In order to realize chain circuit detecting method based on the ARP agreement; The invention provides following functional module: ARP link detecting module, database configuration module and system control module; These three module application in media server, through and media server external switch between cooperation realize link detecting based on the ARP agreement.Through concrete embodiment detection method of the present invention is described below, as shown in Figure 2, this embodiment may further comprise the steps:
Step 201, ARP link detecting module is sent the link detecting request to the database configuration module, to obtain the configuration information of outer network interface.
Comprised at least one medium on the media server and transmitted veneer, medium are transmitted on the veneer and are contained a plurality of outer network interfaces, and these outer network interfaces link to each other with external equipment such as switch, other media servers etc., communicating by letter between completion media server and the external equipment.The present invention mainly is the Link State that detects between above-mentioned outer network interface and external switch.
When needs detect some outside during Link State between the coupled switch of network interface; At first; Need the ARP link detecting module on the media server to send a link detecting request, to obtain the configuration information of storing in the database configuration module that is somebody's turn to do outer network interface to the database configuration module.
The configuration information of above-mentioned outer network interface comprises at least: IP address, medium access control (MAC; Media Access Control) address and purpose IP address; Wherein, IP address, MAC Address are respectively the IP address and the MAC Addresss of this outer network interface, and purpose IP address promptly is meant the IP address of the switch that links to each other with this outer network interface.
Step 202, the configuration information of database configuration module network interface outside ARP link detecting module is returned.
The database configuration module is according to the configuration information of link detecting request network interface outside ARP link detecting module is returned of receiving.
Step 203, ARP link detecting module generates the ARP request message according to the configuration information of outer network interface.
Be illustrated in figure 3 as the data structure of ARP request/response message, for the ARP request message, the value of its each field is following:
The purpose ethernet address: comprising 6 bytes, all is 1;
The transmitting terminal ethernet address: being the MAC Address of this outer network interface, also is 6 bytes, is provided with according to the MAC Address in the configuration information of outer network interface;
Frame type: comprise two bytes, be worth and be 0x0806, represent that this message is the ARP request message.
Because what this ARP request message adopted is ethernet frame type, therefore, above-mentioned three fields have been formed the Ethernet frame head of this message.
Type of hardware: the type of expression hardware address, comprise two bytes, value is that what represented the current use of this ARP request message at 1 o'clock is the address of ethernet type;
Protocol type: the protocol address type of indicating to shine upon, comprise two bytes, be worth and be 0x0800, represent that the current protocol address that uses of this ARP request message is the IP type address;
Hardware address length: represent above-mentioned address of netting very much type, be the length of hardware address, size is 6 bytes;
Length of protocol address: the length of expression above-mentioned IP type address, size is 4 bytes;
Action type (OP): value is 1, and expression ARP request is corresponding with the ARP request message;
Transmitting terminal ethernet address: with the transmitting terminal ethernet address in the Ethernet frame head;
Transmitting terminal IP address: be the IP address of this outer network interface, be provided with according to the IP address in the configuration information of outer network interface;
Purpose ethernet address: with the purpose ethernet address in the Ethernet frame head;
Purpose IP address: the IP address for the switch that links to each other with this outer network interface is provided with according to the purpose IP address in the configuration information of outer network interface.
Step 204, ARP link detecting module sends to switch with the ARP request message.
Start ARP link detecting process, preferably, periodically, send an ARP request message at a distance from 2s and give switch, stop up to ARP link detecting process as every; Can certainly only send the ARP request message one time.Send after can the ARP request message being packaged into the ARP request package.The duration that concrete ARP link detecting process continues can be provided with as required.
After step 205, switch receive the ARP request message, return the arp reply message to ARP link detecting module.
After switch is received the ARP request message, return the arp reply message at once.For the arp reply message, the value of each field is following in this message shown in Figure 3:
The purpose ethernet address: the medium at current outer network interface place are transmitted the hardware address of veneer, are ethernet address;
Transmitting terminal ethernet address: exchanger side ethernet address;
Frame type: comprise two bytes,, be worth and be 0x0806 when this message of expression when being the arp reply message.
Because what this arp reply message adopted is ethernet frame type, therefore, above-mentioned three fields have been formed the Ethernet frame head of this message.
Type of hardware: the type of expression hardware address, comprise two bytes, value is that what represented the current use of arp reply message at 1 o'clock is the address of ethernet type;
Protocol type: the protocol address type of indicating to shine upon, comprise two bytes, be worth and be 0x0800, represent that the current protocol address that uses of this arp reply message is the IP type address;
Hardware address length: represent above-mentioned address of netting very much type, be the length of hardware address, size is 6 bytes;
Length of protocol address: the length of expression above-mentioned IP type address, size is 4 bytes;
Action type (OP): value is 2, and the expression arp reply is corresponding with the arp reply message;
Transmitting terminal ethernet address: exchanger side ethernet address;
Transmitting terminal IP address: exchanger side IP address;
The purpose ethernet address: the medium at current outer network interface place are transmitted the hardware address of veneer, are ethernet address;
Purpose IP address: the IP address that the medium at current outer network interface place are transmitted veneer.
Step 206, ARP link detecting module detect the state of link according to the arp reply message.
Concrete, to the ARP request message that sends to switch at every turn,, judge that then the link between this outer network interface and this switch is normal if the arp reply message that ARP link detecting module receives that in preset time switch returns can be set; Otherwise be unusual.
Link detecting is monitoring in real time among the present invention, therefore, and to the ARP request message that ARP link detecting module is sent to switch, the detection that all need whether receive the arp reply message in the given time at every turn.
Step 207, system control module are provided with the state information of outer network interface according to the link detecting result.
Among the present invention, the state information of outer network interface mainly is: IP address, MAC Address, port status and Link State.Wherein, IP address and MAC Address are the IP address and the MAC Address of this outer network interface, and port status is meant state such as the up or the down of this outer network interface self; Link State promptly is meant Link State between this outer network interface and the switch, comprises normal and unusual two kinds that concrete, can being provided with just often as required, the Link State value is 1; When unusual, the Link State value is 0.
Preferably, can the state information of above-mentioned outer network interface be maintained in the global variable.
Step 208, system control module regularly read the state information of outer network interface, and are implemented in the service deployment on the media server in view of the above.
The state information of network interface outside system control module regularly reads from global variable, and realize the deployment of media server institute loaded service in view of the above is as being that up, Link State are on the network interface outside normal with service deployment to port status.
It is pointed out that the ARP study message that the present invention transmits follows the TCP/IP standard protocol stack, its essence is to obtain the purpose ethernet address through known purpose IP address; The purpose ethernet address that gets access to is used for encapsulating the Ethernet data bag, therefore can correctly transmits, be applicable to the link detecting between the medium forwarding veneer and the external bearer network switch at link layer.
In order to realize above-mentioned detection method, the invention provides a kind of detection system, as shown in Figure 4, comprising: media server 10 and switch 20, wherein:
Media server 10 is used for transmitting according to medium the configuration information generation ARP request message of the outer network interface of veneer, and sends to the switch 20 that is connected with outer network interface; Also be used for the arp reply message that desampler 20 returns, and detect according to the link between external network interface of arp reply message and the switch 20;
Switch 20 is used for the ARP request message that receiving media server 10 sends, and returns the arp reply message to the outer network interface of media server 10.
Media server 10 comprises: ARP link detecting module 11 and database configuration module 12, wherein,
ARP link detecting module 11 is used for sending the link detecting request to database configuration module 12, to obtain the configuration information of outer network interface; Also be used to generate the ARP request message, and periodically send to switch 20; Also be used for the arp reply message that desampler 20 returns, and detect, obtain testing result according to the link between external network interface of arp reply message and the switch 20;
Database configuration module 12 is used to store the configuration information of outer network interface, and offers ARP link detecting module 11.
ARP link detecting module 11 is further used for judging that the link between outer network interface and the switch 20 is normal after network interface is received the arp reply message in preset time outside; Otherwise, judge that link is unusual.
Media server 10 further comprises: system control module 13 is used for the result according to ARP link detecting module 11 detection links, the state information of network interface outside in global variable, being provided with; And it is professional in media server 10 deploy according to the state information of outer network interface.
The above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.