WO2022218370A1 - 一种报文处理的方法及相关装置 - Google Patents
一种报文处理的方法及相关装置 Download PDFInfo
- Publication number
- WO2022218370A1 WO2022218370A1 PCT/CN2022/086775 CN2022086775W WO2022218370A1 WO 2022218370 A1 WO2022218370 A1 WO 2022218370A1 CN 2022086775 W CN2022086775 W CN 2022086775W WO 2022218370 A1 WO2022218370 A1 WO 2022218370A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- network device
- packet
- sid
- nat
- network
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 11
- 238000012545 processing Methods 0.000 claims abstract description 104
- 238000000034 method Methods 0.000 claims abstract description 97
- 230000008569 process Effects 0.000 claims abstract description 19
- 238000004891 communication Methods 0.000 claims description 76
- 238000013519 translation Methods 0.000 claims description 60
- 230000006870 function Effects 0.000 claims description 28
- 230000002085 persistent effect Effects 0.000 claims description 4
- 208000033748 Device issues Diseases 0.000 claims 1
- 238000006243 chemical reaction Methods 0.000 abstract description 27
- 230000005540 biological transmission Effects 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 22
- 230000004044 response Effects 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 11
- 238000012795 verification Methods 0.000 description 10
- 101100064323 Arabidopsis thaliana DTX47 gene Proteins 0.000 description 7
- 101000840469 Arabidopsis thaliana Isochorismate synthase 1, chloroplastic Proteins 0.000 description 7
- 101150026676 SID1 gene Proteins 0.000 description 7
- 238000001514 detection method Methods 0.000 description 7
- 101000961041 Pseudopleuronectes americanus Ice-structuring protein B Proteins 0.000 description 5
- 230000009471 action Effects 0.000 description 5
- 238000007689 inspection Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 101000633607 Bos taurus Thrombospondin-2 Proteins 0.000 description 2
- 101100459439 Caenorhabditis elegans nac-2 gene Proteins 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000011144 upstream manufacturing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/34—Source routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/50—Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2517—Translation of Internet protocol [IP] addresses using port numbers
Definitions
- the embodiments of the present application relate to the field of communications technologies, and in particular, to a packet processing method and related apparatus.
- ISPs Internet service providers
- operator A may send data to Internet service provider B through exit A and exit B, respectively. Then operator A can send high-value data to ISP B through exit A, and send low-value data to ISP B through exit B.
- ISP B may not return the high-value data to operator A through exit A when responding to the high-value data, resulting in data interaction. does not meet the requirements.
- operator A can perform NAT processing on the packets corresponding to the outgoing high-value data through network devices adjacent to egress A.
- the network device does not have a suitable method to distinguish the data that needs to be NATed from the data that does not need to be NATed, so the solution cannot be implemented.
- the embodiments of the present application provide a packet processing method and a related device, which allow network devices to distinguish data that needs to be processed by NAT and data that need not be processed by NAT by using segment identification SIDs. It is ensured that the backhaul traffic of Internet service provider B returns according to the original path, so as to improve user service experience.
- an embodiment of the present application provides a packet processing method, including: a first network device receiving a first packet from a second network device, the first packet including a first segment identifier SID, the The first SID instructs the first network device to perform network address translation NAT on the first packet; the first network device performs NAT processing on the first packet to obtain a second packet; the first network The device sends the second packet.
- the first network device may perform NAT processing on the first packet according to the indication of the segment identifier SID to obtain the second packet and forward it. Therefore, in this embodiment of the present application, the segment identifier SID can be used to allow the first network device to distinguish between data that needs to be processed by NAT and data that need not be processed by NAT. After the NAT conversion process, the backhaul traffic of the second packet can be returned according to the original transmission path, which ensures that the backhaul traffic returns according to the original path and improves user service experience.
- the first network device performing NAT processing on the first packet to obtain the second packet includes: the first network device interpreting the first packet The source address of a packet is replaced with a specific address to obtain the second packet.
- an address pool is configured in a NAT instance used by the first network device to perform NAT processing, and the address pool includes the specific address.
- the method further includes: the first packet The network device advertises the route corresponding to the specific address.
- the first SID is an END.XNAT type or an END.NAT type, or the first SID is a segment routing multi-protocol label switching SR MPLS label .
- the first SID includes indication information or a NAT instance identifier, which is used to instruct the first network device to perform network address translation on the first packet NAT.
- the indication information or the NAT instance identifier is set in a function field or a parameter field of the first SID.
- the first SID is further used to instruct the first network device to send the second packet from a specific interface, or to send the second packet to a specific neighbor Second message.
- the first packet includes a segment routing header SRH; the SRH includes the first SID, or the SRH includes the first SID and a second SID, where the second SID instructs the first network device to send the second packet from a specific interface or to send the second packet to a specific neighbor.
- the segment identification list SID List of the SRH includes the first SID, or the segment identification list SID List of the SRH includes the first SID SID and the second SID.
- the method before the first network device receives the first packet from the second network device, the method further includes: the first network device establishes a The association relationship between the first SID and the specific interface or the association relationship between the first SID and the specific neighbor; the first network device publishes the first SID to other network devices.
- the first network device is an operator edge router PE
- the second network device is a broadband access server BRAS
- the first network device and the second network device are both PEs.
- the first network device and the second network device are set on an SRv6 network or an SR MPLS network.
- This implementation makes the solutions provided by the embodiments of the present application more comprehensive.
- an embodiment of the present application provides a packet processing method, including: a first network device sends a first packet to a second network device, the first packet includes a first segment identifier SID, the The first SID instructs the second network device to perform network address translation NAT on the first packet to obtain a second packet and forward it.
- the first SID is specifically used to instruct the second network device to replace the source address of the first packet with a specific address to obtain the first SID. Two messages. This implementation makes the solutions provided by the embodiments of the present application more comprehensive.
- the method before the first network device sends the first packet to the second network device, the method further includes: the first network device identifies the The application type or service flow type of the first packet; if the application type or service flow type is a specific type, the first network device pushes the first SID into the first packet.
- the method before the first network device sends the first packet to the second network device, the method further includes: the first network device identifies the The application type or service flow type of the first packet; if the application type or service flow type is a specific type, the first network device determines the target network according to the destination address of the first packet; the first The network device pushes the first SID into the first packet, and the first SID is further used to instruct the second network device to send the second packet from a specific interface, or to send all information to a specific neighbor. In the second packet, the specific interface or the specific neighbor is determined according to the target network.
- the method before the first network device sends the first packet to the second network device, the method further includes: the first network device identifies the The application type or service flow type of the first packet; if the application type or service flow type is a specific type, the first network device determines the target network according to the destination address of the first packet; the first The network device pushes the first SID and the second SID into the first packet, where the second SID is used to instruct the second network device to send the second packet from a specific interface, or send the second packet to a specific interface.
- the neighbor sends the second packet, and the specific interface or the specific neighbor is determined according to the target network.
- the obtaining, by the first network device, the first packet includes: the first network device obtaining the first packet from the user-side device, or The first network device generates the first packet.
- the first SID is an END.XNAT type or an END.NAT type, or the first SID is a segment routing multiprotocol label switching SR MPLS label .
- the first SID includes indication information or a NAT instance identifier, which is used to instruct the second network device to perform network address translation on the first packet NAT.
- the indication information or the NAT instance identifier is set in a function field or a parameter field of the first SID.
- the first packet includes a segment routing header SRH; the SRH includes the first SID, or the SRH includes the first SID and a second SID, where the second SID instructs the second network device to send the second packet from a specific interface or to send the second packet to a specific neighbor.
- the first network device and the second network device are an Internet gateway IGW.
- IGW Internet gateway
- the first network device is a broadband access server BRAS
- the second network device is an operator edge router PE
- the first network device and the second network device are both PEs.
- the first network device and the second network device are set on an SRv6 network or an SR MPLS network.
- This implementation makes the solutions provided by the embodiments of the present application more comprehensive.
- an embodiment of the present application provides an apparatus for processing a packet, including: an acquisition module configured to receive a first packet from another network device, where the first packet includes a first segment identifier SID, The first SID instructs the processing module to perform network address translation NAT processing on the first packet; the processing module is configured to perform NAT processing on the first packet according to the indication of the first SID to obtain a second packet. message; a sending module, configured to send the second message.
- the processing module is further configured to replace the source address of the first packet with a specific address to obtain the second packet.
- the sending module is further configured to publish the route corresponding to the specific address.
- an address pool is configured in the NAT instance used by the processing module for NAT processing, and the address pool includes the specific address.
- the first SID is an END.XNAT SID or an END.NAT SID, or the first SID is a segment routing multiprotocol label switching SR MPLS label .
- the first SID includes indication information or a NAT instance identifier, which is used to instruct the processing module to perform network address translation NAT on the first packet.
- the indication information or the NAT instance identifier is set in a function field or a parameter field of the first SID.
- the first SID is further used to instruct the sending module to send the second packet from a specific interface, or to send the second packet to a specific neighbor .
- the first packet includes a segment routing header SRH; the SRH includes the first SID, or the SRH includes the first SID and a second SID, where the second SID instructs the sending module to send the second packet from a specific interface or to send the second packet to a specific neighbor.
- the segment identification list SID List of the SRH includes the first SID, or the segment identification list SID List of the SRH includes the first SID SID and the second SID.
- the processing module is further configured to establish an association relationship between the first SID and the specific interface or an association relationship between the first SID and the specific neighbor.
- the association relationship; the sending module is further configured to publish the first SID to other network devices.
- the device for processing the message is an Internet gateway IGW.
- the device for processing the message is the operator's edge router PE, the other network device is the broadband access server BRAS, or the device for processing the message and another network device.
- a network device is all PE.
- the device for processing the message is set on the SRv6 network or the SR MPLS network.
- an embodiment of the present application provides an apparatus for processing a message, including: an obtaining module, configured to obtain a first message; a sending module, configured to send the first message to another network device, the The first packet includes a first segment identifier SID, and the first SID instructs the other network device to perform network address translation NAT on the first packet to obtain and forward the second packet.
- the first SID is specifically used to instruct the other network device to replace the source address of the first packet with a specific address to obtain the first SID. Two messages.
- the processing module is further configured to identify the application type or service flow type of the first packet; if the application type or service flow type is a specific type, Then, the processing module pushes the first SID into the first message.
- the processing module is further configured to identify the application type or service flow type of the first packet; if the application type or service flow type is a specific type, Then the processing module determines the target network according to the destination address of the first packet; pushes the first SID into the first packet, and the first SID is also used to instruct another network device to send from a specific interface the second packet, or send the second packet to a specific neighbor, where the specific interface or the specific neighbor is determined according to the target network.
- the processing module is further configured to identify the application type or service flow type of the first packet; if the application type or service flow type is a specific type, Then the processing module determines the target network according to the destination address of the first packet; pushes the first SID and the second SID into the first packet, and the second SID is used to instruct another network device from The specific interface sends the second packet, or sends the second packet to a specific neighbor, where the specific interface or the specific neighbor is determined according to the target network.
- the obtaining module is configured to obtain the first packet from the user-side device, or generate the first packet.
- the first SID is an END.XNAT type or an END.NAT type, or the first SID is a segment routing multiprotocol label switching SR MPLS label .
- the first SID includes indication information or a NAT instance identifier, which is used to instruct another network device to perform network address translation NAT on the first packet.
- the indication information or the NAT instance identifier is set in a function field or a parameter field of the first SID.
- the obtaining module is configured to receive the first SID advertised by the second network device; the processing module is further configured to establish the first SID and the target address relationship between.
- the first packet includes a segment routing header SRH; the SRH includes the first SID, or the SRH includes the first SID and the first SRH.
- Two SIDs where the second SID instructs another network device to send the second packet from a specific interface, or to send the second packet to a specific neighbor.
- the device for processing the message and another network device are an Internet gateway IGW.
- the device for processing the message is a broadband access server BRAS, and the other network device is the operator's edge router PE, or the device for processing the message and another network device.
- a network device is all PE.
- the device for processing the message and another network device are set on an SRv6 network or an SR MPLS network.
- an embodiment of the present application provides a network device, where the network device includes one or more central processing units, a memory, a communication bus, and a communication interface; the memory is a temporary storage memory or a persistent storage memory, and program codes are stored in the memory;
- the communication interface is used to send and receive data; the central processing unit communicates with the memory through the communication bus, and executes the program code in the memory on the network device to execute the method according to the first aspect.
- an embodiment of the present application provides a network device, where the network device includes one or more central processing units, a memory, a communication bus, and a communication interface; the memory is a temporary storage memory or a persistent storage memory, and program codes are stored in the memory;
- the communication interface is used for sending and receiving data; the central processing unit communicates with the memory through the communication bus, and executes the program code in the memory on the network device to execute the method of the second aspect.
- an embodiment of the present application provides a system for processing packets, where the system includes the network device of the fifth aspect and the network device of the sixth aspect.
- embodiments of the present application provide a computer-readable storage medium, including instructions, which, when the instructions are executed on a computer, cause a computer device to perform the method of the first aspect.
- FIG. 1 is a schematic diagram of a terminal accessing an Internet service provider according to an embodiment of the present application
- FIG. 2 is a schematic diagram of a system architecture provided by an embodiment of the present application.
- FIG. 3 is a flowchart of a method for processing a message according to an embodiment of the present application.
- FIG. 4 is a schematic interface diagram of a terminal 201 running an application program operated by an ISP 203 according to an embodiment of the present application;
- 6a is a schematic diagram of NAT conversion in an embodiment of the present application.
- FIG. 6b is a signaling diagram of message transmission corresponding to a high-value application provided by an embodiment of the present application.
- FIG. 7a is a schematic diagram of an IPv6 message in the SRv6 technology
- Figure 7b is a schematic diagram of a SID in an IPv6 message
- FIG. 8 is one of the flow charts of processing a message provided by an embodiment of the present application.
- FIG. 9a is the second flowchart of the processing message provided by the embodiment of the present application.
- FIG. 9b is the third flowchart of the processing message provided by the embodiment of the present application.
- FIG. 10a is the fourth flowchart of the processing message provided by the embodiment of the present application.
- FIG. 10b is the fifth flowchart of the processing message provided by the embodiment of the application.
- FIG. 11 is the sixth flowchart of the processing message provided by the embodiment of the present application.
- FIG. 12 is a schematic diagram of a home broadband scenario in an embodiment of the application.
- FIG. 13 is a schematic diagram of a network device according to an embodiment of the present application.
- FIG. 14 is a schematic diagram of a first message processing apparatus provided by an embodiment of the present application.
- FIG. 15 is a schematic diagram of a second type of packet processing apparatus according to an embodiment of the present application.
- the embodiments of the present application provide a packet processing method and a related device, which allow network devices to distinguish data that needs to be processed by NAT and data that need not be processed by NAT by using segment identification SIDs. It is ensured that the backhaul traffic of Internet service provider B returns according to the original path, so as to improve user service experience.
- words such as “exemplary” or “for example” are used to represent examples, illustrations or illustrations. Any embodiments or designs described in the embodiments of the present application as “exemplary” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present the related concepts in a specific manner.
- FIG. 1 is a schematic diagram of a terminal accessing an Internet service provider according to an embodiment of the present application. As shown in FIG. 1 , the terminal 101 accesses the resources of the Internet service provider 103 through the communication system 102 and performs data exchange.
- the terminal 101 mentioned in the embodiments of this application is also referred to as user equipment (user equipment, UE), mobile station (mobile station, MS), mobile terminal (mobile terminal, MT), terminal equipment, etc., and is a kind of A device that provides voice and/or data connectivity to a user, or a chip disposed within the device, eg, a handheld device, vehicle-mounted device, etc., with wireless connection power enabled.
- Terminals may include, but are not limited to, handheld devices with wireless communication capabilities, in-vehicle devices, wearable devices, computing devices, other processing devices connected to wireless modems, mobile phones, tablet computers, notebook computers, palmtop computers, Mobile internet device (MID), machine type communication terminal, virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control (industrial control), unmanned driving Wireless terminals in (self driving), wireless terminals in remote medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, in smart city wireless terminals, wireless terminals in smart homes, etc.
- MID Mobile internet device
- VR virtual reality
- AR augmented reality
- wireless terminal in industrial control industrial control
- wireless terminals in remote medical surgery wireless terminals in smart grid, wireless terminals in transportation safety, in smart city wireless terminals, wireless terminals in smart homes, etc.
- the communication system 102 mentioned in the embodiments of the present application may be a base station access system of a 2G network, a base station access system of a 3G network, a base station access system of a 4G network, a base station access system of a 5G network, and the like.
- the communication system may include one or more network devices.
- the network device can be any device that has the function of sending and receiving network data.
- Network equipment includes but is not limited to: base stations (such as base station BS, base station NodeB, evolved base station eNodeB or eNB, base station gNodeB or gNB in the fifth generation 5G communication system, base station in future communication system, access node in WiFi system , wireless relay node, wireless backhaul node), network node, communication node, etc.
- the base station can be: a macro base station, a micro base station, a pico base station, a small base station, a relay station, and the like.
- a network node can be an Internet Gateway (IGW), a workstation, a network user equipment or a personal computer, and can also be a server and other network-connected devices.
- the connection between network devices may be a wired connection or a wireless connection, which is not limited in this embodiment of the present application.
- the communication system 102 may be operated by an operator.
- the communication system 102 is operated by operator A.
- Operators generally refer to providers that provide network services.
- the network node 104 and the network node 105 may be transit peers (Transit Peers), that is, nodes between an operator and an upper-level ISP.
- the communication system 102 operated by the operator A can access the resources of the ISP 103 through the network node 104 and the network node 105 .
- operator A can purchase a connection from ISP 103 and settle for traffic or bandwidth.
- some connections are carried by the network node 104 and settled by traffic.
- Some connections can be carried through the network node 105 , the network node 105 is usually a node with average performance, and the ISP 103 can provide free connections to the operator through the network node 105 .
- the network node 105 can be an Internet Exchange Point (Internet Exchange Point, IXP), the IXP is operated by a third-party center, and each operator can connect to the IXP to implement mutual traffic exchange, and the IXP is a free connection.
- IXPs may include, but are not limited to, Amsterdam Internet Exchange (AMS-IX), Hong Kong Internet Exchange (HKIX), and the like.
- the network node 104 and the network node 105 may also be referred to as external border gateway protocol peers (external border gateway protocol peers, EBGP peers).
- the communication system 102 operated by the operator A can also connect to the communication systems operated by other ISPs or other operators through other exits and other transit peers, and the ISP 103 can also connect to other communication systems through the network node 105 or other network nodes.
- An operator or other ISP which is not limited in this embodiment of the present application.
- the terminal 101 exchanges data with the ISP 103 to support the operation of the high-value APP.
- a certain game APP is provided by the ISP 103, and when the user runs the game APP through the terminal 101, the user needs to perform data interaction with the ISP 103.
- the game APP requires a relatively low delay, in the embodiment of the present application, the game APP is a high-value APP.
- the data generated by the terminal 101 running the game APP is generally transmitted through the A exit of the communication system 102, passes through the network node 104, and finally reaches the ISP103, and the data related to the game APP generated by the ISP103 needs to pass through the network node 104, A exit and communication.
- System 102 reaches terminal 101 .
- the terminal 101 often not only runs one high-value APP, but may run multiple APPs, including high-value APP and low-value APP, and the network data of these APPs may need to interact with the ISP 103 or communicate with each other.
- the network node 104 is usually a node that can provide better network transmission services (eg, low latency, high speed, etc.), while the network node 105 is usually a relatively common free node.
- FIG. 2 is a schematic diagram of a system architecture provided by an embodiment of the present application.
- the communication system 202 includes a network device 206 , a network device 207 , a network device 208 , a network device 209 , a network device 210 , and a network device 211 .
- the communication system 202 is communicatively connected to the ISP 203 through the exit A and the network node 204 , or the communication system 202 is communicatively connected to the ISP 203 through the exit B and the network node 205 .
- the terminal 201 is similar to the terminal 101 in the description corresponding to FIG. 1
- the communication system 202 is similar to the communication system 102 in the description corresponding to FIG. 1
- the ISP 203 is similar to the description corresponding to FIG. 1.
- ISP103, the network node 204 is similar to the network node 104 in the foregoing description corresponding to FIG. 1
- the network node 205 is similar to the network node 105 in the foregoing description corresponding to FIG. 1, and will not be repeated here.
- the network device 206 , the network device 207 , the network device 208 , the network device 209 , the network device 210 , and the network device 211 are internal network nodes of the communication system 202 , and are used to implement data transmission in the communication system 202 .
- an embodiment of the present application provides a packet processing method as shown in FIG. 3 , and the method includes the following steps:
- the network device 206 receives the message sent by the terminal 201, and identifies the application corresponding to the message through an application detection method;
- the message is a form of data sent by the terminal 201, and is a data unit exchanged and transmitted in the network.
- the data may also be in the form of data packets, data blocks, etc., which is not limited in this embodiment of the present application.
- the packet received by the network device 206 may be sent by the terminal 201 .
- the packets received by the network device 206 may also be sent by other network devices, which is not limited in this embodiment of the present application.
- the network device 206 may also generate a packet according to information data received by itself, which is not limited in this embodiment of the present application.
- FIG. 4 is a schematic interface diagram of the terminal 201 running an application program operated by the ISP 203 .
- the user can first enter the mobile phone number, and then click the "Get Verification Code" button.
- the terminal 201 is triggered by the click of the "Acquire Verification Code" button, acquires the mobile phone number input by the user, and generates an instruction for requesting the verification code (the instruction may include the mobile phone number and the requested identification, etc.)
- the message is sent to ISP 203 through communication system 202 .
- the ISP 203 can send the SMS verification code to the mobile phone number.
- the user can enter the verification code and the registration password in the interface shown in Figure 4, and then click Register.
- the terminal 201 is triggered by the click of the "register" button, obtains information such as the mobile phone number, verification code, registration password and other information input by the user, and generates an instruction for registering an account (the instruction may include the mobile phone number, verification code, registration password, etc. information) into the message, and then the message is sent to the ISP 203 through the communication system 202.
- ISP203 can check whether the verification code is the same as the verification code sent by ISP203 before. If it is the same, ISP203 can complete the account registration according to the mobile phone number, registration password and other information in the message.
- the ISP 203 can send a message including a registration success identifier to the terminal 201 through the communication system 202, and the registration success identifier is used to indicate that the account is successfully registered.
- the terminal may display that the registration is successful on the interface, as shown in FIG. 5 (FIG. 5 is an interface diagram of successful account registration provided by this embodiment of the present application).
- the message sent by the terminal 201 to the ISP 203 through the communication system 202 may first be transmitted to the network device 206 in the communication system 202 .
- the network device 206 can identify the application corresponding to the packet through the application detection method according to the packet.
- the application detection method can analyze the information in the packet to determine the application corresponding to the packet.
- the network device 206 can analyze the information in the message through the application detection method to determine that the application corresponding to the message is the application program A.
- the application detection method may be deep packet inspection (Deep Packet Inspection, DPI), deep/dynamic flow inspection (Deep/Dynamic Flow Inspection, DFP), access control list (Access Control List, ACL) matching rules (or It is called a matching rule based on quintuple information), etc., the embodiment of the present application does not limit which application detection method is selected.
- the network device 206 when the network device 206 receives the message A and the message B, the network device 206 can respectively detect that the application corresponding to the message A is the application program A and the application corresponding to the message B is the application program B through the application detection method. .
- the network device 206 can directly identify that the applications corresponding to these packets are high-value applications or low-value applications, that is, there are only two types of applications corresponding to the packets, one is high-value applications and the other is low-value applications Value application, the network device 206 does not identify the specific application corresponding to the packet, but directly identifies whether the application corresponding to the packet is a high-value application or a low-value application.
- the network device 206 may first identify what type of application the application corresponds to, and then determine whether the application corresponding to the packet is a high-value application or a low-value application. For example, the network device 206 can first identify that the type of a certain packet is a game type, and then determine that the application of the game type is a high-value application according to the relationship between the application type and the application value (high value or low value), then the packet corresponding to Apps are high-value apps.
- the network device 206 may also directly identify the name of the application, and then determine whether the name corresponds to a high-value application or a low-value application according to the relationship between the name of the application and the application value (high-value or low-value), so as to determine whether the name corresponds to a high-value application or a low-value application.
- the application corresponding to the packet is a high-value application or a low-value application.
- the network device 206 can finally identify whether the application corresponding to the packet is a high-value application or a low-value application, and the embodiments of the present application do not limit the process therein.
- the application program operated by the ISP 203 may be a game type application program, a commercial platform type application program, or an online video playback type application program. Do limit.
- the above is the method for the network device 206 to identify the application type.
- the network device 206 can also identify the service flow type of the message.
- the service flow type includes video stream, audio stream, etc.
- the identification method is the same as the above-mentioned network device 206 identifies the application type. The method is similar and will not be repeated here.
- the network device 206 determines the outbound interface corresponding to the packet
- the network device 206 can first read the destination IP address of the message from the message, and determine the ISP to which the message is to be transmitted in combination with the preset ISP IP address segment.
- IP1-IP2 is located at the AISP
- IP3-IP4 is located at the CISP. If the destination IP address of the packet is within IP3-IP4, the ISP to which the packet is to be transmitted is the CISP.
- the IP address attribution information (the association relationship between the IP address segment and the ISP) can be obtained by purchasing a dedicated IP address library (eg IPIP.net, ip2location). Certainly, the IP address attribution information can also be obtained through other channels, which is not limited in this embodiment of the present application.
- the network device 206 may determine the outbound interface corresponding to the packet in combination with the ISP to which the packet is to be transmitted and the application corresponding to the packet determined in step 301 .
- the communication system 202 communicates with the ISP 203 through the exit A and the network node 204 , or communicates with the ISP 203 through the exit B and the network node 205 .
- the exit A and the network node 204 are generally used to transmit packets corresponding to high-value applications
- the exit B and the network node 205 are generally used to transmit packets corresponding to low-value applications.
- the network device 206 determines that the ISP to which a certain packet is to be transmitted is ISP 203 and the application corresponding to the packet is a high-value application, the network device 206 can determine that the outlet corresponding to the packet is export A. Similarly, if the network device 206 determines that the ISP to which the message is to be transmitted is the ISP 203 and the application corresponding to the message is a low-value application, the network device may determine that the outlet corresponding to the message is the export B.
- the network device 206 puts the NAT translation related information into the message according to the application and the exit corresponding to the message, and forwards it to the network device 209 .
- NAT network address translation
- FIG. 6a is a schematic diagram of NAT translation in an embodiment of the present application.
- Figure 6b is a signaling diagram of a high-value application corresponding to packet transmission.
- the network device 209 can determine the exit corresponding to the packet according to the relevant information of NAT translation in the packet, so as to forward the packet according to the corresponding exit.
- the network node 204 can be described in detail in the following situations according to the embodiments of the present application:
- the network device 209 determines that the exit corresponding to the packet uploaded by the user is exit A, then the network device 209 can forward the packet through exit A.
- the network device 209 can modify the source address of the packet to a specific address, that is, a specific address in the NAT address pool (an address pool is configured in the NAT instance used by the network device 209 for NAT translation, and the address pool includes several specific addresses. ), that is, a pre-allocated public network address and port (the public network address and port may be the public network address and port corresponding to the network device 209 ), and then the packet is forwarded to the network node 204 .
- the network device 209 may forward the packet through the exit A in a redirection manner, thereby reaching the network node 204 .
- the network node 204 forwards the message to the ISP 203 according to the destination address of the message.
- the ISP 203 processes the message, and can generate a response message for the message.
- the ISP203 will return the packet according to the source address of the packet, and the source address of the packet has been modified to the pre-assigned public network address and port, so the ISP203 can return the response packet's source address.
- the destination address is set as the source address of the message, so that the response message is transmitted to the network device 209 .
- the network device 209 only advertises the NAT address pool route to the network node 204 in advance (because the network node 204 is a route corresponding to a specific address in the NAT address pool), but not to the network node 205, so the destination address is
- the response message of the above-mentioned public network address and port will only be returned to the network device 209 through the network node 204, which ensures the return path of the response message, that is, the path when the ISP 203 sends the backhaul traffic is the path taken by the high-value application message (ie, the path corresponding to the network device 204 and exit A).
- the network device 209 determines that the exit corresponding to the message uploaded by the user is exit B, then the network device 209 can modify the source address of the message to a specific address, that is, a specific address in the NAT address pool (the network device 209 performs The NAT instance used for NAT translation is configured with an address pool, and the address pool includes several specific addresses), that is, the pre-assigned public network address and port (the public network address and port are generally the public network address corresponding to the network device 209). and port), and then the packet can be forwarded through exit B in a redirection manner, thereby reaching the network node 205.
- the network device 209 only publishes the NAT address pool route to the network node 205 (because the network node 205 is a route corresponding to a specific address in the NAT address pool), and after receiving the message, the network node 205 can forward the message to ISP203.
- the ISP 203 processes the message, and can generate a response message for the message. Since the source address of the packet has been modified to the pre-assigned public network address and port, the ISP 203 can set the destination address of the response packet as the source address of the packet, so that the response packet is transmitted to the network device 209 .
- the path of the traffic is the path taken by the low-value application packet (ie, the path corresponding to the network device 205 and the egress B).
- the information such as the route of the NAT address pool, the public network address, and the port may be stored in the network device 209 in advance, and may be specifically stored in the form of a NAT instance. After the network device 209 determines the outgoing interface of the packet, the corresponding NAT instance can be determined according to the outgoing interface, thereby obtaining relevant information.
- An example of a NAT instance is as follows:
- nat instance nat1id 1 means that the serial number id of the NAT instance nat1 is defined as 1
- port-range 1024 means the port range used in the NAT instance
- service-instance-group group1 is The CPU group used by the NAT instance is group1
- no. 1 in the NAT address pool means the No. 1 in the NAT address pool.
- a set of NAT public network address ranges from 11.11.11.101 to 11.11.11.105.
- the network device 209 can allocate the NAT address pool route to the corresponding network node, and then send the NAT address pool route to the corresponding network
- the node ensures the return path of the response message, that is, the path when the ISP 203 sends the backhaul traffic is the path the message takes when the user uploads the message.
- the network device 209 can obtain the NAT instance ID from the message uploaded by the user, and then find the corresponding NAT instance according to the NAT instance ID, as follows:
- the network device 209 In case 3, the message uploaded by the user does not directly specify the exit, but gives the NAT instance ID, so the network device 209 generally considers the message with the NAT instance ID as the message corresponding to the high-value application, so it can be determined that the The outgoing interface corresponding to the packet is egress A. Then the network device 209 can send the packet to the network node 204 corresponding to the egress A.
- the NAT instance may also carry redirection information, as follows:
- system-view indicates the system aspect
- “nat instance cpel id 1” indicates that the id that defines the redirection is 1
- redirect ip-nexthop 192.168.1.1 outbound” indicates that the redirection configures the upstream direction (that is, the report uploaded by the user).
- the IP address of the redirection to the next hop is 192.168.1.1.
- the network device 209 can find the corresponding NAT instance in the memory according to the NAT instance ID, and then according to the redirection information in the NAT instance, through the redirection method The directed method sends the message to the network node 204 .
- the network device 209 can advertise the NAT address pool route to the network node 204 to ensure the return path of the response message from the ISP 203, that is, to ensure that the path when the ISP 203 sends the return traffic is the path taken by the high-value application message.
- the packet uploaded by the user specifies both the exit and the NAT instance ID. Then the network device 209 can determine the exit according to the message, and then the network device 209 can find the corresponding NAT instance in the memory according to the NAT instance ID, and then send the message to the corresponding network node and the NAT address pool by redirecting the message. The route is advertised to the corresponding network node to ensure the return path of the response message from the ISP203.
- the network device 209 can either obtain the NAT instance ID from the message uploaded by the user to determine the NAT instance, or can determine the NAT instance after determining the outbound interface corresponding to the message uploaded by the user, then the network device 209 can determine the NAT instance according to the preset
- the manual setting prefers the NAT instance determined by the NAT instance ID.
- the network device 209 preferentially selects the NAT instance determined according to the outgoing interface, which is not limited in this embodiment of the present application.
- the network device 209 can obtain the information of the corresponding exit in the message uploaded by the user. In some cases, the network device 209 may also obtain the NAT instance ID in the message uploaded by the user. Therefore, the network device 206 generally puts relevant information into the message uploaded by the user according to the application and exit corresponding to the message.
- the relevant information generally includes three categories, as follows:
- the first type of information is information used to determine the NAT instance.
- the first type of information may be a NAT instance ID or a link interface identifier (also referred to as indication information).
- the network device 209 may determine the NAT instance according to the NAT instance ID. In general, when the network device 209 detects that the packet contains the NAT instance ID, it can determine that the packet is a packet corresponding to a high-value application, and selects the corresponding exit A to forward the packet.
- the network device 209 can forward the packet according to the redirection information (so that the packet is sent according to the predetermined outbound interface). Forward).
- the network device 209 may determine the outbound interface corresponding to the packet according to the link interface identifier.
- a link interface identifier of 1 indicates that the outbound interface corresponding to the packet is export A
- a link interface identifier of 2 indicates that the outbound interface corresponding to the packet is export B, etc. This is not limited in this embodiment of the present application.
- the network device 209 may then read the NAT instance corresponding to the link interface identification from memory.
- the NAT instance corresponding to the link interface identifier 1 is NAT instance 1
- the NAT instance corresponding to the link interface identifier 2 is NAT instance 2. Therefore, through the first type of information, the network device 209 can determine the NAT instance and complete the subsequent NAT translation.
- the embodiment of the present application does not exclude the situation that the first type of information is the NAT instance itself.
- the network device 209 can directly read the relevant information from the packet.
- the first type of information in the embodiments of this application is mainly information that can determine the NAT instance.
- the first type of information may also carry the ID of the NAT instance, and the NAT instance is sent through other methods. Therefore, this application implements The example does not limit the specific content of the first type of information.
- the second type of information is an identifier indicating whether to perform NAT translation. Exemplarily, if the second type of information is 0, it means that NAT translation is not performed, and if the second type of information is 1, it means that NAT translation is performed. Therefore, after obtaining the message uploaded by the user, the network device 209 can first obtain the second type of information from the message. If the second type of information indicates that NAT translation is not to be performed, the network device 209 does not need to search for the first type of information from the message.
- the class information saves the processing steps of the network device 209 and improves the packet processing efficiency.
- the network device 209 can directly read the first type of information from the preset location, without verifying the information (judging whether it is the first type of information), saving the network device 209 processing steps, which improves the packet processing efficiency.
- the network device 206 can carry the above-mentioned segment identity document (SID) in the SRv6 extension header of the packet in the IPv6-based source routing (segment routing over IPv6, SRv6) technology.
- SID segment identity document
- IPv6-based source routing Segment routing over IPv6, SRv6 technology.
- an IPv6 packet can be divided into multiple segments, including an IPv6 packet header 701, an SRv6 extension header 702, and a payload 703 (playload, that is, the specific content of the packet).
- the version field in the IPv6 packet header 701 Indicates the protocol version supported by the current packet
- the source address (SA) indicates the source address of the packet
- the destination address (DA) indicates the address of the device to which the packet is expected to arrive.
- the SRv6 extension header 702 includes some basic information (indicated by ... in Fig. 7a) and a plurality of segment identification lists (SID lists).
- the segment list can include one or more SID fields, and the SID list is used to identify a packet forwarding path.
- the last SID is an SID used to instruct the network device 209 to perform NAT translation processing.
- a segment identification list SID List includes one SID or multiple SIDs, as shown in Figure 7b.
- the SID can be understood as a piece of information in the SRv6 extension header of the packet, which is used to identify a node or link on the forwarding path.
- the SID generally includes three parts, a locator field 704 , a function field 705 and an argument field 706 .
- the network device 206 can put the information into the message in the following ways:
- the network device 206 may adopt a newly defined SID type—END.XNAT.
- the function of the function field 705 of the SID of the END.XNAT type is to forward the packet from the specified link of the device (eg, the physical link connecting the network node 204 ), and to specify whether to perform NAT translation during forwarding.
- the function field 705 may include the link interface identification (one of the first type of information) and the identification of whether to perform NAT translation (the second type of information).
- the network device 206 when the network device 206 determines that the outbound interface of the packet is export A, and the packet is a packet corresponding to a high-value application, the network device 206 can set one of the SIDs (usually a SID) in the SRv6 extension header in the packet.
- the last SID is an SID of the END.XNAT type, and the link interface identifier of the function field 705 in the SID is 1 (indicating that the outbound interface corresponding to the packet is exit A), and the identifier of whether to perform NAT translation is 1 (indicating that the NAT translation).
- the network device 206 when the network device 206 determines that the outbound interface of the packet is export B, and the packet is a packet corresponding to a low-value application, the network device 206 can set one of the SIDs (usually a SID) in the SRv6 extension header in the packet.
- the last SID is the SID of END.XNAT type, and the link interface identifier of the function field 705 in the SID is 2 (indicating that the outbound interface corresponding to the packet is exit B), and the identifier of whether to perform NAT translation is 0 (indicating no NAT translation).
- the identifier of whether to perform NAT conversion may be 0 or 1 to indicate whether to perform NAT conversion. Indicates whether to perform NAT translation, which is not limited in this embodiment of the present application. The identification of the link interface is similar and will not be repeated here.
- the network device 206 may adopt a newly defined SID type—END.NAT.
- the function of the function field 705 of the SID of the END.NAT type is to indicate that the message is to be subjected to NAT translation (the second type of information), and the function field 705 carries the NAT instance ID (one of the first type of information).
- the network device 206 determines that the outbound interface of the packet is export A, and the packet is a packet corresponding to a high-value application, the network device 206 can set one of the SIDs (usually a SID) in the SRv6 extension header in the packet.
- the last SID) is END.NAT, and the function field 705 in the SID carries a NAT instance ID of 123 (the network device 209 can find the corresponding NAT instance according to the NAT instance ID 123 after receiving the message).
- the network device 206 determines that the outbound interface of the packet is export B, and the packet is a packet corresponding to a low-value application, the network device 206 can set the last SID in the SRv6 extension header in the packet to be a common type. Instead of the type of END.NAT, the network device 209 can forward the packet according to the traditional scheme after receiving the packet (generally through the free exit B and the network node 205).
- the network device 206 may add the SID of the END.NAT type to the segment identification list SID List where the SID of the END.X type is located, then the SID List has two SIDs (including SID1 and SID2), wherein SID1 is an SID of type END.X, which is used to indicate the outgoing interface of the packet or the next neighbor of the packet, and SID2 is an SID of type END.NAT, which is used to carry the NAT instance ID.
- the network device 209 can perform NAT translation processing on the packet according to SID2, send the NAT translation processed packet from a specific interface according to SID1, or send the NAT translation processed packet to a specific neighbor. arts.
- the network device 206 can adopt the traditional SID type - END.X, and add the definition of the parameter field 706 in this type of SID.
- the first definition is to define in the parameter field 706 a flag indicating whether to perform NAT translation (the second type of information). Since the SID type of END.X can specify the outgoing interface, in fact, the SID of this type already contains the link interface identifier (one of the first type of information).
- the network device 206 can determine the first type of information and the second type of information according to the packet corresponding to the high-value application or the low-value application and the outbound interface corresponding to the packet, and then according to the first type of information and the second type of information.
- a SID of type END.X is generated that includes the newly defined parameter in parameter field 706.
- the network device 209 can analyze and obtain the first type of information and the second type of information, so as to perform NAT conversion processing and forward the packet according to the corresponding outbound interface.
- the specific example is similar to the foregoing method 1, and details are not repeated here.
- the second definition is to define a parameter in the parameter field 706, which is the ID of the NAT instance (one of the first types of information).
- the network device 206 determines whether the message is a message corresponding to a high-value application or a low-value application, and the outbound interface corresponding to the message, the network device 206 can determine the NAT instance ID, and then determine the NAT instance ID according to the outbound interface and the corresponding outbound interface of the message.
- the NAT instance ID generation parameter field 706 includes the END.X type SID of the NAT instance ID, and a corresponding message is generated and forwarded.
- the network device 209 may not determine the NAT according to the outbound interface after receiving this type of message. instance, the NAT instance is determined directly from the ID of the NAT instance in parameter field 706. The network device 209 may forward the packet according to the outbound interface specified by the SID.
- the communication system 202 may adopt the technical solution corresponding to the first definition above, the technical solution corresponding to the second definition above, or a combination of the above two technical solutions, that is, the parameter of the SID
- the field 706 includes not only the identification of whether to perform NAT translation (the second type of information), but also the ID of the NAT instance (one of the first type of information). Then the network device 206 can determine whether to perform NAT conversion and the NAT instance ID (if NAT conversion is not performed, the NAT instance The ID can be empty or 0 as agreed by the protocol, indicating no NAT instance ID).
- the network device 209 can read the first type of information and the second type of information from the message, so as to perform NAT conversion processing and forward the message according to the corresponding outbound interface.
- the specific example is similar to the foregoing manner, and details are not repeated here.
- the network device 206 may use the traditional SID type—END, and add a definition of the parameter field 706 in this type of SID.
- the definition is to define a parameter in the parameter field 706, which is the ID of the NAT instance (one of the first type of information).
- the NAT instance ID generation parameter field 706 includes the SID of the END type of the NAT instance ID, wherein the outgoing interface corresponding to the packet can be determined by the NAT instance corresponding to the NAT instance ID. For example, after receiving the packet, the network device 209 can obtain the NAT instance ID from the parameter field 706, and then determine the NAT instance. Finally, according to the NAT instance, determine the outbound interface corresponding to the packet and process NAT translation.
- a new parameter may be defined in the parameter field 706 as an identifier for whether to perform NAT translation (the second type of information), which is similar to the two definitions used in Mode 3 above. , and will not be repeated here.
- the network device 209 may pre-establish an association relationship between the SID and a specific interface (packet outgoing interface), and then publish the SID externally (ie, to other network devices in the communication system). After receiving the SID, the network device 206 can establish an association relationship between the SID and the target address.
- the network device 206 when it receives the message, it can determine the corresponding SID and specific interface according to the destination address of the message, and use the above method to generate a suitable SID and push it into the message (SID List). Since the network device 209 pre-establishes an association relationship between the SID and a specific interface (packet outgoing interface), after receiving the SID, the network device 209 can determine the specific interface corresponding to the SID, and then forward the packet through the specific interface. arts. In another case, the network device 209 may establish an association relationship between the SID and a specific neighbor in advance, and then publish the SID to the outside world. The principle is similar, and details are not repeated here.
- the network device 206 can use SR
- the MPLS label implements the above solution, which is not limited in this embodiment of the present application.
- the network device 206 can send the message to the network device 209 .
- the network device 206 and the network device 209 can use the SRv6 tunnel technology to select a path with better communication effect to transmit packets corresponding to high-value applications, and select a path with lower cost and a general communication effect to transmit packets corresponding to low-value applications. message.
- the network device 206 may be an ingress device of the SRv6 tunnel
- the network device 209 may be an egress device of the SRv6 tunnel.
- the packets corresponding to high-value applications are transmitted through the SRv6 tunnel, and only the ingress device and the egress device need to be configured, which avoids modification of other network devices and reduces the cost of device modification.
- the network device 206 when the SRv6 technology is adopted, when generating the SRv6 extension header of the message, the network device 206 can put the SID corresponding to the network device of the transmission path with better communication effect into the SRv6 extension header, so that When the packet is transmitted according to the SRv6 extended packet header, it can be transmitted on the path corresponding to these SIDs.
- the network device 206 when the network device 206 generates the SRv6 extension header of the message, the network device 206 can put the NAT translation related information into the tail SID of the SRv6 extension header, so that the message reaches the network device corresponding to the tail SID (usually an exit device, similar to the network device 209 in the various embodiments corresponding to FIG. 2 ), it can be processed according to step 304 .
- Step 304 will be described in detail below.
- the network device 209 After receiving the packet, the network device 209 performs NAT translation according to the information in the packet, and forwards the packet through the corresponding outbound interface.
- the network device 209 may obtain the first type of information from the message, and then determine the NAT instance according to the first type of information, and then perform NAT translation according to the NAT instance.
- the network device 209 may directly determine the outbound interface corresponding to the packet according to the link interface identifier, and finally forward the packet through the outbound interface corresponding to the packet.
- the network device 209 may determine the NAT instance according to the NAT instance ID, and then forward the packet through the outbound interface corresponding to the NAT instance according to the redirection information in the NAT instance.
- the network device 209 may first obtain the second type of information from the received packet, that is, the identification of whether to perform NAT translation. If the flag of whether to perform NAT conversion is 0 (indicating that NAT conversion is not performed), the network device 209 does not need to search for the first type of information from the message, which saves the processing steps of the network device 209 and improves the message processing efficiency. If the flag of whether to perform NAT conversion is 1 (indicating that NAT conversion is performed), the network device 209 can directly read the first type of information from the preset location, without verifying the information (to determine whether it is the first type of information) , the processing steps of the network device 209 are saved, and the packet processing efficiency is improved.
- the network device 209 can be configured together with the network device 206, for example, to support a certain protocol, and the packets generated by the network device 206 according to the protocol can be successfully analyzed and processed by the network device 209 according to the protocol.
- the network device 209 may use a corresponding method to analyze, as follows:
- the network device 209 may first determine whether the currently processed SID is of the END.XNAT type. If not, the network device 209 performs other processing unrelated to the technical solution of the present application. If so, the network device 209 can read the link interface identifier (one of the first type of information) from the function field 705 of the SID and determine the outgoing interface. Then, the network device 209 may perform a penultimate segment pop of the SRH (PSP) operation to remove the SRv6 extension header (also referred to as a segment routing header (Segment Routing Header, SRH)).
- PSP penultimate segment pop of the SRH
- SRH segment routing header
- the network device 209 can directly read the identification of whether to perform NAT translation (the second type of information) from the function field 705 in the SID of the END.XNAT type. If the flag of whether to perform NAT conversion is 0 (indicating that NAT conversion is not performed), the network device 209 does not need to search for the first type of information in the message, and then forwards the message according to the determined outbound interface. If the flag of whether to perform NAT conversion is 1 (indicating that NAT conversion is performed), the network device 209 may determine the corresponding NAT instance according to the determined outbound interface.
- the network device 209 After the network device 209 determines the NAT instance, it can perform NAT translation (including publishing the address pool route corresponding to the NAT instance to the corresponding network node, modifying the source address of the packet to be the pre-assigned public network address and port, etc.), and in the corresponding The outgoing interface forwards packets, etc.
- NAT translation including publishing the address pool route corresponding to the NAT instance to the corresponding network node, modifying the source address of the packet to be the pre-assigned public network address and port, etc.
- the network device 209 determines that the SID is of the END.NAT type, it can determine that the message needs to be NATed.
- the network device 209 can then read the NAT instance ID (one of the first types of information) from the function field 705 in the SID of type END.NAT. Then the network device 209 can determine the NAT instance according to the NAT instance ID, and can perform NAT translation, forward packets on the corresponding outbound interface, and so on.
- the network device 209 may also perform a PSP action, remove the SRH extension header, etc., which will not be repeated in this embodiment of the present application.
- the network device 206 may add the SID of type END.NAT to the segment list where the SID of type END.X is located, then the segment list has two SIDs (including SID1 and SID2), where SID1 is END .X type SID, SID2 is END.NAT type SID. Then, the processing process of the network device 209 receiving the packet is shown in FIG. 9b. The network device 209 first determines whether SID1 is a SID of type END.X. If not, perform other processing; if yes, the network device 209 may directly determine the outbound interface corresponding to the packet according to SID1.
- the network device 209 can continue to determine whether SID2 is an END.NAT type SID, if not, perform other processing, if so, the network device 209 can determine the NAT instance according to the NAT instance ID in SID2. Then the network device 209 can perform the PSP action, remove the SRH extension header, perform NAT translation, forward the packet on the corresponding outbound interface, and so on.
- the network device 209 can determine whether the currently processed SID is an END.X type SID after receiving the packet. If not, perform other processing; if yes, the network device 209 may determine the outbound interface corresponding to the packet according to the SID. Then the network device 209 can perform the PSP action, remove the SRH extension header, and read the identification of whether to perform NAT translation (the second type of information) from the function field 705 in the SID.
- the network device 209 does not need to search for the first type of information in the message, and forwards the message according to the outbound interface corresponding to the message. If the flag of whether to perform NAT conversion is 1 (indicating that NAT conversion is performed), the network device 209 may determine the corresponding NAT instance according to the determined outbound interface. After the network device 209 determines the NAT instance, it can perform NAT translation, forward packets on the corresponding outbound interface, and the like.
- the network device 209 can determine whether the currently processed SID is an END.X type SID after receiving the message. If not, perform other processing; if yes, the network device 209 may determine the outbound interface corresponding to the packet according to the SID. The network device 209 may then perform PSP actions to remove the SRH extension header. Then, the network device 209 can read the NAT instance ID (one of the first type of information) from the function field 705 in the SID. Then the network device 209 can determine the NAT instance according to the NAT instance ID, and can perform NAT translation, forward packets on the corresponding outbound interface, and so on. If the network device 209 does not read the NAT instance ID, the network device 209 may forward the packet according to the outbound interface corresponding to the packet.
- the NAT instance ID one of the first type of information
- the network device 209 can first read the identification of whether to perform NAT translation (the second type of information) from the function field 705 in the SID of the END.X type. If the flag of whether to perform NAT conversion is 0 (indicating that NAT conversion is not performed), the network device 209 does not need to search for the first type of information from the packet. If the flag of whether to perform NAT conversion is 1 (indicating that NAT conversion is performed), the network device 209 can read the NAT instance ID (one of the first type of information) from the function field 705 in the SID of the END.X type. . Then the network device 209 can determine the NAT instance according to the NAT instance ID, and can perform NAT translation, forward packets on the corresponding outbound interface, and so on.
- the network device 209 can first read the identification of whether to perform NAT translation (the second type of information) from the function field 705 in the SID of the END.X type. If the flag of whether to perform NAT conversion is 0 (indicating that NAT conversion is
- the network device 209 may determine whether the currently processed SID is an END-type SID after receiving the message. If not, perform other processing, and if so, the network device 209 may perform a PSP action to remove the SRH extension header. Then, the network device 209 can read the NAT instance ID (one of the first type of information) from the function field 705 in the SID. Then the network device 209 can determine the NAT instance according to the NAT instance ID, and can perform NAT translation, forward packets on the corresponding outbound interface, and so on.
- the network device 209 may determine whether the currently processed SID is an END-type SID after receiving the message. If not, perform other processing, and if so, the network device 209 may perform a PSP action to remove the SRH extension header. Then, the network device 209 can read the NAT instance ID (one of the first type of information) from the function field 705 in the SID. Then the network device 209 can determine the NAT instance according to the NAT instance ID,
- the network device 209 may forward the packet according to the outbound interface corresponding to the packet. If the network device 206 also adds the identification of whether to perform NAT translation (the second type of information) when processing the message, the network device 209 can first read and analyze the identification of whether to perform the NAT translation (the second type of information).
- the network device 209 only advertises the NAT address pool route corresponding to the NAT instance to the corresponding network node (the network node 204 or the network node 205) to ensure that the path of the backhaul traffic of the ISP 203 is the same as the path of the outgoing traffic.
- the network device 209 may first determine the outgoing interface corresponding to the packet, and then forward the packet according to the outgoing interface. In practical applications, the network device 209 may also determine a neighbor corresponding to the packet (using an identifier similar to the above-mentioned link interface identifier), and then send the packet to the neighbor, which is not limited in this embodiment of the present application.
- FIG. 12 is a schematic diagram of a scenario of home broadband in an embodiment of the present application.
- the terminal 1201 accesses the broadband access server 1203 (Broadband Access Server, BRAS) through the router 1202 .
- BRAS Broadband Access Server
- the router 1202 may be a wireless router, a wired router, a switch, or the like, which is not limited in this embodiment of the present application.
- the connection between the terminal 1201 and the router 1202 may be a wireless connection, a wired connection, or the like.
- the broadband access server 1203 may be connected to a core router 1204 (core router, CR) to a provider edge router 1205 (Provider Edge, PE) or a provider edge router 1209. It can be understood that the broadband access server 1203 is similar to the network device 206 in the foregoing embodiments corresponding to FIG. 2 , the PE1205 is similar to the network device 209 in the foregoing embodiments corresponding to FIG. 2 , and the PE1209 is another egress device similar to the PE1205 .
- the broadband access server 1203, the core router 1204, the PE1205, and the PE1209 can use the SRv6 technology to select an appropriate transmission path for the packets corresponding to the high-value applications.
- the SID corresponding to the broadband access server 1203, the core router 1204, and the PE1205 can be used in the SRv6 extension header, so that the packet is transmitted according to the SID according to the corresponding SID.
- the path of the broadband access server 1203, the core router 1204, and the PE1205 is transmitted, but is not transmitted to the PE1209.
- PE1205 may perform the steps performed by the network device 209 in the foregoing embodiment, perform NAT translation on the packet, and forward the packet to the access router 1206 (Access Router, AR).
- the access router 1206 can perform the steps performed by the network node 204 in the above-mentioned embodiment, and transmit the message to the Internet Data Center 1208 (Internet Data Center, IDC) through the Industrial Internet 1207.
- the packets corresponding to low-value applications are generally transmitted to the IDC 1208 through the broadband access server 1203 , the core router 1204 , the PE 1209 , and the public Internet 1210 .
- the broadband access server 1203 When the broadband access server 1203 generates the SRv6 extension header of the message, it can use the SIDs corresponding to the broadband access server 1203, the core router 1204, and the PE1209, so that the message is transmitted according to the SID according to the broadband access server 1203, the core router 1204. , PE1209 path for transmission.
- the type of the broadband access server 1203 may be replaced by the operator edge router PE, which does not affect the implementation of the embodiments of the present application.
- the types of the foregoing network devices may be replaced according to actual needs, and the embodiments of the present application do not limit the types of the foregoing network devices.
- FIG. 13 is a schematic diagram of a network device according to an embodiment of the present application.
- the network device 1300 includes: one or more processors 1301, a memory 1303, and a communication interface 1304.
- the processor 1301, the memory 1303, and the communication interface 1304 can be connected through a communication bus 1302.
- the memory 1303 is used to store one or more programs; the one or more processors 1301 are used to run the one or more programs, so that the network device 1300 executes the methods corresponding to the foregoing method embodiments. That is, the network device 1300 may be the network device 206 , the network device 209 , or the network node 204 and the network node 205 in the method embodiment shown in FIG. 2 above.
- the processor 1301 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or may be one or more integrated circuits for implementing the solutions of the present application, such as , an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
- PLD programmable logic device
- the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof.
- the communication bus 1302 is used to transfer information between the aforementioned components.
- the communication bus 1302 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 13, 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) or other types of static storage devices that can store static information and instructions, or can be random access memory (RAM) or can store information and instructions Other types of dynamic storage devices, it can also be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage , optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage medium or other magnetic storage device, or can be used to carry or store desired program code in the form of instructions or data structures and any other medium that can be accessed by a computer, but is not limited thereto.
- the memory 1303 may exist independently and be connected to the processor 1301 through the communication bus 1302 .
- the memory 1303 may also be integrated with the processor 1301.
- the Communication interface 1304 uses any transceiver-like device for communicating with other devices or a communication network.
- 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, and the like.
- the processor 1301 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 13 .
- the network device 1300 may include multiple processors, such as the processor 1301 and the processor 1305 shown in FIG. 13 .
- processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
- a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
- the network device 1300 may further include an output device and an input device.
- the output device communicates with the processor 1301 and can display information in a variety of ways.
- the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like.
- the input device communicates with the processor 1301 and can receive user input in a variety of ways.
- the input device may be a mouse, a keyboard, a touch screen device, or a sensor device, or the like.
- the memory 1303 is used to store the program code 1310 for executing the solutions of the present application, and the processor 1301 can execute the program code 1310 stored in the memory 1303 . That is, the network device 1300 may implement the packet processing method provided by the method embodiment by using the processor 1301 and the program code 1310 in the memory 1303 .
- the network device 1300 in this embodiment of the present application may correspond to the gateway device in the foregoing method embodiments, and the processor 1301, the communication interface 1304, etc. in the network device 1300 may implement the features of the gateway device in the foregoing method embodiments. functions and/or the various steps and methods implemented. For brevity, details are not repeated here.
- the network device 1300 corresponds to the network device in the foregoing method embodiments, and each unit in the network device 1300 and the other operations and/or functions described above are respectively implemented to implement the network device 206 or the network device 209 shown in FIG. 2 above.
- the various steps and methods please refer to the above method embodiments, which are not repeated here for brevity.
- FIG. 14 is a schematic diagram of a first packet processing apparatus according to an embodiment of the present application.
- the message processing apparatus 1400 includes:
- the obtaining module 1401 is configured to perform the steps of receiving the message by the network device 209 in the respective embodiments corresponding to FIG. 3;
- the processing module 1402 is configured to perform the steps of the network device 209 in the respective embodiments corresponding to FIG. 3 to process the message, such as NAT conversion processing;
- the sending module 1403 is configured to perform the step of sending a packet by the network device 209 to the network node 204 or the network node 206 in each of the above embodiments corresponding to FIG. 3 .
- FIG. 15 is a schematic diagram of a second type of packet processing apparatus according to an embodiment of the present application.
- the message processing apparatus 1500 includes:
- the obtaining module 1501 is configured to perform the step of receiving the message by the network device 206 in the respective embodiments corresponding to FIG. 3;
- the processing module 1502 is configured to perform the steps of the network device 206 in each of the embodiments corresponding to FIG. 3 for processing packets;
- the sending module 1503 is configured to perform the steps of sending the message by the network device 206 in the above-mentioned embodiments corresponding to FIG. 3 .
- the disclosed system, apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例提供一种报文处理的方法及相关装置。该方法中,在本申请实施例中,第一网络设备可以根据分段标识SID的指示对第一报文进行NAT处理得到第二报文并转发。因此,本申请实施例可以通过分段标识SID让第一网络设备区分需要做NAT处理的数据和不需要做NAT处理的数据。而经过NAT转换处理后,第二报文的回程流量可以按照原传输路径返回,保证了回程流量按照原路返回,提高用户业务体验。
Description
本申请要求于2021年4月15日提交中国国家知识产权局、申请号为202110407564.7、申请名称为“一种报文处理的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及通信技术领域,尤其涉及一种报文处理的方法及相关装置。
随着现代通信技术的发展,各个互联网服务提供商(internet service provider,ISP)与运营商之间通常进行多种数据流量交换。例如,运营商A可以分别通过出口A和出口B向互联网服务提供商B发送数据。那么运营商A可以通过出口A向互联网服务提供商B发送高价值的数据,而通过出口B向互联网服务提供商B发送低价值的数据。
目前的技术中,对于运营商A通过出口A向互联网服务提供商B发送的高价值数据,互联网服务提供商B响应该高价值数据时可能不会通过出口A返回到运营商A,导致数据交互达不到要求。为保证互联网服务提供商B响应高价值数据时沿原路径返回报文,运营商A可以通过出口A相邻的网络设备对发出去的高价值数据对应的报文做NAT处理。
然而,运营商A通过出口A相邻的网络设备做NAT处理时,该网络设备没有合适的方法来区分需要做NAT处理的数据和不需要做NAT处理的数据,导致该方案无法实现。
发明内容
本申请实施例提供了一种报文处理的方法及相关装置,通过分段标识SID让网络设备区分需要做NAT处理的数据和不需要做NAT处理的数据,能够在网络设备改动少的情况下保证互联网服务提供商B的回程流量按照原路返回,提高用户业务体验。
第一方面,本申请实施例提供一种报文处理方法,包括:第一网络设备接收来自第二网络设备的第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述第一网络设备对所述第一报文进行网络地址转换NAT;所述第一网络设备对所述第一报文做NAT处理得到第二报文;所述第一网络设备发送所述第二报文。
在本申请实施例中,第一网络设备可以根据分段标识SID的指示对第一报文进行NAT处理得到第二报文并转发。因此,本申请实施例可以通过分段标识SID让第一网络设备区分需要做NAT处理的数据和不需要做NAT处理的数据。而经过NAT转换处理后,第二报文的回程流量可以按照原传输路径返回,保证了回程流量按照原路返回,提高用户业务体验。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备对所述第一报文做NAT处理得到第二报文包括:所述第一网络设备将所述第一报文的源地址替换为特定地址得到所述第二报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备进行NAT处理所用的NAT实例中配置有地址池,所述地址池包含所述特定地址。该实现方式使得本申请 实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备对所述第一报文做NAT处理得到第二报文之前,所述方法还包括:所述第一网络设备发布所述特定地址对应的路由。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一SID为END.XNAT类型或END.NAT类型,或所述第一SID为分段路由多协议标签交换SR MPLS标签。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一SID包含指示信息或NAT实例标识,用于指示所述第一网络设备对所述第一报文进行网络地址转换NAT。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一SID还用于指示所述第一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示所述第一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述SRH的段标识列表SID List中包含所述第一SID,或所述SRH的段标识列表SID List中包含所述第一SID和所述第二SID。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备接收来自第二网络设备的第一报文之前,所述方法还包括:所述第一网络设备建立所述第一SID和所述特定接口的关联关系或所述第一SID和所述特定邻居的关联关系;所述第一网络设备向其他网络设备发布所述第一SID。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备为运营商边缘路由器PE,所述第二网络设备为宽带接入服务器BRAS,或所述第一网络设备和所述第二网络设备均为PE。该实现方式使得本申请实施例提供的方案更具全面性。
结合第一方面,在本申请实施例的一种实现方式中,所述第一网络设备和所述第二网络设备设置在SRv6网络或SR MPLS网络。该实现方式使得本申请实施例提供的方案更具全面性。
第二方面,本申请实施例提供一种报文处理的方法,包括:第一网络设备向第二网络设备发送第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述第二网络设备对所述第一报文进行网络地址转换NAT得到第二报文并转发。
结合第二方面,在本申请实施例的一种实现方式中,所述第一SID具体用于指示所述 第二网络设备将所述第一报文的源地址替换为特定地址得到所述第二报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备在所述第一报文中压入所述第一SID。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备根据所述第一报文的目的地址确定目标网络;所述第一网络设备在所述第一报文中压入所述第一SID,所述第一SID还用于指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备根据所述第一报文的目的地址确定目标网络;所述第一网络设备在所述第一报文中压入所述第一SID和第二SID,所述第二SID用于指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备获得第一报文包括:所述第一网络设备获取来自用户侧设备的所述第一报文,或所述第一网络设备生成所述第一报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一SID为END.XNAT类型或END.NAT类型,或所述第一SID为分段路由多协议标签交换SR MPLS标签。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一SID包含指示信息或NAT实例标识,用于指示所述第二网络设备对所述第一报文进行网络地址转换NAT。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备和所述第二网 络设备为互联网网关IGW。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备为宽带接入服务器BRAS,所述第二网络设备为运营商边缘路由器PE,或所述第一网络设备和所述第二网络设备均为PE。该实现方式使得本申请实施例提供的方案更具全面性。
结合第二方面,在本申请实施例的一种实现方式中,所述第一网络设备和所述第二网络设备设置在SRv6网络或SR MPLS网络。该实现方式使得本申请实施例提供的方案更具全面性。
第三方面,本申请实施例提供一种报文处理的装置,包括:获取模块,用于接收来自另一网络设备的第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述处理模块对所述第一报文进行网络地址转换NAT处理;处理模块,用于根据所述第一SID的指示对所述第一报文做NAT处理得到第二报文;发送模块,用于发送所述第二报文。
结合第三方面,在本申请实施例的一种实现方式中,所述处理模块还用于将所述第一报文的源地址替换为特定地址得到所述第二报文。
结合第三方面,在本申请实施例的一种实现方式中,发送模块还用于发布所述特定地址对应的路由。
结合第三方面,在本申请实施例的一种实现方式中,处理模块进行NAT处理所用的NAT实例中配置有地址池,所述地址池包含所述特定地址。
结合第三方面,在本申请实施例的一种实现方式中,所述第一SID为END.XNAT SID或END.NAT SID,或所述第一SID为分段路由多协议标签交换SR MPLS标签。
结合第三方面,在本申请实施例的一种实现方式中,所述第一SID包含指示信息或NAT实例标识,用于指示所述处理模块对所述第一报文进行网络地址转换NAT。
结合第三方面,在本申请实施例的一种实现方式中,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。
结合第三方面,在本申请实施例的一种实现方式中,所述第一SID还用于指示发送模块从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
结合第三方面,在本申请实施例的一种实现方式中,所述第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示所述发送模块从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
结合第三方面,在本申请实施例的一种实现方式中,所述SRH的段标识列表SID List中包含所述第一SID,或所述SRH的段标识列表SID List中包含所述第一SID和所述第二SID。
结合第三方面,在本申请实施例的一种实现方式中,所述处理模块还用于建立所述第一SID和所述特定接口的关联关系或所述第一SID和所述特定邻居的关联关系;发送模块还用于向其他网络设备发布所述第一SID。
结合第三方面,在本申请实施例的一种实现方式中,该报文处理的装置为互联网网关IGW。
结合第三方面,在本申请实施例的一种实现方式中,该报文处理的装置为运营商边缘 路由器PE,另一网络设备为宽带接入服务器BRAS,或该报文处理的装置和另一网络设备均为PE。
结合第三方面,在本申请实施例的一种实现方式中,该报文处理的装置设置在SRv6网络或SR MPLS网络。
第四方面,本申请实施例提供一种报文处理的装置,包括:获取模块,用于获得第一报文;发送模块,用于向另一网络设备发送所述第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述另一网络设备对所述第一报文进行网络地址转换NAT得到第二报文并转发。
结合第四方面,在本申请实施例的一种实现方式中,所述第一SID具体用于指示所述另一网络设备将所述第一报文的源地址替换为特定地址得到所述第二报文。
结合第四方面,在本申请实施例的一种实现方式中,处理模块还用于识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则处理模块在所述第一报文中压入所述第一SID。
结合第四方面,在本申请实施例的一种实现方式中,处理模块还用于识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则处理模块根据所述第一报文的目的地址确定目标网络;在所述第一报文中压入所述第一SID,所述第一SID还用于指示另一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。
结合第四方面,在本申请实施例的一种实现方式中,处理模块还用于识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则处理模块根据所述第一报文的目的地址确定目标网络;在所述第一报文中压入所述第一SID和第二SID,所述第二SID用于指示另一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。
结合第四方面,在本申请实施例的一种实现方式中,获取模块用于获取来自用户侧设备的所述第一报文,或生成所述第一报文。
结合第四方面,在本申请实施例的一种实现方式中,所述第一SID为END.XNAT类型或END.NAT类型,或所述第一SID为分段路由多协议标签交换SR MPLS标签。
结合第四方面,在本申请实施例的一种实现方式中,所述第一SID包含指示信息或NAT实例标识,用于指示另一网络设备对所述第一报文进行网络地址转换NAT。
结合第四方面,在本申请实施例的一种实现方式中,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。
结合第四方面,在本申请实施例的一种实现方式中,获取模块用于接收所述第二网络设备通告的所述第一SID;处理模块还用于建立所述第一SID与目标地址之间的关联关系。
结合第四方面,在本申请实施例的一种实现方式中,第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示另一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
结合第四方面,在本申请实施例的一种实现方式中,该报文处理的装置和另一网络设 备为互联网网关IGW。
结合第四方面,在本申请实施例的一种实现方式中,该报文处理的装置为宽带接入服务器BRAS,另一网络设备为运营商边缘路由器PE,或该报文处理的装置和另一网络设备均为PE。
结合第四方面,在本申请实施例的一种实现方式中,该报文处理的装置和另一网络设备设置在SRv6网络或SR MPLS网络。第五方面,本申请实施例提供一种网络设备,网络设备包括一个或一个以上中央处理器,存储器,通信总线,通信接口;存储器为短暂存储存储器或持久存储存储器,存储器中存储有程序代码;通信接口用于收发数据;中央处理器通过通信总线与存储器通信,在网络设备上执行存储器中的程序代码以执行如第一方面的方法。
第五方面,本申请实施例提供一种网络设备,网络设备包括一个或一个以上中央处理器,存储器,通信总线,通信接口;存储器为短暂存储存储器或持久存储存储器,存储器中存储有程序代码;通信接口用于收发数据;中央处理器通过通信总线与存储器通信,在网络设备上执行存储器中的程序代码以执行如第二方面的方法。
第六方面,本申请实施例提供一种报文处理的系统,该系统包括如第五方面的网络设备和第六方面的网络设备。
第七方面,本申请实施例提供一种计算机可读存储介质,包括指令,当指令在计算机上运行时,使得计算机设备执行如第一方面的方法。
图1为本申请实施例提供的终端访问互联网服务提供商的示意图;
图2为本申请实施例提供的系统架构示意图;
图3为本申请实施例提供的一种报文处理的方法的流程图;
图4为本申请实施例提供的终端201运行ISP203运营的应用程序的界面示意图;
图5为本申请实施例提供的账号注册成功的界面图;
图6a为本申请实施例中NAT转换的示意图;
图6b为本申请实施例提供的高价值应用对应报文传输的信令图;
图7a为SRv6技术中IPv6报文的示意图;
图7b为IPv6报文中一个SID的示意图;
图8为本申请实施例提供的处理报文的流程图之一;
图9a为本申请实施例提供的处理报文的流程图之二;
图9b为本申请实施例提供的处理报文的流程图之三;
图10a为本申请实施例提供的处理报文的流程图之四;
图10b为本申请实施例提供的处理报文的流程图之五;
图11为本申请实施例提供的处理报文的流程图之六;
图12为本申请实施例中家庭宽带的场景示意图;
图13为本申请实施例提供的一种网络设备的示意图;
图14为本申请实施例提供的第一种报文处理的装置的示意图;
图15为本申请实施例提供的第二种报文处理的装置的示意图。
本申请实施例提供了一种报文处理的方法及相关装置,通过分段标识SID让网络设备区分需要做NAT处理的数据和不需要做NAT处理的数据,能够在网络设备改动少的情况下保证互联网服务提供商B的回程流量按照原路返回,提高用户业务体验。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“对应于”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
为了下述各实施例的描述清楚简洁,首先给出相关技术的简要介绍:
图1为本申请实施例提供的终端访问互联网服务提供商的示意图。如图1所示,终端101通过通信系统102访问互联网服务提供商103的资源,并进行数据交互。
在本申请实施例中所提及的终端101又称之为用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、终端设备等,是一种向用户提供语音和/或数据连通性的设备,或,设置于该设备内的芯片,例如,具有无线连接功率允许的手持式设备、车载设备等。终端可以包括但不限于:具有无线通信功能的手持式设备、车载设备、可穿戴设备、计算设备、连接到无线调制解调器的其它处理设备、手机(mobile phone)、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、机器类型通信终端、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。
在本申请实施例中所提及的通信系统102可以是2G网络的基站接入系统,3G网络的基站接入系统,4G网络的基站接入系统,5G网络的基站接入系统等。该通信系统可以包括一个或多个网络设备。网络设备可以是任意一种具有网络数据收发功能的设备。网络设备包括但不限于:基站(例如基站BS,基站NodeB、演进型基站eNodeB或eNB、第五代5G 通信系统中的基站gNodeB或gNB、未来通信系统中的基站、WiFi系统中的接入节点、无线中继节点、无线回传节点),网络节点,通信节点等。基站可以是:宏基站,微基站,微微基站,小站,中继站等。而网络节点可以是互联网网关(Internet Gateway,IGW)、工作站、网络用户设备或个人计算机,还可以是服务器和其他网络连接的设备。在通信系统中,网络设备之间的连接可以是有线连接,也可以是无线连接,本申请实施例对此不做限定。
可以理解的是,通信系统102可以由运营商来运营。示例性的,通信系统102由运营商A来运营。运营商一般是指提供网络服务的供应商。
可以理解的是,网络节点104和网络节点105可以是中转对等体(Transit Peer),即运营商与上一级ISP之间的节点。运营商A运营的通信系统102可以通过网络节点104和网络节点105访问ISP103的资源。通常,运营商A可以向ISP103购买连接,以流量或带宽进行结算。其中,有的连接通过网络节点104承载,以流量结算。有的连接可以通过网络节点105承载,网络节点105通常是性能一般的节点,ISP103可以通过网络节点105给运营商提供免费的连接。示例性的,网络节点105可以为互联网交换点(Internet Exchange Point,IXP),IXP由第三方中心运营,各运营商可以连接到IXP,实现相互之间的流量交换,IXP为免费连接。例如,IXP可以包括但不限于阿姆斯特丹互联网交换中心(AMS-IX)、香港互联网交换中心(HKIX)等。或者,网络节点104和网络节点105也可以称为外部边界网关协议对等体(external border gateway protocol peer,EBGP Peer)。
在实际应用中,运营商A运营的通信系统102还可以通过其他出口和其他中转对等体连接其他ISP或者其他运营商运营的通信系统,而ISP103也可以通过网络节点105或其他网络节点连接其他运营商或其他ISP,本申请实施例对此不做限定。
如图1所示,当用户使用终端101上的高价值应用程序(application,APP)时,终端101与ISP103交互数据,来支持该高价值APP的运行。示例性的,某一款游戏APP由ISP103提供服务,那么当用户通过终端101运行该游戏APP时,需要与ISP103进行数据交互。而由于游戏APP需要较低的延时,因此在本申请实施例中游戏APP为高价值APP。终端101运行该游戏APP所产生的数据一般通过通信系统102的A出口传输,经过网络节点104,最后到达ISP103,而ISP103产生的与该游戏APP相关的数据需要经过网络节点104、A出口和通信系统102到达终端101。
可以理解的是,终端101往往不仅运行一个高价值APP,而是很可能运行有多个APP,其中包括高价值APP和低价值APP,这些APP的网络数据均可能需要与ISP103交互或者是经过通信系统102、ISP103。同时,网络节点104通常是能够提供更好的网络传输服务(例如低延时、速度快等)的节点,而网络节点105通常是较为普通的免费节点。因此,一般希望,高价值APP相关的数据在通信系统102和ISP103之间传输时,经过A出口和网络节点104来回;而低价值APP相关的数据在通信系统102和ISP103之间传输时,经过B出口和网络节点105来回。
然而,现有的技术无法实现上述要求。有鉴于此,本申请实施例提供一种报文处理的方法,该方法可应用在如图2所示的系统架构上。请参阅图2,图2为本申请实施例提供的系统架构示意图。
如图2所示,该系统架构中,终端201使用ISP203运营的应用程序时,终端201与ISP203交换数据,终端201发送的数据经过某运营商运营的通信系统202到达ISP203,ISP203反馈的数据经过通信系统202返回到终端201。其中,通信系统202中包括网络设备206、网络设备207、网络设备208、网络设备209、网络设备210、网络设备211。通信系统202通过出口A、网络节点204与ISP203通信连接,或者通信系统202通过出口B、网络节点205与ISP203通信连接。
图2所示的系统架构中,终端201与前述图1对应的描述中的终端101类似,通信系统202与前述图1对应的描述中的通信系统102类似,ISP203与前述图1对应的描述中的ISP103,网络节点204与前述图1对应的描述中的网络节点104类似,网络节点205与前述图1对应的描述中的网络节点105类似,此处不再赘述。网络设备206、网络设备207、网络设备208、网络设备209、网络设备210、网络设备211为通信系统202的内部网络节点,用于实现通信系统202中的数据传输。
基于图2所示的系统架构,本申请实施例提供一种报文处理的方法如图3所示,该方法包括以下步骤:
301、网络设备206接收终端201发送的报文,通过应用检测方法识别报文对应的应用;
在本申请实施例中,报文是终端201发送的数据的一种形式,是网络中交换与传输的数据单元。在实际应用中,数据也可能是数据包、数据块等形式,本申请实施例对此不做限定。在本申请实施例中,网络设备206接收到的报文可以是终端201发送的。在实际应用中,网络设备206接收到的报文还可以是其他网络设备发送的,本申请实施例对此不作限定。在一些情况下,网络设备206还可能根据自身接收到的信息数据来生成报文,本申请实施例对此不做限定。
当用户使用终端201上的ISP203运营的应用程序时,一般会产生与ISP203交互的数据,例如用户点击了某个按钮,则触发终端201将该按钮对应的指令通过报文发送给ISP203。具体地,如图4所示,图4为终端201运行ISP203运营的应用程序的界面示意图。图4中用户可以先输入手机号,然后点击“获取验证码”按钮。终端201受“获取验证码”按钮的点击触发,获取到用户输入的手机号,并生成请求验证码的指令(该指令可以包括该手机号以及请求的标识等)放入报文中,然后将报文通过通信系统202发送到ISP203。一般地,ISP203接收到该指令后,可以向该手机号发送短信验证码。用户通过该手机号接收到验证码之后,可以在如图4所示的界面中输入验证码以及注册密码,然后点击注册。同理,终端201受“注册”按钮的点击触发,获取到用户输入的手机号、验证码、注册密码等信息,并生成注册账号的指令(该指令可以包括手机号、验证码、注册密码等信息)放入报文中,然后将报文通过通信系统202发送到ISP203。ISP203收到该报文后可以核对验证码是否与之前ISP203发送出去的验证码是否相同,若相同,则ISP203可以根据该报文中的手机号、注册密码等信息完成账号注册。账号注册完成后,ISP203可以通过通信系统202向终端201发送包含注册成功标识的报文,该注册成功标识用于表示账号成功注册。终端接收到该报文后,可以在界面上显示注册成功,如图5所示(图5为本申请实施例提供的账号注册成功的界面图)。
上述过程中,终端201通过通信系统202向ISP203发送的报文,首先可以传输到通信系统202中的网络设备206。网络设备206接收到该报文后,可以根据该报文,通过应用检测方法识别报文对应的应用。应用检测方法可以分析报文中的信息从而确定该报文对应的应用。示例性的,该报文是终端201运行应用程序A产生的,则网络设备206通过应用检测方法可以分析报文中的信息从而确定该报文对应的应用为应用程序A。具体地,该应用检测方法可以是深度报文检测(Deep Packet Inspection,DPI)、深度/动态流检测(Deep/Dynamic Flow Inspection,DFP)、访问控制列表(Access Control List,ACL)匹配规则(或称基于五元组信息的匹配规则)等,本申请实施例对选用何种应用检测方法不做限定。
示例性的,网络设备206接收到报文A和报文B,则网络设备206可以通过应用检测方法分别检测到报文A对应的应用为应用程序A,报文B对应的应用为应用程序B。在一些实施例中,网络设备206可以直接识别这些报文对应的应用是高价值应用或低价值应用,即报文对应的应用仅有两种类别,一种是高价值应用,一种是低价值应用,网络设备206并不识别报文对应的应用具体是什么应用,而是直接识别报文对应的应用是高价值应用或低价值应用。而在另一些实施例中,网络设备206可以先识别报文对应的应用是何种类型的应用,在确定该报文对应的应用是高价值应用或低价值应用。例如,网络设备206可以先识别某一报文的类型是游戏类型,再根据应用类型与应用价值(高价值或低价值)的关系确定游戏类型的应用是高价值应用,则该报文对应的应用是高价值应用。在实际应用中,网络设备206还可能直接识别应用程序的名称,然后根据应用程序的名称与应用价值(高价值或低价值)的关系确定该名称对应是高价值应用还是低价值应用,从而确定报文对应的应用是高价值应用或低价值应用。综合上述情况,网络设备206最终能够识别报文对应的应用是高价值应用或低价值应用即可,本申请实施例对其中的过程不做限定。
在本申请实施例中,ISP203运营的应用程序可以是游戏类型的应用程序,也可以是商业平台类型的应用程序,或者是在线视频播放类型的应用程序,本申请实施例对应用程序的类型不做限定。
上述为网络设备206识别应用类型的方法,在实际应用中,网络设备206还可以识别报文的业务流类型,业务流类型包括视频流、音频流等,识别方法与上述网络设备206识别应用类型的方法类似,此处不再赘述。
302、网络设备206确定该报文对应的出接口;
在本申请实施例中,网络设备206首先可以从报文中读取到报文的目标IP地址,结合预置的ISP IP地址段,确定该报文所要传输到达的ISP。示例性的,IP1-IP2归属地位于A ISP,IP3-IP4归属地位于C ISP,若报文的目标IP地址在IP3-IP4内,则报文所要传输到达的ISP为C ISP。IP地址归属地信息(IP地址段与ISP的关联关系)可通过购买专用的IP地址库(比如IPIP.net、ip2location)来得到。当然,IP地址归属地信息也还可以通过其他渠道获得,本申请实施例对此不做限定。
然后,网络设备206可以结合报文所要传输到达的ISP以及步骤301确定的报文对应的应用来确定该报文对应的出接口。示例性的,如图2对应的系统架构中,通信系统202 通过出口A和网络节点204与ISP203通信,或者通过出口B和网络节点205与ISP203通信。其中,出口A和网络节点204一般用于传输高价值应用对应的报文,出口B和网络节点205一般用于传输低价值应用对应的报文。因此,网络设备206确定某一报文所要传输到达的ISP为ISP203,且该报文对应的应用为高价值应用时,网络设备206可以确定该报文对应的出口为出口A。同理,若网络设备206确定报文所要传输到达的ISP为ISP203且该报文对应的应用为低价值应用时,网络设备可以确定报文对应的出口为出口B。
303、网络设备206根据报文对应的应用及出口,将NAT转换的相关信息放入报文中,并向网络设备209转发。
网络地址转换NAT(network address translation)是一种IP地址共享技术,可以实现多用户共享少量公网Ipv4地址访问外部网络。在本申请实施例中,NAT转换可以是指通信系统202与ISP203数据传输过程中,邻近出口A和出口B的网络设备209以及网络节点204对报文做的处理,使得报文来回通道一致。具体地,该处理可以由图6a和图6b进行解释。图6a为本申请实施例中NAT转换的示意图。图6b为高价值应用对应报文传输的信令图。
在本申请实施例中,网络设备209接收到用户上传的报文后,根据该报文中NAT转换的相关信息可以确定该报文对应的出口,从而将该报文按照对应的出口转发出去。而网络节点204可以根据本申请实施例以下列几种情况进行详细的描述:
情况一、网络设备209确定该用户上传的报文对应的出口为出口A,那么网络设备209可以通过出口A将该报文转发出去。网络设备209可以将该报文的源地址修改为特定地址,即NAT地址池中的特定地址(网络设备209进行NAT转换所用的NAT实例中配置有地址池,该地址池中包括若干个特定地址),即预先分配好的公网地址和端口(该公网地址和端口可以为网络设备209对应的公网地址和端口),然后再将该报文转发到网络节点204。具体地,网络设备209可以通过重定向的方式将该报文通过出口A转发出去,从而到达网络节点204。网络节点204按照该报文的目的地址将该报文转发到ISP203。ISP203接收到该报文后,对该报文进行处理,可以生成针对该报文的响应报文。一般地,ISP203会根据该报文的源地址来进行报文的原路返回,而该报文的源地址已经被修改为预先分配好的公网地址和端口,因此ISP203可以将响应报文的目标地址设定为该报文的源地址,使得该响应报文向网络设备209传输。可以理解的是,网络设备209预先只将NAT地址池路由发布给网络节点204(因为网络节点204是NAT地址池中的特定地址对应的路由),而没有发布给网络节点205,因此目标地址为上述公网地址和端口的响应报文仅会通过网络节点204返回网络设备209,保证了响应报文的返回路径,即保证了ISP203发送回程流量时的路径是高价值应用报文所走的路径(即网络设备204和出口A对应的路径)。
情况二、网络设备209确定该用户上传的报文对应的出口为出口B,则网络设备209可以将该报文的源地址修改为特定地址,即NAT地址池中的特定地址(网络设备209进行NAT转换所用的NAT实例中配置有地址池,该地址池中包括若干个特定地址),即预先分配好的公网地址和端口(该公网地址和端口一般为网络设备209对应的公网地址和端口),然后可以通过重定向的方式将该报文通过出口B转发出去,从而到达网络节点205。并且, 网络设备209只将NAT地址池路由发布给网络节点205(因为网络节点205是NAT地址池中的特定地址对应的路由),网络节点205接收到该报文后,可以将该报文转发到ISP203。ISP203接收到该报文后,对该报文进行处理,可以生成针对该报文的响应报文。由于报文的源地址已经被修改为预先分配好的公网地址和端口,因此ISP203可以将响应报文的目标地址设定为该报文的源地址,使得该响应报文向网络设备209传输。且相应的NAT地址池路由只在网络节点205中,不在网络节点204,因此该响应报文仅会通过网络节点205返回网络设备209,保证了响应报文的返回路径,即保证了ISP203发送回程流量时的路径是低价值应用报文所走的路径(即网络设备205和出口B对应的路径)。
可以理解的是,上述情况中,NAT地址池路由、公网地址和端口等信息可以预先保存在网络设备209中,具体可以以NAT实例的方式保存。网络设备209确定报文的出接口后,根据该出接口可以确定对应的NAT实例,从而获取到相关信息。NAT实例的示例如下:
nat instance nat1 id 1
port-range 1024
service-instance-group group1
nat address-group address-group1 group-id 1
section 1 11.11.11.101 11.11.11.105
上述NAT实例中,“nat instance nat1id 1”的含义是定义NAT实例nat1的编号id为1,“port-range 1024”的含义是NAT实例中使用的端口段,“service-instance-group group1”为NAT实例所使用的CPU组是group1,“nat address-group address-group1group-id 1”的含义是NAT地址池路由(NAT公网地址池)的定义,“section 1”表示NAT地址池中的第一组NAT公网地址段为11.11.11.101到11.11.11.105。
根据上述NAT实例,在网络设备209确定报文对应的出接口(出口A或出口B)后,网络设备209可以对对应的网络节点分配NAT地址池路由,然后将NAT地址池路由发送给对应网络节点(网络节点204或网络节点205),保证了响应报文的返回路径,即保证了ISP203发送回程流量时的路径是用户上传报文时,报文所走的路径。
在另一些情况中,网络设备209可以从用户上传的报文中获得NAT实例ID,然后根据该NAT实例ID找到对应的NAT实例,如下情况:
情况三,该用户上传的报文没有直接指定出口,而是给出了NAT实例ID,那么网络设备209一般认为带有NAT实例ID的报文为高价值应用对应的报文,因此可以确定该报文对应的出接口为出口A。然后网络设备209可以将报文发送给出口A对应的网络节点204。
在一些实施例中(一般是用户上传的报文没有直接指定出口的实施例中),NAT实例还可以带有重定向的信息,如下:
system-view
nat instance cpel id 1
redirect ip-nexthop 192.168.1.1 outbound
其中,“system-view”表示系统方面,“nat instance cpel id 1”表示定义重定向的 id为1,“redirect ip-nexthop 192.168.1.1 outbound”表示该重定向配置上行方向(即用户上传的报文传输方向)重定向到下一跳的的IP地址为192.168.1.1。
在网络节点204对应IP地址为192.168.1.1的情况下,根据上述重定向方式,网络设备209可以根据NAT实例ID找到存储器中对应的NAT实例,然后根据NAT实例中的重定向的信息,通过重定向的方法将报文发送给网络节点204。
并且,网络设备209可以将NAT地址池路由发布给网络节点204,保证ISP203的响应报文的返回路径,即保证ISP203发送回程流量时的路径是高价值应用报文所走的路径。
情况四,该用户上传的报文既指定了出口,又给出了NAT实例ID。那么网络设备209可以根据该报文确定出口,然后网络设备209可以根据该NAT实例ID在存储器中找到对应的NAT实例,然后通过重定向的方法将报文发送给对应网络节点,以及NAT地址池路由发布给对应网络节点,保证ISP203的响应报文的返回路径。
在一些情况中,网络设备209既可以从用户上传的报文中获得NAT实例ID来确定NAT实例,也可以确定用户上传的报文对应的出接口后确定NAT实例,那么网络设备209可以根据预先的人工设置优先选择根据NAT实例ID确定的NAT实例。当然也不排除网络设备209优先选择根据出接口确定的NAT实例的情况,本申请实施例对此不做限定。
根据上述对NAT转换的描述可知,网络设备209可以在用户上传的报文中获得对应出口的信息。在一些情况下,网络设备209也可以在用户上传的报文中获得NAT实例ID。因此,网络设备206一般会根据报文对应的应用及出口,将相关信息放入用户上传的报文中。该相关信息一般包括三类,如下:
第一类信息是用于确定NAT实例的信息。该第一类信息可以是NAT实例ID或者是链路接口标识(也可以称为指示信息)。其中,当第一类信息是NAT实例ID时,网络设备209可以根据NAT实例ID确定NAT实例。在一般情况下,网络设备209检测到报文中带有NAT实例ID时,可以确定该报文是高价值应用对应的报文,则选择对应的出口A进行报文转发。在一些情况下,网络设备209根据NAT实例ID确定NAT实例后,该NAT实例中带有重定向的信息,则网络设备209可以按照重定向的信息进行报文转发(使得报文按照预定出接口转发)。
另一种情况是,当第一类信息是链路接口标识时,网络设备209可以根据链路接口标识确定报文对应的出接口。示例性的,链路接口标识为1表示报文对应的出接口为出口A,链路接口标识为2表示报文对应的出接口为出口B等,本申请实施例对此不做限定。然后,网络设备209可以从存储器中读取与链路接口标识对应的NAT实例。示例性的,链路接口标识为1对应的NAT实例为NAT实例1,链路接口标识为2对应的NAT实例为NAT实例2。因此,通过第一类信息,网络设备209可以确定NAT实例,并且完成后续的NAT转换。
可以理解的是,本申请实施例不排除第一类信息为NAT实例本身的情况。当第一类信息为NAT实例本身时,网络设备209能够直接从报文读取到相关信息。本申请实施例中第一类信息主要是能够确定NAT实例的信息,在实际应用中,还可能是第一类信息携带NAT实例ID,而NAT实例通过其他报文发送等方式,因此本申请实施例对第一类信息的具体内容不做限定。
第二类信息是表示是否进行NAT转换的标识。示例性的,第二类信息为0,则表示不进行NAT转换,第二类信息为1,则表示进行NAT转换。因此,网络设备209获取到用户上传的报文后,可以先从报文中获取第二类信息,若第二类信息表示不进行NAT转换,则网络设备209无需再从报文中搜寻第一类信息,节省了网络设备209的处理步骤,提高了报文处理效率。若第二类信息表示进行NAT转换,则网络设备209可以直接从预设位置读取到第一类信息,无需对信息进行校验(判断其是否为第一类信息),节省了网络设备209的处理步骤,提高了报文处理效率。
在实际应用中,网络设备206可以通过在基于IPv6的源路由(segment routing over IPv6,SRv6)技术中,报文的SRv6拓展头中的段身份标识号(segment identity document,SID)来携带上述第一类信息或上述两类信息。如图7a所示,IPv6报文可以分为多段,包括IPv6报文头701、SRv6拓展头702和负载703(playload,即报文的具体内容),其中,IPv6报文头701中的版本字段表示当前报文支持的协议版本,源地址(source address,SA)表示该报文的来源地址,目标地址(destination address,DA)表示该报文期望到达的设备的地址。SRv6拓展头702包括一些基本信息(图7a中以…表示)以及多个段标识列表(SID list)。段列表可以包括一个或多个SID字段,SID list用于标识一个报文转发路径。可以选的,在本申请实施例中最后一个SID是用于指示网络设备209做NAT转换处理的SID。一个段标识列表SID List包括一个SID或多个SID,如图7b所示。SID可以理解为报文的SRv6拓展头中的一段信息,用于标识转发路径上的一个节点或链路。SID一般包括三部分,位置(locator)字段704、功能(function)字段705和参数(argument)字段706。具体地,网络设备206可以通过以下方式将信息放入报文中:
方式一,网络设备206可以采用新定义的SID类型——END.XNAT。该END.XNAT类型的SID的功能字段705的功能是让报文从设备指定链路转发(如连接网络节点204的物理链路),且指定转发时是否做NAT转换。功能字段705可以包括链路接口标识(第一类信息的其中一种)和是否进行NAT转换的标识(第二类信息)。示例性的,网络设备206确定报文的出接口为出口A,且该报文为高价值应用对应的报文时,网络设备206可以设置该报文中SRv6拓展头中其中一个SID(一般是最后一个SID)为END.XNAT类型的SID,且该SID中功能字段705的链路接口标识为1(表示报文对应的出接口为出口A),是否进行NAT转换的标识为1(表示进行NAT转换)。示例性的,网络设备206确定报文的出接口为出口B,且该报文为低价值应用对应的报文时,网络设备206可以设置该报文中SRv6拓展头中其中一个SID(一般是最后一个SID)为END.XNAT类型的SID,且该SID中功能字段705的链路接口标识为2(表示报文对应的出接口为出口B),是否进行NAT转换的标识为0(表示不进行NAT转换)。
可以理解的是,在本申请实施例中,是否进行NAT转换的标识可以用0或1来表示是否做NAT转换,在实际应用中,还可以用其他数字符号,或者用该标识的有无来表示是否做NAT转换,本申请实施例对此不做限定。链路接口标识类似,此处不再赘述。
方式二,网络设备206可以采用新定义的SID类型——END.NAT。该END.NAT类型的SID的功能字段705的功能是指明该报文要做NAT转换(第二类信息),且功能字段705中 携带有NAT示例ID(第一类信息的其中一种)。示例性的,网络设备206确定报文的出接口为出口A,且该报文为高价值应用对应的报文时,网络设备206可以设置该报文中SRv6拓展头中其中一个SID(一般是最后一个SID)为END.NAT,且该SID中功能字段705携带NAT实例ID为123(网络设备209接收到该报文后可以根据该NAT实例ID123找到对应的NAT实例)。示例性的,网络设备206确定报文的出接口为出口B,且该报文为低价值应用对应的报文时,网络设备206可以设置该报文中SRv6拓展头中最后一个SID为普通类型的SID,而不是END.NAT这种类型,使得网络设备209接收到该报文后可以按照传统方案转发(一般是通过免费的出口B和网络节点205转发)。
在一些实施例中,网络设备206可以将END.NAT类型的SID添加到END.X类型的SID所在的段标识列表SID List中,则该SID List有两个SID(包括SID1和SID2),其中SID1为END.X类型的SID,用于指示报文的出接口或报文的下一个邻居,SID2为END.NAT类型的SID,用于携带NAT示例ID。则网络设备209接收到该报文后,可以根据SID2对报文进行NAT转换处理,根据SID1从特定接口发送做了NAT转换处理的报文,或向特定邻居发送该做了NAT转换处理的报文。
方式三,网络设备206可以采用传统SID类型——END.X,并新增这类SID中参数字段706的定义。第一种定义是在参数字段706中定义一个是否进行NAT转换的标识(第二类信息)。而由于END.X这种SID类型可以指定出接口,因此实际上这种类型的SID已包含链路接口标识(第一类信息的其中一种)。网络设备206可以根据报文为高价值应用或低价值应用对应的报文,以及报文对应的出接口来确定第一类信息和第二类信息,然后根据第一类信息和第二类信息生成包括参数字段706中新定义参数的END.X类型的SID。网络设备209从报文中读取到该SID后可以分析得到第一类信息和第二类信息,从而做NAT转换处理以及按照对应出接口转发该报文。具体示例与前述方式一类似,此处不再赘述。
第二种定义是在参数字段706中定义一个参数,该参数即NAT实例的ID(第一类信息的其中一种)。在网络设备206确定了报文是高价值应用对应报文还是低价值应用对应报文,以及报文对应的出接口后,网络设备206可以确定NAT实例ID,然后根据报文对应的出接口和NAT实例ID生成参数字段706中包括NAT实例ID的END.X类型的SID,并生成对应报文转发出去。而在网络设备209接收到这种类型的报文之后,虽然END.X这种SID类型可以指定出接口,但网络设备209接收到这种类型的报文后可以不按照该出接口来确定NAT实例,而是直接根据参数字段706中的NAT实例的ID来确定NAT实例。网络设备209可以按照SID指定的出接口来转发报文。
在实际应用中,通信系统202可以采用上述第一种定义对应的技术方案,也可以采用上述第二种定义对应的技术方案,还可以采用上述两种技术方案结合的方式,即该SID的参数字段706中既包括是否进行NAT转换的标识(第二类信息),也包括NAT实例的ID(第一类信息的其中一种)。则网络设备206可以在确定报文是高价值应用对应报文还是低价值应用对应报文,以及报文对应的出接口后确定是否进行NAT转换以及NAT实例ID(若不进行NAT转换,NAT实例ID可以为空或者是协议约定的表示无NAT实例ID的0)。网络设备209则可以从报文中读取到第一类信息和第二类信息,从而做NAT转换处理以及按照对应 出接口转发该报文。具体示例与前述方式类似,此处不再赘述。
方式四,网络设备206可以采用传统SID类型——END,并新增这类SID中参数字段706的定义。该定义是在参数字段706中定义一个参数,该参数即NAT实例的ID(第一类信息的其中一种)。在网络设备206确定了报文是高价值应用对应报文还是低价值应用对应报文,以及报文对应的出接口后,网络设备206可以确定NAT实例ID,然后根据报文对应的出接口和NAT实例ID生成参数字段706中包括NAT实例ID的END类型的SID,其中,报文对应的出接口可以通过NAT实例ID对应的NAT实例确定。例如,网络设备209接收到该报文后,可以从参数字段706中获得NAT实例ID,然后确定NAT实例。最后,根据NAT实例确定报文对应的出接口以及处理NAT转换。
在一些情况下,网络设备206采用方式四处理报文时,也可以在参数字段706中新定义一个参数为是否进行NAT转换的标识(第二类信息),与前述方式三采用两种定义类似,此处不再赘述。可以理解的是,网络设备209可以预先建立了SID与特定接口(报文出接口)的关联关系,然后对外(即对通信系统的其他网络设备)发布该SID。网络设备206接收到该SID后,可以建立该SID与目标地址之间的关联关系。则当网络设备206接收到报文后,可以根据报文你的目标地址确定对应的SID和特定接口,以采用上述方式生成合适的SID并压入报文(的SID List)中。而由于网络设备209预先建立了SID与特定接口(报文出接口)的关联关系,因此当网络设备209接收到该SID后,可以确定该SID对应的特定接口,然后通过该特定接口转发该报文。在另一种情况下,网络设备209可以预先建立SID与特定邻居之间的关联关系,然后对外发布该SID,原理类似,此处不再赘述。
上述四种方式是本申请实施例提供的一些应用例,在实际应用中,还可能存在其他方式来实现本方案,例如在分段路由多协议标签交换SR MPLS场景下,网络设备206可以采用SR MPLS标签来实现上述方案,本申请实施例对此不做限定。
在网络设备206根据报文对应的应用及出口,将NAT转换的相关信息放入报文中后,网络设备206可以向网络设备209发送该报文。可以理解的是,网络设备206与网络设备209之间可能存在多个网络设备(网络设备207、网络设备208、网络设备210、网络设备211),因此网络设备206与网络设备209之间可能存在多种通信路径。因此,网络设备206与网络设备209之间可以通过SRv6隧道技术选择通信效果较好的路径来传输高价值应用对应的报文,选择费用较低,通信效果一般的路径来传输低价值应用对应的报文。可以理解的是,网络设备206可以是SRv6隧道的入口设备,网络设备209可以是SRv6隧道的出口设备。本申请实施例通过SRv6隧道传输高价值应用对应的报文,那么仅需在入口设备和出口设备进行配置即可,避免了其他网络设备的改动,设备改造成本低。
具体地,在采用SRv6技术时,网络设备206在生成该报文的SRv6拓展报文头时,可以将通信效果较好的传输路径的网络设备对应的SID放入SRv6拓展报文头中,使得报文按照SRv6拓展报文头传输时可以在这些SID对应的路径传输。同时,在网络设备206生成该报文的SRv6拓展报文头时,网络设备206可以将NAT转换的相关信息放入SRv6拓展报文头的尾部SID中,使得报文到达尾部SID对应的网络设备(一般是出口设备,类似图2对应的各个实施例中的网络设备209)后,能够按照步骤304处理。以下将对步骤304进行 详细的介绍。
304、网络设备209接收到该报文后,按照报文中的信息进行NAT转换,并将报文通过对应的出接口转发出去。
在本申请实施例中,网络设备209接收到该报文后,可以从该报文中获取到第一类信息,然后根据第一类信息确定NAT实例,则可以根据NAT实例进行NAT转换。当第一类信息是链路接口标识时,网络设备209可以直接根据链路接口标识确定报文对应的出接口,最后通过该报文对应的出接口将该报文转发出去。当第一类信息是NAT实例ID时,网络设备209可以根据NAT实例ID确定NAT实例,然后根据NAT实例中的重定向信息来将该报文通过NAT实例对应的出接口转发出去。
在一些实施例中,网络设备209可以先从接收到的报文中获取第二类信息,即是否进行NAT转换的标识。若是否进行NAT转换的标识为0(表示不进行NAT转换),则网络设备209无需再从报文中搜寻第一类信息,节省了网络设备209的处理步骤,提高了报文处理效率。若是否进行NAT转换的标识为1(表示进行NAT转换),则网络设备209可以直接从预设位置读取到第一类信息,无需对信息进行校验(判断其是否为第一类信息),节省了网络设备209的处理步骤,提高了报文处理效率。
在实际应用中,网络设备209可以与网络设备206共同配置,例如共同支持某种协议,则网络设备206按照该协议生成的报文可以被网络设备209按照该协议顺利分析处理。示例性的,对于上述网络设备206在实际应用中通过SID承载第一类信息(在一些情况中SID还承载第二类信息)时,网络设备209可以采用对应方式进行分析,如下:
如图8所示,针对上述网络设备206处理报文的方式一,网络设备209可以先确定当前处理的SID是否为END.XNAT类型。若否,则网络设备209进行其他与本申请技术方案无关的处理。若是,则网络设备209可以从SID的功能字段705中读取到链路接口标识(第一类信息的其中一种)并确定出接口。然后,网络设备209可以执行倒数第二段SRH移除操作(Penultimate Segment Pop of the SRH,PSP),移除SRv6拓展头(也可以称为段路由扩展头(Segment Routing Header,SRH))。然后,网络设备209可以从END.XNAT类型的SID中的功能字段705中直接读取到是否进行NAT转换的标识(第二类信息)。若是否进行NAT转换的标识为0(表示不进行NAT转换),则网络设备209无需再从报文中搜寻第一类信息,然后按照确定的出接口转发该报文。若是否进行NAT转换的标识为1(表示进行NAT转换),则网络设备209可以根据确定的出接口确定对应的NAT实例。网络设备209确定NAT实例后,可以进行NAT转换(包括将NAT实例对应的地址池路由发布给对应的网络节点,修改报文的源地址为预分配的公网地址和端口等处理)、在对应出接口转发报文等。
如图9a所示,针对上述网络设备206处理报文的方式二,网络设备209确定该SID是END.NAT类型后,可以确定该报文要做NAT转换。然后网络设备209可以从END.NAT类型的SID中的功能字段705中读取到NAT示例ID(第一类信息的其中一种)。然后网络设备209可以根据NAT示例ID确定NAT实例,可以进行NAT转换、在对应出接口转发报文等。其中,网络设备209还可以执行PSP动作,移除SRH拓展头等,本申请实施例对此不再赘述。
在一些实施例中,网络设备206可以将END.NAT类型的SID添加到END.X类型的SID所在的段列表中,则该段列表有两个SID(包括SID1和SID2),其中SID1为END.X类型的SID,SID2为END.NAT类型的SID。那么网络设备209接收到该报文的处理过程如图9b所示。网络设备209先确定SID1是否为END.X类型的SID。若否,则进行其他处理,若是,则网络设备209可以根据SID1直接确定报文对应的出接口。然后网络设备209可以继续判断SID2是否为END.NAT类型的SID,若否,则进行其他处理,若是,则网络设备209可以根据SID2中的NAT示例ID确定NAT实例。然后网络设备209可以执行PSP动作,移除SRH拓展头,进行NAT转换、在对应出接口转发报文等。
如图10a所示,针对上述网络设备206处理报文的方式三的第一种定义,网络设备209可以在接收到报文后判断当前处理的SID是否为END.X类型的SID。若否,则进行其他处理,若是,则网络设备209可以根据该SID确定报文对应的出接口。然后网络设备209可以执行PSP动作,移除SRH拓展头,并从SID中的功能字段705中读取到是否进行NAT转换的标识(第二类信息)。若是否进行NAT转换的标识为0(表示不进行NAT转换),则网络设备209无需再从报文中搜寻第一类信息,并按照报文对应的出接口转发该报文。若是否进行NAT转换的标识为1(表示进行NAT转换),则网络设备209可以根据确定的出接口确定对应的NAT实例。网络设备209确定NAT实例后,可以进行NAT转换、在对应出接口转发报文等。
如图10b所示,针对上述网络设备206处理报文的方式三的第二种定义,网络设备209可以在接收到报文后判断当前处理的SID是否为END.X类型的SID。若否,则进行其他处理,若是,则网络设备209可以根据该SID确定报文对应的出接口。然后网络设备209可以执行PSP动作,移除SRH拓展头。然后,网络设备209可以从SID中的功能字段705中读取到NAT示例ID(第一类信息的其中一种)。然后网络设备209可以根据NAT示例ID确定NAT实例,可以进行NAT转换、在对应出接口转发报文等。若网络设备209没有读取到NAT示例ID,则网络设备209可以按照报文对应的出接口转发报文即可。
若网络设备206处理报文时上述两种定义都用上,则网络设备209可以先END.X类型的SID中的功能字段705中读取到是否进行NAT转换的标识(第二类信息)。若是否进行NAT转换的标识为0(表示不进行NAT转换),则网络设备209无需再从报文中搜寻第一类信息。若是否进行NAT转换的标识为1(表示进行NAT转换),则网络设备209可以从END.X类型的SID中的功能字段705中读取到NAT示例ID(第一类信息的其中一种)。然后网络设备209可以根据NAT示例ID确定NAT实例,可以进行NAT转换、在对应出接口转发报文等。
如图11所示,针对上述网络设备206处理报文的方式四,网络设备209可以在接收到报文后判断当前处理的SID是否为END类型的SID。若否,则进行其他处理,若是,则网络设备209可以执行PSP动作,移除SRH拓展头。然后,网络设备209可以从SID中的功能字段705中读取到NAT示例ID(第一类信息的其中一种)。然后网络设备209可以根据NAT示例ID确定NAT实例,可以进行NAT转换、在对应出接口转发报文等。若网络设备209没有读取到NAT示例ID,则网络设备209可以按照报文对应的出接口转发报文即可。若网 络设备206处理报文时还加入了是否进行NAT转换的标识(第二类信息),则网络设备209可以先读取并分析是否进行NAT转换的标识(第二类信息)。
可以理解的是,网络设备209只将NAT实例对应的NAT地址池路由发布给对应网络节点(网络节点204或网络节点205),保证ISP203的回程流量的路径与去程流量的路径相同。
上述实施例中,网络设备209可以先确定报文对应的出接口,再按照该出接口进行转发。在实际应用中,网络设备209还可以(通过上述链路接口标识类似的标识)确定报文对应的邻居,然后向该邻居发送该报文,本申请实施例对此不做限定。
本申请实施例不仅可以应用到如上述图2对应的场景,还可以应用到运营商专网保障服务等级协议(service level agreement,SLA)、家庭宽带、无线互联网等场景。图12为本申请实施例中家庭宽带的场景示意图。如图12所示,终端1201通过路由器1202接入宽带接入服务器1203(Broadband Access Server,BRAS)。可以理解的是,终端1201与前述图1对应的终端101类似,此处不再赘述。路由器1202可以是无线路由器、有线路由器、交换机等,本申请实施例对此不做限定。终端1201与路由器1202之间的连接可以是无线连接、有线连接等。宽带接入服务器1203可以核心路由器1204(core router,CR)连接到运营商边缘路由器1205(Provider Edge,PE)或者运营商边缘路由器1209。可以理解的是,宽带接入服务器1203类似前述图2对应的各个实施例中的网络设备206,PE1205类似前述图2对应的各个实施例中的网络设备209,PE1209为与PE1205类似的其他出口设备。宽带接入服务器1203、核心路由器1204、PE1205、PE1209之间可以通过SRv6技术来对高价值应用对应的报文选择合适的传输路径。在宽带接入服务器1203识别某报文为高价值应用对应的报文后,可以在SRv6拓展头中使用宽带接入服务器1203、核心路由器1204、PE1205对应的SID,使得报文按照SID传输时按照宽带接入服务器1203、核心路由器1204、PE1205的路径进行传输,而不会传输到PE1209。当该报文到达PE1205后,PE1205可以执行如前述实施例中网络设备209执行的步骤,将报文进行NAT转换以及根据报文对应出接口的转发该报文到接入路由器1206(Access Router,AR)。接入路由器1206接收到该报文后可以执行如上述实施例中网络节点204执行的步骤,将该报文通过产业互联网1207传输到互联网数据中心1208(Internet Data Center,IDC)。而低价值应用对应的报文一般是通过宽带接入服务器1203、核心路由器1204、PE1209、公众互联网1210传输到IDC1208。宽带接入服务器1203在生成该报文的SRv6拓展头时,可以使用宽带接入服务器1203、核心路由器1204、PE1209对应的SID,使得报文按照SID传输时按照宽带接入服务器1203、核心路由器1204、PE1209的路径进行传输。
在实际应用中,宽带接入服务器1203的类型可以替换为运营商边缘路由器PE,并不影响本申请实施例的实现。实际上,上述网络设备的类型可以根据实际需要进行替换,本申请实施例对上述网络设备的类型不做限定。
上述实施例的应用场景均为SRv6网络,在实际应用中,本申请实施例还可以应用在SR MPLS网络,实现方式类似,本申请实施例对此不再赘述。
图13为本申请实施例提供的一种网络设备的示意图。该网络设备1300包括:一个或 多个处理器1301、存储器1303和通信接口1304,处理器1301、存储器1303和通信接口1304可以通过通信总线1302相连。所述存储器1303用于存储一个或多个程序;所述一个或多个处理器1301用于运行所述一个或多个程序,使得所述网络设备1300执行如上述各个方法实施例对应的方法。即,该网络设备1300可为上述图2所示的方法实施例中的网络设备206、网络设备209或网络节点204、网络节点205。
处理器1301可以是一个通用中央处理器(central processing unit,CPU)、网络处理器(network processer,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可以分为地址总线、数据总线、控制总线等。为便于表示,附图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器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。
在具体实现中,作为一种实施例,网络设备1300可以包括多个处理器,如附图13中所示的处理器1301和处理器1305。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,网络设备1300还可以包括输出设备和输入设备。输出设备和处理器1301通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设 备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备和处理器1301通信,可以以多种方式接收用户的输入。例如,输入设备可以是鼠标、键盘、触摸屏设备或传感设备等。
在一些实施例中,存储器1303用于存储执行本申请方案的程序代码1310,处理器1301可以执行存储器1303中存储的程序代码1310。也即是,网络设备1300可以通过处理器1301以及存储器1303中的程序代码1310,来实现方法实施例提供的报文处理方法。
本申请实施例的网络设备1300可对应于上述各个方法实施例中的网关设备,并且,该网络设备1300中的处理器1301、通信接口1304等可以实现上述各个方法实施例中的网关设备所具有的功能和/或所实施的各种步骤和方法。为了简洁,在此不再赘述。
应理解,网络设备1300对应于上述方法实施例中的网络设备,网络设备1300中的各单元和上述其他操作和/或功能分别为了实现上述图2所示的网络设备206或网络设备209所实施的各种步骤和方法,具体细节可参见上述方法实施例,为了简洁,在此不再赘述。
图14为本申请实施例提供的第一种报文处理的装置的示意图。该报文处理的装置1400包括:
获取模块1401,用于执行上述图3对应的各个实施例中网络设备209接收报文的步骤;
处理模块1402,用于执行上述图3对应的各个实施例中网络设备209处理报文的步骤,如NAT转换处理;
发送模块1403,用于执行上述图3对应的各个实施例中网络设备209向网络节点204或网络节点206发送报文的步骤。
图15为本申请实施例提供的第二种报文处理的装置的示意图。该报文处理的装置1500包括:
获取模块1501,用于执行上述图3对应的各个实施例中网络设备206接收报文的步骤;
处理模块1502,用于执行上述图3对应的各个实施例中网络设备206处理报文的步骤;
发送模块1503,用于执行上述图3对应的各个实施例中网络设备206发送报文的步骤。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例的技术方案的范围。
Claims (34)
- 一种报文处理方法,其特征在于,包括:第一网络设备接收来自第二网络设备的第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述第一网络设备对所述第一报文进行网络地址转换NAT处理;所述第一网络设备根据所述第一SID的指示对所述第一报文做NAT处理得到第二报文;所述第一网络设备发送所述第二报文。
- 根据权利要求1所述的方法,其特征在于,所述第一网络设备对所述第一报文做NAT处理得到第二报文包括:所述第一网络设备将所述第一报文的源地址替换为特定地址得到所述第二报文。
- 根据权利要求2所述的方法,其特征在于,所述第一网络设备对所述第一报文做NAT处理得到第二报文之前,所述方法还包括:所述第一网络设备发布所述特定地址对应的路由。
- 根据权利要求1至3任意一项所述的方法,其特征在于,所述第一网络设备进行NAT处理所用的NAT实例中配置有地址池,所述地址池包含所述特定地址。
- 根据权利要求1至3任意一项所述的方法,其特征在于,所述第一SID为END.XNAT SID或END.NAT SID,或所述第一SID为分段路由多协议标签交换SR MPLS标签。
- 根据权利要求1至5任意一项所述的方法,其特征在于,所述第一SID包含指示信息或NAT实例标识,用于指示所述第一网络设备对所述第一报文进行网络地址转换NAT。
- 根据权利要求6所述的方法,其特征在于,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。
- 根据权利要求1至7任意一项所述的方法,其特征在于,所述第一SID还用于指示所述第一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
- 根据权利要求1至7任意一项所述的方法,其特征在于,所述第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示所述第一网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
- 根据权利要求9所述的方法,其特征在于,所述SRH的段标识列表SID List中包含所述第一SID,或所述SRH的段标识列表SID List中包含所述第一SID和所述第二SID。
- 根据权利要求8至10任意一项所述的方法,其特征在于,所述第一网络设备接收来自第二网络设备的第一报文之前,所述方法还包括:所述第一网络设备建立所述第一SID和所述特定接口的关联关系或所述第一SID和所述特定邻居的关联关系;所述第一网络设备向其他网络设备发布所述第一SID。
- 根据权利要求1至11任意一项所述的方法,其特征在于,所述第一网络设备和所述第二网络设备为互联网网关IGW。
- 根据权利要求1至11任意一项所述的方法,其特征在于,所述第一网络设备为运营商边缘路由器PE,所述第二网络设备为宽带接入服务器BRAS,或所述第一网络设备和所述第二网络设备均为PE。
- 根据权利要求1至13任意一项所述的方法,其特征在于,所述第一网络设备和所述第二网络设备设置在SRv6网络或SR MPLS网络。
- 一种报文处理的方法,其特征在于,包括:第一网络设备获得第一报文;所述第一网络设备向第二网络设备发送所述第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述第二网络设备对所述第一报文进行网络地址转换NAT得到第二报文并转发。
- 根据权利要求15所述的方法,其特征在于,所述第一SID具体用于指示所述第二网络设备将所述第一报文的源地址替换为特定地址得到所述第二报文。
- 根据权利要求15或16所述的方法,其特征在于,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备在所述第一报文中压入所述第一SID。
- 根据权利要求15或16所述的方法,其特征在于,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备根据所述第一报文的目的地址确定目标网络;所述第一网络设备在所述第一报文中压入所述第一SID,所述第一SID还用于指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。
- 根据权利要求15或16所述的方法,其特征在于,所述第一网络设备向第二网络设备发送第一报文之前,所述方法还包括:所述第一网络设备识别所述第一报文的应用类型或业务流类型;若所述应用类型或业务流类型为特定类型,则所述第一网络设备根据所述第一报文的目的地址确定目标网络;所述第一网络设备在所述第一报文中压入所述第一SID和第二SID,所述第二SID用于指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文,所述特定接口或所述特定邻居根据所述目标网络确定。
- 根据权利要求15至19任意一项所述的方法,其特征在于,所述第一网络设备获得第一报文包括:所述第一网络设备获取来自用户侧设备的所述第一报文,或所述第一网络设备生成所述第一报文。
- 根据权利要求15至19任意一项所述的方法,其特征在于,所述第一SID为END.XNAT类型或END.NAT类型,或所述第一SID为分段路由多协议标签交换SR MPLS标签。
- 根据权利要求15至21任意一项所述的方法,其特征在于,所述第一SID包含指示信息或NAT实例标识,用于指示所述第二网络设备对所述第一报文进行网络地址转换NAT。
- 根据权利要求22所述的方法,其特征在于,所述指示信息或NAT实例标识设置在所述第一SID的功能字段中或参数字段中。
- 根据权利要求15至23任意一项所述的方法,其特征在于,所述第一网络设备向第二网络设备发送所述第一报文之前,所述方法还包括:所述第一网络设备接收所述第二网络设备通告的所述第一SID;所述第一网络设备建立所述第一SID与目标地址之间的关联关系。
- 根据权利要求15至24任意一项所述的方法,其特征在于,所述第一报文包含分段路由头SRH;所述SRH包含所述第一SID,或所述SRH包含所述第一SID和第二SID,所述第二SID指示所述第二网络设备从特定接口发送所述第二报文,或向特定邻居发送所述第二报文。
- 根据权利要求15至25任意一项所述的方法,其特征在于,所述第一网络设备和所述第二网络设备为互联网网关IGW。
- 根据权利要求15至25任意一项所述的方法,其特征在于,所述第一网络设备为宽带接入服务器BRAS,所述第二网络设备为运营商边缘路由器PE,或所述第一网络设备和所述第二网络设备均为PE。
- 根据权利要求15至27任意一项所述的方法,其特征在于,所述第一网络设备和所述第二网络设备设置在SRv6网络或SR MPLS网络。
- 一种报文处理的装置,其特征在于,包括获取模块,用于接收来自另一网络设备的第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示处理模块对所述第一报文进行网络地址转换NAT处理;所述处理模块,用于根据所述第一SID的指示对所述第一报文做NAT处理得到第二报文;发送模块,用于发送所述第二报文。
- 一种报文处理的装置,其特征在于,包括获取模块,用于获得第一报文;发送模块,用于向另一网络设备发送所述第一报文,所述第一报文包含第一分段标识SID,所述第一SID指示所述另一网络设备对所述第一报文进行网络地址转换NAT得到第二报文并转发。
- 一种网络设备,其特征在于,所述网络设备包括一个或一个以上中央处理器,存储器,通信总线,通信接口;所述存储器为短暂存储存储器或持久存储存储器,所述存储器中存储有程序代码;所述通信接口用于收发数据;所述中央处理器通过所述通信总线与所述存储器通信,在所述网络设备上执行所述存储器中的程序代码以执行权利要求1至14中任意一项所述的方法。
- 一种网络设备,其特征在于,所述网络设备包括一个或一个以上中央处理器,存储器,通信总线,通信接口;所述存储器为短暂存储存储器或持久存储存储器,所述存储器中存储有程序代码;所述通信接口用于收发数据;所述中央处理器通过所述通信总线与所述存储器通信,在所述网络设备上执行所述存储器中的程序代码以执行权利要求15至28中任意一项所述的方法。
- 一种报文处理的系统,其特征在于,包括如权利要求31所述的网络设备和如权利要求32所述的网络设备。
- 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算机上运行时,使得计算机设备执行权利要求1至28任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110407564.7A CN115225571A (zh) | 2021-04-15 | 2021-04-15 | 一种报文处理的方法及相关装置 |
CN202110407564.7 | 2021-04-15 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022218370A1 true WO2022218370A1 (zh) | 2022-10-20 |
Family
ID=83604204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/086775 WO2022218370A1 (zh) | 2021-04-15 | 2022-04-14 | 一种报文处理的方法及相关装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115225571A (zh) |
WO (1) | WO2022218370A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101052009A (zh) * | 2007-05-14 | 2007-10-10 | 中兴通讯股份有限公司 | 私网网元用公网地址借助nat设备实现内部访问的方法 |
US7313145B1 (en) * | 2003-05-28 | 2007-12-25 | Nortel Networks Limited | Method and system for establishing paths between end points in packet data networks |
US10129207B1 (en) * | 2015-07-20 | 2018-11-13 | Juniper Networks, Inc. | Network address translation within network device having multiple service units |
CN109218229A (zh) * | 2017-06-30 | 2019-01-15 | 华为技术有限公司 | 一种报文处理方法、网络设备及存储介质 |
CN111435922A (zh) * | 2019-01-11 | 2020-07-21 | 北京邦天信息技术有限公司 | 一种带宽共享方法 |
-
2021
- 2021-04-15 CN CN202110407564.7A patent/CN115225571A/zh active Pending
-
2022
- 2022-04-14 WO PCT/CN2022/086775 patent/WO2022218370A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7313145B1 (en) * | 2003-05-28 | 2007-12-25 | Nortel Networks Limited | Method and system for establishing paths between end points in packet data networks |
CN101052009A (zh) * | 2007-05-14 | 2007-10-10 | 中兴通讯股份有限公司 | 私网网元用公网地址借助nat设备实现内部访问的方法 |
US10129207B1 (en) * | 2015-07-20 | 2018-11-13 | Juniper Networks, Inc. | Network address translation within network device having multiple service units |
CN109218229A (zh) * | 2017-06-30 | 2019-01-15 | 华为技术有限公司 | 一种报文处理方法、网络设备及存储介质 |
CN111435922A (zh) * | 2019-01-11 | 2020-07-21 | 北京邦天信息技术有限公司 | 一种带宽共享方法 |
Also Published As
Publication number | Publication date |
---|---|
CN115225571A (zh) | 2022-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20240022650A1 (en) | Computing power application traffic forwarding method and apparatus | |
US20220078114A1 (en) | Method and Apparatus for Providing Service for Traffic Flow | |
CN103339901B (zh) | 内容导向网络环境中的终端和中间节点以及终端和中间节点的通信方法 | |
TWI509544B (zh) | 經由虛擬存取點介面廣告,探索,及使用服務 | |
US20160301603A1 (en) | Integrated routing method based on software-defined network and system thereof | |
US11606337B2 (en) | Fog-enabled multipath virtual private network | |
US9042272B2 (en) | Distributed proxy addressing operations | |
US20170093685A1 (en) | Generating service-optimized paths based on enhanced eigrp telemetry | |
EP4024782A1 (en) | Method by which host network performance requirements may be programmed, device and system | |
US10855491B2 (en) | Method for implementing GRE tunnel, access point and gateway | |
US20230353479A1 (en) | Edge Computing Data and Service Discovery Using an Interior Gateway Protocol (IGP) | |
JP2021524204A (ja) | サービス品質監視方法、及びシステム、並びに装置 | |
US11870683B2 (en) | 3GPP network function set adaptation for pre-5G network elements | |
CN111740908B (zh) | 通信方法及相关设备 | |
Mueller et al. | Design and implementation of a carrier grade software defined telecommunication switch and controller | |
JP2024504466A (ja) | パケット転送方法、パケット処理方法、およびデバイス | |
CN110601982B (zh) | 路由传递方法、装置及路由器 | |
WO2022218370A1 (zh) | 一种报文处理的方法及相关装置 | |
CN113285877A (zh) | 一种报文转发的控制方法及相关装置 | |
WO2022228090A1 (zh) | 路径学习方法、装置、业务节点及存储介质 | |
US12095724B2 (en) | Capability discovery in an information centric network | |
CN115277720A (zh) | 组播组的管理方法、装置、设备及存储介质 | |
WO2021135486A1 (zh) | 用于获取网络切片标识的方法和装置 | |
CN115801675A (zh) | 一种报文处理方法及相关装置 | |
CN114915519A (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: 22787592 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22787592 Country of ref document: EP Kind code of ref document: A1 |