WO2021139289A1 - 报文发送方法、路由表项的生成方法、装置及存储介质 - Google Patents

报文发送方法、路由表项的生成方法、装置及存储介质 Download PDF

Info

Publication number
WO2021139289A1
WO2021139289A1 PCT/CN2020/120460 CN2020120460W WO2021139289A1 WO 2021139289 A1 WO2021139289 A1 WO 2021139289A1 CN 2020120460 W CN2020120460 W CN 2020120460W WO 2021139289 A1 WO2021139289 A1 WO 2021139289A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
tunnel
site
entry
routing table
Prior art date
Application number
PCT/CN2020/120460
Other languages
English (en)
French (fr)
Inventor
房永龙
何宏伟
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to JP2022542047A priority Critical patent/JP7469479B2/ja
Priority to EP20912260.5A priority patent/EP4068704A4/en
Publication of WO2021139289A1 publication Critical patent/WO2021139289A1/zh
Priority to US17/859,335 priority patent/US20220345404A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]

Definitions

  • This application relates to the field of communication technology, and in particular to a method for sending a message, a method, device and storage medium for generating a routing table entry.
  • SD-WAN Software Defined WAN
  • SDN Software Defined Networking
  • the interface of the next hop device can be implemented using the interface of the next hop device. That is, the site prefix of the site where the next-hop device is located and the interface identifier of the next-hop device can be stored in the routing table as a routing table entry, and the interface identifier of the next-hop device can be The tunnel identifier of the tunnel established between one-hop devices is stored in the tunnel table as a tunnel entry. In this way, when a data message is received, the destination address carried in the data message can be matched with the routing table entry in the routing table. If the destination address of the data packet matches a certain routing table entry in the routing table, then the corresponding tunnel table entry can be matched from the tunnel table according to the interface identifier included in the routing table entry. If the interface identifier included in this routing table entry matches a certain tunnel entry in the tunnel table, then the data packet can be sent according to the tunnel identified by the tunnel identifier included in this tunnel entry.
  • routing table entries about the network device can be stored in the routing table. In this way, there will be a large number of duplicate routing table entries. Moreover, when the state of the network device changes, it will cause the routing table to be updated, which in turn will affect the network performance.
  • This application provides a message sending method, device and storage medium, which can solve the problem that there are a large number of repeated routing table entries in the related art, and when the state of the network equipment changes, the routing table will be updated, thereby alleviating the problem.
  • the impact of network performance. is as follows:
  • a method for sending a message wherein a routing table is stored in the first network device, the routing table includes a plurality of routing table entries, and each routing table entry of the plurality of routing table entries Include a site prefix and the corresponding site identifier.
  • the first network device receives a first data packet; the first network device determines a target routing table entry from the routing table according to the destination address, and the destination address matches the The site prefix included in the target routing table entry, and the site identifier included in the target routing table entry is used to identify the second site; the first network device sends the first datagram to the network device deployed in the second site Text.
  • the first data message carries a destination address
  • the first network device refers to a network device deployed in the first site.
  • each routing table entry in the routing table stored by the first network device in the first site includes a site prefix and a corresponding site identifier
  • the target routing table entry can be determined from the routing table. Since the site identifier in the target routing table entry is used to identify the second site, the first network device can directly send the first data message to the second site according to the site identifier in the target routing table entry.
  • the first network device can directly send it to the second site according to the site identifier of the second site, without determining whether the data message is specifically sent to the second site Which interface of the network device, and, for a site, the first network device can store only one routing table entry, avoiding a large number of repeated routing table entries, and also avoiding changes in the status of the network device. Lead to an update of the routing table.
  • the first network device determines according to the site identifier included in the target routing table entry One or more tunnel entries, where the one or more tunnel entries refer to tunnel entries corresponding to the tunnel established between the first site and the second site; the first network device receives information from the One tunnel entry is selected from one or more tunnel entries as the target tunnel entry; the first network device sends the first data packet through the tunnel corresponding to the target tunnel entry.
  • the first network device determines the site identifications included in the target routing table entry according to the first network device, Determine one or more tunnel identifiers, where the one or more tunnel identifiers refer to the identifiers of the tunnel established between the first site and the second site; the first network device is based on the one or more tunnel identifiers.
  • the tunnel identifier is used to determine the one or more tunnel table entries from the tunnel table.
  • a tunnel table is stored in the first network device, each tunnel entry in the tunnel table includes a tunnel identifier and corresponding tunnel attribute information, and the tunnel table is used to store tunnels corresponding to multiple sites Entry, the multiple sites refer to sites that have tunnels established with the first site, and the multiple sites include the second site.
  • the first network device may determine one or more tunnel identifiers according to the site identifiers included in the target routing table entry, and the one or more tunnel identifiers refer to the tunnel established between the first site and the second site Of the logo. After that, the first network device may determine one or more tunnel table entries from the tunnel table according to the one or more tunnel identifiers.
  • the tunnel attribute information included in each tunnel entry may include the tunnel encapsulation mode, the source address and destination address of the tunnel, the bandwidth of the tunnel, and the delay of the tunnel.
  • the first network device may store a first mapping relationship between the site identifier and the tunnel identifier, that is, the first mapping relationship stores the identifiers of each site that has a tunnel with the first site, and The identifier of the tunnel established between each site and the first site. In this way, the first network device can determine one or more tunnel identifiers from the first mapping relationship according to the site identifiers included in the target routing table entry. After that, the first network device may determine from the tunnel table a tunnel entry that includes the same tunnel identifier as the one or more tunnel identifiers, so as to obtain one or more tunnel entries.
  • the first network device determines the site identifications included in the target routing table entry according to the first network device, Determine the identifier of the target tunnel table, where the target tunnel table refers to the tunnel table corresponding to the second site among the multiple tunnel tables; the first network device obtains information from the target tunnel table according to the identifier of the target tunnel table.
  • the target tunnel table is determined from multiple tunnel tables, and the tunnel entry stored in the target tunnel table is determined as the one or more tunnel entry.
  • a plurality of tunnel tables are stored in the first network device, and the plurality of tunnel tables are in one-to-one correspondence with a plurality of sites, and the plurality of sites refer to sites that have tunnels established with the first site , And the plurality of sites includes the second site.
  • the first network device may determine the identifier of the target tunnel table according to the site identifier included in the target routing table entry, and the target tunnel table refers to the tunnel table corresponding to the second site among the multiple tunnel tables. After that, the first network device may determine the target tunnel table from the multiple tunnel tables according to the identifier of the target tunnel table, and determine the tunnel entry stored in the target tunnel table as one or more tunnel entry.
  • the first network device stores different tunnel tables for different sites, and the first network device can store the second mapping relationship between the site identifier and the tunnel table identifier, that is, the second mapping relationship is stored with the first site The identifier of each site where the tunnel is established, and the identifier of the tunnel table corresponding to each site. In this way, the first network device can determine the identifier of the target tunnel table from the second mapping relationship according to the site identifier included in the target routing table entry. After that, the target tunnel table can be determined from the multiple tunnel tables according to the identifier of the target tunnel table, and the tunnel entry in the target tunnel table can be determined as the one or more tunnel entry mentioned above.
  • the first network device can select a tunnel entry from the one or more tunnel entries as the target tunnel entry according to the tunnel selection strategy .
  • the first network device when there is no tunnel entry that satisfies the tunnel selection policy in the one or more tunnel entries, that is, the first network device cannot be included in the one or more tunnel entries according to the tunnel selection policy.
  • the target tunnel entry is selected.
  • the first network device may discard the first data packet.
  • the first network device may select one tunnel entry from one or more tunnel entries as the target tunnel entry by using a hash algorithm.
  • each tunnel entry in the one or more tunnel entries further includes a Unicom ID, and the Unicom ID is used to indicate whether the corresponding tunnel is connected.
  • the first network device When selecting a tunnel entry from the one or more tunnel entries as the target tunnel entry, the first network device filters out the tunnel entry with a valid Unicom identifier from the one or more tunnel entries; The first network device selects a tunnel entry from the filtered tunnel entry as the target tunnel entry.
  • the first network device After the first network device selects the target tunnel entry, it can obtain the tunnel identifier included in the target tunnel entry, use the tunnel identified by the tunnel identifier as the target tunnel, and then send the first data message through the target tunnel.
  • the target tunnel determined by the first network device may be the first network device and the second network device.
  • the tunnel established between network devices in the site may also be a tunnel established between the second network device and the network device in the second site.
  • the second network device is a network in the first site except the first network device equipment.
  • the first network device can directly obtain the tunnel of the target tunnel from the target tunnel table entry stored in itself.
  • the attribute information and then tunnel encapsulation of the first data message according to the acquired tunnel attribute information to obtain the second data message, and send the second data message through the target tunnel.
  • the first network device may add the tunnel identifier of the target tunnel to the first data packet.
  • Obtain the third data packet and send the third data packet to the second network device through the physical link with the second network device.
  • the second network device may parse the third data packet to obtain the tunnel identifier of the target tunnel and the first data packet.
  • the second network device may obtain the tunnel attribute information of the target tunnel from the target tunnel table entry stored by the second network device according to the tunnel identifier of the target tunnel, and then tunnel the first data packet according to the obtained tunnel attribute information Encapsulate to obtain the second data message, and send the second data message through the target tunnel.
  • a method for generating routing table entries is provided, and the method is applicable to a first network device that is deployed in a first site.
  • the first network device obtains a site prefix and a site identifier, the site identifier is used to identify a second site, and the network address of the second network device matches the site prefix; the first network device is in the first
  • a first routing table entry is added to the routing table of the network device, the first routing table entry includes the site prefix and the site identifier, and the first routing table entry is used to send a datagram to the second network device Text.
  • the network address of the second network device matches the site prefix obtained by the first network device, that is, obtained through the first network device.
  • the arrived site prefix and site identifier can send a data message to the second network device. Therefore, the first network device can add the acquired site prefix and site identifier as the first routing table entry to the stored routing table. In this way, for a site, the first network device can only store one routing table entry. Avoid a large number of duplicate routing table entries, and can also avoid the update of the routing table due to changes in the state of the network equipment.
  • the second network device can be deployed in the second site or the third site.
  • the first network device and the second network device can communicate directly or through other network devices. Transit for communication. Therefore, the following will be divided into three cases for description.
  • the second network device is deployed in the second site, and the first network device and the second network device access the same one or more transmission networks.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device, so , It can be determined that the site prefix and site identifier obtained by the first network device are the site prefix and site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network devices that access the same transmission network as the second network device include the first network device, that is, , The second network device can communicate with the first network device. Therefore, the control device can send the site prefix and site identifier of the second site to the first network device.
  • the first network device after the first network device adds a first routing table entry to the routing table of the first network device, the first network device obtains one or more transmission networks of the second network device Port TNP information, the one or more TNP information corresponds to the one or more transmission networks; the first network device establishes the connection between the first network device and the one or more transmission networks according to the one or more TNP information The tunnel between the second network devices; the first network device stores the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • the second network device when the second network device sends the site prefix and site identifier of the second site to the control device, it also sends the TNP information of the second network device.
  • the first network device receives the site prefix and site identifier of the second site sent by the control device, it can also receive one or more TNP information of the second network device. Or one-to-one correspondence between multiple transmission networks. That is, the one or more TNP information is TNP information corresponding to each transmission network in the same one or more transmission networks that the first network device and the second network device access.
  • the TNP information is used to indicate a physical interface or a logical interface that can be accessed from the outside, and the parameters required in the communication process.
  • TNP information may include network operator identification, encryption mode, whether there is network address translation, and the routing domain of the corresponding transmission network.
  • the first network device After the first network device receives one or more TNP information of the second network device, it can match its own TNP information with the one or more TNP information. If a TNP information of the first network device and a TNP information of the second network device can be matched successfully, then the first network device and the second network device can establish the first network device and the first network device through the pair of TNP information that is successfully matched. Two tunnels between network devices.
  • the TNP information of the first network device and the TNP information of the second network device are matched to determine whether the match is successful. That is, when one TNP information of the first network device and one TNP information of the second network device satisfy the matching condition, it can be determined that the TNP information of the first network device and the TNP information of the second network device can be successfully matched.
  • the matching condition can be set according to the actual situation.
  • the matching condition may mean that part of the data included in the two TNP information is the same, for example, the network operator identifiers included in the two TNP information are the same, or the routing domains of the transmission networks corresponding to the two TNP information are the same.
  • the matching condition may mean that all the information included in the two TNP information is the same.
  • TNP information of the first network device and the TNP information of the second network device can successfully match multiple pairs of TNP information, multiple tunnels may be established between the first network device and the second network device.
  • the first network device may directly use the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as A tunnel entry is stored.
  • one tunnel table or multiple tunnel tables may be stored in the first network device.
  • the first network device can use the tunnel identifier of each tunnel and the corresponding tunnel attribute information as a tunnel table The entry is added to the tunnel table, and the first mapping relationship between the site identifier of the second site and the tunnel identifier is stored.
  • the first network device may search for the tunnel table identifier corresponding to the second site in the second mapping relationship between the site identifier and the tunnel table identifier according to the site identifier of the second site.
  • the first network device may add the tunnel identifier of each tunnel currently established and the corresponding tunnel attribute information as a tunnel table entry to the tunnel table corresponding to the second site. If the tunnel table identifier corresponding to the second site is not found, the first network device can create a tunnel table, and add the tunnel identifier of each tunnel currently established and the corresponding tunnel attribute information as a tunnel table entry to the created tunnel table , And store the second mapping relationship between the site identifier of the second site and the tunnel table identifier of the tunnel table.
  • one or more third network devices are also deployed in the first site, and each third network device of the one or more third network devices establishes a tunnel with the network device in the second site, And each third network device in the one or more third network devices also has a physical link established with the first network device.
  • the first network device can also obtain from the corresponding third network device the corresponding tunnel between the corresponding third network device and the network device in the second site through the physical link with each third network device.
  • Tunnel entry which stores the obtained tunnel entry.
  • the first network device and the third network device can be connected through a network tunnel.
  • the network tunnel It may include Generic Routing Encapsulation (GRE) tunnels.
  • GRE Generic Routing Encapsulation
  • the network tunnel can also be other tunnels.
  • the physical link or network tunnel between the first network device and each third network device is mainly used to synchronize the tunnel table entries in the site and the transmission of data packets within the site, and does not need to be published to the outside of the site. Therefore, the network address on the interface used to establish the physical link on the network device in the first site can be set as a private network address, and even different sites can use the same address space, which can save SD-WAN network pairs. Consumption of operator network address resources.
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device and the fourth network device are connected to the first transmission network
  • the second network device and the fourth network device access the second transmission network and establish a tunnel.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device, so , It can be determined that the site prefix obtained by the first network device is the site prefix of the third site, and the site identifier obtained by the first network device is the site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network device that accesses the same transmission network as the second network device includes the fourth network device, and the second network device A tunnel is established between the network device and the fourth network device, and the fourth network device and the first network device are connected to the same transmission network, but the first network device and the second network device are not connected to the same transmission network. That is, the second network device can communicate with the fourth network device, and the fourth network device can communicate with the first network device. However, the first network device and the second network device cannot communicate directly. Therefore, the control device can communicate with the second network device. The site identifier of the second site and the site prefix of the third site are sent to the first network device.
  • the first network device obtains the TNP information of the fourth network device, and the first network device 4.
  • the TNP information of the network device corresponds to the first transmission network; the first network device establishes a tunnel between the first network device and the fourth network device according to the TNP information of the fourth network device ;
  • the first network device stores the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • control device when the control device sends the site identifier of the second site and the site prefix of the third site to the first network device, it also sends the TNP information of the fourth network device.
  • the first network device receives the site identifier of the second site and the site prefix of the third site sent by the control device, it can also receive the TNP information of the fourth network device, where the TNP information corresponds to the first transmission network.
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device, the second network device, and the fourth network The devices are all connected to the first transmission network
  • the second network device and the fourth network device are connected to the second transmission network and a tunnel is established.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device, so , It can be determined that the site prefix obtained by the first network device is the site prefix of the third site, and the site identifier obtained by the first network device is the site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network devices that access the same transmission network as the second network device include the first network device and the fourth network Device, and a tunnel is established between the second network device and the fourth network device, and the fourth network device and the first network device access the same transmission network. That is, the first network device can communicate with the second network device, the first network device can also communicate with the fourth network device, and the fourth network device can communicate with the second network device. Therefore, the control device can communicate with the second network device.
  • the site identifier of the third site and the site prefix of the third site are sent to the first network device.
  • the first network device after the first network device adds a first routing table entry to the routing table of the first network device, the first network device obtains the site identifier of the third site; the first network device The network device adds a second routing table entry to the routing table of the first network device, the second routing table entry includes the site prefix and the site identifier of the third site, and the second routing table entry uses To send a data message to the second network device.
  • the first network device in this application can communicate with the second network device, based on high reliability considerations, in addition to obtaining the site identifier of the second site and the site prefix of the third site, the first network device The site ID of the third site can also be obtained.
  • control device may also send the site identifier of the third site to the first network device.
  • control device may also first send the site identifier of the second site and the site prefix of the third site to the first network device, and then send the site identifier of the third site to the first network device.
  • the first network device acquires the TNP information of the second network device and the first network device 4.
  • TNP information of the network device the first network device establishes a connection between the first network device and the second network device according to the TNP information of the second network device and the TNP information of the fourth network device And the tunnel between the first network device and the fourth network device; the first network device stores the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry .
  • the control device when the control device sends the site identifier of the second site and the site prefix of the third site to the first network device, it also sends the TNP information of the fourth network device. In this way, when the first network device receives the site identifier of the second site and the site prefix of the third site sent by the control device, it can also receive the TNP information of the fourth network device, where the TNP information corresponds to the first transmission network. Similarly, when the control device sends the site identifier of the third site to the first network device, it also sends the TNP information of the second network device. In this way, when the first network device receives the site identifier of the third site sent by the control device, it can also receive the TNP information of the second network device.
  • the first network device After the first network device receives the TNP information of the second network device and the TNP information of the fourth network device, it can directly establish the tunnel between the first network device and the second network device according to the TNP information of the second network device.
  • the TNP information of the fourth network device establishes a tunnel between the first network device and the fourth network device.
  • the first network device may obtain the priority of the second site and the priority of the third site. If the priority of the third site is higher than the priority of the second site, the first network device may establish a tunnel between the first network device and the second network device according to the TNP information of the second network device. After that, the first network device detects the connectivity of the tunnel between the first network device and the second network device. If the detection fails, the first network device may establish a tunnel between the first network device and the fourth network device according to the TNP of the fourth network device. If the detection is successful, the first network device may temporarily not establish the tunnel between the first network device and the fourth network device until the tunnel between the first network device and the second network device fails and cannot be connected. Establish a tunnel between the first network device and the fourth network device.
  • the priority of the second site and the priority of the third site may be sent by the control device to the first network device at the same time as the above-mentioned site identifier and site prefix.
  • the above-mentioned priority may also be sent first.
  • the site identifier and site prefix and then send the priority of the second site and the priority of the third site.
  • the purpose of this application is to realize the transmission of data packets between the first network device and the second network device, generating routing table entries and establishing tunnels. Therefore, the control device usually sets the priority of the third station a little higher, that is, the priority of the third station is higher than the priority of the second station, so that the first network device will give priority to establishing the first The tunnel between the network device and the second network device. After that, the data message transmitted between the first network device and the second network device will be preferentially transmitted through the tunnel directly connected between the two devices without forwarding through the fourth network device, thereby reducing network overhead. Improve message transmission efficiency.
  • the first network device stores the tunnel identifier of each established tunnel and the corresponding tunnel attribute information as a tunnel entry
  • the first network device detects the connectivity of each established tunnel;
  • the first network device stores the tunnel identifier of each tunnel whose connectivity detection is successful, the corresponding tunnel attribute information, and the valid Unicom identifier as a tunnel entry; and/or, the first network device
  • the tunnel identifier of each tunnel whose connectivity detection fails, the corresponding tunnel attribute information, and the invalidated Unicom identifier are stored as a tunnel entry.
  • the first network device Since the first network device detects the connectivity of each tunnel established in the same way, taking one of the tunnels as an example, after the tunnel is established, the first network device can communicate to the second network device through the tunnel. Send a probe message, which is used to detect whether the tunnel is currently available. If a response message returned by the second network device for the detection message is received, it can be determined that the tunnel is available, that is, the tunnel can be connected. If the response message returned by the second network device for the detection message is not received, it can be determined that the tunnel is unavailable, that is, the tunnel cannot be connected.
  • the detection information can not only detect whether the tunnel is currently available, but also detect the bandwidth and delay of the tunnel.
  • the first network device may periodically send a detection signal for detection, which is not limited in this application.
  • a message sending device in a third aspect, is provided, and the message sending device has the function of realizing the behavior of the message sending method in the first aspect.
  • the message sending device includes at least one module, and the at least one module is used to implement the message sending method provided in the first aspect described above.
  • a device for generating a routing table entry in a fourth aspect, is provided, and the device for generating a routing table entry has a function of realizing the behavior of the method for generating a routing table entry in the second aspect.
  • the device for generating routing table entries includes at least one module, and the at least one module is used to implement the method for generating routing table entries provided in the second aspect described above.
  • a network device in a fifth aspect, includes a processor and a memory, and the memory is configured to store a program that executes the message sending method provided in the first aspect or the routing table provided in the second aspect.
  • the program of the item generation method and stores the data used to implement the message sending method provided in the first aspect or the routing table item generation method provided in the second aspect.
  • the processor is configured to execute a program stored in the memory.
  • the operating device of the storage device may further include a communication bus, and the communication bus is used to establish a connection between the processor and the memory.
  • a computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the message sending method or the first method described in the first aspect.
  • the method for generating routing table entries provided by the two aspects.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the method for sending the message described in the first aspect or the method for generating routing table entries provided in the second aspect. .
  • each routing table entry in the routing table stored by the first network device in the first site includes a site prefix and a corresponding site identifier
  • the first network device can directly send the first data message to the second site according to the site identifier in the target routing table entry. That is, for the data message sent from the first site to the second site, the first network device can directly send the data message to the second site according to the site identifier of the second site, and there is no need to determine whether the data message is specifically sent to the second site.
  • Which interface of the network device, and, for a site the first network device can store only one routing table entry, avoiding a large number of repeated routing table entries, and also avoiding changes in the status of the network device. Lead to an update of the routing table.
  • FIG. 1 is a system architecture diagram involved in a method for sending a message provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a method for sending a message according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a tunnel index field provided by an embodiment of the present application.
  • FIG. 4 is a system architecture diagram involved in a method for generating routing table entries provided by an embodiment of the present application
  • FIG. 5 is a system architecture diagram involved in another method for generating routing table entries provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for generating routing table entries according to an embodiment of the present application.
  • FIG. 7 is a system architecture diagram involved in another method for generating routing table entries provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of another method for generating routing table entries according to an embodiment of the present application.
  • FIG. 9 is a system architecture diagram involved in yet another method for generating routing table entries provided by an embodiment of the present application.
  • FIG. 10 is a flowchart of yet another method for generating routing table entries according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a message sending apparatus provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of an apparatus for generating routing table entries according to an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • FIG. 1 is a system architecture diagram involved in a method for sending a message provided by an embodiment of the present application.
  • the system includes a network device 101, a network device 102, a network device 103, and a control device 104.
  • the network device 101 and the network device 102 are network devices deployed in the first site
  • the network device 103 is the network device deployed in the second site.
  • the network device 101, the network device 102, and the network device 103 may be connected to the control device 104 in a wireless or wired manner for communication.
  • a tunnel 1 is established between the network device 101 and the network device 103 through a Long Term Evolution (LTE) network, and the network device 102 and the network device 103 use Multi-Protocol Label Switching (Multi-Protocol Label Switching).
  • MPLS Multi-Protocol Label Switching
  • MPLS Multi-Protocol Label Switching
  • the network device 101 and the network device 102 can also receive the site prefix and site identifier of the second site sent by the control device 104, and add the site prefix and site identifier of the second site as a routing table entry in the stored routing table That is, the network device 101 may add the site prefix and site identifier of the second site as a routing table entry to the routing table stored by the network device 101, and the network device 102 may also add the site prefix and site identifier of the second site It is added as a routing table entry in the routing table stored by the network device 102.
  • the network device 103 can also receive the site prefix and site identifier of the first site sent by the control device 104, and add the site prefix and site identifier of the first site as a routing table entry to the routing table stored by the network device 103 .
  • these network equipment may also store a tunnel entry corresponding to each tunnel established. That is, the network device 101, the network device 102, and the network device 103 can all store tunnel entry corresponding to the tunnel 1 and the tunnel 2, and the tunnel entry includes the tunnel identifier and tunnel attribute information.
  • the network equipment in the first site and the network equipment in the second site establish a tunnel, store routing table entries and tunnel entries through the above methods, the network equipment in the first site and the network equipment in the second site can be based on The stored routing table and tunnel table entries transmit data messages through the established tunnel.
  • the stored routing table and tunnel table entries transmit data messages through the established tunnel.
  • the network equipment in the first site and the network equipment in the second site can establish a tunnel through the control device 104, and obtain the site prefix and site identifier of the opposite site.
  • the system may not include the control device 104.
  • the network device in the first site can broadcast the site prefix and site identifier of the first site.
  • the second site The internal network device can receive the site prefix and site identifier of the first site, so as to store the site prefix and site identifier of the first site as a routing table entry.
  • the network device in the second site can broadcast the site prefix and site identifier of the second site.
  • the network device in the first site can receive the site prefix and site identifier of the second site, and the site of the second site
  • the prefix and site identifier are stored as a routing table entry.
  • the network equipment in the first site and the network equipment in the second site can establish a tunnel.
  • it can also be implemented by other methods, and the embodiments of the present application are not limited herein.
  • the source end information and the opposite end information in the tunnel attribute information stored in the network devices at both ends of the tunnel are opposite.
  • the source information in the tunnel attribute information stored in the network device 101 and the network device 102 is the destination information of the tunnel attribute information stored in the network device 103
  • the network device 101 and the network device 102 store
  • the destination information in the tunnel attribute information of is the source information of the tunnel attribute information stored in the network device 103.
  • the source end information of the tunnel may include the source network address of the tunnel
  • the destination end information of the tunnel may include the destination network address of the tunnel.
  • two network devices are deployed in the first site and one network device is deployed in the second site for illustration.
  • one network device or two or more network devices can also be deployed in the first site, and two or more network devices can also be deployed in the second site, and the first site
  • the number of network devices deployed in the site may be the same as or different from the number of network devices deployed in the second site.
  • the method is applicable to a first network device.
  • the first network device may be any network device in the first site.
  • the first The network device may be the network device 101 or the network device 102 shown in FIG. 1.
  • a routing table is stored in the first network device, and the routing table includes a plurality of routing table entries, and each routing table entry of the plurality of routing table entries includes a site prefix and a corresponding site identifier. Please refer to Figure 2.
  • the method includes the following steps.
  • Step 201 A first network device receives a first data packet, where the first data packet carries a destination address, and the first network device refers to a network device deployed in the first site.
  • the first data message may be a data message sent to the first network device by the user terminal in the first site, or may be a data message sent to the first network device by network devices in other sites Text.
  • the client in the first site is sending the first network device. Before the data message, it is necessary to select one network device from the multiple network devices in the first site as the first network device, and then send the first data message to the first network device.
  • the user terminal in the first site may select one network device from the multiple network devices in the first site as the first network device according to the networking mode of the first site.
  • the corresponding relationship between the networking mode and the device ID can be stored in the client.
  • the client When the client needs to send data packets, it can be based on the networking mode of the site where it is located, and the relationship between the networking mode and the device ID.
  • determine a network device to send data packets For example, for the user terminal in the first site, the user terminal may obtain the corresponding device identifier from the stored correspondence relationship between the network method and the device identifier according to the network method of the first site, and then The network device identified by the device identifier is determined as the first network device.
  • Step 202 The first network device determines the target routing table entry from the stored routing table according to the destination address carried in the first data message, where the destination address carried in the first data message matches the site prefix included in the target routing table entry , The site identifier included in the target routing table entry is used to identify the second site.
  • the destination address carried in the first data message can be matched with the site prefix included in each routing table entry in the routing table, so that the target routing table can be determined from the routing table item.
  • the target address carried in the first data message matches the site prefix included in the target routing table entry, and the site identifier included in the target routing table entry is used to identify the second site, it can be determined that the first data message carries The destination address is the address of the client in the second site, and it can be determined that the site prefix included in the target routing table entry is the site prefix of the second site, and the site identifier included in the target routing table entry is the identifier of the second site.
  • Step 203 The first network device sends the first data packet to the network device deployed in the second site.
  • the first network device may send the first data packet to the network device deployed in the second site through the following steps (1)-(3).
  • the first network device determines one or more tunnel table entries according to the site identifier included in the target routing table entry.
  • the one or more tunnel table entries refer to those corresponding to the tunnel established between the first site and the second site Tunnel entry.
  • a tunnel table is stored in the first network device.
  • Each tunnel entry in the tunnel table includes a tunnel identifier and corresponding tunnel attribute information.
  • the tunnel table is used to store tunnels corresponding to multiple sites.
  • Table entry, the multiple sites refer to sites that have tunnels established with the first site, and the multiple sites include the second site.
  • the first network device can determine one or more tunnel identifiers according to the site identifiers included in the target routing table entry, and the one or more tunnel identifiers refer to the identifiers of the tunnel established between the first site and the second site. After that, the first network device may determine one or more tunnel table entries from the tunnel table according to the one or more tunnel identifiers.
  • the tunnel attribute information included in each tunnel entry may include the tunnel encapsulation mode, the source address and destination address of the tunnel, the bandwidth of the tunnel, and the delay of the tunnel.
  • the first network device may store a first mapping relationship between the site identifier and the tunnel identifier, that is, the first mapping relationship stores the identifiers of each site that has a tunnel with the first site. And the identification of the tunnel established between each site and the first site. In this way, the first network device can determine one or more tunnel identifiers from the first mapping relationship according to the site identifiers included in the target routing table entry. After that, the first network device may determine from the tunnel table a tunnel entry that includes the same tunnel identifier as the one or more tunnel identifiers, so as to obtain one or more tunnel entries.
  • a plurality of tunnel tables are stored in the first network device, and the plurality of tunnel tables are in a one-to-one correspondence with a plurality of sites, and the plurality of sites refer to those that have tunnels established with the first site.
  • Site, and the plurality of sites includes a second site.
  • the first network device can determine the identifier of the target tunnel table according to the site identifier included in the target routing table entry, and the target tunnel table refers to the tunnel table corresponding to the second site among the multiple tunnel tables.
  • the first network device may determine the target tunnel table from the multiple tunnel tables according to the identifier of the target tunnel table, and determine the tunnel entry stored in the target tunnel table as one or more tunnel entry.
  • the first network device stores different tunnel tables for different sites, and the first network device can store the second mapping relationship between the site identifier and the tunnel table identifier, that is, the second mapping relationship is stored with the first site The identifier of each site where the tunnel is established, and the identifier of the tunnel table corresponding to each site. In this way, the first network device can determine the identifier of the target tunnel table from the second mapping relationship according to the site identifier included in the target routing table entry. After that, the target tunnel table can be determined from the multiple tunnel tables according to the identifier of the target tunnel table, and the tunnel entry in the target tunnel table can be determined as the one or more tunnel entry mentioned above.
  • the first network device selects a tunnel entry from the one or more tunnel entries as the target tunnel entry.
  • the first network device may select a tunnel entry from the one or more tunnel entries as the target tunnel entry according to the tunnel selection policy.
  • the tunnel selection strategy stored by the first network device is: selecting the tunnel with the largest bandwidth.
  • the first network device can obtain the tunnel attribute information included in the one or more tunnel entries, and obtain the bandwidth of the tunnel from the tunnel attribute information.
  • the first network device may select a tunnel entry with the largest bandwidth from the one or more tunnel entries as the target tunnel entry according to the bandwidth of the tunnel.
  • the tunnel selection strategy stored by the first network device is: selecting a tunnel with a bandwidth greater than 1M.
  • the first network device can obtain the tunnel attribute information included in the one or more tunnel entries, and obtain the bandwidth of the tunnel from the tunnel attribute information.
  • the bandwidth of the one or more tunnels is less than 1M.
  • the first A network device can discard the first data message.
  • the first network device when there is no tunnel entry that satisfies the tunnel selection policy in the one or more tunnel entries, that is, the first network device cannot be included in the one or more tunnel entries according to the tunnel selection policy.
  • the target tunnel entry is selected.
  • the first network device may discard the first data packet.
  • the first network device may select one tunnel entry from one or more tunnel entries as the target tunnel entry by using a hash algorithm.
  • each tunnel entry in the one or more tunnel entries further includes a Unicom ID, and the Unicom ID is used to indicate whether the corresponding tunnel is connected.
  • the first network device can filter out the tunnel entries with a valid Unicom ID from the one or more tunnel entries.
  • a network device can select a tunnel entry from the filtered tunnel entries as the target tunnel entry. Among them, the method for selecting the target tunnel is the same as the method described above, and will not be repeated here.
  • the first network device sends the first data packet through the tunnel corresponding to the target tunnel entry.
  • the first network device After the first network device selects the target tunnel entry, it can obtain the tunnel identifier included in the target tunnel entry, use the tunnel identified by the tunnel identifier as the target tunnel, and then send the first data message through the target tunnel.
  • the target tunnel determined by the first network device may be the first network device and the second network device.
  • the tunnel established between network devices in the site may also be a tunnel established between the second network device and the network device in the second site.
  • the second network device is a network in the first site except the first network device equipment.
  • the first network device may directly obtain the tunnel attribute of the target tunnel from the target tunnel table entry stored in itself Information, and then tunnel encapsulation of the first data message according to the acquired tunnel attribute information to obtain the second data message, and send the second data message through the target tunnel.
  • the first network device may add the tunnel identifier of the target tunnel to the first data packet to obtain The third data packet is sent to the second network device through the physical link with the second network device.
  • the second network device may parse the third data packet to obtain the tunnel identifier of the target tunnel and the first data packet.
  • the second network device may obtain the tunnel attribute information of the target tunnel from the target tunnel table entry stored by the second network device according to the tunnel identifier of the target tunnel, and then tunnel the first data packet according to the obtained tunnel attribute information Encapsulate to obtain the second data message, and send the second data message through the target tunnel.
  • the first network device may add a tunnel index field to the first data message, and the tunnel index field may include the tunnel identifier of the target tunnel, so as to obtain the third data message. After that, the third data packet can be sent to the second network device through the physical link with the second network device.
  • the tunnel index field may include a tunnel identifier, and the tunnel identifier may be the tunnel identifier of the target tunnel.
  • the tunnel index field may also include encapsulation mode, label, version number, protocol type, and so on.
  • the encapsulation method is the type of tunnel corresponding to the tunnel identifier
  • the label is a flag bit, which can be used to indicate that the data message is sent from the user side to the tunnel side or received from the tunnel side
  • the version number is the tunnel index field used.
  • the version number of the protocol type is the protocol type of the first data message.
  • the tunnel index field includes not only the tunnel identifier of the target tunnel, but also the encapsulation method, label, version number, protocol type, etc. of the tunnel index field, the second network device can follow the encapsulation method, label, version number, etc. , The protocol type information, the first data packet is parsed from the third data packet, and at the same time, the tunnel identifier of the target tunnel can also be obtained.
  • the second network device parses the first data packet, since the second network device also stores the target tunnel entry, the second network device can obtain the target tunnel from the target tunnel entry according to the tunnel identifier of the target tunnel According to the acquired tunnel attribute information, the first data message is tunnel encapsulated to obtain the second data message, and the second data message is sent through the target tunnel.
  • the network device in the second site may decapsulate the second data message through the tunnel to obtain the first data message.
  • steps 201-203 are the case where the network device in the first site sends data packets to the network device in the second site. It should be understood that the network device in the second site can also send data packets to the network device in the first site, and the network device in the second site sends data packets to the network device in the first site. You can refer to the above steps 201-203, which will not be repeated here.
  • each routing table entry in the routing table stored by the first network device in the first site includes a site prefix and a corresponding site identifier
  • the target routing table entry can be determined from the routing table. Since the site identifier in the target routing table entry is used to identify the second site, the first network device can directly send the first data message to the second site according to the site identifier in the target routing table entry.
  • the first network device can directly send it to the second site according to the site identifier of the second site, without determining whether the data message is specifically sent to the second site Which interface of the network device, and, for a site, the first network device can store only one routing table entry, avoiding a large number of repeated routing table entries, and also avoiding changes in the status of the network device. Lead to an update of the routing table.
  • the first network device when the first network device sends a data message to the second site, it can also send the data message through the tunnel established by other network devices in the first site and the second site, so there is no need to create more tunnels, which saves resources , Improve the utilization rate of the tunnel.
  • the network device in the first site may transmit data packets with the network device in the second site based on the stored routing table. Therefore, before the network devices in the two sites transmit data packets, the network devices need to generate and store routing table entries. Since the ways for network devices to generate routing table entries are different under different system architectures, the following will be divided into multiple embodiments for description.
  • FIG. 4 is a system architecture diagram involved in a method for generating routing table entries provided by an embodiment of the present application.
  • the system includes a network device 401, a network device 402, a network device 403, a network device 404, and a control device 405.
  • the network device 401 and the network device 402 are network devices deployed in the first site
  • the network device 403 and the network device 404 are network devices deployed in the second site.
  • the network device 401, the network device 402, the network device 403, and the network device 404 may be connected to the control device 405 in a wireless or wired manner for communication.
  • a physical link is established between the network device 401 and the network device 402, and a physical link is established between the network device 403 and the network device 404.
  • the network device 401 and the network device 403 access the same transmission network, that is, the LTE network.
  • the network device 402 and the network device 404 access the same transmission network, that is, the MPLS network.
  • tunnel 1 can be established between network device 401 and network device 403 via the LTE network
  • tunnel 2 can be established between network device 402 and network device 404 via the MPLS network
  • these network devices can generate routing table entries.
  • the system architecture shown in FIG. 4 may not include the control device 405, which is not limited in the embodiment of the present application.
  • two network devices are deployed in the first site and two network devices are deployed in the second site for illustration.
  • one network device or two or more network devices can also be deployed in the first site, and one or more network devices can also be deployed in the second site, and the first site
  • the number of network devices deployed in the second site may be the same as or different from the number of network devices deployed in the second site.
  • a network device 501 is deployed in the first site, and a network device 502 is deployed in the second site.
  • the network device 501 and the network device 502 can be connected to the control device 503 in a wireless or wired manner.
  • the network device 501 and the network device 502 can access the same multiple transmission networks, that is, the network device 501 and the network device 502 both access the LTE network and the MPLS network, and the two network devices can establish multiple transmission networks through the multiple transmission networks. Tunnels.
  • the embodiment of the present application provides a method for generating routing table entries, and the method is suitable for the first network device.
  • the first network device is deployed in the first site
  • the second network device is deployed in the second site
  • the first network device and the second network device are connected to the same one or more transmission networks.
  • the first network device may be the network device 401 or the network device 402 shown in FIG. 4, or the network device 501 shown in FIG. 5, and the second network device may be the network device 403 or the network device shown in FIG. 4
  • the device 404 may also be the network device 502 shown in FIG. 5. Please refer to Figure 6, the method includes the following steps.
  • the network equipment in the first site and the network equipment in the second site can establish a tunnel through the control device, and obtain the site prefix and site identifier of the opposite site, they may also be implemented without the control device. Regardless of whether the control device is used or not, the method for the first network device to generate routing table entries is similar. Therefore, the following takes the realization of the control device as an example to introduce the generation method of the routing table entry.
  • Step 601 The first network device obtains a site prefix and a site identifier, where the site identifier is used to identify a second site, and the network address of the second network device matches the site prefix.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device. Therefore, the first network can be determined
  • the site prefix and site identifier obtained by the device are the site prefix and site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network devices that access the same transmission network as the second network device include the first network device, that is, , The second network device can communicate with the first network device. Therefore, the control device can send the site prefix and site identifier of the second site to the first network device.
  • Step 602 The first network device adds a first routing table entry to the routing table of the first network device, the first routing table entry includes the site prefix and the site identifier, and the first routing table entry is used to send to the second network device Data message.
  • the first network device After the first network device generates and stores the routing table entry through the above steps 601-602, it may also generate and store the tunnel table entry through the following steps 603-605.
  • Step 603 The first network device obtains one or more TNP information of the second network device, and the one or more TNP information is in one-to-one correspondence with one or more transmission networks.
  • the second network device when the second network device sends the site prefix and the site identifier of the second site to the control device, it also sends the TNP information of the second network device.
  • the first network device receives the site prefix and site identifier of the second site sent by the control device, it can also receive one or more TNP information of the second network device.
  • the one or more TNP information is TNP information corresponding to each transmission network in the same one or more transmission networks that the first network device and the second network device access.
  • the TNP information is used to indicate a physical interface or a logical interface that can be accessed from the outside, and the parameters required in the communication process.
  • TNP information may include network operator identification, encryption mode, whether there is network address translation, and the routing domain of the corresponding transmission network.
  • Step 604 The first network device establishes a tunnel between the first network device and the second network device according to one or more TNP information of the second network device.
  • the first network device After the first network device receives one or more TNP information of the second network device, it can match its own TNP information with the one or more TNP information. If a TNP information of the first network device and a TNP information of the second network device can be matched successfully, then the first network device and the second network device can establish the first network device and the first network device through the pair of TNP information that is successfully matched. Two tunnels between network devices.
  • the TNP information of the first network device and the TNP information of the second network device are matched to determine whether the matching can be successful. That is, when one TNP information of the first network device and one TNP information of the second network device satisfy the matching condition, it can be determined that the TNP information of the first network device and the TNP information of the second network device can be successfully matched.
  • the matching condition can be set according to the actual situation.
  • the matching condition may mean that part of the data included in the two TNP information is the same, for example, the network operator identifiers included in the two TNP information are the same, or the routing domains of the transmission networks corresponding to the two TNP information are the same.
  • the matching condition may mean that all the information included in the two TNP information is the same.
  • TNP information of the first network device and the TNP information of the second network device can successfully match multiple pairs of TNP information, multiple tunnels may be established between the first network device and the second network device.
  • Step 605 The first network device stores the tunnel identifier and corresponding tunnel attribute information of each tunnel established with the second network device as a tunnel entry.
  • the first network device may directly use the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel. Entries are stored.
  • the first network device can detect the connectivity of each tunnel established. Afterwards, the first network device may store the tunnel identifier of each tunnel successfully detected in connectivity, the corresponding tunnel attribute information, and the valid Unicom identifier as a tunnel entry; and/or the first network device may The tunnel identifier of each tunnel whose connectivity detection fails, the corresponding tunnel attribute information, and the invalidated Unicom identifier are stored as a tunnel entry.
  • the first network device Since the first network device detects the connectivity of each tunnel established in the same way, taking one of the tunnels as an example, after the tunnel is established, the first network device can communicate to the second network device through the tunnel. Send a probe message, which is used to detect whether the tunnel is currently available. If a response message returned by the second network device for the detection message is received, it can be determined that the tunnel is available, that is, the tunnel can be connected. If the response message returned by the second network device for the detection message is not received, it can be determined that the tunnel is unavailable, that is, the tunnel cannot be connected.
  • the detection information can not only detect whether the tunnel is currently available, but also detect the bandwidth and delay of the tunnel.
  • the first network device may periodically send a detection signal to perform detection, which is not limited in the embodiment of the present application.
  • one tunnel table or multiple tunnel tables may be stored in the first network device.
  • the first network device can use the tunnel identifier of each tunnel and the corresponding tunnel attribute information as a tunnel table The entry is added to the tunnel table, and the first mapping relationship between the site identifier of the second site and the tunnel identifier is stored.
  • the first network device may search for the tunnel table identifier corresponding to the second site in the second mapping relationship between the site identifier and the tunnel table identifier according to the site identifier of the second site.
  • the first network device may add the tunnel identifier of each tunnel currently established and the corresponding tunnel attribute information as a tunnel table entry to the tunnel table corresponding to the second site. If the tunnel table identifier corresponding to the second site is not found, the first network device can create a tunnel table, and add the tunnel identifier of each tunnel currently established and the corresponding tunnel attribute information as a tunnel table entry to the created tunnel table , And store the second mapping relationship between the site identifier of the second site and the tunnel table identifier of the tunnel table.
  • one or more third network devices are also deployed in the first site, and each third network device of the one or more third network devices establishes a tunnel with the network device in the second site, And each third network device in the one or more third network devices also has a physical link established with the first network device.
  • the first network device can also obtain from the corresponding third network device the corresponding tunnel between the corresponding third network device and the network device in the second site through the physical link with each third network device.
  • Tunnel entry which stores the obtained tunnel entry.
  • the method for the first network device to store the tunnel entry obtained from the third network device may be the same as the foregoing method, which will not be repeated here.
  • the first network device and the third network device can be connected through a network tunnel.
  • the network tunnel It may include Generic Routing Encapsulation (GRE) tunnels.
  • GRE Generic Routing Encapsulation
  • the network tunnel can also be other tunnels.
  • the physical link or network tunnel between the first network device and each third network device is mainly used to synchronize the tunnel table entries in the site and the transmission of data packets within the site, and does not need to be published to the outside of the site. Therefore, the network address on the interface used to establish the physical link on the network device in the first site can be set as a private network address, and even different sites can use the same address space, which can save SD-WAN network pairs. Consumption of operator network address resources.
  • the first network device after the first network device obtains the site prefix and site identifier of the second site, it can add the site prefix and site identifier of the second site as the first routing table entry in the stored routing table, so For a site, the first network device can only store one routing table entry, avoiding a large number of repeated routing table entries, and also avoiding the update of the routing table due to changes in the status of the network device.
  • the first network device may also store the tunnel identifier and tunnel attribute information of the tunnel established with the second site as tunnel entries in the tunnel table, and may also associate other network devices in the first site with the second site The tunnel table entry of the established tunnel is stored in the tunnel table. In this way, the first network device can subsequently send data packets to the second site through the tunnel between other network devices in the first site and the second site without creating more tunnels, which saves resources and improves tunnel performance. Utilization rate.
  • FIG. 7 is a system architecture diagram involved in a method for generating routing table entries provided by an embodiment of the present application.
  • the system includes a network device 701, a network device 702, a network device 703, and a control device 704.
  • the network device 701 is a network device deployed in the first site
  • the network device 702 is a network device deployed in the third site
  • the network device 703 is a network device deployed in the second site.
  • the network device 701, the network device 702, and the network device 703 may be connected to the control device 704 in a wireless or wired manner for communication.
  • the network device 701 and the network device 703 access the same transmission network, that is, an LTE network.
  • the network device 702 and the network device 703 access the same transmission network, that is, the MPLS network.
  • a tunnel 1 can be established between the network device 701 and the network device 703 via the LTE network
  • a tunnel 2 can be established between the network device 702 and the network device 703 via the MPLS network
  • these network devices can generate routing table entries, specifically For the implementation manner, reference may be made to the related description in the embodiment of FIG. 8 below, and the description is not expanded here.
  • the system architecture shown in FIG. 7 may also not include the control device 704, which is not limited in the embodiment of the present application.
  • one network device is deployed in each of the first site, the second site, and the third site for illustration.
  • more than two network devices can be deployed in the first site, the second site, and the third site, and the network devices deployed in the first site, the second site, and the third site
  • the number can be the same or different.
  • an embodiment of the present application provides a method for generating routing table entries, and the method is suitable for the first network device.
  • the first network device is deployed in the first site
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device is connected to the fourth network device.
  • the second network device and the fourth network device are connected to the second transmission network and a tunnel is established.
  • the first network device may be the network device 701 shown in FIG. 7
  • the second network device may be the network device 702 shown in FIG. 7
  • the fourth network device may be the network device 703 shown in FIG. 7.
  • the method includes the following steps.
  • the network equipment in the first site and the network equipment in the second site can establish a tunnel through the control device, and obtain the site prefix and site identifier of the opposite site
  • the network equipment in the second site and the third site can establish a tunnel through the control device, and obtain the site prefix and site identifier of the opposite site, but it can also be implemented without the control device.
  • the method for the first network device to generate routing table entries is similar. Therefore, the following takes the realization of the control device as an example to introduce the generation method of the routing table entry.
  • Step 801 The first network device obtains a site prefix and a site identifier, where the site identifier is used to identify a second site, and the network address of the second network device matches the site prefix.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device. Therefore, the first network can be determined
  • the site prefix acquired by the device is the site prefix of the third site
  • the site identifier acquired by the first network device is the site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network device that accesses the same transmission network as the second network device includes the fourth network device, and the second network device A tunnel is established between the network device and the fourth network device, and the fourth network device and the first network device are connected to the same transmission network, but the first network device and the second network device are not connected to the same transmission network. That is, the second network device can communicate with the fourth network device, and the fourth network device can communicate with the first network device. However, the first network device and the second network device cannot communicate directly. Therefore, the control device can communicate with the second network device. The site identifier of the second site and the site prefix of the third site are sent to the first network device.
  • Step 802 The first network device adds a first routing table entry to the routing table of the first network device, the first routing table entry includes the site prefix and the site identifier, and the first routing table entry is used to send to the second network device Data message.
  • the first network device After the first network device generates and stores the routing table entry through the above steps 801-802, it can also generate and store the tunnel table entry through the following steps 803-805.
  • Step 803 The first network device obtains the TNP information of the fourth network device, and the TNP information of the fourth network device corresponds to the first transmission network.
  • the control device when the control device sends the site identifier of the second site and the site prefix of the third site to the first network device, it also sends the TNP information of the fourth network device.
  • the first network device receives the site identifier of the second site and the site prefix of the third site sent by the control device, it can also receive the TNP information of the fourth network device, where the TNP information corresponds to the first transmission network.
  • Step 804 The first network device establishes a tunnel between the first network device and the fourth network device according to the TNP information of the fourth network device.
  • step 804 Since the first network device establishes a tunnel between itself and other network devices, the implementation process is basically the same. Therefore, the embodiment of this application does not elaborate on step 804.
  • step 804 please refer to step 604 in the foregoing embodiment.
  • step 604 in the foregoing embodiment.
  • Step 805 The first network device stores the tunnel identifier and corresponding tunnel attribute information of each tunnel established between itself and the fourth network device as a tunnel entry.
  • step 805 Since the first network device stores the tunnel table entries corresponding to the tunnels established between itself and other network devices, the implementation process is basically the same. Therefore, the embodiment of the present application does not elaborate on step 805, and the relevant explanation in step 805 can be Refer to the relevant explanation in step 605 in the foregoing embodiment.
  • the first network device may add the site prefix of the third site and the site identifier of the second site as a routing table entry in the stored routing table.
  • the first network device can store only one routing table entry, avoiding a large number of duplicate routing table entries, and also avoiding the update of the routing table due to changes in the status of the network device.
  • the first network device may send the data packet to the fourth network device through the tunnel with the fourth network device according to the routing table entry, and then The fourth network device sends the data message to the second network device through the tunnel with the second network device, which solves the problem that the first network device cannot establish a tunnel between the first network device and the second network device. The problem of not being able to send data packets to the second network device.
  • FIG. 9 is a system architecture diagram involved in a method for generating routing table entries provided by an embodiment of the present application.
  • the system includes a network device 901, a network device 902, a network device 903, and a control device 904.
  • the network device 901 is a network device deployed in the first site
  • the network device 902 is a network device deployed in the third site
  • the network device 903 is a network device deployed in the second site.
  • the network device 901, the network device 902, and the network device 903 may be connected to the control device 904 in a wireless or wired manner for communication.
  • the network device 901, the network device 902, and the network device 903 access the same transmission network, that is, the LTE network.
  • the network device 902 and the network device 903 access the same transmission network, that is, the MPLS network.
  • a tunnel 1 can be established between the network device 901 and the network device 903 via the LTE network
  • a tunnel 2 can be established between the network device 901 and the network device 902 via the LTE network
  • the network device 902 and the network device 903 can be established via MPLS.
  • a tunnel 3 is established in the network, and these network devices can generate routing table entries.
  • the system architecture shown in FIG. 9 may also not include the control device 904, which is not limited in the embodiment of the present application.
  • one network device is deployed in each of the first site, the second site, and the third site for illustration.
  • more than two network devices can be deployed in the first site, the second site, and the third site, and the network devices deployed in the first site, the second site, and the third site
  • the number can be the same or different.
  • an embodiment of the present application provides a method for generating routing table entries, and the method is suitable for the first network device.
  • the first network device is deployed in the first site
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device, the second network device, and the The fourth network device is connected to the first transmission network
  • the second network device and the fourth network device are connected to the second transmission network and a tunnel is established.
  • the first network device may be the network device 901 shown in FIG. 9
  • the second network device may be the network device 902 shown in FIG.
  • the fourth network device may be the network device 903 shown in FIG. 9.
  • the method includes the following steps.
  • the network equipment in the first site, the network equipment in the second site, and the network equipment in the third site can establish a tunnel through the control device, and obtain the site prefix and site identifier of the opposite site, but also It can be realized without controlling equipment. Regardless of whether the control device is used or not, the method for the first network device to generate routing table entries is similar. Therefore, the following takes the realization of the control device as an example to introduce the generation method of the routing table entry.
  • Step 1001 The first network device obtains a site prefix and a site identifier, where the site identifier is used to identify a second site, and the network address of the second network device matches the site prefix.
  • the site identifier obtained by the first network device is used to identify the second site, and the network address of the second network device matches the site prefix obtained by the first network device. Therefore, the first network can be determined
  • the site prefix acquired by the device is the site prefix of the third site
  • the site identifier acquired by the first network device is the site identifier of the second site.
  • the second network device after the second network device is powered on, it can register with the control device to obtain the configuration information of the second network device from the control device.
  • the configuration information can include the site identifier and site prefix of the second site, and the second site prefix. TNP information of network equipment, etc.
  • the second network device may send the site prefix and the site identifier of the second site to the control device.
  • the control device After the control device receives the site prefix and site identifier of the second site sent by the second network device, it can determine, according to the network topology, that the network devices that access the same transmission network as the second network device include the first network device and the fourth network Device, and a tunnel is established between the second network device and the fourth network device, and the fourth network device and the first network device access the same transmission network. That is, the first network device can communicate with the second network device, the first network device can also communicate with the fourth network device, and the fourth network device can communicate with the second network device. Therefore, the control device can communicate with the second network device.
  • the site identifier of the third site and the site prefix of the third site are sent to the first network device.
  • Step 1002 The first network device adds a first routing table entry to the routing table of the first network device, the first routing table entry includes the site prefix and the site identifier, and the first routing table entry is used to send to the second network device Data message.
  • Step 1003 The first network device obtains the site identifier of the third site.
  • the first network device in the embodiment of this application can communicate with the second network device, based on high reliability considerations, in addition to obtaining the site identifier of the second site and the site prefix of the third site, the first network device The network device can also obtain the site identification of the third site.
  • control device may also send the site identifier of the third site to the first network device.
  • control device may also first send the site identifier of the second site and the site prefix of the third site to the first network device, and then send the site identifier of the third site to the first network device.
  • Step 1004 The first network device adds a second routing table entry to the routing table of the first network device.
  • the second routing table entry includes the site prefix of the third site and the site identifier of the third site, and the second routing table entry is used for Send a data message to the second network device.
  • the first network device After the first network device generates and stores the routing table entry through the above steps 1001-1004, it may also generate and store the tunnel table entry through the following steps 1005-1007.
  • Step 1005 The first network device obtains the TNP information of the second network device and the TNP information of the fourth network device.
  • the control device when the control device sends the site identifier of the second site and the site prefix of the third site to the first network device, it also sends the TNP information of the fourth network device. In this way, when the first network device receives the site identifier of the second site and the site prefix of the third site sent by the control device, it can also receive the TNP information of the fourth network device, where the TNP information corresponds to the first transmission network. Similarly, when the control device sends the site identifier of the third site to the first network device, it also sends the TNP information of the second network device. In this way, when the first network device receives the site identifier of the third site sent by the control device, it can also receive the TNP information of the second network device.
  • Step 1006 The first network device establishes a tunnel between the first network device and the second network device, and the relationship between the first network device and the fourth network device according to the TNP information of the second network device and the TNP information of the fourth network device. Between the tunnels.
  • the first network device may directly establish a tunnel between the first network device and the second network device based on the TNP information of the second network device, and establish the first network device based on the TNP information of the fourth network device Tunnel with the fourth network device.
  • the first network device may obtain the priority of the second site and the priority of the third site. If the priority of the third site is higher than the priority of the second site, the first network device may establish a tunnel between the first network device and the second network device according to the TNP information of the second network device. After that, the first network device detects the connectivity of the tunnel between the first network device and the second network device. If the detection fails, the first network device may establish a tunnel between the first network device and the fourth network device according to the TNP of the fourth network device. If the detection is successful, the first network device may temporarily not establish the tunnel between the first network device and the fourth network device until the tunnel between the first network device and the second network device fails and cannot be connected. Establish a tunnel between the first network device and the fourth network device.
  • the priority of the second site and the priority of the third site may be sent by the control device to the first network device at the same time as the above-mentioned site identifier and site prefix.
  • the above-mentioned priority may also be sent first.
  • the site identifier and site prefix and then send the priority of the second site and the priority of the third site.
  • the embodiment of the present application is to realize the transmission of data packets between the first network device and the second network device, generating routing table entries and establishing tunnels. Therefore, the control device usually sets the priority of the third station a little higher, that is, the priority of the third station is higher than the priority of the second station, so that the first network device will give priority to establishing the first The tunnel between the network device and the second network device. After that, the data message transmitted between the first network device and the second network device will be preferentially transmitted through the tunnel directly connected between the two devices without forwarding through the fourth network device, thereby reducing network overhead. Improve message transmission efficiency.
  • step 1006 Since the first network device establishes a tunnel between itself and other network devices, the implementation process is basically the same. Therefore, the embodiment of the present application does not elaborate on step 1006.
  • step 1006 please refer to step 604 in the foregoing embodiment.
  • step 605 for the implementation process of detecting the connectivity of the tunnel between the first network device and the second network device by the first network device.
  • Step 1007 The first network device stores the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • step 1007 Since the first network device stores the tunnel table entries corresponding to the tunnels established between itself and other network devices, the implementation process is basically the same. Therefore, the embodiment of the present application does not elaborate on step 1007, and the relevant explanation in step 1007 can be Refer to the relevant explanation in step 605 in the foregoing embodiment.
  • the first network device may add the site prefix of the third site and the site identifier of the second site as the first routing table entry to the stored routing table, and add the site prefix and site identifier of the third site It is added to the stored routing table as the second routing table entry.
  • the first network device can store only one routing table entry, avoiding a large number of duplicate routing table entries, and also avoiding the update of the routing table due to changes in the status of the network device.
  • the first network device can preferentially establish a tunnel between the first network device and the second network device.
  • the first network device can establish the first network device
  • the tunnel between the fourth network device and the fourth network device forwards the data message sent to the second network device to the second network device through the fourth network device, which improves the reliability of data message transmission.
  • FIG. 11 is a schematic structural diagram of a message sending device provided by an embodiment of the present application.
  • the message sending device can be implemented as part or all of the first network device by software, hardware, or a combination of the two.
  • a device refers to a network device deployed in the first site.
  • a routing table is stored in the first network device.
  • the routing table includes multiple routing table entries. Each routing table entry in the multiple routing table entries includes a site prefix and a corresponding Site ID.
  • the device includes: a receiving module 1101, a determining module 1102, and a sending module 1103.
  • the receiving module 1101 is configured to receive a first data message, where the first data message carries a destination address, and the first network device refers to a network device deployed in the first site. That is, it is used to perform the operation of step 201 in the embodiment of FIG. 2;
  • the determining module 1102 is configured to determine a target routing table entry from the routing table according to the destination address carried in the first data message, the destination address carried in the first data message matches the site prefix included in the target routing table entry, and the target routing table entry
  • the included site ID is used to identify the second site. That is, it is used to perform the operation of step 202 in the embodiment of FIG. 2;
  • the sending module 1103 is configured to send the first data message to the network device deployed in the second site. That is, it is used to perform the operation of step 203 in the embodiment of FIG. 2.
  • the sending module 1103 includes:
  • the determining sub-module is used to determine one or more tunnel entries according to the site identifier included in the target routing entry, and the one or more tunnel entries refer to the tunnel corresponding to the tunnel established between the first site and the second site Table item
  • the selection sub-module is used to select a tunnel entry from the one or more tunnel entries as the target tunnel entry;
  • the sending submodule is used to send the first data message through the tunnel corresponding to the target tunnel entry.
  • a tunnel table is stored in the first network device, each tunnel entry in the tunnel table includes a tunnel identifier and corresponding tunnel attribute information, and the tunnel table is used to store tunnel entries corresponding to multiple sites ,
  • the multiple sites refer to sites that have tunnels established with the first site, and the multiple sites include the second site;
  • Determining sub-modules are mainly used for:
  • the one or more tunnel table entries are determined from the tunnel table.
  • multiple tunnel tables are stored in the first network device, and the multiple tunnel tables have a one-to-one correspondence with multiple sites.
  • the multiple sites refer to sites that have tunnels established with the first site.
  • Each site includes the second site;
  • Determining sub-modules are mainly used for:
  • the target tunnel table is determined from the multiple tunnel tables, and the tunnel entry stored in the target tunnel table is determined as the one or more tunnel entry.
  • each tunnel entry in the one or more tunnel entries further includes a Unicom ID, and the Unicom ID is used to indicate whether the corresponding tunnel is connected;
  • Select sub-modules are mainly used for:
  • each routing table entry in the routing table stored by the first network device in the first site includes a site prefix and a corresponding site identifier
  • the target routing table entry can be determined from the routing table. Since the site identifier in the target routing table entry is used to identify the second site, the first network device can directly send the first data message to the second site according to the site identifier in the target routing table entry.
  • the first network device can directly send it to the second site according to the site identifier of the second site, without determining whether the data message is specifically sent to the second site Which interface of the network device, and, for a site, the first network device can store only one routing table entry, avoiding a large number of repeated routing table entries, and also avoiding changes in the status of the network device. Lead to an update of the routing table.
  • the message sending device provided in the above embodiment sends a message
  • only the division of the above functional modules is used as an example.
  • the above functions can be allocated by different functional modules according to needs. , That is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the message sending device provided in the foregoing embodiment and the message sending method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • Figure 12 is a schematic structural diagram of an apparatus for generating routing table entries provided by an embodiment of the present application.
  • the message sending apparatus can be implemented as part or all of the first network device by software, hardware, or a combination of the two.
  • a network device is deployed in the first site. Referring to FIG. 12, the device includes: a first acquiring module 1201 and a first adding module 1202.
  • the first obtaining module 1201 is configured to obtain a site prefix and a site identifier, where the site identifier is used to identify the second site, and the network address of the second network device matches the site prefix; that is, it is used to perform the site prefix in the embodiment of FIG. 6 Step 601, step 801 in the embodiment of FIG. 8 or step 1001 in the embodiment of FIG. 10;
  • the first adding module 1202 is configured to add a first routing table entry to the routing table of the first network device, the first routing table entry includes the site prefix and the site identifier, and the first routing table entry is used to send the routing table entry to the second network device Send data messages. That is, it is used to perform the operations of step 602 in the embodiment of FIG. 6, step 802 in the embodiment of FIG. 8, or step 1002 in the embodiment of FIG. 10;
  • the second network device is deployed in the second site, and the first network device and the second network device access the same one or more transmission networks.
  • the device further includes:
  • the second acquisition module is configured to acquire TNP information of one or more transmission network ports of the second network device, and the one or more TNP information corresponds to the one or more transmission networks in a one-to-one manner;
  • the first establishment module is configured to establish a tunnel between the first network device and the second network device according to the one or more TNP information;
  • the storage module is used to store the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • one or more third network devices are also deployed in the first site, and each third network device of the one or more third network devices establishes a tunnel with the network device in the second site, And each third network device in the one or more third network devices also has a physical link established with the first network device;
  • the device also includes:
  • the third obtaining module is used to obtain the tunnel corresponding to the tunnel between the corresponding third network device and the network device in the second site from the corresponding third network device through the physical link with each third network device Entry, store the obtained tunnel entry.
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device and the fourth network device are connected to the first transmission network
  • the second network device is connected to the fourth network
  • the device is connected to the second transmission network and a tunnel is established.
  • the device further includes:
  • the fourth acquisition module is configured to acquire TNP information of the fourth network device, and the TNP information of the fourth network device corresponds to the first transmission network;
  • the second establishment module is configured to establish a tunnel between the first network device and the fourth network device according to the TNP information of the fourth network device;
  • the storage module is used to store the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • the second network device is deployed in the third site
  • the fourth network device is deployed in the second site
  • the first network device, the second network device, and the fourth network device are all connected to the first transmission network
  • the second network device is The network device and the fourth network device are connected to the second transmission network and a tunnel is established.
  • the device further includes:
  • the fifth obtaining module is used to obtain the site identification of the third site
  • the second adding module is used to add a second routing table entry to the routing table of the first network device, the second routing table entry includes the site prefix and the site identifier of the third site, and the second routing table entry is used to add The network device sends data packets.
  • the device further includes:
  • the sixth acquiring module is used to acquire the TNP information of the second network device and the TNP information of the fourth network device;
  • the third establishment module is used to establish a tunnel between the first network device and the second network device, and between the first network device and the fourth network device according to the TNP information of the second network device and the TNP information of the fourth network device. Between the tunnels;
  • the storage module is used to store the tunnel identifier of each tunnel established and the corresponding tunnel attribute information as a tunnel entry.
  • the third establishment module is mainly used for:
  • the tunnel between the first network device and the fourth network device is established according to the TNP of the fourth network device.
  • the storage module is mainly used for:
  • the first network device after the first network device obtains the site prefix and site identifier of the second site, it can add the site prefix and site identifier of the second site as the first routing table entry in In the stored routing table, in this way, for a site, the first network device can store only one routing table entry, avoiding a large number of duplicate routing table entries, and also avoiding routing due to changes in the status of the network device Table update.
  • the first network device may also store the tunnel identifier and tunnel attribute information of the tunnel established with the second site as tunnel entries in the tunnel table, and may also associate other network devices in the first site with the second site The tunnel table entry of the established tunnel is stored in the tunnel table. In this way, the first network device can subsequently send data packets to the second site through the tunnel between other network devices in the first site and the second site without creating more tunnels, which saves resources and improves tunnel performance. Utilization rate.
  • the device for generating routing table entries when generating routing table entries, only uses the division of the above-mentioned functional modules for illustration. In actual applications, the above-mentioned function assignments can be divided according to needs.
  • the function module is completed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above.
  • the device for generating routing table entries provided in the foregoing embodiment and the embodiment of the method for generating routing table entries belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • FIG. 13 is a schematic structural diagram of a network device according to an embodiment of the present application.
  • the network device may be any of the network devices shown in FIG. 1, FIG. 4, FIG. 5, FIG. 7 or FIG. 9. .
  • the network device includes at least one processor 1301, communication bus 1302, memory 1303, and at least one communication interface 1304.
  • the processor 1301 may be a microprocessor (including a central processing unit (CPU), etc.), a network processor (NP), a microprocessor, or may be one or more for implementing the integration of the solutions of the application
  • the circuit for example, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
  • the communication bus 1302 is used to transfer information between the above-mentioned components.
  • the communication bus 1302 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the memory 1303 can be read-only memory (ROM), random access memory (RAM), or electrically erasable programmable read-only memory (Read-Only Memory). , EEPROM), optical discs (including compact disc read-only memory, CD-ROM), compact discs, laser discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or Any other medium used to carry or store desired program codes in the form of instructions or data structures and which can be accessed by a computer, but is not limited to this.
  • the memory 1303 may exist independently and is connected to the processor 1301 through a communication bus 1302.
  • the memory 1303 may also be integrated with the processor 1301.
  • the communication interface 1304 uses any device such as a transceiver for communicating with other devices or communication networks.
  • the communication interface 1304 includes a wired communication interface, and may also include a wireless communication interface.
  • the wired communication interface may be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless communication interface may be a wireless local area network (Wireless Local Area Networks, WLAN) interface, a cellular network communication interface, or a combination thereof.
  • WLAN wireless Local Area Networks
  • the processor 1301 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 13.
  • the network device may include multiple processors, such as a processor 1301 and a processor 1305 as shown in FIG. 13.
  • processors can be a single-core processor or a multi-core processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
  • the memory 1303 is used to store the program code 1310 for executing the solution of the present application, and the processor 1301 may execute the program code 1310 stored in the memory 1303. That is, the network device can implement the message sending method provided in the embodiment of FIG. 2 and the routing provided in the embodiment of FIG. 6, FIG. 8 and FIG. 10 through the processor 1301 and the program code 1310 in the memory 1303. The method of generating entries.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example: floppy disk, hard disk, tape), optical medium (for example: Digital Versatile Disc (DVD)) or semiconductor medium (for example: Solid State Disk (SSD)) Wait.
  • the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.
  • first, second, and other words are used to distinguish the same items or similar items that have basically the same function and function. It should be understood that the terms “first”, “second”, and “nth” There are no logical or timing dependencies between the two, and no restrictions on the number and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, the first image may be referred to as the second image, and similarly, the second image may be referred to as the first image. Both the first image and the second image may be images, and in some cases, may be separate and different images.
  • the size of the sequence number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not correspond to the difference in the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • determining B according to A does not mean that B is determined only according to A, and B can also be determined according to A and/or other information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开了一种报文发送方法、装置及存储介质,属于通信技术领域。在本申请中,第一网络设备接收第一数据报文,并根据第一数据报文携带的目的地址,从存储的路由表中确定目标路由表项。其中,第一数据报文携带的目的地址匹配目标路由表项包括的站点前缀,目标路由表项包括的站点标识用于标识第二站点。之后,第一网络设备可以向第二站点内部署的网络设备发送第一数据报文。也即是,第一网络设备可以按照第二站点的站点标识发送数据报文给第二站点,无需确定数据报文具体是发给第二站点内的哪个网络设备的哪个接口,而且针对一个站点可以只存储一个路由表项,避免了路由表项的重复,也避免了因网络设备的状态发生改变而导致路由表的更新。

Description

报文发送方法、路由表项的生成方法、装置及存储介质
本申请要求于2020年1月8日提交的申请号为202010019657.8、发明名称为“报文发送方法、路由表项的生成方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别涉及一种报文发送方法、路由表项的生成方法、装置及存储介质。
背景技术
软件定义广域网(Software Defined WAN,SD-WAN)是软件定义网络(software defined networking,SDN)的重要实践。在SD-WAN中,通常可以通过叠加(Overlay)技术在两个网络设备之间建立隧道,进而通过隧道发送报文。但是,在Overlay技术中,通常因公私网的地址转换等因素无法与下一跳设备进行联通,导致无法按照下一跳设备的地址来发送报文。因此,在SD-WAN中如何发送报文成为目前亟待解决的问题。
在相关技术中,可以使用下一跳设备的接口来实现。也即是,可以将下一跳设备所在的站点的站点前缀和下一跳设备的接口标识作为一个路由表项存储在路由表中,将下一跳设备的接口标识,以及通过该接口与下一跳设备之间建立的隧道的隧道标识作为一个隧道表项存储在隧道表中。这样,当接收到数据报文时,可以将数据报文携带的目的地址与路由表中的路由表项进行匹配。如果该数据报文的目的地址匹配路由表中的某个路由表项,那么可以按照这个路由表项包括的接口标识,从隧道表中匹配对应的隧道表项。如果这个路由表项包括的接口标识匹配隧道表中的某个隧道表项,那么可以按照这个隧道表项包括的隧道标识所标识的隧道发送该数据报文。
由于一个网络设备通常包括多个接口,因此,按照上述方法,路由表中可以存储关于该网络设备的多个路由表项。这样,就会存在大量的重复路由表项。而且,当网络设备的状态发生变化之后,将会引起路由表的更新,进而会影响网络性能。
发明内容
本申请提供了一种报文发送方法、装置及存储介质,可以解决相关技术中存在大量的重复路由表项,且当网络设备的状态发生变化后会引起路由表的更新的问题,进而减轻对网络性能的影响。所述技术方案如下:
第一方面,提供了一种报文发送方法,所述第一网络设备中存储有路由表,所述路由表包括多个路由表项,所述多个路由表项中的每个路由表项包括一个站点前缀和对应的站点标识。在这种情况下,所述第一网络设备接收第一数据报文;所述第一网络设备根据所述目的地址,从所述路由表中确定目标路由表项,所述目的地址匹配所述目标路由表项包括的站点前缀,所述目标路由表项包括的站点标识用于标识第二站点;所述第一网络设备向所述第二 站点内部署的网络设备发送所述第一数据报文。
其中,所述第一数据报文携带目的地址,所述第一网络设备是指第一站点内部署的一个网络设备。
在本申请中,由于第一站点内的第一网络设备存储的路由表中的每个路由表项包括一个站点前缀和对应的站点标识,因此,当第一网络设备接收到第一数据报文时,可以从路由表中确定目标路由表项。由于目标路由表项中的站点标识用于标识第二站点,因此,第一网络设备可以直接根据目标路由表项中的站点标识,向第二站点发送第一数据报文。也即是,对于第一站点发往第二站点的数据报文,第一网络设备可以直接按照第二站点的站点标识发送给第二站点,无需确定数据报文具体是发给第二站点内的哪个网络设备的哪个接口,而且,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。
可选地,所述第一网络设备向所述第二站点内部署的网络设备发送所述第一数据报文时,所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项,所述一个或多个隧道表项是指所述第一站点与所述第二站点之间建立的隧道对应的隧道表项;所述第一网络设备从所述一个或多个隧道表项中选择一个隧道表项作为目标隧道表项;所述第一网络设备通过所述目标隧道表项对应的隧道发送所述第一数据报文。
可选地,所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项时,所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道标识,所述一个或多个隧道标识是指所述第一站点与所述第二站点之间建立的隧道的标识;所述第一网络设备根据所述一个或多个隧道标识,从所述隧道表中确定所述一个或多个隧道表项。
其中,所述第一网络设备中存储有一个隧道表,所述隧道表中的每个隧道表项包括一个隧道标识和对应的隧道属性信息,所述隧道表用于存储多个站点对应的隧道表项,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点。
在这种情况下,第一网络设备可以根据目标路由表项包括的站点标识,确定一个或多个隧道标识,该一个或多个隧道标识是指第一站点与第二站点之间建立的隧道的标识。之后,第一网络设备可以根据该一个或多个隧道标识,从该隧道表中确定一个或多个隧道表项。
需要说明的是,每个隧道表项包括的隧道属性信息可以包括隧道封装方式、隧道的源地址和目的地址、隧道的带宽以及隧道的时延等。而且,在一些情况下,第一网络设备中可以存储站点标识与隧道标识的第一映射关系,也即是,第一映射关系中存储有与第一站点建立有隧道的各个站点的标识,以及各个站点与第一站点之间建立的隧道的标识。这样,第一网络设备可以根据目标路由表项包括的站点标识,从第一映射关系中,确定一个或多个隧道标识。之后,第一网络设备可以从隧道表中确定包括的隧道标识与这一个或多个隧道标识相同的隧道表项,从而得到一个或多个隧道表项。
可选地,所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项时,所述第一网络设备根据所述目标路由表项包括的站点标识,确定目标隧道表的标识,所述目标隧道表是指所述多个隧道表中与所述第二站点对应的隧道表;所述第一网络设备根据所述目标隧道表的标识,从所述多个隧道表中确定所述目标隧道表,将所述目标隧道表中存储的隧道表项确定为所述一个或多个隧道表项。
其中,所述第一网络设备中存储有多个隧道表,所述多个隧道表与多个站点一一对应,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点。
在这种情况下,第一网络设备可以根据目标路由表项包括的站点标识,确定目标隧道表的标识,目标隧道表是指该多个隧道表中与第二站点对应的隧道表。之后,第一网络设备可以根据目标隧道表的标识,从该多个隧道表中确定目标隧道表,将目标隧道表中存储的隧道表项确定为一个或多个隧道表项。
由于第一网络设备中针对不同的站点存储不同的隧道表,且第一网络设备可以存储站点标识与隧道表标识的第二映射关系,也即是,第二映射关系中存储有与第一站点建立有隧道的各个站点的标识,以及各个站点对应的隧道表的标识。这样,第一网络设备可以根据目标路由表项包括的站点标识,从第二映射关系中,确定目标隧道表的标识。之后,可以根据目标隧道表的标识,从该多个隧道表中确定目标隧道表,进而将目标隧道表中的隧道表项确定为上述的一个或多个隧道表项。
第一网络设备根据目标路由表项包括的站点标识,确定一个或多个隧道表项后,可以根据隧道选择策略,从该一个或多个隧道表项中选择一个隧道表项作为目标隧道表项。
需要说明的是,当该一个或多个隧道表项中不存在满足隧道选择策略的隧道表项时,也即是,第一网络设备根据隧道选择策略在该一个或多个隧道表项中无法选择出目标隧道表项,此时,第一网络设备可以将第一数据报文丢弃。或者,第一网络设备可以通过哈希算法在一个或多个隧道表项中选择一个隧道表项作为目标隧道表项。
可选地,所述一个或多个隧道表项中的每个隧道表项还包括一个联通标识,所述联通标识用于指示对应的隧道是否联通,在此基础上,所述第一网络设备从所述一个或多个隧道表项中选择一个隧道表项作为目标隧道表项时,所述第一网络设备从所述一个或多个隧道表项中筛选出联通标识有效的隧道表项;所述第一网络设备从筛选出的隧道表项中选择一个隧道表项作为所述目标隧道表项。
第一网络设备选择目标隧道表项之后,可以获取目标隧道表项包括的隧道标识,将该隧道标识所标识的隧道作为目标隧道,进而通过目标隧道发送第一数据报文。
需要说明的是,由于隧道表包括第一站点内的网络设备与第二站点内的网络设备之间建立的所有隧道,因此,第一网络设备确定的目标隧道可能是第一网络设备与第二站点内的网络设备之间建立的隧道,也可能是第二网络设备与第二站点内的网络设备之间建立的隧道,第二网络设备为第一站点内除第一网络设备外的一个网络设备。
在一些可能的情况下,如果目标隧道为第一网络设备与第二站点内的网络设备之间建立的隧道,则第一网络设备可以直接从自身存储的目标隧道表项中获取目标隧道的隧道属性信息,进而按照获取的隧道属性信息,对第一数据报文进行隧道封装,得到第二数据报文,并通过目标隧道发送第二数据报文。
在另一些可能的情况下,如果目标隧道为第二网络设备与第二站点内的网络设备之间建立的隧道,则第一网络设备可以在第一数据报文中添加目标隧道的隧道标识,得到第三数据报文,通过与第二网络设备之间的物理链路将第三数据报文发送至第二网络设备。当第二网络设备接收到第三数据报文之后,第二网络设备可以从第三数据报文中解析出目标隧道的隧道标识和第一数据报文。之后,第二网络设备可以根据目标隧道的隧道标识,从第二网络设 备存储的目标隧道表项中获取目标隧道的隧道属性信息,进而按照获取的隧道属性信息,对第一数据报文进行隧道封装,得到第二数据报文,并通过目标隧道发送第二数据报文。
第二方面,提供了一种路由表项的生成方法,所述方法适用于第一网络设备,所述第一网络设备部署在第一站点内。这样,所述第一网络设备获取站点前缀和站点标识,所述站点标识用于标识第二站点,第二网络设备的网络地址匹配所述站点前缀;所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项,所述第一路由表项包括所述站点前缀和所述站点标识,所述第一路由表项用于向所述第二网络设备发送数据报文。
在本申请中,由于第一网络设备获取到的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取到的站点前缀,也即是,通过第一网络设备获取到的站点前缀和站点标识即可向第二网络设备发送数据报文。因此,第一网络设备可以将获取到的站点前缀以及站点标识作为第一路由表项添加在存储的路由表中,这样,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。
需要说明的是,第二网络设备可以部署在第二站点内,也可以部署在第三站点内,而且,第一网络设备与第二网络设备之间可以直接通信,也可以通过其他网络设备的中转进行通信。因此,接下来将分为三种情况进行说明。
第一种情况、所述第二网络设备部署在所述第二站点内,所述第一网络设备与所述第二网络设备接入相同的一种或多个传输网络。
在这种情况下,由于第二网络设备位于第二站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀和站点标识为第二站点的站点前缀和站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第一网络设备,也即是,第二网络设备与第一网络设备可以通信,因此,控制设备可以将第二站点的站点前缀和站点标识发送给第一网络设备。
可选地,在所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,所述第一网络设备获取所述第二网络设备的一个或多个传输网络端口TNP信息,所述一个或多个TNP信息与所述一种或多种传输网络一一对应;所述第一网络设备根据所述一个或多个TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道;所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
在本申请中,第二网络设备在向控制设备发送第二站点的站点前缀和站点标识时,还会发送第二网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点的站点前缀和站点标识时,还可以接收到第二网络设备的一个或多个TNP信息,该一个或多个TNP信息与一种或多种传输网络一一对应。也即是,该一个或多个TNP信息为第一网络设备与第二网络设备接入的相同的一种或多种传输网络中每个传输网络对应的TNP信息。
其中,TNP信息用于指示外部可访问的一个物理接口或逻辑接口,以及通讯过程中所需要参数。比如,TNP信息可以包括网络运营商标识、加密模式、是否有网络地址转换、对应的传输网络的路由域等。
第一网络设备接收到第二网络设备的一个或多个TNP信息后,可以将自身的TNP信息与该一个或多个TNP信息进行匹配。如果第一网络设备的一个TNP信息和第二网络设备的一个TNP信息能够匹配成功,那么,第一网络设备与第二网络设备可以通过匹配成功的这一对TNP信息建立第一网络设备与第二网络设备之间的隧道。
在本申请中,第一网络设备的TNP信息与第二网络设备的TNP信息是通过匹配条件确定是否能够匹配成功的。也即是,当第一网络设备的一个TNP信息和第二网络设备的一个TNP信息满足匹配条件时,可以确定第一网络设备的这个TNP信息和第二网络设备的这个TNP信息能够匹配成功。
其中,匹配条件可以根据实际情况进行设置。作为一种示例,匹配条件可以是指两个TNP信息包括的部分数据相同,比如,两个TNP信息包括的网络运营商标识相同、或者,两个TNP信息对应的传输网络的路由域相同。作为另一种示例,匹配条件可以是指两个TNP信息包括的所有信息均相同。
需要说明的是,当第一网络设备的TNP信息与第二网络设备的TNP信息能够匹配成功多对TNP信息时,第一网络设备与第二网络设备之间可以建立有多个隧道。
在一种可能的情况下,当通过上述步骤建立第一网络设备与第二网络设备之间的隧道之后,第一网络设备可以直接将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
由前述可知,第一网络设备中可以存储一个隧道表,也可以存储多个隧道表。当第一网络设备中存储有一个隧道表时,第一网络设备与第二网络设备之间建立隧道后,第一网络设备可以将每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在该隧道表中,并存储第二站点的站点标识与隧道标识的第一映射关系。当第一网络设备中存储有多个隧道表时,第一网络设备可以根据第二站点的站点标识,在站点标识与隧道表标识的第二映射关系中查找第二站点对应的隧道表标识。如果查找到第二站点对应的隧道表标识,第一网络设备可以将当前建立的每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在第二站点对应的隧道表中。如果未查找到第二站点对应的隧道表标识,第一网络设备可以创建一个隧道表,将当前建立的每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在创建的隧道表中,并存储第二站点的站点标识与该隧道表的隧道表标识的第二映射关系。
可选地,第一站点内还部署有一个或多个第三网络设备,该一个或多个第三网络设备中的每个第三网络设备均与第二站点内的网络设备建立有隧道,且该一个或多个第三网络设备中的每个第三网络设备还与第一网络设备建立有物理链路。这样,第一网络设备还可以通过与每个第三网络设备之间的物理链路,从相应第三网络设备中获取相应第三网络设备与第二站点内的网络设备之间的隧道对应的隧道表项,将获取的隧道表项进行存储。
可选地,当第一网络设备与多个第三网络设备之间的距离较远,或无法通过物理链路连接时,可以通过网络隧道连接第一网络设备与第三网络设备,该网络隧道可以包括通用路由封装(Generic Routing Encapsulation,GRE)隧道。当然,该网络隧道也可以为其他的隧道。
另外,第一网络设备与每个第三网络设备之间的物理链路或网络隧道主要是用于同步站点内的隧道表项、以及站点内的数据报文的传输,无需发布到站点外部的网络,因此,第一站点内的网络设备上用于建立物理链路的接口上的网络地址均可以设置为私网地址,甚至不同站点都可以采用相同的地址空间,可以节约SD-WAN网络对运营商网络地址资源的消耗。
第二种情况、所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备与所述第四网络设备接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
在这种情况下,由于第二网络设备位于第三站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀为第三站点的站点前缀,第一网络设备获取的站点标识为第二站点的站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第四网络设备,且第二网络设备与第四网络设备之间建立有隧道,第四网络设备与第一网络设备接入相同的传输网络,但是第一网络设备与第二网络设备没有接入相同的传输网络。也即是,第二网络设备可以与第四网络设备通信,第四网络设备可以与第一网络设备通信,但是,第一网络设备与第二网络设备不能直接通信,因此,控制设备可以将第二站点的站点标识和第三站点的站点前缀发送给第一网络设备。
可选地,在所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,所述第一网络设备获取所述第四网络设备的TNP信息,所述第四网络设备的TNP信息与所述第一传输网络对应;所述第一网络设备根据所述第四网络设备的TNP信息,建立所述第一网络设备与所述第四网络设备之间的隧道;所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
在本申请中,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀时,还会发送第四网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点的站点标识和第三站点的站点前缀时,还可以接收到第四网络设备的TNP信息,该TNP信息与第一传输网络对应。
第三种情况、所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备、所述第二网络设备和所述第四网络设备均接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
在这种情况下,由于第二网络设备位于第三站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀为第三站点的站点前缀,第一网络设备获取的站点标识为第二站点的站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设 备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第一网络设备和第四网络设备,且第二网络设备与第四网络设备之间建立有隧道,第四网络设备与第一网络设备接入相同的传输网络。也即是,第一网络设备可以与第二网络设备通信,第一网络设备也可以与第四网络设备通信,第四网络设备可以与第二网络设备通信,因此,控制设备可以将第二站点的站点标识和第三站点的站点前缀发送给第一网络设备。
可选地,在所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,所述第一网络设备获取所述第三站点的站点标识;所述第一网络设备在所述第一网络设备的路由表中添加第二路由表项,所述第二路由表项包括所述站点前缀和所述第三站点的站点标识,所述第二路由表项用于向所述第二网络设备发送数据报文。
由于本申请中第一网络设备可以与第二网络设备通信,因此,基于高可靠性考虑,第一网络设备除了获取第二站点的站点标识和第三站点的站点前缀之外,第一网络设备还可以获取第三站点的站点标识。
需要说明的是,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀的同时,可以向第一网络设备发送第三站点的站点标识。当然,控制设备也可以先向第一网络设备发送第二站点的站点标识和第三站点的站点前缀,然后再向第一网络设备发送第三站点的站点标识。
可选地,在所述第一网络设备在所述第一网络设备的路由表中添加第二路由表项之后,所述第一网络设备获取所述第二网络设备的TNP信息和所述第四网络设备的TNP信息;所述第一网络设备根据所述第二网络设备的TNP信息和所述第四网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道,以及所述第一网络设备与所述第四网络设备之间的隧道;所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
在本申请中,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀时,还会发送第四网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点的站点标识和第三站点的站点前缀时,还可以接收到第四网络设备的TNP信息,该TNP信息与第一传输网络对应。同理,控制设备向第一网络设备发送第三站点的站点标识时,还会发送第二网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第三站点的站点标识时,还可以接收到第二网络设备的TNP信息。
第一网络设备接收到第二网络设备的TNP信息和第四网络设备的TNP信息之后,可以直接根据第二网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道,根据第四网络设备的TNP信息,建立第一网络设备与第四网络设备之间的隧道。
可选地,第一网络设备可以获取第二站点的优先级和第三站点的优先级。如果第三站点的优先级高于第二站点的优先级,则第一网络设备可以根据第二网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道。之后,第一网络设备对第一网络设备与第二网络设备之间的隧道的联通性进行探测。如果探测失败,则第一网络设备可以根据第四网络设备的TNP,建立第一网络设备与第四网络设备之间的隧道。如果探测成功,那么第一网络设备可以暂时先不建立第一网络设备与第四网络设备之间的隧道,直到第一网络设备与第二网络 设备之间的隧道出现故障而不能联通时,再建立第一网络设备与第四网络设备之间的隧道。
需要说明的是,第二站点的优先级和第三站点的优先级可以是控制设备在发送上述的站点标识和站点前缀的同时发送给第一网络设备的,当然,也可以是先发送上述的站点标识和站点前缀,再发送第二站点的优先级和第三站点的优先级。
本申请是为了实现第一网络设备与第二网络设备之间传输数据报文,而生成路由表项以及建立隧道。因此,控制设备通常会将第三站点的优先级设置的比较高一点,也即是,第三站点的优先级高于第二站点的优先级,这样,第一网络设备就会优先建立第一网络设备与第二网络设备之间的隧道。之后,第一网络设备与第二网络设备之间传输的数据报文就会优先通过这两个设备之间直连的隧道进行传输,而无需通过第四网络设备进行转发,从而降低网络开销,提高报文传输效率。
可选地,对于上述三种情况,当通过上述步骤建立第一网络设备与第二网络设备之间的隧道之后,有的隧道可能能够联通,有的隧道可能不能联通,因此,在本申请中,在所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储时,所述第一网络设备对建立的每条隧道的联通性进行探测;所述第一网络设备将联通性探测成功的每条隧道的隧道标识、对应的隧道属性信息、以及置为有效的联通标识作为一个隧道表项进行存储;和/或,所述第一网络设备将联通性探测失败的每条隧道的隧道标识、对应的隧道属性信息、以及置为无效的联通标识作为一个隧道表项进行存储。
由于第一网络设备对建立的每条隧道的联通性进行探测的实现方式相同,因此,以其中的一条隧道为例,在建立该隧道之后,第一网络设备可以通过该隧道向第二网络设备发送探测消息,该探测消息用于探测该隧道当前是否可用。如果接收到第二网络设备针对该探测消息返回的响应消息,则可以确定该隧道可用,也即是,该隧道能够联通。如果未接收到第二网络设备针对该探测消息返回的响应消息,则可以确定该隧道不可用,也即是,该隧道不能联通。
需要说明的是,该探测信息不仅可以探测隧道当前是否可用,还可以用来探测隧道的带宽以及时延等信息。另外,第一网络设备可以周期性地发送探测信号进行探测,本申请对此不作限定。
第三方面,提供了一种报文发送装置,所述报文发送装置具有实现上述第一方面中报文发送方法行为的功能。所述报文发送装置包括至少一个模块,该至少一个模块用于实现上述第一方面所提供的报文发送方法。
第四方面,提供了一种路由表项的生成装置,所述路由表项的生成装置具有实现上述第二方面中路由表项的生成方法行为的功能。所述路由表项的生成装置包括至少一个模块,该至少一个模块用于实现上述第二方面所提供的路由表项的生成方法。
第五方面,提供了一种网络设备,所述网络设备包括处理器和存储器,所述存储器用于存储执行上述第一方面所提供的报文发送方法的程序或第二方面所提供的路由表项的生成方法的程序,以及存储用于实现上述第一方面所提供的报文发送方法或第二方面所提供的路由表项的生成方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述存储设备的操作装置还可以包括通信总线,该通信总线用于该处理器与存储器之间建立连接。
第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的报文发送方法或第二方面所提供的路由表项的生成方法。
第七方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的报文发送方法或第二方面所提供的路由表项的生成方法。
上述第三方面、第四方面、第五方面、第六方面和第七方面所获得的技术效果与第一方面或第二方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
本申请提供的技术方案至少可以带来以下有益效果:
在本申请中,由于第一站点内的第一网络设备存储的路由表中的每个路由表项包括一个站点前缀和对应的站点标识,因此,当第一网络设备接收到第一数据报文时,可以从路由表中确定目标路由表项。由于目标路由表项中的站点标识用于标识第二站点,因此,第一网络设备可以直接根据目标路由表项中的站点标识,向第二站点发送第一数据报文。也即是,对于第一站点发往第二站点的数据报文,第一网络设备可以直接按照第二站点的站点标识发送给第二站点,无需确定数据报文具体是发给第二站点内的哪个网络设备的哪个接口,而且,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。
附图说明
图1是本申请实施例提供的一种报文发送方法所涉及的系统架构图;
图2是本申请实施例提供的一种报文发送方法的流程图;
图3是本申请实施例提供的一种隧道索引字段的示意图;
图4是本申请实施例提供的一种路由表项的生成方法所涉及的系统架构图;
图5是本申请实施例提供的另一种路由表项的生成方法所涉及的系统架构图;
图6是本申请实施例提供的一种路由表项的生成方法的流程图;
图7是本申请实施例提供的又一种路由表项的生成方法所涉及的系统架构图;
图8是本申请实施例提供的另一种路由表项的生成方法的流程图;
图9是本申请实施例提供的再一种路由表项的生成方法所涉及的系统架构图;
图10是本申请实施例提供的又一种路由表项的生成方法的流程图;
图11是本申请实施例提供的一种报文发送装置的结构示意图;
图12是本申请实施例提供的一种路由表项的生成装置的结构示意图;
图13是本申请实施例提供的一种网络设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
图1是本申请实施例提供的一种报文发送方法所涉及的系统架构图。如图1所示,该系统包括网络设备101、网络设备102、网络设备103以及控制设备104。其中,网络设备101和网络设备102是部署在第一站点内的网络设备,网络设备103是部署在第二站点内的网络设备。网络设备101、网络设备102、网络设备103可以与控制设备104之间通过无线或有线 方式连接以进行通信。
对于第一站点内的网络设备和第二站点内的网络设备,这些网络设备上电后,可以向控制设备104进行注册,之后,属于不同站点的两个网络设备之间可以通过控制设备104建立隧道,而且,同一站点内的每两个网络设备之间还可以建立有物理链路。示例地,如图1所示,网络设备101与网络设备103之间通过长期演进(Long Term Evolution,LTE)网络建立有隧道1,网络设备102与网络设备103通过多协议标签交换(Multi-Protocol Label Switching,MPLS)网络建立有隧道2,网络设备101与网络设备102之间建立有物理链路。
另外,网络设备101和网络设备102还可以接收控制设备104发送的第二站点的站点前缀和站点标识,并将第二站点的站点前缀和站点标识作为一个路由表项添加在存储的路由表中,也即是,网络设备101可以将第二站点的站点前缀和站点标识作为一个路由表项添加在网络设备101存储的路由表中,网络设备102也可以将第二站点的站点前缀和站点标识作为一个路由表项添加在网络设备102存储的路由表中。同理,网络设备103还可以接收控制设备104发送的第一站点的站点前缀和站点标识,并将第一站点的站点前缀和站点标识作为一个路由表项添加在网络设备103存储的路由表中。
再者,在第一站点内的网络设备与第二站点内的网络设备通过控制设备104建立隧道之后,这些网络设备中还可以存储建立的每条隧道对应的隧道表项。也即是,网络设备101、网络设备102和网络设备103中都可以存储隧道1以及隧道2对应的隧道表项,隧道表项包括隧道标识以及隧道属性信息。
当第一站点内的网络设备和第二站点内的网络设备通过上述方法建立隧道、存储路由表项以及隧道表项之后,第一站点内的网络设备和第二站点内的网络设备,可以根据存储的路由表以及隧道表项,通过建立的隧道传输数据报文。具体详见下述图2所示的实施例,在此不展开说明。
需要说明的是,在图1所示的系统架构中,第一站点内的网络设备和第二站点内的网络设备可以通过控制设备104来建立隧道,以及获取对端站点的站点前缀和站点标识。但是,在另一些实施例中,该系统中也可以不包括控制设备104,在这种情况下,第一站点内的网络设备可以广播第一站点的站点前缀和站点标识,这样,第二站点内的网络设备可以接收第一站点的站点前缀和站点标识,从而将第一站点的站点前缀和站点标识作为一个路由表项进行存储。同理,第二站点内的网络设备可以广播第二站点的站点前缀和站点标识,这样,第一站点内的网络设备可以接收第二站点的站点前缀和站点标识,从而将第二站点的站点前缀和站点标识作为一个路由表项进行存储。之后,第一站点内的网络设备和第二站点内的网络设备可以建立隧道。当然,还可以通过其他方法来实现,本申请实施例在此不做限定。
值得注意的是,关于同一隧道,隧道两端的网络设备中存储的隧道属性信息中的源端信息和对端信息是相反的。比如,对于隧道1来说,网络设备101和网络设备102中存储的隧道属性信息中的源端信息为网络设备103中存储的隧道属性信息的目的端信息,网络设备101和网络设备102中存储的隧道属性信息中的目的端信息为网络设备103中存储的隧道属性信息的源端信息。其中,隧道的源端信息可以包括隧道的源网络地址,隧道的目的端信息可以包括隧道的目的网络地址。
可选地,图1所示的系统中是以第一站点内部署有两台网络设备、第二站点内部署有一台网络设备进行举例说明。当然,在其他可能的情况下,第一站点内也可以部署有一台网络 设备,或者两台以上的网络设备,第二站点内也可以部署有两台或两台以上的网络设备,且第一站点内部署的网络设备的数量可以与第二站点内部署的网络设备的数量相同或者不同。
图2是本申请实施例提供的一种报文发送方法的流程图,该方法适用于第一网络设备,该第一网络设备可以为第一站点内的任一网络设备,示例地,第一网络设备可以为图1所示的网络设备101或者网络设备102。在本申请实施例中,第一网络设备中存储有路由表,路由表包括多个路由表项,该多个路由表项中的每个路由表项包括一个站点前缀和对应的站点标识。请参考图2,该方法包括如下步骤。
步骤201:第一网络设备接收第一数据报文,第一数据报文携带目的地址,第一网络设备是指第一站点内部署的一个网络设备。
在本申请实施例中,第一数据报文可以为第一站点内的用户端发送给第一网络设备的数据报文,也可以为其他站点内的网络设备发送给第一网络设备的数据报文。
当第一数据报文为第一站点内的用户端发送给第一网络设备的数据报文时,由于第一站点内包括多个网络设备,因此,第一站点内的用户端在发送第一数据报文之前,需要从第一站点内的多个网络设备中选择一个网络设备作为第一网络设备,进而将第一数据报文发送给第一网络设备。
作为一种示例,第一站点内的用户端可以根据第一站点的组网方式,从第一站点内的多个网络设备中选择一个网络设备作为第一网络设备。
需要说明的是,用户端中可以存储组网方式与设备标识之间的对应关系,当用户端需要发送数据报文时,可以根据自身所在站点的组网方式,以及组网方式与设备标识之间的对应关系,确定一个网络设备来发送数据报文。示例地,对于第一站点内的用户端来说,该用户端可以根据第一站点的组网方式,从存储的组网方式与设备标识之间的对应关系中,获取对应的设备标识,进而将该设备标识所标识的网络设备确定为第一网络设备。
步骤202:第一网络设备根据第一数据报文携带的目的地址,从存储的路由表中确定目标路由表项,其中,第一数据报文携带的目的地址匹配目标路由表项包括的站点前缀,目标路由表项包括的站点标识用于标识第二站点。
由于站点前缀是指站点对应的网段,因此,可以将第一数据报文携带的目的地址与路由表中每个路由表项包括的站点前缀进行匹配,从而可以从路由表中确定目标路由表项。
需要说明的是,由于第一数据报文携带的目标地址匹配目标路由表项包括的站点前缀,目标路由表项包括的站点标识用于标识第二站点,因此,可以确定第一数据报文携带的目的地址为第二站点内的用户端的地址,进而可以确定目标路由表项包括的站点前缀为第二站点的站点前缀,目标路由表项包括的站点标识为第二站点的标识。
步骤203:第一网络设备向第二站点内部署的网络设备发送第一数据报文。
在本申请实施例,第一网络设备可以通过下述步骤(1)-(3)向第二站点内部署的网络设备发送第一数据报文。
(1)、第一网络设备根据目标路由表项包括的站点标识,确定一个或多个隧道表项,一个或多个隧道表项是指第一站点与第二站点之间建立的隧道对应的隧道表项。
在一些实施例中,第一网络设备中存储有一个隧道表,该隧道表中的每个隧道表项包括一个隧道标识和对应的隧道属性信息,该隧道表用于存储多个站点对应的隧道表项,该多个 站点是指与第一站点之间建立有隧道的站点,且该多个站点包括第二站点。这样,第一网络设备可以根据目标路由表项包括的站点标识,确定一个或多个隧道标识,该一个或多个隧道标识是指第一站点与第二站点之间建立的隧道的标识。之后,第一网络设备可以根据该一个或多个隧道标识,从该隧道表中确定一个或多个隧道表项。
需要说明的是,每个隧道表项包括的隧道属性信息可以包括隧道封装方式、隧道的源地址和目的地址、隧道的带宽以及隧道的时延等。而且,在一些实施例中,第一网络设备中可以存储站点标识与隧道标识的第一映射关系,也即是,第一映射关系中存储有与第一站点建立有隧道的各个站点的标识,以及各个站点与第一站点之间建立的隧道的标识。这样,第一网络设备可以根据目标路由表项包括的站点标识,从第一映射关系中,确定一个或多个隧道标识。之后,第一网络设备可以从隧道表中确定包括的隧道标识与这一个或多个隧道标识相同的隧道表项,从而得到一个或多个隧道表项。
在另一些实施例中,第一网络设备中存储有多个隧道表,该多个隧道表与多个站点一一对应,该多个站点是指与所述第一站点之间建立有隧道的站点,且该多个站点包括第二站点。这样,第一网络设备可以根据目标路由表项包括的站点标识,确定目标隧道表的标识,目标隧道表是指该多个隧道表中与第二站点对应的隧道表。之后,第一网络设备可以根据目标隧道表的标识,从该多个隧道表中确定目标隧道表,将目标隧道表中存储的隧道表项确定为一个或多个隧道表项。
由于第一网络设备中针对不同的站点存储不同的隧道表,且第一网络设备可以存储站点标识与隧道表标识的第二映射关系,也即是,第二映射关系中存储有与第一站点建立有隧道的各个站点的标识,以及各个站点对应的隧道表的标识。这样,第一网络设备可以根据目标路由表项包括的站点标识,从第二映射关系中,确定目标隧道表的标识。之后,可以根据目标隧道表的标识,从该多个隧道表中确定目标隧道表,进而将目标隧道表中的隧道表项确定为上述的一个或多个隧道表项。
(2)、第一网络设备从该一个或多个隧道表项中选择一个隧道表项作为目标隧道表项。
在一些实施例中,第一网络设备可以根据隧道选择策略,从该一个或多个隧道表项中选择一个隧道表项作为目标隧道表项。
示例性地,第一网络设备存储的隧道选择策略为:选择带宽最大的隧道。这样,第一网络设备可以获取该一个或多个隧道表项中包括的隧道属性信息,并从隧道属性信息中获取隧道的带宽。之后,第一网络设备可以根据隧道的带宽,从该一个或多个隧道表项中选择带宽最大的一个隧道表项作为目标隧道表项。
示例性地,第一网络设备存储的隧道选择策略为:选择带宽大于1M的隧道。这样,第一网络设备可以获取该一个或多个隧道表项中包括的隧道属性信息,并从隧道属性信息中获取隧道的带宽,然而一个或多个隧道的带宽均小于1M,此时,第一网络设备可以将第一数据报文丢弃。
需要说明的是,当该一个或多个隧道表项中不存在满足隧道选择策略的隧道表项时,也即是,第一网络设备根据隧道选择策略在该一个或多个隧道表项中无法选择出目标隧道表项,此时,第一网络设备可以将第一数据报文丢弃。或者,第一网络设备可以通过哈希算法在一个或多个隧道表项中选择一个隧道表项作为目标隧道表项。
示例性地,在隧道标识通过数值来表示的情况下,第一网络设备可以对第一数据报文携 带的元组信息进行运算,从而得到一个数值,并确定第一站点与第二站点的隧道数量,进而将运算得到的数值与该隧道数量之间取余,并将得到的余数作为隧道标识,之后,可以将包括该隧道标识的隧道表项作为目标隧道表项。假设,第一数据报文携带的目的地址为10.1.1.1,可以将该目的地址相加,得到数值10+1+1+1=13。且第一站点与第二站点之间的隧道数量为10个,从而可以根据数值13以及隧道数量10计算得到余数3,这样,可以将包括的隧道标识为3的隧道表项作为目标隧道表项。
可选地,该一个或多个隧道表项中的每个隧道表项还包括一个联通标识,该联通标识用于指示对应的隧道是否联通。在这种情况下,当第一网络设备确定该一个或多个隧道表项后,第一网络设备可以从该一个或多个隧道表项中筛选出联通标识有效的隧道表项,之后,第一网络设备可以从筛选出的隧道表项中选择一个隧道表项作为目标隧道表项。其中,选择目标隧道的方法与前述介绍的方法相同,在此不做赘述。
(3)、第一网络设备通过目标隧道表项对应的隧道发送第一数据报文。
第一网络设备选择目标隧道表项之后,可以获取目标隧道表项包括的隧道标识,将该隧道标识所标识的隧道作为目标隧道,进而通过目标隧道发送第一数据报文。
需要说明的是,由于隧道表包括第一站点内的网络设备与第二站点内的网络设备之间建立的所有隧道,因此,第一网络设备确定的目标隧道可能是第一网络设备与第二站点内的网络设备之间建立的隧道,也可能是第二网络设备与第二站点内的网络设备之间建立的隧道,第二网络设备为第一站点内除第一网络设备外的一个网络设备。
在一些实施例中,如果目标隧道为第一网络设备与第二站点内的网络设备之间建立的隧道,则第一网络设备可以直接从自身存储的目标隧道表项中获取目标隧道的隧道属性信息,进而按照获取的隧道属性信息,对第一数据报文进行隧道封装,得到第二数据报文,并通过目标隧道发送第二数据报文。
在另一些实施例中,如果目标隧道为第二网络设备与第二站点内的网络设备之间建立的隧道,则第一网络设备可以在第一数据报文中添加目标隧道的隧道标识,得到第三数据报文,通过与第二网络设备之间的物理链路将第三数据报文发送至第二网络设备。当第二网络设备接收到第三数据报文之后,第二网络设备可以从第三数据报文中解析出目标隧道的隧道标识和第一数据报文。之后,第二网络设备可以根据目标隧道的隧道标识,从第二网络设备存储的目标隧道表项中获取目标隧道的隧道属性信息,进而按照获取的隧道属性信息,对第一数据报文进行隧道封装,得到第二数据报文,并通过目标隧道发送第二数据报文。
在一种可能的实现方式下,第一网络设备可以在第一数据报文中添加一个隧道索引字段,该隧道索引字段中可以包括目标隧道的隧道标识,从而得到第三数据报文。之后,可以通过与第二网络设备之间的物理链路将第三数据报文发送至第二网络设备。
示例性地,如图3所示,隧道索引字段可以包括隧道标识,该隧道标识可以为目标隧道的隧道标识。可选地,隧道索引字段还可以包括封装方式、标签、版本号、协议类型等。其中,封装方式为隧道标识对应的隧道的类型,标签为标志位,可以用于指示数据报文是用户侧发往隧道侧,或者是从隧道侧接收的,版本号为所使用的隧道索引字段的版本号,协议类型为第一数据报文的协议类型。
需要说明的是,由于隧道索引字段不仅包括目标隧道的隧道标识,还包括隧道索引字段的封装方式、标签、版本号、协议类型等,因此,第二网络设备可以按照封装方式、标签、 版本号、协议类型这些信息,从第三数据报文中解析出第一数据报文,同时,还可以获取到目标隧道的隧道标识。
第二网络设备解析出第一数据报文后,由于第二网络设备中也存储有目标隧道表项,因此,第二网络设备可以根据目标隧道的隧道标识,从目标隧道表项中获取目标隧道的隧道属性信息,进而按照获取的隧道属性信息,对第一数据报文进行隧道封装,得到第二数据报文,并通过目标隧道发送第二数据报文。
需要说明的是,第二站点内的网络设备接收到第二数据报文后,可以对第二数据报文进行隧道解封装,从而得到第一数据报文。
需要说明的是,上述步骤201-203是第一站点内的网络设备向第二站点内的网络设备发送数据报文的情况。应当理解的是,第二站点内的网络设备也可以向第一站点内的网络设备发送数据报文,且第二站点内的网络设备向第一站点内的网络设备发送数据报文的实现过程可以参考上述步骤201-203,在此不再赘述。
在本申请实施例中,由于第一站点内的第一网络设备存储的路由表中的每个路由表项包括一个站点前缀和对应的站点标识,因此,当第一网络设备接收到第一数据报文时,可以从路由表中确定目标路由表项。由于目标路由表项中的站点标识用于标识第二站点,因此,第一网络设备可以直接根据目标路由表项中的站点标识,向第二站点发送第一数据报文。也即是,对于第一站点发往第二站点的数据报文,第一网络设备可以直接按照第二站点的站点标识发送给第二站点,无需确定数据报文具体是发给第二站点内的哪个网络设备的哪个接口,而且,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。并且,第一网络设备向第二站点发送数据报文时,也可以通过第一站点内的其他网络设备与第二站点建立的隧道发送数据报文,从而无需创建更多的隧道,节省了资源,提高了隧道的利用率。
在上述实施例中,第一站点内的网络设备可以基于存储的路由表,与第二站点内的网络设备传输数据报文。因此,在两个站点内的网络设备传输数据报文之前,网络设备需要生成并存储路由表项。由于不同的系统架构下,网络设备生成路由表项的方式有所不同,因此,接下来将分为多个实施例进行说明。
图4是本申请实施例提供的一种路由表项的生成方法所涉及的系统架构图。如图4所示,该系统包括网络设备401、网络设备402、网络设备403、网络设备404以及控制设备405。其中,网络设备401和网络设备402是部署在第一站点内的网络设备,网络设备403和网络设备404是部署在第二站点内的网络设备。网络设备401、网络设备402、网络设备403和网络设备404可以与控制设备405之间通过无线或有线方式连接以进行通信。
其中,网络设备401与网络设备402之间建立有物理链路,网络设备403与网络设备404之间建立有物理链路。网络设备401和网络设备403接入同一传输网络,即,LTE网络。网络设备402和网络设备404接入同一传输网络,即,MPLS网络。这样,网络设备401与网络设备403之间可以通过LTE网络建立隧道1,网络设备402与网络设备404之间可以通过MPLS网络建立隧道2,且这些网络设备可以生成路由表项,具体的实现方式可以参考下述图5实施例中的相关描述,此处不展开说明。
需要说明的是,参考上述图1中的相关描述,图4所示的系统架构中也可以不包括控制设备405,本申请实施例在此不做限定。
可选地,图4所示的系统中是以第一站点内部署有两台网络设备、第二站点内部署有两台网络设备进行举例说明。当然,在其他可能的情况下,第一站点内也可以部署有一台网络设备,或者两台以上的网络设备,第二站点内也可以部署有一台或两台以上的网络设备,且第一站点内部署的网络设备的数量可以与第二站点内部署的网络设备的数量相同或者不同。
示例地,参见图5,第一站点内部署一台网络设备501,第二站点内部署一台网络设备502,网络设备501和网络设备502可以与控制设备503之间通过无线或有线方式连接以进行通信。网络设备501和网络设备502可以接入相同的多个传输网络,即,网络设备501和网络设备502均接入LTE网络和MPLS网络,并且这两个网络设备可以通过该多个传输网络建立多条隧道。
在图4和图5的系统架构的基础上,本申请实施例提供了一种路由表项的生成方法,该方法适用于第一网络设备。本申请实施例中,第一网络设备部署在第一站点内,第二网络设备部署在第二站点内,第一网络设备与第二网络设备接入相同的一种或多个传输网络。示例地,第一网络设备可以为图4所示的网络设备401或者网络设备402,又或者为图5所示的网络设备501,第二网络设备可以为图4所示的网络设备403或者网络设备404,又或者为图5所示的网络设备502。请参考图6,该方法包括如下步骤。
基于上述描述,由于第一站点内的网络设备和第二站点内的网络设备可以通过控制设备来建立隧道,以及获取对端站点的站点前缀和站点标识,也可以不通过控制设备来实现。不管是否通过控制设备,第一网络设备生成路由表项的方法类似。因此,接下来以通过控制设备来实现为例,对路由表项的生成方法进行介绍。
步骤601:第一网络设备获取站点前缀和站点标识,该站点标识用于标识第二站点,第二网络设备的网络地址匹配该站点前缀。
由于第二网络设备位于第二站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀和站点标识为第二站点的站点前缀和站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第一网络设备,也即是,第二网络设备与第一网络设备可以通信,因此,控制设备可以将第二站点的站点前缀和站点标识发送给第一网络设备。
步骤602:第一网络设备在第一网络设备的路由表中添加第一路由表项,第一路由表项包括该站点前缀和该站点标识,第一路由表项用于向第二网络设备发送数据报文。
当第一网络设备通过上述步骤601-602生成并存储路由表项之后,还可以通过下述步骤603-605生成并存储隧道表项。
步骤603:第一网络设备获取第二网络设备的一个或多个TNP信息,该一个或多个TNP信息与一种或多种传输网络一一对应。
在本申请实施例中,第二网络设备在向控制设备发送第二站点的站点前缀和站点标识时,还会发送第二网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点 的站点前缀和站点标识时,还可以接收到第二网络设备的一个或多个TNP信息,该一个或多个TNP信息与一种或多种传输网络一一对应。也即是,该一个或多个TNP信息为第一网络设备与第二网络设备接入的相同的一种或多种传输网络中每个传输网络对应的TNP信息。
其中,TNP信息用于指示外部可访问的一个物理接口或逻辑接口,以及通讯过程中所需要参数。比如,TNP信息可以包括网络运营商标识、加密模式、是否有网络地址转换、对应的传输网络的路由域等。
步骤604:第一网络设备根据第二网络设备的一个或多个TNP信息,建立第一网络设备与第二网络设备之间的隧道。
第一网络设备接收到第二网络设备的一个或多个TNP信息后,可以将自身的TNP信息与该一个或多个TNP信息进行匹配。如果第一网络设备的一个TNP信息和第二网络设备的一个TNP信息能够匹配成功,那么,第一网络设备与第二网络设备可以通过匹配成功的这一对TNP信息建立第一网络设备与第二网络设备之间的隧道。
在本申请实施例中,第一网络设备的TNP信息与第二网络设备的TNP信息是通过匹配条件确定是否能够匹配成功的。也即是,当第一网络设备的一个TNP信息和第二网络设备的一个TNP信息满足匹配条件时,可以确定第一网络设备的这个TNP信息和第二网络设备的这个TNP信息能够匹配成功。
其中,匹配条件可以根据实际情况进行设置。作为一种示例,匹配条件可以是指两个TNP信息包括的部分数据相同,比如,两个TNP信息包括的网络运营商标识相同、或者,两个TNP信息对应的传输网络的路由域相同。作为另一种示例,匹配条件可以是指两个TNP信息包括的所有信息均相同。
需要说明的是,当第一网络设备的TNP信息与第二网络设备的TNP信息能够匹配成功多对TNP信息时,第一网络设备与第二网络设备之间可以建立有多个隧道。
步骤605:第一网络设备将与第二网络设备之间建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
在一些实施例中,当通过上述步骤建立第一网络设备与第二网络设备之间的隧道之后,第一网络设备可以直接将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
在另一些实施例中,当通过上述步骤建立第一网络设备与第二网络设备之间的隧道之后,有的隧道可能能够联通,有的隧道可能不能联通,因此,在本申请实施例中,建立第一网络设备与第二网络设备之间的隧道后,第一网络设备可以对建立的每条隧道的联通性进行探测。之后,第一网络设备可以将联通性探测成功的每条隧道的隧道标识、对应的隧道属性信息、以及置为有效的联通标识作为一个隧道表项进行存储;和/或,第一网络设备可以将联通性探测失败的每条隧道的隧道标识、对应的隧道属性信息、以及置为无效的联通标识作为一个隧道表项进行存储。
由于第一网络设备对建立的每条隧道的联通性进行探测的实现方式相同,因此,以其中的一条隧道为例,在建立该隧道之后,第一网络设备可以通过该隧道向第二网络设备发送探测消息,该探测消息用于探测该隧道当前是否可用。如果接收到第二网络设备针对该探测消息返回的响应消息,则可以确定该隧道可用,也即是,该隧道能够联通。如果未接收到第二网络设备针对该探测消息返回的响应消息,则可以确定该隧道不可用,也即是,该隧道不能 联通。
需要说明的是,该探测信息不仅可以探测隧道当前是否可用,还可以用来探测隧道的带宽以及时延等信息。另外,第一网络设备可以周期性地发送探测信号进行探测,本申请实施例对此不作限定。
由前述可知,第一网络设备中可以存储一个隧道表,也可以存储多个隧道表。当第一网络设备中存储有一个隧道表时,第一网络设备与第二网络设备之间建立隧道后,第一网络设备可以将每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在该隧道表中,并存储第二站点的站点标识与隧道标识的第一映射关系。当第一网络设备中存储有多个隧道表时,第一网络设备可以根据第二站点的站点标识,在站点标识与隧道表标识的第二映射关系中查找第二站点对应的隧道表标识。如果查找到第二站点对应的隧道表标识,第一网络设备可以将当前建立的每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在第二站点对应的隧道表中。如果未查找到第二站点对应的隧道表标识,第一网络设备可以创建一个隧道表,将当前建立的每条隧道的隧道标识以及对应的隧道属性信息作为一个隧道表项添加在创建的隧道表中,并存储第二站点的站点标识与该隧道表的隧道表标识的第二映射关系。
可选地,第一站点内还部署有一个或多个第三网络设备,该一个或多个第三网络设备中的每个第三网络设备均与第二站点内的网络设备建立有隧道,且该一个或多个第三网络设备中的每个第三网络设备还与第一网络设备建立有物理链路。这样,第一网络设备还可以通过与每个第三网络设备之间的物理链路,从相应第三网络设备中获取相应第三网络设备与第二站点内的网络设备之间的隧道对应的隧道表项,将获取的隧道表项进行存储。
需要说明的是,第一网络设备将从第三网络设备中获取的隧道表项进行存储的方法可以与前述方法相同,在此不再赘述。
可选地,当第一网络设备与多个第三网络设备之间的距离较远,或无法通过物理链路连接时,可以通过网络隧道连接第一网络设备与第三网络设备,该网络隧道可以包括通用路由封装(Generic Routing Encapsulation,GRE)隧道。当然,该网络隧道也可以为其他的隧道。
另外,第一网络设备与每个第三网络设备之间的物理链路或网络隧道主要是用于同步站点内的隧道表项、以及站点内的数据报文的传输,无需发布到站点外部的网络,因此,第一站点内的网络设备上用于建立物理链路的接口上的网络地址均可以设置为私网地址,甚至不同站点都可以采用相同的地址空间,可以节约SD-WAN网络对运营商网络地址资源的消耗。
在本申请实施例中,第一网络设备获取到第二站点的站点前缀和站点标识之后,可以将第二站点的站点前缀以及站点标识作为第一路由表项添加在存储的路由表中,这样,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。同时,第一网络设备还可以将与第二站点建立的隧道的隧道标识以及隧道属性信息作为隧道表项存储在隧道表中,而且,还可以将第一站点内的其他网络设备与第二站点建立的隧道的隧道表项存储在隧道表中。这样,第一网络设备后续可以通过第一站点内的其他网络设备与第二站点之间的隧道向第二站点发送数据报文,而无需创建更多的隧道,节省了资源,提高了隧道的利用率。
图7是本申请实施例提供的一种路由表项的生成方法所涉及的系统架构图。如图7所示,该系统包括网络设备701、网络设备702、网络设备703以及控制设备704。其中,网络设备 701是部署在第一站点内的网络设备,网络设备702是部署在第三站点内的网络设备,网络设备703是部署在第二站点内的网络设备。网络设备701、网络设备702、网络设备703可以与控制设备704之间通过无线或有线方式连接以进行通信。
其中,网络设备701和网络设备703接入同一传输网络,即,LTE网络。网络设备702和网络设备703接入同一传输网络,即,MPLS网络。这样,网络设备701与网络设备703之间可以通过LTE网络建立有隧道1,网络设备702与网络设备703之间可以通过MPLS网络建立有隧道2,且这些网络设备可以生成路由表项,具体的实现方式可以参考下述图8实施例中的相关描述,此处不展开说明。
需要说明的是,参考上述图1中的相关描述,图7所示的系统架构中也可以不包括控制设备704,本申请实施例在此不做限定。
可选地,图7所示的系统中是以第一站点、第二站点以及第三站点内均部署有一台网络设备进行举例说明。当然,在其他可能的情况下,第一站点内、第二站点以及第三站点内也可以部署有两台以上的网络设备,且第一站点、第二站点、第三站点内部署的网络设备的数量可以相同或者不同。
在图7的系统架构的基础上,本申请实施例提供了一种路由表项的生成方法,该方法适用于第一网络设备中。在本申请实施例中,第一网络设备部署在第一站点内,第二网络设备部署在第三站点内,第四网络设备部署在第二站点内,第一网络设备与第四网络设备接入第一传输网络,第二网络设备与第四网络设备接入第二传输网络且建立有隧道。示例地,第一网络设备可以为图7所示的网络设备701,第二网络设备可以为图7所示的网络设备702,第四网络设备可以为图7所示的网络设备703。请参考图8,该方法包括如下步骤。
基于上述描述,由于第一站点内的网络设备和第二站点内的网络设备可以通过控制设备来建立隧道,以及获取对端站点的站点前缀和站点标识,第二站点内的网络设备和第三站点内的网络设备可以通过控制设备来建立隧道,以及获取对端站点的站点前缀和站点标识,但是也可以不通过控制设备来实现。不管是否通过控制设备,第一网络设备生成路由表项的方法类似。因此,接下来以通过控制设备来实现为例,对路由表项的生成方法进行介绍。
步骤801:第一网络设备获取站点前缀和站点标识,该站点标识用于标识第二站点,第二网络设备的网络地址匹配该站点前缀。
由于第二网络设备位于第三站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀为第三站点的站点前缀,第一网络设备获取的站点标识为第二站点的站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第四网络设备,且第二网络设备与第四网络设备之间建立有隧道,第四网络设备与第一网络设备接入相同的传输网络,但是第一网络设备与第二网络设备没有接入相同的传输网络。也即是,第二网络设备可以与第四网络设备通信,第四网络设备可以与第一网络设备通信,但是,第一网络设备与 第二网络设备不能直接通信,因此,控制设备可以将第二站点的站点标识和第三站点的站点前缀发送给第一网络设备。
步骤802:第一网络设备在第一网络设备的路由表中添加第一路由表项,第一路由表项包括该站点前缀和该站点标识,第一路由表项用于向第二网络设备发送数据报文。
当第一网络设备通过上述步骤801-802生成并存储路由表项之后,还可以通过下述步骤803-805生成并存储隧道表项。
步骤803:第一网络设备获取第四网络设备的TNP信息,第四网络设备的TNP信息与第一传输网络对应。
在本申请实施例中,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀时,还会发送第四网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点的站点标识和第三站点的站点前缀时,还可以接收到第四网络设备的TNP信息,该TNP信息与第一传输网络对应。
其中,TNP信息的相关解释可以参考前述实施例中步骤603中的相关解释,在此不再赘述。
步骤804:第一网络设备根据第四网络设备的TNP信息,建立第一网络设备与第四网络设备之间的隧道。
由于第一网络设备建立自身与其他网络设备之间的隧道的实现过程基本相同,因此,本申请实施例对步骤804不做详细阐述,步骤804中相关解释可以参考前述实施例中步骤604中的相关解释。
步骤805:第一网络设备将自身与第四网络设备之间建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
由于第一网络设备将自身与其他网络设备之间建立的隧道对应的隧道表项进行存储的实现过程基本相同,因此,本申请实施例对步骤805不做详细阐述,步骤805中的相关解释可以参考前述实施例中步骤605中的相关解释。
在本申请实施例中,由于第一网络设备与第二网络设备之间无法建立隧道,也即是,第一网络设备与第二网络设备之间无法通过隧道通信,而第一网络设备和第二网络设备均与第四网络设备之间建立有隧道,在这种情况下,第一网络设备与第二网络设备之间的数据报文可以通过第四网络设备进行转发。因此,第一网络设备可以将第三站点的站点前缀,以及第二站点的站点标识作为一个路由表项添加在存储的路由表中。这样,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。同时,当第一网络设备向第二网络设备发送数据报文时,第一网络设备可以根据该路由表项将数据报文通过与第四网络设备之间的隧道发送至第四网络设备,进而由第四网络设备将数据报文通过与第二网络设备之间的隧道发送至第二网络设备,解决了由于第一网络设备与第二网络设备之间无法建立隧道,而导致第一网络设备无法向第二网络设备发送数据报文的问题。
图9是本申请实施例提供的一种路由表项的生成方法所涉及的系统架构图。如图9所示,该系统包括网络设备901、网络设备902、网络设备903以及控制设备904。其中,网络设备901是部署在第一站点内的网络设备,网络设备902是部署在第三站点内的网络设备,网络设备903是部署在第二站点内的网络设备。网络设备901、网络设备902、网络设备903可以 与控制设备904之间通过无线或有线方式连接以进行通信。
其中,网络设备901、网络设备902和网络设备903接入同一传输网络,即,LTE网络。网络设备902和网络设备903接入同一传输网络,即,MPLS网络。这样,网络设备901与网络设备903之间可以通过LTE网络建立有隧道1,网络设备901与网络设备902之间可以通过LTE网络建立有隧道2,网络设备902与网络设备903之间可以通过MPLS网络建立有隧道3,且这些网络设备可以生成路由表项,具体的实现方式可以参考下述图10实施例中的相关描述,此处不展开说明。
需要说明的是,参考上述图1中的相关描述,图9所示的系统架构也可以不包括控制设备904,本申请实施例在此不做限定。
可选地,图9所示的系统中是以第一站点、第二站点以及第三站点内均部署有一台网络设备进行举例说明。当然,在其他可能的情况下,第一站点内、第二站点以及第三站点内也可以部署有两台以上的网络设备,且第一站点、第二站点、第三站点内部署的网络设备的数量可以相同或者不同。
在图9的系统架构的基础上,本申请实施例提供了一种路由表项的生成方法,该方法适用于第一网络设备。在本申请实施例中,第一网络设备部署在第一站点内,第二网络设备部署在第三站点内,第四网络设备部署在第二站点内,第一网络设备、第二网络设备和第四网络设备均接入第一传输网络,第二网络设备与第四网络设备接入第二传输网络且建立有隧道。示例地,第一网络设备可以为图9所示的网络设备901,第二网络设备可以为图9所示的网络设备902,第四网络设备可以为图9所示的网络设备903。请参考图10,该方法包括如下步骤。
基于上述描述,由于第一站点内的网络设备、第二站点内的网络设备和第三站点内的网络设备可以通过控制设备来建立隧道,以及获取对端站点的站点前缀和站点标识,但是也可以不通过控制设备来实现。不管是否通过控制设备,第一网络设备生成路由表项的方法类似。因此,接下来以通过控制设备来实现为例,对路由表项的生成方法进行介绍。
步骤1001:第一网络设备获取站点前缀和站点标识,该站点标识用于标识第二站点,第二网络设备的网络地址匹配该站点前缀。
由于第二网络设备位于第三站点内,第一网络设备获取的站点标识用于标识第二站点,第二网络设备的网络地址匹配第一网络设备获取的站点前缀,因此,可以确定第一网络设备获取的站点前缀为第三站点的站点前缀,第一网络设备获取的站点标识为第二站点的站点标识。
需要说明的是,第二网络设备上电后可以向控制设备进行注册,以从控制设备中获取第二网络设备的配置信息,该配置信息可以包括第二站点的站点标识和站点前缀、第二网络设备的TNP信息等。之后,第二网络设备可以将第二站点的站点前缀以及站点标识发送至控制设备。控制设备接收到第二网络设备发送的第二站点的站点前缀和站点标识之后,可以根据网络拓扑结构,确定与第二网络设备接入相同传输网络的网络设备包括第一网络设备和第四网络设备,且第二网络设备与第四网络设备之间建立有隧道,第四网络设备与第一网络设备接入相同的传输网络。也即是,第一网络设备可以与第二网络设备通信,第一网络设备也可以与第四网络设备通信,第四网络设备可以与第二网络设备通信,因此,控制设备可以将第二站点的站点标识和第三站点的站点前缀发送给第一网络设备。
步骤1002:第一网络设备在第一网络设备的路由表中添加第一路由表项,第一路由表项包括该站点前缀和该站点标识,第一路由表项用于向第二网络设备发送数据报文。
步骤1003:第一网络设备获取第三站点的站点标识。
由于本申请实施例中第一网络设备可以与第二网络设备通信,因此,基于高可靠性考虑,第一网络设备除了获取第二站点的站点标识和第三站点的站点前缀之外,第一网络设备还可以获取第三站点的站点标识。
需要说明的是,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀的同时,可以向第一网络设备发送第三站点的站点标识。当然,控制设备也可以先向第一网络设备发送第二站点的站点标识和第三站点的站点前缀,然后再向第一网络设备发送第三站点的站点标识。
步骤1004:第一网络设备在第一网络设备的路由表中添加第二路由表项,第二路由表项包括第三站点的站点前缀和第三站点的站点标识,第二路由表项用于向第二网络设备发送数据报文。
当第一网络设备通过上述步骤1001-1004生成并存储路由表项之后,还可以通过下述步骤1005-1007生成并存储隧道表项。
步骤1005:第一网络设备获取第二网络设备的TNP信息和第四网络设备的TNP信息。
在本申请实施例中,控制设备向第一网络设备发送第二站点的站点标识和第三站点的站点前缀时,还会发送第四网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第二站点的站点标识和第三站点的站点前缀时,还可以接收到第四网络设备的TNP信息,该TNP信息与第一传输网络对应。同理,控制设备向第一网络设备发送第三站点的站点标识时,还会发送第二网络设备的TNP信息。这样,第一网络设备在接收到控制设备发送的第三站点的站点标识时,还可以接收到第二网络设备的TNP信息。
其中,TNP信息的相关解释可以参考前述实施例中步骤503中的相关解释,在此不再赘述。
步骤1006:第一网络设备根据第二网络设备的TNP信息和第四网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道,以及第一网络设备与第四网络设备之间的隧道。
在一些实施例中,第一网络设备可以直接根据第二网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道,根据第四网络设备的TNP信息,建立第一网络设备与第四网络设备之间的隧道。
在另一些实施例中,第一网络设备可以获取第二站点的优先级和第三站点的优先级。如果第三站点的优先级高于第二站点的优先级,则第一网络设备可以根据第二网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道。之后,第一网络设备对第一网络设备与第二网络设备之间的隧道的联通性进行探测。如果探测失败,则第一网络设备可以根据第四网络设备的TNP,建立第一网络设备与第四网络设备之间的隧道。如果探测成功,那么第一网络设备可以暂时先不建立第一网络设备与第四网络设备之间的隧道,直到第一网络设备与第二网络设备之间的隧道出现故障而不能联通时,再建立第一网络设备与第四网络设备之间的隧道。
需要说明的是,第二站点的优先级和第三站点的优先级可以是控制设备在发送上述的站 点标识和站点前缀的同时发送给第一网络设备的,当然,也可以是先发送上述的站点标识和站点前缀,再发送第二站点的优先级和第三站点的优先级。
本申请实施例是为了实现第一网络设备与第二网络设备之间传输数据报文,而生成路由表项以及建立隧道。因此,控制设备通常会将第三站点的优先级设置的比较高一点,也即是,第三站点的优先级高于第二站点的优先级,这样,第一网络设备就会优先建立第一网络设备与第二网络设备之间的隧道。之后,第一网络设备与第二网络设备之间传输的数据报文就会优先通过这两个设备之间直连的隧道进行传输,而无需通过第四网络设备进行转发,从而降低网络开销,提高报文传输效率。
由于第一网络设备建立自身与其他网络设备之间的隧道的实现过程基本相同,因此,本申请实施例对步骤1006不做详细阐述,步骤1006中的相关解释可以参考前述实施例中步骤604中的相关解释。而且,第一网络设备对第一网络设备与第二网络设备之间的隧道的联通性进行探测的实现过程可以参考前述实施例中步骤605中的相关解释。
步骤1007:第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
由于第一网络设备将自身与其他网络设备之间建立的隧道对应的隧道表项进行存储的实现过程基本相同,因此,本申请实施例对步骤1007不做详细阐述,步骤1007中的相关解释可以参考前述实施例中步骤605中的相关解释。
在本申请实施例中,第一网络设备可以将第三站点的站点前缀以及第二站点的站点标识作为第一路由表项添加在存储的路由表中,将第三站点的站点前缀以及站点标识作为第二路由表项添加在存储的路由表中。这样,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。另外,第一网络设备可以优先建立第一网络设备与第二网络设备之间的隧道,当第一网络设备与第二网络设备之间的隧道不可用时,第一网络设备可以建立第一网络设备与第四网络设备之间的隧道,进而通过第四网络设备,将发往第二网络设备的数据报文转发至第二网络设备,提高了数据报文发送的可靠性。
图11是本申请实施例提供的一种报文发送装置的结构示意图,该报文发送装置可以由软件、硬件或者两者的结合实现成为第一网络设备的部分或者全部,其中,第一网络设备是指第一站点内部署的一个网络设备,第一网络设备中存储有路由表,路由表包括多个路由表项,多个路由表项中的每个路由表项包括一个站点前缀和对应的站点标识。参见图11,该装置包括:接收模块1101、确定模块1102和发送模块1103。
接收模块1101,用于接收第一数据报文,第一数据报文携带目的地址,第一网络设备是指第一站点内部署的一个网络设备。也即是,用于执行图2实施例中的步骤201的操作;
确定模块1102,用于根据第一数据报文携带的目的地址,从路由表中确定目标路由表项,第一数据报文携带的目的地址匹配目标路由表项包括的站点前缀,目标路由表项包括的站点标识用于标识第二站点。也即是,用于执行图2实施例中的步骤202的操作;
发送模块1103,用于向第二站点内部署的网络设备发送第一数据报文。也即是,用于执行图2实施例中的步骤203的操作。
可选地,发送模块1103包括:
确定子模块,用于根据目标路由表项包括的站点标识,确定一个或多个隧道表项,该一 个或多个隧道表项是指第一站点与第二站点之间建立的隧道对应的隧道表项;
选择子模块,用于从该一个或多个隧道表项中选择一个隧道表项作为目标隧道表项;
发送子模块,用于通过目标隧道表项对应的隧道发送第一数据报文。
可选地,第一网络设备中存储有一个隧道表,该隧道表中的每个隧道表项包括一个隧道标识和对应的隧道属性信息,该隧道表用于存储多个站点对应的隧道表项,该多个站点是指与第一站点之间建立有隧道的站点,且该多个站点包括第二站点;
确定子模块主要用于:
根据目标路由表项包括的站点标识,确定一个或多个隧道标识,该一个或多个隧道标识是指第一站点与第二站点之间建立的隧道的标识;
根据该一个或多个隧道标识,从该隧道表中确定该一个或多个隧道表项。
可选地,第一网络设备中存储有多个隧道表,该多个隧道表与多个站点一一对应,该多个站点是指与第一站点之间建立有隧道的站点,且该多个站点包括第二站点;
确定子模块主要用于:
根据目标路由表项包括的站点标识,确定目标隧道表的标识,目标隧道表是指该多个隧道表中与第二站点对应的隧道表;
根据目标隧道表的标识,从该多个隧道表中确定目标隧道表,将目标隧道表中存储的隧道表项确定为该一个或多个隧道表项。
可选地,该一个或多个隧道表项中的每个隧道表项还包括一个联通标识,该联通标识用于指示对应的隧道是否联通;
选择子模块主要用于:
从该一个或多个隧道表项中筛选出联通标识有效的隧道表项;
从筛选出的隧道表项中选择一个隧道表项作为目标隧道表项。
在本申请中,由于第一站点内的第一网络设备存储的路由表中的每个路由表项包括一个站点前缀和对应的站点标识,因此,当第一网络设备接收到第一数据报文时,可以从路由表中确定目标路由表项。由于目标路由表项中的站点标识用于标识第二站点,因此,第一网络设备可以直接根据目标路由表项中的站点标识,向第二站点发送第一数据报文。也即是,对于第一站点发往第二站点的数据报文,第一网络设备可以直接按照第二站点的站点标识发送给第二站点,无需确定数据报文具体是发给第二站点内的哪个网络设备的哪个接口,而且,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。
需要说明的是:上述实施例提供的报文发送装置在发送报文时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的报文发送装置与报文发送方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图12是本申请实施例提供的一种路由表项的生成装置的结构示意图,该报文发送装置可以由软件、硬件或者两者的结合实现成为第一网络设备的部分或者全部,其中,第一网络设备部署在第一站点内。参见图12,该装置包括:第一获取模块1201和第一添加模块1202。
第一获取模块1201,用于获取站点前缀和站点标识,该站点标识用于标识第二站点,第 二网络设备的网络地址匹配该站点前缀;也即是,用于执行图6实施例中的步骤601、图8实施例中的步骤801或图10实施例中的步骤1001的操作;
第一添加模块1202,用于在第一网络设备的路由表中添加第一路由表项,第一路由表项包括该站点前缀和该站点标识,第一路由表项用于向第二网络设备发送数据报文。也即是,用于执行图6实施例中的步骤602、图8实施例中的步骤802或图10实施例中的步骤1002的操作;
可选地,第二网络设备部署在第二站点内,第一网络设备与第二网络设备接入相同的一种或多个传输网络。
可选地,该装置还包括:
第二获取模块,用于获取第二网络设备的一个或多个传输网络端口TNP信息,该一个或多个TNP信息与该一种或多种传输网络一一对应;
第一建立模块,用于根据该一个或多个TNP信息,建立第一网络设备与第二网络设备之间的隧道;
存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
可选地,第一站点内还部署有一个或多个第三网络设备,该一个或多个第三网络设备中的每个第三网络设备均与第二站点内的网络设备建立有隧道,且该一个或多个第三网络设备中的每个第三网络设备还与第一网络设备建立有物理链路;
该装置还包括:
第三获取模块,用于通过与每个第三网络设备之间的物理链路,从相应第三网络设备中获取相应第三网络设备与第二站点内的网络设备之间的隧道对应的隧道表项,将获取的隧道表项进行存储。
可选地,第二网络设备部署在第三站点内,第四网络设备部署在第二站点内,第一网络设备与第四网络设备接入第一传输网络,第二网络设备与第四网络设备接入第二传输网络且建立有隧道。
可选地,该装置还包括:
第四获取模块,用于获取第四网络设备的TNP信息,第四网络设备的TNP信息与第一传输网络对应;
第二建立模块,用于根据第四网络设备的TNP信息,建立第一网络设备与第四网络设备之间的隧道;
存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
可选地,第二网络设备部署在第三站点内,第四网络设备部署在第二站点内,第一网络设备、第二网络设备和第四网络设备均接入第一传输网络,第二网络设备与第四网络设备接入第二传输网络且建立有隧道。
可选地,该装置还包括:
第五获取模块,用于获取第三站点的站点标识;
第二添加模块,用于在第一网络设备的路由表中添加第二路由表项,第二路由表项包括该站点前缀和第三站点的站点标识,第二路由表项用于向第二网络设备发送数据报文。
可选地,该装置还包括:
第六获取模块,用于获取第二网络设备的TNP信息和第四网络设备的TNP信息;
第三建立模块,用于根据第二网络设备的TNP信息和第四网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道,以及第一网络设备与第四网络设备之间的隧道;
存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
可选地,第三建立模块主要用于:
获取第二站点的优先级和第三站点的优先级;
如果第三站点的优先级高于第二站点的优先级,则根据第二网络设备的TNP信息,建立第一网络设备与第二网络设备之间的隧道;
对第一网络设备与第二网络设备之间的隧道的联通性进行探测;
如果探测失败,则根据第四网络设备的TNP,建立第一网络设备与第四网络设备之间的隧道。
可选地,存储模块主要用于:
对建立的每条隧道的联通性进行探测;
将联通性探测成功的每条隧道的隧道标识、对应的隧道属性信息、以及置为有效的联通标识作为一个隧道表项进行存储;和/或,将联通性探测失败的每条隧道的隧道标识、对应的隧道属性信息、以及置为无效的联通标识作为一个隧道表项进行存储。
在本申请实施例中,在本申请实施例中,第一网络设备获取到第二站点的站点前缀和站点标识之后,可以将第二站点的站点前缀以及站点标识作为第一路由表项添加在存储的路由表中,这样,对于一个站点来说,第一网络设备可以只存储一个路由表项,避免了大量的重复路由表项,并且也可以避免由于网络设备的状态发生改变,而导致路由表的更新。同时,第一网络设备还可以将与第二站点建立的隧道的隧道标识以及隧道属性信息作为隧道表项存储在隧道表中,而且,还可以将第一站点内的其他网络设备与第二站点建立的隧道的隧道表项存储在隧道表中。这样,第一网络设备后续可以通过第一站点内的其他网络设备与第二站点之间的隧道向第二站点发送数据报文,而无需创建更多的隧道,节省了资源,提高了隧道的利用率。
需要说明的是:上述实施例提供的报路由表项的生成装置在生成路由表项时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的路由表项的生成装置与路由表项的生成方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
请参考图13,图13是根据本申请实施例示出的一种网络设备的结构示意图,该网络设备可以是图1、图4、图5、图7或图9中所示的任一网络设备。该网络设备包括至少一个处理器1301、通信总线1302、存储器1303以及至少一个通信接口1304。
处理器1301可以是一个微处理器(包括中央处理器(central processing unit,CPU)等)、网络处理器(NP)、微处理器、或者可以是一个或多个用于实现本申请方案的集成电路,例如,专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable  logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。
通信总线1302用于在上述组件之间传送信息。通信总线1302可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器1303可以是只读存储器(read-only memory,ROM),也可以是随机存取存储器(random access memory,RAM),也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、光盘(包括只读光盘(compact disc read-only memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器1303可以是独立存在,并通过通信总线1302与处理器1301相连接。存储器1303也可以和处理器1301集成在一起。
通信接口1304使用任何收发器一类的装置,用于与其它设备或通信网络通信。通信接口1304包括有线通信接口,还可以包括无线通信接口。其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线通信接口可以为无线局域网(Wireless Local Area Networks,WLAN)接口,蜂窝网络通信接口或其组合等。
在具体实现中,作为一种实施例,处理器1301可以包括一个或多个CPU,如图13中所示的CPU0和CPU1。
在具体实现中,作为一种实施例,网络设备可以包括多个处理器,如图13中所示的处理器1301和处理器1305。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在一些实施例中,存储器1303用于存储执行本申请方案的程序代码1310,处理器1301可以执行存储器1303中存储的程序代码1310。也即是,该网络设备可以通过处理器1301以及存储器1303中的程序代码1310,来实现上述图2实施例提供的报文发送方法,以及上述图6、图8和图10实施例提供的路由表项的生成方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。值得注意的是,本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是 非瞬时性存储介质。
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
本申请中术语“第一”、“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。例如,在不脱离各种所述示例的范围的情况下,第一图像可以被称为第二图像,并且类似地,第二图像可以被称为第一图像。第一图像和第二图像都可以是图像,并且在某些情况下,可以是单独且不同的图像。
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个第二报文是指两个或两个以上的第二报文。本文中术语“系统”和“网络”经常可互换使用。
应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。
还应理解,本文中所使用的术语“和/或”是指并且涵盖相关联的所列出的项目中的一个或多个项目的任何和全部可能的组合。术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。
还应理解,本文中所使用的术语“和/或”是指并且涵盖相关联的所列出的项目中的一个或多个项目的任何和全部可能的组合。术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。
还应理解,术语“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“如果确定...”或“如果检测到[所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。
应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式” 未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。

Claims (33)

  1. 一种报文发送方法,所述方法适用于第一网络设备,其特征在于,所述第一网络设备中存储有路由表,所述路由表包括多个路由表项,所述多个路由表项中的每个路由表项包括一个站点前缀和对应的站点标识;所述方法包括:
    所述第一网络设备接收第一数据报文,所述第一数据报文携带目的地址,所述第一网络设备是指第一站点内部署的一个网络设备;
    所述第一网络设备根据所述目的地址,从所述路由表中确定目标路由表项,所述目的地址匹配所述目标路由表项包括的站点前缀,所述目标路由表项包括的站点标识用于标识第二站点;
    所述第一网络设备向所述第二站点内部署的网络设备发送所述第一数据报文。
  2. 如权利要求1所述的方法,其特征在于,所述第一网络设备向所述第二站点内部署的网络设备发送所述第一数据报文,包括:
    所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项,所述一个或多个隧道表项是指所述第一站点与所述第二站点之间建立的隧道对应的隧道表项;
    所述第一网络设备从所述一个或多个隧道表项中选择一个隧道表项作为目标隧道表项;
    所述第一网络设备通过所述目标隧道表项对应的隧道发送所述第一数据报文。
  3. 如权利要求2所述的方法,其特征在于,所述第一网络设备中存储有一个隧道表,所述隧道表中的每个隧道表项包括一个隧道标识和对应的隧道属性信息,所述隧道表用于存储多个站点对应的隧道表项,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点;
    所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项,包括:
    所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道标识,所述一个或多个隧道标识是指所述第一站点与所述第二站点之间建立的隧道的标识;
    所述第一网络设备根据所述一个或多个隧道标识,从所述隧道表中确定所述一个或多个隧道表项。
  4. 如权利要求2所述的方法,其特征在于,所述第一网络设备中存储有多个隧道表,所述多个隧道表与多个站点一一对应,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点;
    所述第一网络设备根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项,包括:
    所述第一网络设备根据所述目标路由表项包括的站点标识,确定目标隧道表的标识,所述目标隧道表是指所述多个隧道表中与所述第二站点对应的隧道表;
    所述第一网络设备根据所述目标隧道表的标识,从所述多个隧道表中确定所述目标隧道表,将所述目标隧道表中存储的隧道表项确定为所述一个或多个隧道表项。
  5. 如权利要求2-4任一所述的方法,其特征在于,所述一个或多个隧道表项中的每个隧道表项还包括一个联通标识,所述联通标识用于指示对应的隧道是否联通;
    所述第一网络设备从所述一个或多个隧道表项中选择一个隧道表项作为目标隧道表项,包括:
    所述第一网络设备从所述一个或多个隧道表项中筛选出联通标识有效的隧道表项;
    所述第一网络设备从筛选出的隧道表项中选择一个隧道表项作为所述目标隧道表项。
  6. 一种路由表项的生成方法,所述方法适用于第一网络设备,其特征在于,所述第一网络设备部署在第一站点内;所述方法包括:
    所述第一网络设备获取站点前缀和站点标识,所述站点标识用于标识第二站点,第二网络设备的网络地址匹配所述站点前缀;
    所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项,所述第一路由表项包括所述站点前缀和所述站点标识,所述第一路由表项用于向所述第二网络设备发送数据报文。
  7. 如权利要求6所述的方法,其特征在于,所述第二网络设备部署在所述第二站点内,所述第一网络设备与所述第二网络设备接入相同的一种或多个传输网络。
  8. 如权利要求7所述的方法,其特征在于,所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,还包括:
    所述第一网络设备获取所述第二网络设备的一个或多个传输网络端口TNP信息,所述一个或多个TNP信息与所述一种或多种传输网络一一对应;
    所述第一网络设备根据所述一个或多个TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道;
    所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  9. 如权利要求7所述的方法,其特征在于,所述第一站点内还部署有一个或多个第三网络设备,所述一个或多个第三网络设备中的每个第三网络设备均与所述第二站点内的网络设备建立有隧道,且所述一个或多个第三网络设备中的每个第三网络设备还与所述第一网络设备建立有物理链路;
    所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储之后,还包括:
    所述第一网络设备通过与每个第三网络设备之间的物理链路,从相应第三网络设备中获取相应第三网络设备与所述第二站点内的网络设备之间的隧道对应的隧道表项,将获取的隧道表项进行存储。
  10. 如权利要求6所述的方法,其特征在于,所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备与所述第四网络设备接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
  11. 如权利要求10所述的方法,其特征在于,所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,所述方法还包括:
    所述第一网络设备获取所述第四网络设备的TNP信息,所述第四网络设备的TNP信息与所述第一传输网络对应;
    所述第一网络设备根据所述第四网络设备的TNP信息,建立所述第一网络设备与所述第四网络设备之间的隧道;
    所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  12. 如权利要求6所述的方法,其特征在于,所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备、所述第二网络设备和所述第四网络设备均接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
  13. 如权利要求12所述的方法,其特征在于,所述第一网络设备在所述第一网络设备的路由表中添加第一路由表项之后,还包括:
    所述第一网络设备获取所述第三站点的站点标识;
    所述第一网络设备在所述第一网络设备的路由表中添加第二路由表项,所述第二路由表项包括所述站点前缀和所述第三站点的站点标识,所述第二路由表项用于向所述第二网络设备发送数据报文。
  14. 如权利要求12所述的方法,其特征在于,所述第一网络设备在所述第一网络设备的路由表中添加第二路由表项之后,还包括:
    所述第一网络设备获取所述第二网络设备的TNP信息和所述第四网络设备的TNP信息;
    所述第一网络设备根据所述第二网络设备的TNP信息和所述第四网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道,以及所述第一网络设备与所述第四网络设备之间的隧道;
    所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  15. 如权利要求14所述的方法,其特征在于,所述第一网络设备根据所述第二网络设备的TNP信息和所述第四网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道,以及所述第一网络设备与所述第四网络设备之间的隧道,包括:
    所述第一网络设备获取所述第二站点的优先级和所述第三站点的优先级;
    如果所述第三站点的优先级高于所述第二站点的优先级,则所述第一网络设备根据所述第二网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道;
    所述第一网络设备对所述第一网络设备与所述第二网络设备之间的隧道的联通性进行探测;
    如果探测失败,则所述第一网络设备根据所述第四网络设备的TNP,建立所述第一网络设备与所述第四网络设备之间的隧道。
  16. 如权利要求8、11或14所述的方法,其特征在于,所述第一网络设备将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储,包括:
    所述第一网络设备对建立的每条隧道的联通性进行探测;
    所述第一网络设备将联通性探测成功的每条隧道的隧道标识、对应的隧道属性信息、以及置为有效的联通标识作为一个隧道表项进行存储;和/或,所述第一网络设备将联通性探测失败的每条隧道的隧道标识、对应的隧道属性信息、以及置为无效的联通标识作为一个隧道表项进行存储。
  17. 一种报文发送装置,应用于第一网络设备,其特征在于,所述第一网络设备中存储有路由表,所述路由表包括多个路由表项,所述多个路由表项中的每个路由表项包括一个站 点前缀和对应的站点标识;所述装置包括:
    接收模块,用于接收第一数据报文,所述第一数据报文携带目的地址,所述第一网络设备是指第一站点内部署的一个网络设备;
    确定模块,用于根据所述目的地址,从所述路由表中确定目标路由表项,所述目的地址匹配所述目标路由表项包括的站点前缀,所述目标路由表项包括的站点标识用于标识第二站点;
    发送模块,用于向所述第二站点内部署的网络设备发送所述第一数据报文。
  18. 如权利要求17所述的装置,其特征在于,所述发送模块包括:
    确定子模块,用于根据所述目标路由表项包括的站点标识,确定一个或多个隧道表项,所述一个或多个隧道表项是指所述第一站点与所述第二站点之间建立的隧道对应的隧道表项;
    选择子模块,用于从所述一个或多个隧道表项中选择一个隧道表项作为目标隧道表项;
    发送子模块,用于通过所述目标隧道表项对应的隧道发送所述第一数据报文。
  19. 如权利要求18所述的装置,其特征在于,所述第一网络设备中存储有一个隧道表,所述隧道表中的每个隧道表项包括一个隧道标识和对应的隧道属性信息,所述隧道表用于存储多个站点对应的隧道表项,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点;
    所述确定子模块主要用于:
    根据所述目标路由表项包括的站点标识,确定一个或多个隧道标识,所述一个或多个隧道标识是指所述第一站点与所述第二站点之间建立的隧道的标识;
    根据所述一个或多个隧道标识,从所述隧道表中确定所述一个或多个隧道表项。
  20. 如权利要求18所述的装置,其特征在于,所述第一网络设备中存储有多个隧道表,所述多个隧道表与多个站点一一对应,所述多个站点是指与所述第一站点之间建立有隧道的站点,且所述多个站点包括所述第二站点;
    所述确定子模块主要用于:
    根据所述目标路由表项包括的站点标识,确定目标隧道表的标识,所述目标隧道表是指所述多个隧道表中与所述第二站点对应的隧道表;
    根据所述目标隧道表的标识,从所述多个隧道表中确定所述目标隧道表,将所述目标隧道表中存储的隧道表项确定为所述一个或多个隧道表项。
  21. 如权利要求18-20任一所述的装置,其特征在于,所述一个或多个隧道表项中的每个隧道表项还包括一个联通标识,所述联通标识用于指示对应的隧道是否联通;
    所述选择子模块主要用于:
    从所述一个或多个隧道表项中筛选出联通标识有效的隧道表项;
    从筛选出的隧道表项中选择一个隧道表项作为所述目标隧道表项。
  22. 一种路由表项的生成装置,应用于第一网络设备,其特征在于,所述第一网络设备部署在第一站点内;所述装置包括:
    第一获取模块,用于获取站点前缀和站点标识,所述站点标识用于标识第二站点,第二网络设备的网络地址匹配所述站点前缀;
    第一添加模块,用于在所述第一网络设备的路由表中添加第一路由表项,所述第一路由表项包括所述站点前缀和所述站点标识,所述第一路由表项用于向所述第二网络设备发送数 据报文。
  23. 如权利要求22所述的装置,其特征在于,所述第二网络设备部署在所述第二站点内,所述第一网络设备与所述第二网络设备接入相同的一种或多个传输网络。
  24. 如权利要求23所述的装置,其特征在于,所述装置还包括:
    第二获取模块,用于获取所述第二网络设备的一个或多个传输网络端口TNP信息,所述一个或多个TNP信息与所述一种或多种传输网络一一对应;
    第一建立模块,用于根据所述一个或多个TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道;
    存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  25. 如权利要求23所述的装置,其特征在于,所述第一站点内还部署有一个或多个第三网络设备,所述一个或多个第三网络设备中的每个第三网络设备均与所述第二站点内的网络设备建立有隧道,且所述一个或多个第三网络设备中的每个第三网络设备还与所述第一网络设备建立有物理链路;
    所述装置还包括:
    第三获取模块,用于通过与每个第三网络设备之间的物理链路,从相应第三网络设备中获取相应第三网络设备与所述第二站点内的网络设备之间的隧道对应的隧道表项,将获取的隧道表项进行存储。
  26. 如权利要求22所述的装置,其特征在于,所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备与所述第四网络设备接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
  27. 如权利要求26所述的装置,其特征在于,所述装置还包括:
    第四获取模块,用于获取所述第四网络设备的TNP信息,所述第四网络设备的TNP信息与所述第一传输网络对应;
    第二建立模块,用于根据所述第四网络设备的TNP信息,建立所述第一网络设备与所述第四网络设备之间的隧道;
    存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  28. 如权利要求22所述的装置,其特征在于,所述第二网络设备部署在第三站点内,第四网络设备部署在所述第二站点内,所述第一网络设备、所述第二网络设备和所述第四网络设备均接入第一传输网络,所述第二网络设备与所述第四网络设备接入第二传输网络且建立有隧道。
  29. 如权利要求28所述的装置,其特征在于,所述装置还包括:
    第五获取模块,用于获取所述第三站点的站点标识;
    第二添加模块,用于在所述第一网络设备的路由表中添加第二路由表项,所述第二路由表项包括所述站点前缀和所述第三站点的站点标识,所述第二路由表项用于向所述第二网络设备发送数据报文。
  30. 如权利要求28所述的装置,其特征在于,所述装置还包括:
    第六获取模块,用于获取所述第二网络设备的TNP信息和所述第四网络设备的TNP信 息;
    第三建立模块,用于根据所述第二网络设备的TNP信息和所述第四网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道,以及所述第一网络设备与所述第四网络设备之间的隧道;
    存储模块,用于将建立的每条隧道的隧道标识与对应的隧道属性信息作为一个隧道表项进行存储。
  31. 如权利要求30所述的装置,其特征在于,所述第三建立模块主要用于:
    获取所述第二站点的优先级和所述第三站点的优先级;
    如果所述第三站点的优先级高于所述第二站点的优先级,则根据所述第二网络设备的TNP信息,建立所述第一网络设备与所述第二网络设备之间的隧道;
    对所述第一网络设备与所述第二网络设备之间的隧道的联通性进行探测;
    如果探测失败,则根据所述第四网络设备的TNP,建立所述第一网络设备与所述第四网络设备之间的隧道。
  32. 如权利要求24、27或30所述的装置,其特征在于,所述存储模块主要用于:
    对建立的每条隧道的联通性进行探测;
    将联通性探测成功的每条隧道的隧道标识、对应的隧道属性信息、以及置为有效的联通标识作为一个隧道表项进行存储;和/或,将联通性探测失败的每条隧道的隧道标识、对应的隧道属性信息、以及置为无效的联通标识作为一个隧道表项进行存储。
  33. 一种计算机可读存储介质,其特征在于,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-5任一所述的方法的步骤,或者实现权利要求6-16所述的方法的步骤。
PCT/CN2020/120460 2020-01-08 2020-10-12 报文发送方法、路由表项的生成方法、装置及存储介质 WO2021139289A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2022542047A JP7469479B2 (ja) 2020-01-08 2020-10-12 パケット送信方法、ルーティング・エントリ生成方法、装置及び記憶媒体
EP20912260.5A EP4068704A4 (en) 2020-01-08 2020-10-12 PACKET TRANSMISSION METHOD, ROUTING TABLE ENTRY GENERATION METHOD, DEVICE AND STORAGE MEDIA
US17/859,335 US20220345404A1 (en) 2020-01-08 2022-07-07 Packet sending method, routing entry generation method, apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010019657.8 2020-01-08
CN202010019657.8A CN113098770B (zh) 2020-01-08 2020-01-08 报文发送方法、路由表项的生成方法、装置及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/859,335 Continuation US20220345404A1 (en) 2020-01-08 2022-07-07 Packet sending method, routing entry generation method, apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2021139289A1 true WO2021139289A1 (zh) 2021-07-15

Family

ID=76663432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/120460 WO2021139289A1 (zh) 2020-01-08 2020-10-12 报文发送方法、路由表项的生成方法、装置及存储介质

Country Status (5)

Country Link
US (1) US20220345404A1 (zh)
EP (1) EP4068704A4 (zh)
JP (1) JP7469479B2 (zh)
CN (1) CN113098770B (zh)
WO (1) WO2021139289A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113794644B (zh) * 2021-10-12 2023-05-26 新华三信息安全技术有限公司 一种路由表项删除方法及装置
CN116669132A (zh) * 2022-02-18 2023-08-29 华为技术有限公司 数据传输的方法、网络设备和用户设备
CN115426314B (zh) * 2022-08-08 2024-05-14 中国电信股份有限公司 一种通信方法、装置、网络设备及处理器可读存储介质
JP7362974B1 (ja) * 2023-03-03 2023-10-17 エヌ・ティ・ティ・コミュニケーションズ株式会社 通信制御システム
JP7362973B1 (ja) 2023-03-03 2023-10-17 エヌ・ティ・ティ・コミュニケーションズ株式会社 情報提供システム

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101668324A (zh) * 2008-09-04 2010-03-10 华为技术有限公司 中继网络的路由方法、装置及系统
WO2018188337A1 (zh) * 2017-04-10 2018-10-18 华为技术有限公司 报文广播方法及设备
CN110166361A (zh) * 2019-05-30 2019-08-23 新华三技术有限公司 一种报文转发方法及装置
US20190289525A1 (en) * 2005-01-25 2019-09-19 Sipco, Llc Wireless network protocol systems and methods
CN110461018A (zh) * 2019-08-16 2019-11-15 东北大学秦皇岛分校 基于可计算ap的机会网络路由转发方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002335274A (ja) 2001-03-06 2002-11-22 Fujitsu Ltd パケット中継装置およびパケット中継方法
US7779461B1 (en) * 2004-11-16 2010-08-17 Juniper Networks, Inc. Point-to-multi-point/non-broadcasting multi-access VPN tunnels
CN101114971A (zh) * 2006-07-27 2008-01-30 华为技术有限公司 基于IPv6地址结构实现虚拟专用网的方法
US9680750B2 (en) * 2010-07-06 2017-06-13 Nicira, Inc. Use of tunnels to hide network addresses
JP5288506B2 (ja) 2011-06-29 2013-09-11 Necインフロンティア株式会社 ネットワーク機器、ネットワーク及びそれらに用いる経路情報設定方法
CN102355402B (zh) * 2011-08-03 2014-05-07 华为技术有限公司 一种基于vpn路由建立lsp的方法、系统和路由器
KR101469718B1 (ko) * 2013-04-11 2014-12-05 한국해양과학기술원 선박 애드 혹 네트워크(sanet)를 위한 네트워크 계층에서의 패킷 처리 방법
GB2519443B (en) * 2013-07-05 2021-07-21 Pismo Labs Technology Ltd Methods and systems for transmitting packets through network interfaces
JP2017069657A (ja) 2015-09-29 2017-04-06 アラクサラネットワークス株式会社 通信システムまたは通信装置
CN110661711B (zh) * 2018-06-29 2021-01-29 华为技术有限公司 生成标签转发表的方法、报文发送方法、装置及设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190289525A1 (en) * 2005-01-25 2019-09-19 Sipco, Llc Wireless network protocol systems and methods
CN101668324A (zh) * 2008-09-04 2010-03-10 华为技术有限公司 中继网络的路由方法、装置及系统
WO2018188337A1 (zh) * 2017-04-10 2018-10-18 华为技术有限公司 报文广播方法及设备
CN110166361A (zh) * 2019-05-30 2019-08-23 新华三技术有限公司 一种报文转发方法及装置
CN110461018A (zh) * 2019-08-16 2019-11-15 东北大学秦皇岛分校 基于可计算ap的机会网络路由转发方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4068704A4

Also Published As

Publication number Publication date
CN113098770B (zh) 2024-04-16
EP4068704A4 (en) 2023-02-08
JP7469479B2 (ja) 2024-04-16
CN113098770A (zh) 2021-07-09
US20220345404A1 (en) 2022-10-27
EP4068704A1 (en) 2022-10-05
JP2023509532A (ja) 2023-03-08

Similar Documents

Publication Publication Date Title
WO2021139289A1 (zh) 报文发送方法、路由表项的生成方法、装置及存储介质
WO2017113306A1 (zh) 可扩展虚拟局域网报文发送方法、计算机设备和可读介质
WO2016101646A1 (zh) 以太虚拟网络的接入方法及装置
US9667541B2 (en) Virtual MAC address, mask-based, packet forwarding
US11979322B2 (en) Method and apparatus for providing service for traffic flow
CN107113241B (zh) 路由确定方法、网络配置方法以及相关装置
JP2022500915A (ja) 通信方法、デバイス、及びシステム
US20170085528A1 (en) Method and Device for Storing and Sending MAC Address Entry, and System
WO2018032962A1 (zh) 一种信息同步的方法,装置及系统
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
CN106982163B (zh) 按需获取路由的方法及网关
JP7053901B2 (ja) ループ回避通信方法、ループ回避通信デバイスおよびループ回避通信システム
US20220255772A1 (en) Packet sending method, apparatus, and system
US20180159758A1 (en) Virtual media access control addresses for hosts
US11838846B2 (en) Configuration method and controller
US11956148B2 (en) Packet transmission method and device
US20220345400A1 (en) Packet sending method and apparatus, and storage medium
WO2021088561A1 (zh) 位索引显式复制网络中负载分担的方法、装置及设备
JP2023518594A (ja) Macアドレス送信方法、装置、およびシステム、ならびに関連デバイス
WO2019196914A1 (zh) 一种发现转发路径的方法及其相关设备
WO2021104284A1 (zh) 关于数据传输的表项建立方法及相关设备
WO2023035836A1 (zh) 一种报文处理方法及相关装置
US11811658B1 (en) Method for mobile ad-hoc network (manet) multi-hop routing in a broadcast domain
WO2024001701A1 (zh) 数据处理方法、装置及系统
WO2024037200A1 (zh) 一种通信方法及其相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20912260

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020912260

Country of ref document: EP

Effective date: 20220627

ENP Entry into the national phase

Ref document number: 2022542047

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE