CN109039918A - A kind of file transmitting method and device - Google Patents

A kind of file transmitting method and device Download PDF

Info

Publication number
CN109039918A
CN109039918A CN201811273708.9A CN201811273708A CN109039918A CN 109039918 A CN109039918 A CN 109039918A CN 201811273708 A CN201811273708 A CN 201811273708A CN 109039918 A CN109039918 A CN 109039918A
Authority
CN
China
Prior art keywords
message
tunnel
gre
address
list item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811273708.9A
Other languages
Chinese (zh)
Other versions
CN109039918B (en
Inventor
韩冰
陈翀
吴宝平
聂树伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201811273708.9A priority Critical patent/CN109039918B/en
Publication of CN109039918A publication Critical patent/CN109039918A/en
Application granted granted Critical
Publication of CN109039918B publication Critical patent/CN109039918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2592Translation of Internet protocol [IP] addresses using tunnelling or encapsulation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

The embodiment of the present application provides a kind of file transmitting method and device, wherein file transmitting method includes: to inquire the first tunnel table using the destination address of message to be sent;The the first tunnel list item to match if it does not exist with the destination address of message to be sent, it is determined that the target application type of message to be sent;Utilize the second tunnel table of target application type queries;The the second tunnel list item to match if it exists with target application type then sends message to be sent using the second tunnel list item.Pass through the technical program, the application type of second tunnel table records center node received packet and the tunnel source address for sending the message, when central node needs to send the response message for the asymmetric IP operation message received, the tunnel list item to match with the application type of message to be sent can be inquired from the second tunnel table, and then message to be sent is sent using the tunnel list item.

Description

A kind of file transmitting method and device
Technical field
This application involves fields of communication technology, more particularly to a kind of file transmitting method and device.
Background technique
GRE (Generic Routing Encapsulation, generic route encapsulation) agreement is used for other IP (Internet Protocol, Internet protocol), MPLS (Multiprotocol Label Switching, multi-protocols mark Label exchange), the data messages of the agreements such as Ethernet is packaged, and the data message after encapsulation passed in gre tunneling It is defeated.Data message after encapsulation is GRE message.Gre tunneling includes point-to-point and two kinds of connection types of point-to-multipoint GRE tunnels Road.Wherein, point-to-multipoint gre tunneling be capable of providing a central node to multiple branch nodes virtual link.
Central node obtains transmission protocol message head after the GRE message for receiving branch node transmission from GRE message The message source IP address of the tunnel source IP address and passenger protocol heading (internal layer IP) of (encapsulated layer IP), by tunnel source IP Address is determined as tunnel purpose IP address, and message source IP address is determined as message purpose IP address, and by the tunnel destination IP Address and the message purpose IP address are determined as corresponding relationship.
Central node is stored with gre tunneling table, and gre tunneling table includes multiple gre tunneling list items, each gre tunneling list item Record the corresponding relationship of tunnel purpose IP address and message purpose IP address.Central node determines tunnel purpose from GRE message After the corresponding relationship of IP address and message purpose IP address, inquiry whether there is the GRE of the corresponding relationship in gre tunneling table Tunnel list item, if it does not exist, then the corresponding relationship creates a gre tunneling list item, and the newly-built gre tunneling list item is stored In gre tunneling table.
When central node needs to send datagram by gre tunneling to branch node, hair needed for central node determines The destination address of the data message sent, i.e. message purpose IP address, and inquiry whether there is the message purpose in gre tunneling table The gre tunneling list item of IP address, and if it exists, tunnel purpose IP address is then determined according to gre tunneling list item, utilizes the tunnel mesh IP address data message is packaged as GRE message, and send the GRE message.
In general, the business of central node processing is that IP is symmetrical, and the message for such business is also IP symmetrical. For example, the received GRE message of central node institute is GRE request message, the GRE message that central node is sent is GRE response message. GRE request message and GRE response message are the symmetrical messages of IP, it may be assumed that the tunnel source IP address and GRE of GRE request message respond The tunnel purpose IP address of message is identical, the source IP address of internal layer message and internal layer report in GRE response message in GRE request message The purpose IP address of text is identical, the tunnel purpose IP address and the tunnel source IP address phase of GRE response message of GRE request message Together, the purpose IP address of internal layer message is identical as the source IP address of internal layer message in GRE response message in GRE request message.
However, central node can also handle the business of asymmetric IP, such as the detection of IPv6 address conflict, OSPF (Open Shortest Path First, ospf) business etc..When central node receives branch node transmission When the GRE message of asymmetric IP operation, even if central node establishes gre tunneling table according to the GRE message of the asymmetric IP operation ?.When central node sends the GRE message of the asymmetric IP operation to the equipment, the purpose of internal layer message in the GRE message IP address and the message purpose IP address in gre tunneling list item be not identical, it is thus impossible to get tunnel purpose IP address, leads Cause central node that can not send GRE message by gre tunneling.
By taking Fig. 1 as an example, equipment A be centered on node equipment, equipment B is branch node, and the tunnel interface of equipment A matches Setting the address IPv6 is 1111::1111, and when the tunnel interface address configuration of IP v6 of equipment B is 1111::1111, equipment B is sent NS (Neighbor Solicitation) message carries out the detection of IPv6 address conflict.Equipment B is first packaged NS message, right NS message after encapsulation, tunnel source IP address are 2.0.0.1, and tunnel purpose IP address is 1.0.0.1, the source IP of NS message Location are as follows::, the purpose IP address of NS message is ff02::1:ff00:1111 (multicast address), after equipment A receives the encapsulation In the gre tunneling list item established after NS message: message purpose IP address are as follows::, tunnel purpose IP address is 2.0.0.1.When setting When standby A feeds back NA (Neighbor Advertisement) message to equipment B, the source address of the NA message is 1111::1111, Destination address is ff02::1 (multicast address), cannot be matched to the destination address in the gre tunneling list item that equipment A is established (ff02::1), so that equipment A can not obtain tunnel purpose IP address, and then equipment A is caused NA message can not to be sent to equipment B。
Therefore, the tunnel destination address that how central node obtains the GRE message of asymmetric IP operation is urgently to be resolved Problem.
Summary of the invention
The embodiment of the present application is designed to provide a kind of file transmitting method and device, can not be obtained with solving central node The problem of getting the tunnel destination address of the GRE message of asymmetric IP operation, and then the GRE message can not be sent.Particular technique Scheme is as follows:
In a first aspect, the embodiment of the present application provides a kind of file transmitting method, it is applied to central node, the method packet It includes:
The first tunnel table is inquired using the destination address of message to be sent;
The the first tunnel list item to match if it does not exist with the destination address of the message to be sent, it is determined that described pending Deliver newspaper text target application type;
Utilize second tunnel table of target application type queries, wherein second tunnel table is according to branch node The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message of transmission;
The the second tunnel list item to match if it exists with the target application type is then sent out using second tunnel list item Send the message to be sent.
Optionally, the method also includes:
The GRE message that branch node is sent is received, and judges whether the GRE message meets preset condition;
If so, obtaining the tunnel source address of the application type of internal layer message and transmission the GRE message in the GRE message;
Corresponding tunnel list item is established according to the application type and tunnel source address that get, it is old for tunnel list item setting Change the time, and is maintained in the second tunnel table.
Optionally, when the transmission message to be sent using second tunnel list item, the method also includes:
The ageing time of the second tunnel list item to match with the target application type is reset into preset default value.
Optionally, described to judge that the step of whether the GRE message meets preset condition includes:
Obtain the destination address of internal layer message in received GRE message;
Address that whether the acquired destination address of judgement is the central node, the address phase with the central node Any one of the multicast address matched and broadcast address;
If it is, determining that the received GRE message of institute meets preset condition.
Optionally, described the step of sending the message to be sent using second tunnel list item, includes:
If second tunnel list item be it is multiple, using the tunnel address in each second tunnel list item respectively to it is described to It sends message and carries out GRE encapsulation, obtain the different each GRE message of tunnel destination address;
Each GRE message obtained after encapsulation is passed through corresponding gre tunneling respectively to send.
Second aspect, the embodiment of the present application provide a kind of packet transmission device, are applied to central node, described device packet It includes:
First enquiry module, for inquiring the first tunnel table using the destination address of message to be sent;
First determining module, the first tunnel table for matching if it does not exist with the destination address of the message to be sent , it is determined that the target application type of the message to be sent;
Second enquiry module, for utilizing second tunnel table of target application type queries, wherein second tunnel Table is the tunnel source address of the application type of internal layer message and transmission the GRE message in the GRE message sent according to branch node It establishes;
Sending module, the second tunnel list item for matching if it exists with the target application type, then using described Second tunnel list item sends the message to be sent.
Optionally, described device further include:
Judgment module for receiving the GRE message of branch node transmission, and judges whether the GRE message meets default item Part;
Module is obtained, for when the judging result of the judgment module, which is, is, then obtaining internal layer message in the GRE message Application type and send the GRE message tunnel source address;
Module is established, for establishing corresponding tunnel list item according to the application type and tunnel source address that get, for this Ageing time is arranged in tunnel list item, and is maintained in the second tunnel table.
Optionally, described device further include:
Module is reset, the ageing time of the second tunnel list item for will match with the target application type is reset to Preset default value.
Optionally, the judgment module is specifically used for:
Obtain institute received GRE message in internal layer message destination address, judge acquired in destination address whether be institute State any one of address, the multicast address to match with the address of the central node and the broadcast address of central node;Such as Fruit is to determine that the received GRE message of institute meets preset condition.
Optionally, the sending module is specifically used for:
If second tunnel list item be it is multiple, using the tunnel address in each second tunnel list item respectively to it is described to It sends message and carries out GRE encapsulation, obtain the different each GRE message of tunnel destination address;By each GRE message obtained after encapsulation point It is not sent by corresponding gre tunneling.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including processor and machine readable storage medium, The machine readable storage medium is stored with the machine-executable instruction that can be executed by the processor, and the processor is by institute It states machine-executable instruction to promote: realizing any of the above-described file transmitting method step.
Fourth aspect, the embodiment of the present application provide a kind of machine readable storage medium, are stored with machine-executable instruction, When being called and being executed by processor, the machine-executable instruction promotes the processor: realizing any of the above-described report Literary sending method step.
In technical solution provided by the embodiments of the present application, the first tunnel table is inquired using the destination address of message to be sent; The the first tunnel list item to match if it does not exist with the destination address of message to be sent, it is determined that the target application of message to be sent Type;Utilize the second tunnel table of target application type queries;The the second tunnel list item to match if it exists with target application type, Then message to be sent is sent using the second tunnel list item.
By technical solution provided by the embodiments of the present application, the second tunnel table be central node according to receive, branch The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message that node is sent, centromere Point records asymmetric IP operation report in the GRE message in the GRE message for receiving asymmetric IP operation in the second tunnel table Mapping relations between the source address of literary application type and the gre tunneling for sending the GRE message, that is, establish corresponding tunnel table ?.And for central node, for the response message of a service message, the response message sent and the industry received The application type of business message be it is identical, therefore, when central node is when responding the service message received, need to send out Send the message to be sent of asymmetric IP operation, based on application type it is constant, can be inquired from the second tunnel table with it is to be sent The second tunnel list item that the application type of message matches, and then message to be sent is sent using the second tunnel list item.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of file transmitting method provided by the embodiments of the present application;
Fig. 2 is another flow chart of file transmitting method provided by the embodiments of the present application;
Fig. 3 is the schematic diagram that central node provided by the embodiments of the present application is interacted with branch node;
Fig. 4 is a kind of structural schematic diagram of packet transmission device provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
In order to solve the problems, such as that central node can not obtain the tunnel destination address of the GRE message of asymmetric IP operation, this Application embodiment provides a kind of file transmitting method and device, is applied to central node, wherein provided by the embodiments of the present application A kind of file transmitting method includes:
The first tunnel table is inquired using the destination address of message to be sent;
The the first tunnel list item to match if it does not exist with the destination address of message to be sent, it is determined that message to be sent Target application type;
Utilize the second tunnel table of target application type queries, wherein the second tunnel table is the GRE sent according to branch node The tunnel source address of the application type of internal layer message and transmission the GRE message is established in message;
The the second tunnel list item to match if it exists with target application type is then sent using the second tunnel list item to be sent Message.
By technical solution provided by the embodiments of the present application, the second tunnel table be central node according to receive, branch The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message that node is sent, centromere Point records asymmetric IP operation report in the GRE message in the GRE message for receiving asymmetric IP operation in the second tunnel table Mapping relations between the source address of literary application type and the gre tunneling for sending the GRE message, that is, establish corresponding tunnel table ?.And for central node, for the response message of a service message, the response message sent and the industry received The application type of business message be it is identical, therefore, when central node is when responding the service message received, need to send out Send the message to be sent of asymmetric IP operation, based on application type it is constant, can be inquired from the second tunnel table with it is to be sent The second tunnel list item that the application type of message matches, and then message to be sent is sent using the second tunnel list item.
A kind of file transmitting method provided by the embodiments of the present application is introduced first below.The embodiment of the present application provides File transmitting method be applied to central node, central node be configured with GRE P2MP (point 2multiple point, point To multiple spot main website) tunnel interface, it is based on GRE P2MP tunnel interface, central node can be established a plurality of with multiple branch nodes Gre tunneling is realized and establishes the tunnel GRE P2MP between central node and branch node.It is believed that central node is The side P2MP, i.e. a central node correspond to multiple branch nodes, and branch node is the side P2P, i.e. a branch node only corresponds to one A central node.
Central node can transmit GRE message by the gre tunneling established with branch node.Central node and branch node It can be packaged according to data message of the GRE protocol to required transmission, obtain GRE message, then send by gre tunneling GRE message.
As shown in Figure 1, a kind of file transmitting method provided by the embodiments of the present application, includes the following steps.
S101 inquires the first tunnel table using the destination address of message to be sent;
Wherein, message to be sent is the message that central node is sent to branch node.It is believed that central node from branch The received message of node with the message sent to the branch node be it is corresponding, for example, pair of request message and response message It should be related to.Therefore, message to be sent is center node from the corresponding response message of branch node received request message.
Wherein, the first tunnel table is that the source address of internal layer message and transmission should in the GRE message sent according to branch node What the tunnel source address of GRE message was established.It may include multiple first tunnels list item in first tunnel table, each tunnel list item note Record the corresponding pass of the source address of internal layer message and the tunnel source address for sending the GRE message in the GRE message that branch node is sent System.
For example, the source address of internal layer message is 10.1.1.2 in the GRE message that branch node is sent, the GRE message is sent Tunnel source address be 11.1.1.2, then for the source address and the tunnel source address, record is such as the following table 1 institute in the first tunnel table Show:
Table 1
Wherein, the first tunnel table can be pre-stored within central node.For each the first tunnel list item, in addition to record Other than corresponding relationship, ageing time can also be set.The ageing time of first tunnel list item is for indicating the first tunnel list item Duration needed for aging, ageing time are constantly reduced with the time, until becoming 0.After ageing time becomes 0, this One tunnel list item can be deleted from the first tunnel table.Wherein, ageing time timing since being established the first tunnel list item.
For example, the ageing time of a first tunnel list item is 10 seconds, then the timing since being established the first tunnel list item, Ageing time continued reduction since 10 seconds, and after ageing time becomes 0 second, which can be deleted.
By the way that ageing time is arranged to the first tunnel list item, every one first tunnel list item is only in corresponding ageing time It is stored in the first tunnel table, once ageing time becomes 0, which is deleted, and is deposited so that release is certain Store up space.In this way, not only saving the memory space resource of central node.
S102, the first tunnel list item to match if it does not exist with the destination address of message to be sent, it is determined that be sent The target application type of message.
There is no the first tunnel list item that the destination address with message to be sent matches, i.e. do not remember in the first tunnel table Address identical with the destination address of message to be sent is recorded, and then corresponding tunnel source address can not be found.
Wherein it is determined that the implementation of the application type of message to be sent can be through TCP (Transmission Control Protocol transmission control protocol) head or UDP (User Datagram Protocol, User Datagram Protocol) Port information in head determines, can also pass through ICMP (Internet Control Message Protocol, internet control Message protocol processed) message type field or code field determine, can also by IP (Internet Protocol, it is internet Agreement) the protocol information of head determines.
For example, the application type determined is OSPF when the protocol information of the IP of message to be sent head is 89 (Open Shortest Path First, ospf);When the protocol letter of the IP head of message to be sent Breath is 58 and ICMP TYPE field when being 135, and the application type determined is ND (Neighbor Discovery, Lin Jufa Existing agreement) agreement.
Three of the above is not limited in for the determination method of application type, can also be determined by other means, herein It repeats no more.
S103 utilizes the second tunnel table of target application type queries.
Wherein, the second tunnel table is the application type of internal layer message and transmission in the GRE message sent according to branch node What the tunnel source address of the GRE message was established.Second tunnel table may include multiple second tunnels list item, every one second tunnel table The tunnel source address of the application type and transmission of internal layer message the GRE message in the GRE message that item record branch node is sent Corresponding relationship.
For example, the application type that central node receives internal layer message in the GRE message of branch node transmission is OSPF, and The tunnel source address for sending the GRE message is 2.0.0.1, the then application type recorded in the second tunnel list item and tunnel source address Corresponding relationship are as follows: the corresponding relationship of OSPF and 2.0.0.1.
In the second tunnel table, for same application type, there can be a second tunnel list item, can also have multiple Second tunnel list item, i.e. the second tunnel list item comprising same application type have one or more.In this way, a kind of application type can To be corresponding with a tunnel source address, multiple tunnel source addresses can also be corresponding with.
For example, the second tunnel list item based on application type OSPF includes: OSPF and 2.0.0.1 in the second tunnel table The second tunnel list item of the second tunnel list item of second tunnel list item, OSPF and 11.1.1.2, OSPF and 11.1.1.24.
In a kind of implementation using the second tunnel table of target application type queries, inquires in the second tunnel table and whether deposit In target application type, and if it exists, can think, in the second tunnel table comprising target application type the second tunnel list item with Target application type matches.
S104, the second tunnel list item to match if it exists with target application type are then sent using the second tunnel list item Message to be sent.
It in the presence of the second tunnel list item to match with target application type, i.e. include target application class in the second tunnel list item Type.
Specifically, obtain the second tunnel list item to match with target application type from the second tunnel table, and from this Tunnel source address is obtained in two tunnel list items, and using acquired tunnel source address as the tunnel being packaged to message to be sent Road destination address, and message to be sent is packaged using the tunnel destination address.
To the available GRE message based on the message to be sent after the completion of message to be sent encapsulation, the biography of the GRE message The tunnel destination address of defeated protocol massages head is the tunnel source address obtained from the second tunnel table.Central node is being somebody's turn to do GRE message and then the GRE message is sent to by tunnel destination address by gre tunneling.In this way, central node just completes Message to be sent is sent by gre tunneling.
In a kind of embodiment, if with the second tunnel list item that target application type matches have it is multiple in the case where, GRE encapsulation is carried out to message to be sent respectively using the tunnel address in each second tunnel list item, obtains tunnel destination address not Same each GRE message;Each GRE message obtained after encapsulation is passed through corresponding gre tunneling respectively to send.
For example, there are two the second tunnel list items to match in the second tunnel table with target application type OSPF, and should The tunnel address for including in two the second tunnel list items is respectively as follows: 2.0.0.1 and 11.1.1.2.Then using 2.0.0.1 to pending Text of delivering newspaper carries out GRE encapsulation, the available one GRE message based on the message to be sent, and utilizes 11.1.1.2 to pending Text of delivering newspaper carries out GRE encapsulation, another available GRE message based on the message to be sent.Central node by with 2.0.0.1 gre tunneling sends first GRE message, by sending second GRE message with the gre tunneling of 11.1.1.2.
Second tunnel table is the application type of internal layer message and transmission GRE in the GRE message sent according to branch node What the tunnel source address of message was established, for the foundation of the second tunnel list item in the second tunnel table, in a kind of embodiment, center Node can receive the GRE message of branch node transmission, and the branch node for sending the GRE message can be either branch node.
Central node is after receiving GRE message, it can be determined that whether the GRE message meets preset condition.Wherein, in advance If condition can be customized setting.
In a kind of embodiment, central node it is available the destination address of internal layer message in received GRE message, and Whether the acquired destination address of judgement is center address of node, the multicast address to match with the address of central node and wide Broadcast any one of address;If it is, can determine that the received GRE message of institute meets preset condition, otherwise, then can determine The received GRE message of institute is unsatisfactory for preset condition, at this point, central node can carry out the GRE message according to the destination address Forwarding.
Wherein, when the destination address of internal layer message is center address of node in received GRE message when, then can be true Center node the received GRE message meet preset condition.
When in received GRE message the destination address of internal layer message be the multicast that matches with the address of central node When location, then it can determine that central node is one of them in the multiple equipment for receive internal layer message.Wherein, multicast address is to connect Receive a group address of internal layer message, the match address of i.e. central node of the address of central node and multicast address is multicast address In one of address.
For example, in received GRE message the destination address of internal layer message be ff02::1:ff00:1111, the destination Location is the multicast address of Ipv6, as long as last 24 of address are 00:1111, it can thinks that the address is in multicast address One of address.When center address of node be 1111::1111, then can determine 1111::1111 and ff02::1:ff00: 1111 match, i.e., the address of central node is one of address in multicast address, and then determines central node institute The received GRE message meets preset condition.
When the destination address of internal layer message is broadcast address in received GRE message when, it may be considered that receiving this The address of internal layer message is one of address in broadcast address, and then determines the received GRE message of central node institute Meet preset condition.
If judging, the GRE message meets preset condition, and internal layer message answers in the available GRE message of central node With the tunnel source address of type and transmission the GRE message.
Specifically, central node carries out decapsulation processing to GRE message, the tunnel source address of the available GRE message, The tunnel source address is to send the tunnel interface address of the branch node of the GRE message.It can also obtain in the GRE message Internal layer message can determine the application type of the internal layer message according to the internal layer message.
In obtaining the GRE message after the tunnel source address of the application type of internal layer message and transmission the GRE message, root Corresponding tunnel list item is established according to the application type and tunnel source address that get, ageing time is set for the tunnel list item, and It is maintained in the second tunnel table.
Wherein, the duration that ageing time is used to indicate the tunnel entry aging is set for the tunnel list item.In this way, the second tunnel Each tunnel list item in road table includes application type, tunnel source address and ageing time.
It is a tunnel list item in the second tunnel table in table 2 for following table 2, corresponding relationship in the tunnel list item are as follows: The corresponding relationship of OSPF and 2.0.0.1, the ageing time of the tunnel list item are 60 seconds.
Table 2
The ageing time of tunnel list item can since tunnel list item establish timing, when the ageing time of a tunnel list item After becoming 0 second, which can delete from the second tunnel table.
For example, the ageing time of a tunnel list item in the second tunnel table is 60 seconds, then opened from tunnel list item foundation Beginning timing, ageing time continued reduction since 60 seconds, and after ageing time becomes 0 second, which can be from the second tunnel It is deleted in table.
Ageing time can be customized setting.In a kind of implementation, ageing time can be according to the business of message Type is set, specifically, set ageing time be greater than belong to that the message of same type of service sends twice in succession when Between be spaced.For example, being directed to a kind of message of type of service, the time interval for sending message twice in succession is 50 seconds, then being directed to should The ageing time of type of service should be greater than 50 seconds.
By the way that ageing time is arranged for the tunnel list item in the second tunnel table, each tunnel list item is only in corresponding aging It is maintained in time in the second tunnel table, once ageing time becomes 0, which deletes from the second tunnel table, thus Discharge certain memory space.In this way, saving the memory space resource of central node.
It, can also will be with target application when sending message to be sent using the second tunnel list item in a kind of embodiment The ageing time for the second tunnel list item that type matches resets to preset default value.
Wherein, default value can be customized setting.It resets to defaults by the ageing time of the second tunnel list item Afterwards, then the ageing time of the second tunnel list item becomes default value, restarts timing.When a length of default value ageing time After becoming 0, and the second tunnel list item is not matched success during ageing time becomes 0, then by the corresponding relationship It deletes.
It is illustrated by taking above-mentioned table 2 as an example, default value is 60 seconds, and the ageing time in upper table 1 persistently reduces, in aging Between when being reduced to 10 seconds, central node is matched into when target application type is that OSPF is matched with the tunnel list item in table 2 Function then resets to the ageing time in table 2 60 seconds, the ageing time timing since 60 seconds again.
The embodiment of the present application also provides a kind of file transmitting method, as shown in Fig. 2, the file transmitting method includes following step Suddenly.
S201 receives the GRE message that branch node is sent.
In conjunction with being illustrated for Fig. 3.A is center node, and B is branch node, and gre tunneling is established between A and B.Wherein, The address IPv6 of A configuration is 1111::1111, tunnel address 1.0.0.1, when the address IPv6 that B is needed to configure is similarly When 1111::1111, according to IPv6 protocol requirement, before the address IPv6 configured is come into force, first sends NS message and carry out repeatedly Location detection, NS message detect address, i.e. 1111::1111 needed for carrying.The tunnel address of B is 2.0.0.1, and B is using the tunnel Location is packaged NS message, i.e., NS message is internal layer message, obtains the GRE message based on NS message, and the GRE message is sent out Give A.
For the GRE message, as shown in table 3 below, encapsulated layer IP tunnel source addresses are 2.0.0.1, tunnel destination Location are as follows: 1.0.0.1, the source IP address that internal layer is IP are as follows::, destination address ff02::1:ff00:1111.
Table 3
Source address Destination address
Encapsulated layer IP head 2.0.0.1 1.0.0.1
Internal layer IP head :: ff02::1:ff00:1111
S202, obtain institute received GRE message in internal layer message destination address, and judge acquired in destination address be No any one of multicast address and broadcast address for center address of node and the address matching of central node.If so, Then determine that the received GRE message of institute meets preset condition.
After A receives GRE message, GRE message is decapsulated, the destination address for obtaining NS message is ff02::1: Ff00:1111, which is multicast address, and is matched with the address the IPv6 1111::1111 of A, then can determine the GRE Message meets preset condition.
In addition, after A receives GRE message the first tunnel list item can be established according to the GRE message, as shown in table 4 below.
Table 4
Wherein, the ageing time for the first tunnel list item established is 10 seconds, which is maintained in first In tunnel table.
S203 obtains the tunnel source address of the application type of internal layer message and transmission the GRE message in the GRE message.
A is after to GRE message decapsulation processing, available NS message, and message IP from NS message is available Protocol information, and can determine that the application type of NS message is according to protocol information and icmp packet information IPv6DAD (Duplicate address detect, duplicate address detection) application type.In addition, A can also be from GRE message Acquisition tunnel source address is 2.0.0.1.
S204 establishes corresponding tunnel list item according to the application type and tunnel source address that get, for the tunnel list item Ageing time is set, and is maintained in the second tunnel table.
Include: in the tunnel list item established IPv6DAD and 2.0.0.1 corresponding relationship and ageing time 10 seconds.Institute The tunnel list item of foundation is as shown in table 5 below.
Table 5
S205, using message to be sent destination address inquire the first tunnel table, if it does not exist with the mesh of message to be sent The first tunnel list item for matching of address, it is determined that the target application type of message to be sent.
A, when finding be detected as 1111::1111, can be determined when carrying out duplicate address detection processing to NA message With the address conflict of A itself, then need to send NA message to B, to report the address conflict to B.A to B send NA message when be It is sent in a manner of multicast, so for NA message, source address 1111::1111, destination address ff02::1.
A is inquired in the first tunnel table using the destination address (ff02::1) of NA message whether there is and ff02::1 phase The the first tunnel list item matched can determine the mesh of NA message if not inquiring the first tunnel list item to match with ff02::1 Application type is marked, the second tunnel table that inquiry matches with the presence or absence of the target application type with NA message in the second tunnel table ?.Such as, the application type for determining NA message is IPv6DAD, and using IPv6DAD as target application type.
S206 utilizes the second tunnel table of target application type queries.
A is inquired in the second tunnel table with the presence or absence of the second tunnel list item to match with IPv6DAD, i.e., in the second tunnel Search whether there is the second tunnel list item to match with IPv6DAD in each tunnel list item included by table.
S207, the second tunnel list item to match if it exists with target application type are then sent using the second tunnel list item Message to be sent.And the ageing time of the second tunnel list item to match with target application type is reset into preset default Value.
When only the tunnel list item of above-mentioned table 5 matches with target application type IPv6DAD in the second tunnel table, then from above-mentioned It is 2.0.0.1 that the corresponding tunnel source address of IPv6DAD is obtained in the tunnel list item of table 5, using address 2.0.0.1 as tunnel mesh Address, NA message is packaged, the GRE message based on NA message is obtained.For the GRE report based on NA message Text, as shown in table 6 below, encapsulated layer IP tunnel source addresses are 1.0.0.1, tunnel destination address are as follows: 2.0.0.1, internal layer IP The source IP address of head is 1111::1111, destination address ff02::1.
Table 6
Source address Destination address
Encapsulated layer IP head 1.0.0.1 2.0.0.1
Internal layer IP head 1111::1111 ff02::1
A is being packaged processing to NA message using the second tunnel list item, after obtaining corresponding GRE message, by the GRE Message is sent to B by corresponding gre tunneling.In this way, for message to be sent, even if cannot be got from the first tunnel table Tunnel destination address can obtain tunnel destination by technical solution provided by the embodiments of the present application from the second tunnel table Location, and then message to be sent is packaged using the tunnel destination address, and the GRE message obtained after encapsulation is sent to point Zhi Jiedian.
Corresponding to above-mentioned file transmitting method embodiment, the embodiment of the present application also provides a kind of packet transmission device, application In central node, as shown in figure 4, the packet transmission device includes:
First enquiry module 410, for inquiring the first tunnel table using the destination address of message to be sent;
First determining module 420, the first tunnel table for matching if it does not exist with the destination address of message to be sent , it is determined that the target application type of message to be sent;
Second enquiry module 430, for utilizing the second tunnel table of target application type queries, wherein the second tunnel table is The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message sent according to branch node 's;
Sending module 440, the second tunnel list item for matching if it exists with target application type then utilize the second tunnel Road list item sends message to be sent.
In a kind of embodiment, which can also include:
Judgment module for receiving the GRE message of branch node transmission, and judges whether the GRE message meets default item Part;
Module is obtained, for when the judging result of judgment module, which is, is, then obtaining answering for internal layer message in the GRE message With the tunnel source address of type and transmission the GRE message;
Module is established, for establishing corresponding tunnel list item according to the application type and tunnel source address that get, for this Ageing time is arranged in tunnel list item, and is maintained in the second tunnel table.
In a kind of embodiment, which can also include:
Module is reset, it is default for resetting to the ageing time of the second tunnel list item to match with target application type Default value.
In a kind of embodiment, judgment module is specifically used for:
The destination address for obtaining internal layer message in the received GRE message of institute, judge acquired in destination address whether be Any one of heart address of node, the multicast address to match with the address of central node and broadcast address;If so, determining The received GRE message of institute meets preset condition.
In a kind of embodiment, sending module 440 is specifically used for:
If the second tunnel list item be it is multiple, using the tunnel address in each second tunnel list item respectively to message to be sent GRE encapsulation is carried out, the different each GRE message of tunnel destination address is obtained;Each GRE message obtained after encapsulation is passed through pair respectively The gre tunneling answered is sent.
By technical solution provided by the embodiments of the present application, the second tunnel table be central node according to receive, branch The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message that node is sent, centromere Point records asymmetric IP operation report in the GRE message in the GRE message for receiving asymmetric IP operation in the second tunnel table Mapping relations between the source address of literary application type and the gre tunneling for sending the GRE message, that is, establish corresponding tunnel table ?.And for central node, for the response message of a service message, the response message sent and the industry received The application type of business message be it is identical, therefore, when central node is when responding the service message received, need to send out Send the message to be sent of asymmetric IP operation, based on application type it is constant, can be inquired from the second tunnel table with it is to be sent The second tunnel list item that the application type of message matches, and then message to be sent is sent using the second tunnel list item.
The embodiment of the present application also provides a kind of electronic equipment, as shown in figure 5, including processor 510 and machine readable depositing Storage media 520, machine readable storage medium 520 are stored with the machine-executable instruction that can be executed by processor 510.
In addition, as shown in figure 5, electronic equipment can also include: communication interface 530 and communication bus 540;Wherein, it handles Device 510, machine readable storage medium 520, communication interface 530 complete mutual communication, communication interface by communication bus 540 530 for the communication between above-mentioned electronic equipment and other equipment.
Processor 510 promotes to execute the embodiment of any of the above-described kind of file transmitting method, wherein file transmitting method packet It includes:
The first tunnel table is inquired using the destination address of message to be sent;
The the first tunnel list item to match if it does not exist with the destination address of message to be sent, it is determined that message to be sent Target application type;
Utilize the second tunnel table of target application type queries, wherein the second tunnel table is the GRE sent according to branch node The tunnel source address of the application type of internal layer message and transmission the GRE message is established in message;
The the second tunnel list item to match if it exists with target application type is then sent using the second tunnel list item to be sent Message.
By technical solution provided by the embodiments of the present application, the second tunnel table be central node according to receive, branch The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message that node is sent, centromere Point records asymmetric IP operation report in the GRE message in the GRE message for receiving asymmetric IP operation in the second tunnel table Mapping relations between the source address of literary application type and the gre tunneling for sending the GRE message, that is, establish corresponding tunnel table ?.And for central node, for the response message of a service message, the response message sent and the industry received The application type of business message be it is identical, therefore, when central node is when responding the service message received, need to send out Send the message to be sent of asymmetric IP operation, based on application type it is constant, can be inquired from the second tunnel table with it is to be sent The second tunnel list item that the application type of message matches, and then message to be sent is sent using the second tunnel list item.
Above-mentioned communication bus 540 can be PCI, and (Peripheral Component Interconnect, external components are mutual Even standard) bus or EISA (Extended Industry Standard Architecture, expanding the industrial standard structure) be total Line etc..The communication bus 540 can be divided into address bus, data/address bus, control bus etc..For convenient for indicating, only with one in Fig. 5 Bar thick line indicates, it is not intended that an only bus or a type of bus.
Machine readable storage medium 520 may include RAM (Random Access Memory, random access memory), It also may include NVM (Non-Volatile Memory, nonvolatile memory), for example, at least a magnetic disk storage.Separately Outside, machine readable storage medium 520 can also be that at least one is located remotely from the storage device of aforementioned processor.
Above-mentioned processor 510 can be general processor, including CPU (Central Processing Unit, centre Manage device), NP (Network Processor, network processing unit) etc.;It can also be DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, it is dedicated Integrated circuit), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable patrol Collect device, discrete gate or transistor logic, discrete hardware components.
Corresponding to the embodiment of above-mentioned file transmitting method, the embodiment of the present application also provides a kind of machine readable storage Jie Matter is stored with machine-executable instruction, and when being called and being executed by processor, machine-executable instruction promotes processor to realize State file transmitting method.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.It is sent out especially for message For sending device, electronic equipment and machine readable storage medium embodiment, since it is substantially similar to file transmitting method reality Example is applied, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely the preferred embodiments of the application, are not intended to limit the protection scope of the application.It is all Any modification, equivalent replacement, improvement and so within spirit herein and principle are all contained in the protection scope of the application It is interior.

Claims (12)

1. a kind of file transmitting method, which is characterized in that be applied to central node, which comprises
The first tunnel table is inquired using the destination address of message to be sent;
The the first tunnel list item to match if it does not exist with the destination address of the message to be sent, it is determined that described pending to deliver newspaper The target application type of text;
Utilize second tunnel table of target application type queries, wherein second tunnel table is sent according to branch node Generic route encapsulation GRE message in internal layer message application type and send the GRE message tunnel source address establish;
The the second tunnel list item to match if it exists with the target application type then sends institute using second tunnel list item State message to be sent.
2. the method according to claim 1, wherein the method also includes:
The GRE message that branch node is sent is received, and judges whether the GRE message meets preset condition;
If so, obtaining the tunnel source address of the application type of internal layer message and transmission the GRE message in the GRE message;
Corresponding tunnel list item is established according to the application type and tunnel source address that get, when aging is set for the tunnel list item Between, and be maintained in the second tunnel table.
3. according to the method described in claim 2, it is characterized in that, described described pending using the transmission of second tunnel list item Deliver newspaper text when, the method also includes:
The ageing time of the second tunnel list item to match with the target application type is reset into preset default value.
4. according to the method described in claim 2, it is characterized in that, described judge whether the GRE message meets preset condition Step includes:
Obtain the destination address of internal layer message in received GRE message;
Whether the acquired destination address of judgement is that the address of the central node and the address of the central node match Any one of multicast address and broadcast address;
If it is, determining that the received GRE message of institute meets preset condition.
5. the method according to claim 1, wherein described described pending using the transmission of second tunnel list item Deliver newspaper text step include:
If second tunnel list item be it is multiple, using the tunnel address in each second tunnel list item respectively to described to be sent Message carries out GRE encapsulation, obtains the different each GRE message of tunnel destination address;
Each GRE message obtained after encapsulation is passed through corresponding gre tunneling respectively to send.
6. a kind of packet transmission device, which is characterized in that be applied to central node, described device includes:
First enquiry module, for inquiring the first tunnel table using the destination address of message to be sent;
First determining module, the first tunnel list item for matching if it does not exist with the destination address of the message to be sent, Then determine the target application type of the message to be sent;
Second enquiry module, for utilizing second tunnel table of target application type queries, wherein second tunnel table is The tunnel source address of the application type of internal layer message and transmission the GRE message is established in the GRE message sent according to branch node 's;
Sending module, the second tunnel list item for matching if it exists with the target application type then utilize described second Tunnel list item sends the message to be sent.
7. device according to claim 6, which is characterized in that described device further include:
Judgment module for receiving the GRE message of branch node transmission, and judges whether the GRE message meets preset condition;
Module is obtained, for when the judging result of the judgment module, which is, is, then obtaining answering for internal layer message in the GRE message With the tunnel source address of type and transmission the GRE message;
Module is established, for establishing corresponding tunnel list item according to the application type and tunnel source address that get, for the tunnel Ageing time is arranged in list item, and is maintained in the second tunnel table.
8. device according to claim 7, which is characterized in that described device further include:
Module is reset, it is default for resetting to the ageing time of the second tunnel list item to match with the target application type Default value.
9. device according to claim 7, which is characterized in that the judgment module is specifically used for:
Obtain institute received GRE message in internal layer message destination address, judge acquired in destination address whether be in described Any one of heart address of node, the multicast address to match with the address of the central node and broadcast address;If so, Determine that the received GRE message of institute meets preset condition.
10. device according to claim 6, which is characterized in that the sending module is specifically used for:
If second tunnel list item be it is multiple, using the tunnel address in each second tunnel list item respectively to described to be sent Message carries out GRE encapsulation, obtains the different each GRE message of tunnel destination address;Each GRE message obtained after encapsulation is led to respectively Corresponding gre tunneling is crossed to send.
11. a kind of electronic equipment, which is characterized in that including processor and machine readable storage medium, the machine readable storage Media storage has the machine-executable instruction that can be executed by the processor, and the processor is by the machine-executable instruction Promote: realizing any method and step of claim 1-5.
12. a kind of machine readable storage medium, which is characterized in that be stored with machine-executable instruction, by processor call and When execution, the machine-executable instruction promotes the processor: realizing any method and step of claim 1-5.
CN201811273708.9A 2018-10-30 2018-10-30 Message sending method and device Active CN109039918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811273708.9A CN109039918B (en) 2018-10-30 2018-10-30 Message sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811273708.9A CN109039918B (en) 2018-10-30 2018-10-30 Message sending method and device

Publications (2)

Publication Number Publication Date
CN109039918A true CN109039918A (en) 2018-12-18
CN109039918B CN109039918B (en) 2021-05-28

Family

ID=64614465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811273708.9A Active CN109039918B (en) 2018-10-30 2018-10-30 Message sending method and device

Country Status (1)

Country Link
CN (1) CN109039918B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743256A (en) * 2019-03-22 2019-05-10 成都西加云杉科技有限公司 Message forwarding method and device
CN111211981A (en) * 2019-12-30 2020-05-29 杭州迪普科技股份有限公司 Message forwarding method and device based on policy routing
CN113794643A (en) * 2021-08-31 2021-12-14 新华三信息安全技术有限公司 Flow forwarding method and node equipment
CN114697408A (en) * 2020-12-28 2022-07-01 国家计算机网络与信息安全管理中心 Tunnel message processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848171A (en) * 2010-07-01 2010-09-29 杭州华三通信技术有限公司 Data transmission method based on GRE tunnel, device and system
CN102130826A (en) * 2010-11-25 2011-07-20 华为技术有限公司 Message transmitting method and device
CN106878184A (en) * 2017-02-28 2017-06-20 新华三技术有限公司 A kind of data message transmission method and device
WO2018109536A1 (en) * 2016-12-17 2018-06-21 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for monitoring virtual extensible local area network (vxlan) tunnel with border gateway protocol (bgp)-ethernet virtual private network (evpn) infrastructure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848171A (en) * 2010-07-01 2010-09-29 杭州华三通信技术有限公司 Data transmission method based on GRE tunnel, device and system
CN102130826A (en) * 2010-11-25 2011-07-20 华为技术有限公司 Message transmitting method and device
WO2018109536A1 (en) * 2016-12-17 2018-06-21 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for monitoring virtual extensible local area network (vxlan) tunnel with border gateway protocol (bgp)-ethernet virtual private network (evpn) infrastructure
CN106878184A (en) * 2017-02-28 2017-06-20 新华三技术有限公司 A kind of data message transmission method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743256A (en) * 2019-03-22 2019-05-10 成都西加云杉科技有限公司 Message forwarding method and device
CN109743256B (en) * 2019-03-22 2022-01-14 成都西加云杉科技有限公司 Message forwarding method and device
CN111211981A (en) * 2019-12-30 2020-05-29 杭州迪普科技股份有限公司 Message forwarding method and device based on policy routing
CN114697408A (en) * 2020-12-28 2022-07-01 国家计算机网络与信息安全管理中心 Tunnel message processing method and device
CN114697408B (en) * 2020-12-28 2023-09-26 国家计算机网络与信息安全管理中心 Tunnel message processing method and device
CN113794643A (en) * 2021-08-31 2021-12-14 新华三信息安全技术有限公司 Flow forwarding method and node equipment

Also Published As

Publication number Publication date
CN109039918B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN109039918A (en) A kind of file transmitting method and device
US11909633B2 (en) Packet processing method, device, and system
US10225189B2 (en) Egress peer engineering using IPv4-mapped IPv6 addresses
CN111682996B (en) Method for forwarding message in network, network node and network system
CA2644900C (en) Connecting multi-hop mesh networks using mac bridge
EP3190754B1 (en) Method and apparatus for processing a modified packet
WO2018072728A1 (en) Segment identifier acquisition
CN113595897B (en) Path detection method and device
CN109257279A (en) A kind of message forwarding method and device
CN102273177A (en) Neighbour discovery protocol mediation
CN104683210A (en) Automatic tunnel establishing method and device
CN110278155B (en) Method and apparatus for assisted replication with multi-homing and local biasing
CN106507414B (en) Message forwarding method and device
CN105187311A (en) Message forwarding method and message forwarding device
CN109379241A (en) A kind of routing information determines method and device
CN109547350A (en) A kind of route learning method and gateway
CN108075991B (en) Message forwarding method and device
CN108259301A (en) A kind of tunnel loading method and device
CN107659436A (en) A kind of method and device for preventing service disconnection
CN106161249A (en) The processing method and processing device of PPPoE message
CN113810288B (en) Message backhaul method and device
CN110391984B (en) Message forwarding method and device
CN107689881A (en) Message processing method and device
CN107453998A (en) The method and apparatus of transmitting message
CN104394081A (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant