WO2015106421A1 - 加载代码的方法以及网络装置 - Google Patents

加载代码的方法以及网络装置 Download PDF

Info

Publication number
WO2015106421A1
WO2015106421A1 PCT/CN2014/070739 CN2014070739W WO2015106421A1 WO 2015106421 A1 WO2015106421 A1 WO 2015106421A1 CN 2014070739 W CN2014070739 W CN 2014070739W WO 2015106421 A1 WO2015106421 A1 WO 2015106421A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
code
control plane
forwarding plane
plane
Prior art date
Application number
PCT/CN2014/070739
Other languages
English (en)
French (fr)
Inventor
陈洪飞
龚钧
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201480001469.5A priority Critical patent/CN104981779A/zh
Priority to PCT/CN2014/070739 priority patent/WO2015106421A1/zh
Priority to JP2016537089A priority patent/JP2016535901A/ja
Priority to EP14878618.9A priority patent/EP3007064A4/en
Publication of WO2015106421A1 publication Critical patent/WO2015106421A1/zh
Priority to US15/084,323 priority patent/US20160210128A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to the field of communications, and in particular to a method of loading code and a network device.
  • Background Network devices are provided by network device providers.
  • the network device provider can be Huawei or Cisco.
  • the user of the network device is the operator of the network device.
  • the operator of the network device can be China Mobile Communications Corporation or Verizon Communications.
  • the network device provided by the network device provider may contain code to perform a certain service.
  • the router may contain code that performs Internet Protocol (English: Internet Protocol, IP for short) forwarding. Therefore, after the router receives the IP packet, the router can forward the IP packet according to the code that performs IP forwarding.
  • IP Internet Protocol
  • new business needs are raised.
  • an operator of a network device wants the network device to be able to deploy new services.
  • the new business can be operation, administration and maintenance (English: operation, administration and maintenance, abbreviation: 0AM).
  • the prior art does not adequately meet the demand for new services. Summary of the invention
  • Embodiments of the present invention provide a method for loading a code and a network device.
  • a new service can be deployed by using the technical solution provided by the embodiment of the present invention. Helps meet the demand for new business.
  • a method of loading code including:
  • the control plane of the network device obtains a process (English: rocess) to be executed by the forwarding plane of the network device (English: rocess) and code for executing the process, the code being through advanced programming Language (English: rogramming language) described;
  • the control plane of the network device determines that the service configuration information of the network device corresponds to the code;
  • the control plane of the network device loads the compiled code to a forwarding plane of the network device.
  • control plane of the network device obtains processing and code for executing the processing.
  • the control plane of the network device determines that the service configuration information corresponds to the code.
  • the network's control plane loads the compiled code to the forwarding plane of the network device.
  • the new service can be executed by the compiled code loaded into the forwarding plane of the network device. Therefore, new services can be deployed through the above technical solutions to help meet the needs of new services.
  • the method further comprises: obtaining, by the control plane of the network device, a location of a field to be matched by a forwarding plane of the network device.
  • the method further includes:
  • the control plane of the network device translates the location of the field to generate an instruction to trigger a lookup engine of the forwarding plane of the network device to perform a matching operation.
  • the first aspect provides a first possible implementation of the provided method, or the first aspect provides a second possible implementation of the provided method, the first aspect providing a third of the provided method Possible implementations,
  • the variables in the code include the value of the field of the message or the value of the register. According to a first aspect, or the first aspect provides a first possible implementation of the provided method, or the first aspect provides a second possible implementation of the provided method, or the first aspect provides a third of the provided method A possible implementation manner, in a fourth possible implementation manner of providing the method provided by the first aspect,
  • the code is used to access a function or coprocessor.
  • a network device including: a control plane and a forwarding plane.
  • the control plane includes:
  • a first obtaining unit configured to obtain a code to be executed by a forwarding plane of the network device, and to execute the processing, the code being described by a high-level programming language
  • a determining unit configured to determine that the service configuration information of the network device corresponds to the code obtained by the first obtaining unit
  • a compiling unit configured to compile the code obtained by the first obtaining unit to generate compiled code
  • the method further includes: a second obtaining unit, configured to obtain a location of a field to be matched by a forwarding plane of the network device.
  • the method further includes:
  • a translation unit configured to translate a position of the field obtained by the second obtaining unit to generate an instruction that triggers a search engine of a forwarding plane of the network device to perform a matching operation.
  • the third device of the network device provided in the second aspect Possible implementations
  • the variables in the code include the value of the field of the message or the value of the register.
  • the first possible implementation manner of the network device provided by the second aspect, or the second possible implementation manner of the network device provided by the second aspect, or the third network device provided by the second aspect A possible implementation manner, in a fourth possible implementation manner of the network device provided by the second aspect,
  • the code is used to access a function or coprocessor.
  • FIG. 1 is a schematic flowchart of a method for loading a code according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a network device according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a network device according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic flowchart diagram of a method for loading a code according to an embodiment of the present invention.
  • the executive body of the method is a network device.
  • the network device may be a router, a network switch, a packet transport network (English: acket transpor t network, PTN) device, a firewall, a load balancer, a data center, or a wavelength division multiplexing (English: wave leng th-div is Ion mul t iplex ing , abbreviation: WDM ) device.
  • the network switch can be an open flow switch (English) Text: OpenFlow Switch ). Referring to FIG. 1, the method includes:
  • the control plane of the network device obtains the processing to be performed by the forwarding plane of the network device and the code to perform the processing, the code being described by a high level programming language.
  • control plane of the network device may include a central processing unit (English: central processing unit, CPU for short).
  • CPU central processing unit
  • the forwarding plane of the network device may include a network processor (English: network processor, NP for short).
  • a network processor English: network processor, NP for short.
  • control plane can be carried on a main control board of the network device.
  • the forwarding plane may be carried on an interface board of the network device (English: interf ace board).
  • the high level programming language can be Java or C++.
  • the processing may include performing a forwarding operation on the packet, performing a modification operation on the packet, calculating a checksum (English: checks), decrementing the value of the lifetime, and performing a counting operation on the packet,
  • the message performs the quality of service (English: quality of service, QoS for short) operation, and performs at least one of an access control operation on the message and a discard operation on the message.
  • performing a modification operation on the packet may be performing a encapsulation operation on the packet or decapsulating the packet.
  • the checksum may be a transmission control protocol (English: transmission control protocol, abbreviation: TCP) checksum.
  • the QoS operation may be a committed access rate (CAR) operation.
  • the access control operation can be implemented by controlling the access list (English: access control list, ACL for short).
  • the control plane of the network device determines that the service configuration information of the network device corresponds to the code.
  • the service configuration information is used to describe a service to be performed by the network device.
  • the service may be a forwarding service.
  • the forwarding service may be a Layer 3 virtual private network (L3VPN) forwarding service, and a Layer 2 virtual private network (L2VPN) forwarding service.
  • L3VPN Layer 3 virtual private network
  • L2VPN Layer 2 virtual private network
  • Virtual private LAN service (English: virtual private LAN service, VPLS for short), multiprotocol label switching (MPLS) forwarding service, IP forwarding service or Layer 2 switching .
  • MPLS multiprotocol label switching
  • the service can be performed through an interface of the network device.
  • the service configuration information may describe: enabling the service for the interface.
  • the interface may be a physical interface or a logical interface.
  • the logical interface may be an aggregate interface (English: trunk interface) or a virtual local area network interface (English: VLAN interface).
  • the service configuration information can be generated by using telnet.
  • the service configuration information may also be generated by the network management system.
  • the service configuration information may be generated by an open flow controller.
  • the OpenFlow controller may send the service configuration information to the OpenFlow switch through a control channel (English: control channel).
  • the S102 may include: determining, by the control plane of the network device, a service corresponding to the service configuration information.
  • the control plane of the network device determines that the code is a computer program for executing the service.
  • the control plane of the network device compiles the code to generate a compiled code.
  • S103 may specifically include: a control plane of the network device, by an editor, for example, the compiled code may include an assembly language code, a machine language code, an open stream instruction (English: instruction) Or open stream action (English: action).
  • the action may be a push tag (English: Push-Tag), a bullet tag (English: Pop-Tag), a discard (English: Drop), an output (English: Output), or Group (English: Group).
  • the instructions of the OpenFlow or the action of the OpenFlow refer to the OpenFlow Switch Specification Version 1.4.0 (English: OpenFlow Switch Specification version 1.4.0).
  • control plane of the network device loads the compiled code to the forwarding plane of the network device.
  • control plane of the network device obtains processing and code for executing the processing.
  • the control plane of the network device determines that the service configuration information corresponds to the code.
  • the network's control plane loads the compiled code to the forwarding plane of the network device.
  • the new service can be executed by the compiled code loaded into the forwarding plane of the network device. Therefore, new services can be deployed through the above technical solutions to help meet the needs of new services.
  • the foregoing technical solution may further include:
  • the control plane of the network device obtains the location of the field to be matched by the forwarding plane of the network device.
  • the field may be a destination IP address in an IP header.
  • the field can be a destination IP address.
  • the field may be a source IP address, a destination IP address, a source port, a destination port, and a protocol (English: protocol ).
  • the source IP address, the destination IP address, and the protocol are information in an IP header.
  • the source port and the destination port may be information in a TCP header or a user datagram protocol (abbreviation: UDP) header.
  • the obtaining, by the control plane of the network device, the location of the field may include that the control plane of the network device obtains the location of the field through an integrated development environment (English: integrated development environment, referred to as: IDE).
  • IDE integrated development environment
  • the location may be the address of the register.
  • the location may be the starting location and length of the field.
  • S101 specifically includes:
  • the control plane of the network device obtains the processing and the code via an IDE.
  • S 101 can include:
  • the control plane of the network device receives user input through the IDE to generate the code.
  • the IDE can include a code editor (English: code edi tor ).
  • the IDE may also include a compiler, a debugger (English: debugger), and a graphical user interface (English: graphica l user interface, referred to as GUI).
  • the user may be the operator of the network device. Specifically, the user may be an engineer of the operator.
  • the user can provide the input to a control plane of the network device via a physical keyboard or a virtual keyboard.
  • the virtual keyboard can be implemented by the graphical user interface.
  • the variable in the code includes at least one of a value of a field of the message or a value of the register.
  • the code is used to access functions (English: funct ion) or coprocessors (English: coproces sor ).
  • the name of the function is included in the code.
  • the code includes instructions for accessing the coprocessor.
  • the coprocessor may be provided by a chip company.
  • the chip company can be EZCHIP or CAVIUM.
  • the method may further include: The control plane of the network device translates the location of the field to generate an instruction to trigger a lookup engine of the forwarding plane of the network device to perform a matching operation.
  • control plane of the network device can translate the location of the field by a compiler to generate an instruction to trigger a lookup engine of the forwarding plane of the network device to perform a matching operation.
  • the method may further include:
  • the forwarding plane of the network device receives the message.
  • a lookup engine of the forwarding plane of the network device obtains a lookup key (English: search key) from the message and/or register based on the location of the field.
  • a lookup engine of a forwarding plane of the network device performs a matching operation according to the lookup key
  • the lookup engine of the forwarding plane of the network device determines that the result of the matching operation is a hit; processing.
  • the packet may be an IP packet, an Ethernet frame (English: e therne t f rame ) or an MPLS protocol packet.
  • Network device 200 can be used to perform the method illustrated in FIG.
  • the network device can be a router, a network switch, a PTN device, a firewall, a load balancer, a data center, or a WDM device.
  • the network switch can be an open flow switch.
  • network device 200 includes a control plane 210 and a forwarding plane 220.
  • the control plane 210 includes a first obtaining unit 211, a determining unit 212, a compiling unit 213, and a loading unit 214.
  • the first obtaining unit 211 is configured to obtain a process to be performed by a forwarding plane of the network device and to execute the process, the code being described by a high-level programming language.
  • the control plane can be carried on the main control board of the network device 200.
  • the forwarding plane can be carried on an interface board of the network device 200.
  • control plane 210 of the network device 200 can include a CPU.
  • forwarding plane 220 of network device 200 can include an NP.
  • the high level programming language can be Java or C++.
  • the processing may include performing a forwarding operation on the packet, performing a modification operation on the packet, calculating a checksum, decrementing the value of the lifetime, performing a counting operation on the packet, and performing a QoS operation on the packet. Performing at least one of an access control operation on the message and a discarding operation on the message.
  • performing a modification operation on the packet may be performing a encapsulation operation on the packet or decapsulating the packet.
  • the checksum can be a TCP checksum.
  • the QoS operation can be a CAR operation.
  • Performing access control operations on packets can be implemented through ACLs.
  • the determining unit 212 is configured to determine that the service configuration information of the network device corresponds to the code obtained by the first obtaining unit 211.
  • the service configuration information is used to describe a service to be performed by the network device.
  • the service may be a forwarding service.
  • the forwarding service may be an L3VPN forwarding service, an L2VPN forwarding service, a VPLS, an MPLS forwarding service, an IP forwarding service, or a Layer 2 switching service.
  • the service can be performed through an interface of the network device.
  • the service configuration information may describe: enabling the service for the interface.
  • the interface may be a physical interface or a logical interface.
  • the logical interface may be an aggregation interface or a virtual local area network interface.
  • the service configuration information may be generated by using a message.
  • the service configuration information may also be generated by the network management system.
  • the service configuration information may be generated by an open flow controller.
  • the OpenFlow controller may send the service configuration information to the OpenFlow switch through a control channel.
  • the determining unit 212 may specifically include a first unit and a second unit.
  • the first unit is configured to determine a service corresponding to the service configuration information.
  • the second unit is for determining that the code is a computer program for performing the service.
  • the compiling unit 213 is configured to compile the code obtained by the first obtaining unit 211 to generate compiled code.
  • the compiling unit 213 is specifically configured to obtain the first obtaining unit 211 by an editor.
  • the compiled code may include an assembly language code, a machine language code, an open stream instruction, or an open stream.
  • action can be a push tag, a bullet tag, a drop, an output, or a group.
  • instructions of the OpenFlow or the action of the OpenFlow refer to the OpenFlow Switch Specification Version 1.4.0.
  • control plane 210 in the network device 200 shown in FIG. 2 may further include: a second obtaining unit, configured to obtain a location of a field to be matched by a forwarding plane of the network device.
  • the field may be a destination IP address in an IP header.
  • the fields can be source IP address, destination IP address, source port, destination port, and protocol.
  • the source IP address, the destination IP address, and the protocol are information in an IP header.
  • the source port and the destination port may be information in a TCP header or information in a UDP header.
  • the second obtaining unit is specifically configured to obtain the location of the field by using an IDE.
  • the location may be the address of the register.
  • the location may be the starting location and length of the field. code.
  • the first obtaining unit 211 is specifically configured to receive an input of a user by using the IDE to generate the code.
  • the IDE can include a code editor.
  • the IDE can also include a compiler, a debugger, and a GUI.
  • the user may be an operator of the network device. Specifically, the user may be an engineer of the operator.
  • the user can provide the input to a control plane of the network device via a physical keyboard or a virtual keyboard.
  • the virtual keyboard can be implemented by the graphical user interface.
  • control plane 210 may further include:
  • a translation unit configured to translate a position of the field obtained by the second obtaining unit to generate an instruction that triggers a search engine of a forwarding plane of the network device to perform a matching operation.
  • the translation unit is specifically configured to translate the location of the field by a compiler to generate an instruction that triggers a lookup engine of a forwarding plane of the network device to perform a matching operation.
  • the variable in the code includes at least one of a value of a field of the message or a value of the register.
  • the code is used to access a function or coprocessor.
  • the name of the function is included in the code.
  • the code includes instructions for accessing the coprocessor.
  • the coprocessor may be provided by a chip company.
  • the chip company can be EZCHIP or CAVIUM.
  • the forwarding plane 220 may include: a code that is loaded into the forwarding plane 220 to receive a message.
  • a lookup engine for obtaining a search key from the message and/or register based on the location of the field.
  • the lookup engine is further configured to perform a matching operation according to the lookup key.
  • the lookup engine is also used to determine the result of the matching operation as a hit.
  • FIG. 3 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • the network device can be a router, a network switch, a PTN device, a firewall, a load balancer, a data center, or an M device.
  • the network switch can be an open flow switch.
  • Network device 300 can be used to perform the method illustrated in FIG.
  • Network device 300 can be used to implement network device 200 shown in FIG. Referring to FIG. 3, network device 300 includes a memory 310, a central processing unit 320, and a network processor 330.
  • Memory 310 is coupled to central processor 320.
  • Central processor 320 is coupled to network processor 330.
  • Memory 310 includes a computer program.
  • the central processor 320 can execute the computer program by accessing the memory 310.
  • the computer program includes a first acquisition unit 311, a determination unit 312, a compilation unit 313, and a load unit 314.
  • Network processor 330 includes lookup engine 331 and memory 332.
  • the memory 310 and the central processing unit 320 are located at a control plane of the network device 300.
  • Network processor 330 is located at the forwarding plane of network device 300.
  • the control plane is carried on the main control board of the network device 300.
  • the forwarding plane is carried on an interface board of the network device 300.
  • the first obtaining unit 311 is configured to obtain a process to be performed by a forwarding plane of the network device and to execute the process, the code being described by a high-level programming language.
  • the high level programming language can be Java or C++.
  • the processing may include performing a forwarding operation on the packet, performing a modification operation on the packet, calculating a checksum, decrementing the value of the lifetime, performing a counting operation on the packet, and performing a QoS operation on the packet. Performing at least one of an access control operation on the message and a discarding operation on the message.
  • performing a modification operation on the packet may be performing a encapsulation operation on the packet or decapsulating the packet.
  • the checksum can be a TCP checksum.
  • the QoS operation can be a CAR operation.
  • Performing access control operations on packets can be implemented through ACLs.
  • the determining unit 312 is configured to determine that the service configuration information of the network device corresponds to the code obtained by the first obtaining unit 311.
  • the service configuration information is used to describe a service to be performed by the network device.
  • the service may be a forwarding service.
  • the forwarding service may be an L3VPN forwarding service, an L2VPN forwarding service, a VPLS, an MPLS forwarding service, an IP forwarding service, or a Layer 2 switching service.
  • the service can be performed through an interface of the network device.
  • the service configuration information may describe: enabling the service for the interface.
  • the interface may be a physical interface or a logical interface.
  • the logical interface may be a convergence interface or a virtual office i or a network interface.
  • the service configuration information can be generated by te lnet.
  • the service configuration information may also be generated by the network management system.
  • the service configuration information may be generated by an open flow controller.
  • the determining unit 312 may specifically include a first unit and a second unit.
  • the first unit is configured to determine a service corresponding to the service configuration information.
  • the second unit is for determining that the code is a computer program for performing the service.
  • the compiling unit 313 is configured to compile the code obtained by the first obtaining unit 311 to generate compiled code.
  • the compiling unit 313 is specifically used to obtain the first obtaining unit 311 by an editor.
  • the compiled code may include an assembly language code, a machine language code, an open stream instruction, or an open stream. action.
  • the action can be a push tag, a bullet tag, a drop, an output, or a group.
  • the instructions of the OpenFlow or the action of the OpenFlow see the OpenFlow Switch Specification Version 1.4.0. To the forwarding plane of the network device. In particular, the compiled code is loaded into memory 332 in network processor 330.
  • the memory 310 in the network device 300 shown in FIG. 3 may further include:
  • a second obtaining unit configured to obtain a location of a field to be matched by a forwarding plane of the network device.
  • the field may be a destination IP address in an IP header.
  • the fields can be source IP address, destination IP address, source port, destination port, and protocol.
  • the source IP address, the destination IP address, and the protocol are information in an IP header.
  • the source port and the destination port may be information in a TCP header or information in a UDP header.
  • the second obtaining unit is specifically configured to obtain the location of the field through the IDE.
  • the location may be the address of the register.
  • the location may be the starting location and length of the field. code.
  • the first obtaining unit 311 is specifically configured to receive an input of a user by using the IDE to generate the code.
  • the IDE can include a code editor.
  • the IDE may also include a compiler, a debugger, and a GUI.
  • the user may be an operator of the network device. Specifically, the user may be an engineer of the operator.
  • the user can provide the input to a control plane of the network device via a physical keyboard or a virtual keyboard.
  • the virtual keyboard can be implemented by the graphical user interface.
  • the memory 310 may further include:
  • a translation unit configured to translate a position of the field obtained by the second obtaining unit to generate an instruction that triggers a search engine of a forwarding plane of the network device to perform a matching operation.
  • the translation unit is specifically configured to translate the location of the field by a compiler to generate an instruction that triggers a lookup engine of a forwarding plane of the network device to perform a matching operation.
  • the variable in the code includes at least one of a value of a field of the message or a value of the register.
  • the code is used to access a function or coprocessor.
  • the name of the function is included in the code.
  • the code includes instructions for accessing the coprocessor.
  • the coprocessor may be provided by a chip company.
  • the chip company can be EZCHIP or CAVIUM.
  • the network processor 330 may include: receiving a message after the code is loaded into the forwarding plane.
  • the receiving unit can be a receiver.
  • the search engine 331 is configured to obtain a lookup key from the message and/or register according to the location of the field.
  • the lookup engine 331 is further configured to perform a matching operation according to the lookup key.
  • the lookup engine 331 is further configured to determine that the result of the matching operation is a hit.
  • a processing unit is also included in the memory 332.
  • the processing unit may be the compiled code.
  • the packet may be an IP packet, an Ethernet frame, or an MPLS protocol packet.
  • the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technology solution. A person skilled in the art can use different methods for implementing the described functions for each specific application, but such implementation should not be clearly understood by those skilled in the art to which the present invention pertains, and is convenient and concise for the description.
  • the device and the unit described above reference may be made to the corresponding process in the foregoing method embodiment, and details are not described herein again.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit may be only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined. Either can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage mediums include: a flash drive, a mobile hard disk, and a read only memory (English:
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • disk or optical disk disk, and other media that can store computer programs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

本发明实施例提供了一种加载代码的方法,包括:网络装置的控制平面获得将被所述网络装置的转发平面执行的处理以及执行所述处理的代码,所述代码是通过高级编程语言描述的;所述网络装置的控制平面确定所述网络装置的业务配置信息对应所述代码;所述网络装置的控制平面对所述代码进行编译以生成编译后的代码;所述网络装置的控制平面将所述编译后的代码加载到所述网络装置的转发平面。此外,本发明实施例还提供了相应的网络装置。可以通过上述技术方案部署新的业务。有助于满足对新的业务的需求。

Description

加载代码的方法以及网络装置 技术领域 本发明涉及通信领域, 特别是加载代码的方法以及网络装置。
背景技术 网络装置 (例如路由器和交换机)是由网络装置提供商提供的。 网络 装置提供商可以是华为或者思科。 网络装置的使用者是网络装置的运营商。 网络装置的运营商可以是中国移动通信集团公司 (英文: China Mobile Communications Corporation ) 或者威讯通信 ( 英文: Verizon Communications )。 网络装置提供商提供的网络装置中可能包含了执行某种 业务的代码。 例如, 路由器中可能包含了执行网际协议(英文: Internet Protocol, 简称: IP)转发的代码。 因此, 路由器接收到 IP报文后, 路由 器可以根据执行 IP转发的代码对所述 IP报文进行转发。 随着技术的发展, 新的业务的需求被提出。 例如, 网络装置的运营商希望网络装置能够部署 新的业务。 新的业务可以是操作、 管理和维护 (英文: operation, administration and maintenance, 简称: 0AM )。 现有技术不能很好的满 足对新的业务的需求。 发明内容
本发明实施例提供了加载代码的方法以及网络装置。 可以通过本发明 实施例提供的技术方案部署新的业务。 有助于满足对新的业务的需求。
第一方面, 提供了一种加载代码的方法, 包括:
网络装置的控制平面 (英文: control plane)获得将被所述网络装置 的转发平面 (英文: forwarding plane )执行的处理(英文: rocess ) 以 及执行所述处理的代码,所述代码是通过高级编程语言(英文: rogramming language )描述的; 所述网络装置的控制平面确定所述网络装置的业务配置信息对应所述 代码;
(英文: comp i l ed code ) ; 以及
所述网络装置的控制平面将所述编译后的代码加载到所述网络装置的 转发平面。
上述技术方案中, 网络装置的控制平面获得处理以及执行所述处理的 代码。 所述网络装置的控制平面确定业务配置信息对应所述代码。 所述网 置的控制平面将所述编译后的代码加载到所述网络装置的转发平面。 可以 通过加载到所述网络装置的转发平面的所述编译后的代码执行新的业务。 因此, 可以通过上述技术方案部署新的业务, 有助于满足对新的业务的需 求。
在第一方面提供的方法的第一种可能的实现方式中, 所述方法还包括: 所述网络装置的控制平面获得将被所述网络装置的转发平面匹配的字 段的位置。
根据第一方面提供的方法的第一种可能的实现方式, 在第一方面提供 的方法的第二种可能的实现方式中,
所述网络装置的控制平面获得将被所述网络装置的转发平面匹配的字 段的位置之后, 所述方法还包括:
所述网络装置的控制平面对所述字段的位置进行翻译以生成触发所述 网络装置的转发平面的查找引擎执行匹配操作的指令。
根据第一方面, 或者第一方面提供提供的方法的第一种可能的实现方 式, 或者第一方面提供提供的方法的第二种可能的实现方式, 在第一方面 提供提供的方法的第三种可能的实现方式中,
所述代码中的变量包括报文的字段的值或者寄存器的值。 根据第一方面, 或者第一方面提供提供的方法的第一种可能的实现方 式, 或者第一方面提供提供的方法的第二种可能的实现方式, 或者第一方 面提供提供的方法的第三种可能的实现方式, 在第一方面提供提供的方法 的第四种可能的实现方式中,
所述代码用于访问函数或者协处理器。
第二方面, 提供了一种网络装置, 包括: 控制平面和转发平面。
所述控制平面包括:
第一获得单元, 用于获得将被所述网络装置的转发平面执行的处理以 及执行所述处理的代码, 所述代码是通过高级编程语言描述的;
确定单元, 用于确定所述网络装置的业务配置信息对应所述第一获得 单元获得的所述代码;
编译单元, 用于对所述第一获得单元获得的所述代码进行编译以生成 编译后的代码; 以及 转发平面。
在第二方面提供的网络装置的第一种可能的实现方式中, 还包括: 第二获得单元, 用于获得将被所述网络装置的转发平面匹配的字段的 位置。
根据第二方面提供的网络装置的第一种可能的实现方式, 在第二方面 提供的网络装置的第二种可能的实现方式中, 还包括:
翻译单元, 用于对所述第二获得单元获得的所述字段的位置进行翻译 以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指令。
根据第二方面, 或者第二方面提供的网络装置的第一种可能的实现方 式, 或者第二方面提供的网络装置的第二种可能的实现方式, 在第二方面 提供的网络装置的第三种可能的实现方式中,
所述代码中的变量包括报文的字段的值或者寄存器的值。 根据第二方面, 或者第二方面提供的网络装置的第一种可能的实现方 式, 或者第二方面提供的网络装置的第二种可能的实现方式, 或者第二方 面提供的网络装置的第三种可能的实现方式, 在第二方面提供的网络装置 的第四种可能的实现方式中,
所述代码用于访问函数或者协处理器。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作简单的介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的 附图。
图 1为本发明实施例提供的一种加载代码的方法的流程示意图; 图 2为本发明实施例提供的一种网络装置的结构示意图;
图 3为本发明实施例提供的一种网络装置的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进 行清楚地描述, 显然, 所描述的实施例仅是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出 创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
图 1 为本发明实施例提供的一种加载代码的方法的流程示意图。 所述 方法的执行主体是网络装置。 所述网络装置可以是路由器、 网络交换机、 分组传送网 (英文: acket transpor t network, 简称: PTN )设备、 防火 墙、 负载均衡器、 数据中心或者波分复用 (英文: wave leng th-div i s ion mul t iplex ing , 简称: WDM )设备。所述网络交换机可以是开放流交换机 (英 文: OpenFlow Switch )。 参见图 1, 所述方法包括:
S 101、 网络装置的控制平面获得将被所述网络装置的转发平面执行的 处理以及执行所述处理的代码, 所述代码是通过高级编程语言描述的。
举例来说, 所述网络装置的控制平面可以包括中央处理器 (英文: central processing unit, 简称: CPU ) 。
举例来说, 所述网络装置的转发平面可以包括网络处理器 (英文: network processor, 简称: NP ) 。
举例来说, 所述控制平面可以承载在所述网络装置的主控板(英文: control board)。 所述转发平面可以承载在所述网络装置的接口板(英文: interf ace board ) 。
举例来说, 所述高级编程语言可以是 Java或者 C++。
举例来说, 所述处理可以包括对报文执行转发操作, 对报文执行修改 操作, 计算校验和(英文: checks丽) , 对生存时间的值减一, 对报文执 行计数操作, 对报文执行服务质量(英文: quality of service, 简称: QoS)操作, 对报文执行访问控制操作以及对报文执行丟弃操作中的至少一 个。
举例来说, 对报文执行修改操作可以是对所述报文进行封装操作或者 对报文进行解封装操作。 所述校验和可以是传输控制协议 (英文: transmission control protocol , 简称: TCP)校验和。 所述 QoS操作可以 是承诺访问速率 (英文: committed access rate, 简称: CAR)操作。 对 才艮文执行访问控制操作可以通过控制访问列表 (英文: access control list, 简称 ACL) 实现。
S102、 所述网络装置的控制平面确定所述网络装置的业务配置信息对 应所述代码。
举例来说, 所述业务配置信息用于描述将被所述网络装置执行的业务。 举例来说, 所述业务可以是转发业务。 例如, 所述转发业务可以是三层虚拟专用网 (英文: layer 3 virtual private network, 简称: L3VPN)转发业务, 二层虚拟专用网(英文: layer 2 virtual private network, 简称: L2VPN )转发业务, 虚拟专用局域网 业务(英文: virtual private LAN service, 简称: VPLS ) , 多协议标签 交换(英文: multiprotocol label switching, 简称: MPLS )转发业务, IP转发业务或者二层交换(英文: layer 2 switching) 业务。
举例来说, 所述业务可以通过所述网络装置的接口执行。 例如, 所述 业务配置信息可以描述: 为所述接口使能所述业务。 所述接口可以是物理 接口, 也可以是逻辑接口。 例如, 所述逻辑接口可以是汇聚接口 (英文: trunk interface )或者虚拟局域网接口 (英文: VLAN interface ) 。
举例来说, 所述业务配置信息可以通过 telnet生成。 所述业务配置信 息也可以是网管生成的。
举例来说, 在所述网络装置是开放流交换机的场景中, 所述业务配置 信息可以是开放流控制器生成的。所述开放流控制器可以通过控制通道(英 文: control channel ) 向所述开放流交换机发送所述业务配置信息。
举例来说, S102具体可以包括: 所述网络装置的控制平面确定所述业 务配置信息对应的业务。 所述网络装置的控制平面确定所述代码是用于执 行所述业务的计算机程序。
S103、 所述网络装置的控制平面对所述代码进行编译以生成编译后的 代码。
举例来说, S103具体可以包括, 所述网络装置的控制平面通过编辑器 举例来说, 所述编译后的代码可以包括汇编语言的代码、 机器语言的 代码、 开放流的指令(英文: instruction) 或者开放流的动作 (英文: action) 。 举例来说, 所述动作可以是推标签(英文: Push-Tag) 、 弹标 签(英文: Pop-Tag) 、 丟弃(英文: Drop) 、 输出 (英文: Output)或者 组(英文: Group) 。 关于开放流的指令或者开放流的动作, 可以参考开放 流交换机说明书第 1.4.0版(英文: OpenFlow Switch Specification version 1.4.0) 。
SI 04、 所述网络装置的控制平面将所述编译后的代码加载到所述网络 装置的转发平面。
上述技术方案中, 网络装置的控制平面获得处理以及执行所述处理的 代码。 所述网络装置的控制平面确定业务配置信息对应所述代码。 所述网 置的控制平面将所述编译后的代码加载到所述网络装置的转发平面。 可以 通过加载到所述网络装置的转发平面的所述编译后的代码执行新的业务。 因此, 可以通过上述技术方案部署新的业务, 有助于满足对新的业务的需 求。
可选地, 上述技术方案还可以包括:
所述网络装置的控制平面获得将被所述网络装置的转发平面匹配的字 段的位置。
举例来说, 所述字段可以是 IP头中的目的 IP地址。 举例来说, 所述字 段可以是目的 IP地址。 举例来说, 所述字段可以是源 IP地址、 目的 IP地址、 源端口、 目的端口以及协议(英文: protocol ) 。 所述源 IP地址、 所述目 的 IP地址以及所述协议是 IP头中的信息。 所述源端口、 目的端口可以是 TCP 头中信息或者用户数据报协议(英文: user datagram protocol, 简称: UDP) 头中的信息。
举例来说, 所述网络装置的控制平面获得所述字段的位置可以包括, 所述网络装置的控制平面通过集成开发环境 (英文: integrated development environment, 简称: IDE )获得所述字段的位置。 举例来说, 在所述字段是寄存器中的数据的场景中, 所述位置可以是 所述寄存器的地址。 在所述字段是报文中的字段的场景中, 所述位置可以 是所述字段的开始位置以及长度。
可选地, S101具体包括:
所述网络装置的控制平面通过 IDE获得所述处理以及所述代码。
举例来说, S 101可以包括:
所述网络装置的控制平面通过所述 IDE接收用户的输入以生成所述代 码。
例如, 所述 IDE可以包括代码编辑器 (英文: code edi tor ) 。 此外, 所述 IDE还可以包括编译器、调试器(英文: debugger )和图形用户界面(英 文: graphica l user interface , 简称: GUI ) 。 所述用户可以是所述网络 装置的运营商。 具体来说, 所述用户可以是所述运营商的工程师。
例如, 所述用户可以通过物理键盘或者虚拟键盘向所述网络装置的控 制平面提供所述输入。 所述虚拟键盘可以通过所述图形用户界面实现。
可选地 ,
所述代码中的变量包括报文的字段的值或者寄存器的值中的至少一 个。
可选地 ,
所述代码用于访问函数(英文: funct ion ) 或者协处理器 (英文: coproces sor ) 。
举例来说, 所述代码中包含了所述函数的名称。 举例来说, 所述代码 中包含了用于访问所述协处理器的指令。 例如, 所述协处理器可以是芯片 公司提供的。 所述芯片公司可以是 EZCHIP或 CAVIUM。
可选地, 上述技术方案中, 所述网络装置的控制平面获得将被所述网 络装置的转发平面匹配的字段的位置之后, 所述方法还可以包括: 所述网络装置的控制平面对所述字段的位置进行翻译以生成触发所述 网络装置的转发平面的查找引擎执行匹配操作的指令。
举例来说, 所述网络装置的控制平面可以通过编译器对所述字段的位 置进行翻译以生成触发所述网络装置的转发平面的查找引擎执行匹配操作 的指令。
可选地, 上述技术方案中, S104之后, 还可以包括:
所述网络装置的转发平面接收报文。
所述网络装置的转发平面的查找引擎根据所述字段的位置从所述报文 和 /或寄存器中获取查找关键字 (英文: search key ) 。
所述网络装置的转发平面的查找引擎根据所述查找关键字执行匹配操 作;
所述网络装置的转发平面的查找引擎确定所述匹配操作的结果为命 中; 处理。
举例来说, 所述报文可以是 IP报文、 以太网帧(英文: e therne t f rame ) 或者 MPLS协议报文。
图 2为本发明实施例提供的一种网络装置的结构示意图。网络装置 200 可以用于执行图 1所示的方法。 所述网络装置可以是路由器、 网络交换机、 PTN设备、 防火墙、 负载均衡器、 数据中心或者 WDM设备。 所述网络交换机 可以是开放流交换机。 参见图 2 , 网络装置 200包括: 控制平面 210和转发 平面 220。
所述控制平面 210包括第一获得单元 211、 确定单元 212、 编译单元 21 3 以及加载单元 214。
第一获得单元 211, 用于获得将被所述网络装置的转发平面执行的处理 以及执行所述处理的代码, 所述代码是通过高级编程语言描述的。 举例来说, 所述控制平面可以承载在网络装置 200的主控板。 所述转发 平面可以承载在网络装置 200的接口板。
举例来说, 网络装置 200的控制平面 21 0可以包括 CPU。
举例来说, 网络装置 200的转发平面 220可以包括 NP。
举例来说, 所述高级编程语言可以是 Java或者 C++。
举例来说, 所述处理可以包括对报文执行转发操作, 对报文执行修改 操作, 计算校验和, 对生存时间的值减一, 对报文执行计数操作, 对报文 执行 QoS操作, 对报文执行访问控制操作以及对报文执行丟弃操作中的至少 一个。
举例来说, 对报文执行修改操作可以是对所述报文进行封装操作或者 对报文进行解封装操作。 所述校验和可以是 TCP校验和。 所述 QoS操作可以 是 CAR操作。 对报文执行访问控制操作可以通过 ACL实现。
确定单元 212 , 用于确定所述网络装置的业务配置信息对应所述第一获 得单元 211获得的所述代码。
举例来说, 所述业务配置信息用于描述将被所述网络装置执行的业务。 举例来说, 所述业务可以是转发业务。
例如, 所述转发业务可以是 L3VPN转发业务, L2VPN转发业务, VPLS , MPLS转发业务, IP转发业务或者二层交换业务。
举例来说, 所述业务可以通过所述网络装置的接口执行。 例如, 所述 业务配置信息可以描述:为所述接口使能所述业务。 所述接口可以是物理接 口, 也可以是逻辑接口。 例如, 所述逻辑接口可以是汇聚接口或者虚拟局 域网接口。
举例来说, 所述业务配置信息可以通过 te lne t生成。 所述业务配置信 息也可以是网管生成的。 举例来说, 在所述网络装置是开放流交换机的场景中, 所述业务配置 信息可以是开放流控制器生成的。 所述开放流控制器可以通过控制通道向 所述开放流交换机发送所述业务配置信息。
举例来说, 确定单元 212具体可以包括第一单元和第二单元。
所述第一单元用于确定所述业务配置信息对应的业务。
所述第二单元用于确定所述代码是用于执行所述业务的计算机程序。 编译单元 213 , 用于对所述第一获得单元 211获得的所述代码进行编译 以生成编译后的代码。
举例来说, 编译单元 213具体用于通过编辑器对第一获得单元 211获得 举例来说, 所述编译后的代码可以包括汇编语言的代码、 机器语言的 代码、 开放流的指令或者开放流的动作。 举例来说, 所述动作可以是推标 签、 弹标签、 丟弃、 输出或者组。 关于开放流的指令或者开放流的动作, 可以参考开放流交换机说明书第 1. 4. 0版。 到所述转发平面 220。
可选地, 图 2所示的网络装置 200中的控制平面 210还可以包括: 第二获得单元, 用于获得将被所述网络装置的转发平面匹配的字段的 位置。
举例来说, 所述字段可以是 IP头中的目的 IP地址。 举例来说, 所述字 段可以是源 IP地址、 目的 IP地址、 源端口、 目的端口以及协议。 所述源 IP 地址、 所述目的 IP地址以及所述协议是 IP头中的信息。 所述源端口、 目的 端口可以是 TCP头中信息或者 UDP头中的信息。
举例来说, 所述第二获得单元具体用于通过 IDE获得所述字段的位置。 举例来说, 在所述字段是寄存器中的数据场景中, 所述位置可以是所 述寄存器的地址。 在所述字段是报文中的字段的场景中, 所述位置可以是 所述字段的开始位置以及长度。 码。
可选地, 第一获得单元 211具体用于通过所述 IDE接收用户的输入以生 成所述代码。
例如, 所述 IDE可以包括代码编辑器。 此外, 所述 IDE还可以包括编译 器、 调试器和 GUI。 所述用户可以是所述网络装置的运营商。 具体来说, 所 述用户可以是所述运营商的工程师。
例如, 所述用户可以通过物理键盘或者虚拟键盘向所述网络装置的控 制平面提供所述输入。 所述虚拟键盘可以通过所述图形用户界面实现。
可选地, 控制平面 210还可以包括:
翻译单元, 用于对所述第二获得单元获得的所述字段的位置进行翻译 以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指令。
举例来说, 所述翻译单元具体用于通过编译器对所述字段的位置进行 翻译以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指 令。
可选地, 上述技术方案中,
所述代码中的变量包括报文的字段的值或者寄存器的值中的至少一 个。
可选地, 上述技术方案中,
所述代码用于访问函数或者协处理器。
举例来说, 所述代码中包含了所述函数的名称。 举例来说, 所述代码 中包含了用于访问所述协处理器的指令。 例如, 所述协处理器可以是芯片 公司提供的。 所述芯片公司可以是 EZCHIP或 CAVIUM。 可选地, 上述技术方案中, 转发平面 220可以包括: 的代码加载到所述转发平面 220后接收报文。
查找引擎, 用于根据所述字段的位置从所述报文和 /或寄存器中获取查 找关键字。
所述查找引擎还用于根据所述查找关键字执行匹配操作。
所述查找弓 I擎还用于确定所述匹配操作的结果为命中。
处理单元, 用于根据所述编译后的代码对所述报文执行所述处理。 举例来说, 所述报文可以是 IP报文、 以太网帧或者 MPLS协议报文。 图 3 为本发明实施例提供的一种网络装置的结构示意图。 所述网络装 置可以是路由器、 网络交换机、 PTN设备、 防火墙、 负载均衡器、 数据中心 或者 M设备。 所述网络交换机可以是开放流交换机。 网络装置 300可以 用于执行图 1所示的方法。 网络装置 300可以用于实现图 2所示的网络装 置 200。 参见图 3 , 网络装置 300包括存储器 310、 中央处理器 320以及网 络处理器 330。存储器 310与中央处理器 320耦合。 中央处理器 320与网络 处理器 330耦合。 存储器 310包括计算机程序。 中央处理器 320可以通过 访问存储器 310 以执行所述计算机程序。 所述计算机程序包括第一获取单 元 311、 确定单元 312、 编译单元 313和加载单元 314。 网络处理器 330包 括查找引擎 331和存储器 332。 其中, 存储器 310、 中央处理器 320位于网 络装置 300的控制平面。 网络处理器 330位于网络装置 300的转发平面。 所述控制平面承载在网络装置 300 的主控板。 所述转发平面承载在网络装 置 300的接口板。
第一获得单元 311 , 用于获得将被所述网络装置的转发平面执行的处理 以及执行所述处理的代码, 所述代码是通过高级编程语言描述的。
举例来说, 所述高级编程语言可以是 Java或者 C++。 举例来说, 所述处理可以包括对报文执行转发操作, 对报文执行修改 操作, 计算校验和, 对生存时间的值减一, 对报文执行计数操作, 对报文 执行 QoS操作, 对报文执行访问控制操作以及对报文执行丟弃操作中的至少 一个。
举例来说, 对报文执行修改操作可以是对所述报文进行封装操作或者 对报文进行解封装操作。 所述校验和可以是 TCP校验和。 所述 QoS操作可以 是 CAR操作。 对报文执行访问控制操作可以通过 ACL实现。
确定单元 312 , 用于确定所述网络装置的业务配置信息对应所述第一获 得单元 311获得的所述代码。
举例来说, 所述业务配置信息用于描述将被所述网络装置执行的业务。 举例来说, 所述业务可以是转发业务。
例如, 所述转发业务可以是 L3VPN转发业务, L2VPN转发业务, VPLS , MPLS转发业务, IP转发业务或者二层交换业务。
举例来说, 所述业务可以通过所述网络装置的接口执行。 例如, 所述 业务配置信息可以描述: 为所述接口使能所述业务。 所述接口可以是物理 接口, 也可以是逻辑接口。 例如, 所述逻辑接口可以是汇聚接口或者虚拟 局 i或网接口。
举例来说, 所述业务配置信息可以通过 te lnet生成。 所述业务配置信 息也可以是网管生成的。
举例来说, 在所述网络装置是开放流交换机的场景中, 所述业务配置 信息可以是开放流控制器生成的。
举例来说, 确定单元 312具体可以包括第一单元和第二单元。
所述第一单元用于确定所述业务配置信息对应的业务。
所述第二单元用于确定所述代码是用于执行所述业务的计算机程序。 编译单元 313 , 用于对所述第一获得单元 311获得的所述代码进行编译 以生成编译后的代码。 举例来说, 编译单元 313具体用于通过编辑器对第一获得单元 311获得 举例来说, 所述编译后的代码可以包括汇编语言的代码、 机器语言的 代码、 开放流的指令或者开放流的动作。 举例来说, 所述动作可以是推标 签、 弹标签、 丟弃、 输出或者组。 关于开放流的指令或者开放流的动作, 请参见开放流交换机说明书第 1. 4. 0版。 到网络装置的转发平面。 具体来说, 将所述编译后的代码加载到网络处理 器 330中的存储器 332中。
可选地, 图 3所示的网络装置 300中的存储器 310还可以包括:
第二获得单元, 用于获得将被所述网络装置的转发平面匹配的字段的 位置。
举例来说, 所述字段可以是 IP头中的目的 IP地址。 举例来说, 所述字 段可以是源 IP地址、 目的 IP地址、 源端口、 目的端口以及协议。 所述源 IP 地址、 所述目的 IP地址以及所述协议是 IP头中的信息。 所述源端口、 目的 端口可以是 TCP头中信息或者 UDP头中的信息。
举例来说, 所述第二获得单元具体用于通过 IDE获得所述字段的位置。 举例来说, 在所述字段是寄存器中的数据的场景中, 所述位置可以是 所述寄存器的地址。 在所述字段是报文中的字段的场景中, 所述位置可以 是所述字段的开始位置以及长度。 码。
可选地, 第一获得单元 311具体用于通过所述 IDE接收用户的输入以生 成所述代码。 例如, 所述 IDE可以包括代码编辑器。 此外, 所述 IDE还可以包括编译 器、 调试器和 GUI。 所述用户可以是所述网络装置的运营商。 具体来说, 所 述用户可以是所述运营商的工程师。
例如, 所述用户可以通过物理键盘或者虚拟键盘向所述网络装置的控 制平面提供所述输入。 所述虚拟键盘可以通过所述图形用户界面实现。
可选地, 存储器 310还可以包括:
翻译单元, 用于对所述第二获得单元获得的所述字段的位置进行翻译 以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指令。
举例来说, 所述翻译单元具体用于通过编译器对所述字段的位置进行 翻译以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指 令。
可选地, 上述技术方案中,
所述代码中的变量包括报文的字段的值或者寄存器的值中的至少一 个。
可选地, 上述技术方案中,
所述代码用于访问函数或者协处理器。
举例来说, 所述代码中包含了所述函数的名称。 举例来说, 所述代码 中包含了用于访问所述协处理器的指令。 例如, 所述协处理器可以是芯片 公司提供的。 所述芯片公司可以是 EZCHIP或 CAVIUM。
可选地, 上述技术方案中, 网络处理器 330可以包括: 代码加载到所述转发平面后接收报文。 举例来说, 所述接收单元可以是接 收器。
查找引擎 331 , 用于根据所述字段的位置从所述报文和 /或寄存器中获 取查找关键字。
所述查找引擎 331还用于根据所述查找关键字执行匹配操作。 所述查找引擎 331还用于确定所述匹配操作的结果为命中。
存储器 332中还包括处理单元。 所述处理单元可以是所述编译后的代码。
举例来说, 所述报文可以是 IP报文、 以太网帧或者 MPLS协议报文。 本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的 各示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件 的结合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方 案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使 用不同方法来实现所描述的功能, 但是这种实现不应认为超出本发明的范 所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述 描述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的 对应过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置 和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅 是示意性的, 例如, 所述单元的划分, 可以仅仅为一种逻辑功能划分, 实 际实现时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以 集成到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或 讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 装置 或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的 部分可以以软件产品的形式体现出来, 该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服 务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步 骤。 而前述的存储介质包括: 闪存盘、 移动硬盘、 只读存储器 (英文:
Read-Only Memory, 简称: ROM ) 、 随机存取存储器(英文: Random Acces s Memory, 简称: RAM ) 、 磁碟或者光盘等各种可以存储计算机程序的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应所述以权利要求的保护范围为准。

Claims

权利要求
1、 一种加载代码的方法, 其特征在于, 包括:
网络装置的控制平面获得将被所述网络装置的转发平面执行的处理以 及执行所述处理的代码, 所述代码是通过高级编程语言描述的;
所述网络装置的控制平面确定所述网络装置的业务配置信息对应所述 代码; 以及
所述网络装置的控制平面将所述编译后的代码加载到所述网络装置的 转发平面。
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 所述网络装置的控制平面获得将被所述网络装置的转发平面匹配的字 段的位置。
3、 根据权利要求 2所述的方法, 其特征在于,
所述网络装置的控制平面获得将被所述网络装置的转发平面匹配的字 段的位置之后, 所述方法还包括:
所述网络装置的控制平面对所述字段的位置进行翻译以生成触发所述 网络装置的转发平面的查找引擎执行匹配操作的指令。
4、 根据权利要求 1至 3中任一所述的方法, 其特征在于,
所述代码中的变量包括报文的字段的值或者寄存器的值。
5、 根据权利要求 1至 4中任一所述的方法, 其特征在于,
所述代码用于访问函数或者协处理器。
6、 一种网络装置, 其特征在于, 包括: 控制平面和转发平面; 所述控制平面包括: 第一获得单元, 用于获得将被所述网络装置的转发平面执行的处理以 及执行所述处理的代码, 所述代码是通过高级编程语言描述的;
确定单元, 用于确定所述网络装置的业务配置信息对应所述第一获得 单元获得的所述代码;
编译单元, 用于对所述第一获得单元获得的所述代码进行编译以生成 编译后的代码; 以及 转发平面。
7、 根据权利要求 6所述的网络装置, 其特征在于, 还包括:
第二获得单元, 用于获得将被所述网络装置的转发平面匹配的字段的 位置。
8、 根据权利要求 7所述的网络装置, 其特征在于, 还包括:
翻译单元, 用于对所述第二获得单元获得的所述字段的位置进行翻译 以生成触发所述网络装置的转发平面的查找引擎执行匹配操作的指令。
9、 根据权利要求 6至 8中任一所述的网络装置, 其特征在于, 所述代码中的变量包括报文的字段的值或者寄存器的值。
10、 根据权利要求 6至 9中任一所述的网络装置, 其特征在于, 所述代码用于访问函数或者协处理器。
PCT/CN2014/070739 2014-01-16 2014-01-16 加载代码的方法以及网络装置 WO2015106421A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN201480001469.5A CN104981779A (zh) 2014-01-16 2014-01-16 加载代码的方法以及网络装置
PCT/CN2014/070739 WO2015106421A1 (zh) 2014-01-16 2014-01-16 加载代码的方法以及网络装置
JP2016537089A JP2016535901A (ja) 2014-01-16 2014-01-16 コードをロードする方法及びネットワーク装置
EP14878618.9A EP3007064A4 (en) 2014-01-16 2014-01-16 METHOD FOR LOADING A CODE AND NETWORK DEVICE
US15/084,323 US20160210128A1 (en) 2014-01-16 2016-03-29 Code Loading Method and Network Apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/070739 WO2015106421A1 (zh) 2014-01-16 2014-01-16 加载代码的方法以及网络装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/084,323 Continuation US20160210128A1 (en) 2014-01-16 2016-03-29 Code Loading Method and Network Apparatus

Publications (1)

Publication Number Publication Date
WO2015106421A1 true WO2015106421A1 (zh) 2015-07-23

Family

ID=53542290

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/070739 WO2015106421A1 (zh) 2014-01-16 2014-01-16 加载代码的方法以及网络装置

Country Status (5)

Country Link
US (1) US20160210128A1 (zh)
EP (1) EP3007064A4 (zh)
JP (1) JP2016535901A (zh)
CN (1) CN104981779A (zh)
WO (1) WO2015106421A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080077912A1 (en) * 2006-09-22 2008-03-27 Winbond Electronics Corp. Software development methods, systems, and storage media storing software developed thereby
CN101299862A (zh) * 2008-06-11 2008-11-05 中国电信股份有限公司 一种电信业务生成环境系统
CN101771762A (zh) * 2009-01-06 2010-07-07 北京邮电大学 业务系统中业务动态加载系统及方法
CN101958987A (zh) * 2009-07-14 2011-01-26 中国电信股份有限公司 电信业务数据动态转换的方法及其系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8842679B2 (en) * 2010-07-06 2014-09-23 Nicira, Inc. Control system that elects a master controller instance for switching elements
WO2013074827A1 (en) * 2011-11-15 2013-05-23 Nicira, Inc. Architecture of networks with middleboxes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080077912A1 (en) * 2006-09-22 2008-03-27 Winbond Electronics Corp. Software development methods, systems, and storage media storing software developed thereby
CN101299862A (zh) * 2008-06-11 2008-11-05 中国电信股份有限公司 一种电信业务生成环境系统
CN101771762A (zh) * 2009-01-06 2010-07-07 北京邮电大学 业务系统中业务动态加载系统及方法
CN101958987A (zh) * 2009-07-14 2011-01-26 中国电信股份有限公司 电信业务数据动态转换的方法及其系统

Also Published As

Publication number Publication date
EP3007064A1 (en) 2016-04-13
JP2016535901A (ja) 2016-11-17
CN104981779A (zh) 2015-10-14
US20160210128A1 (en) 2016-07-21
EP3007064A4 (en) 2016-09-28

Similar Documents

Publication Publication Date Title
EP3677000B1 (en) Method and system for tracing packets in software defined networks
US10270843B2 (en) Chaining service zones by way of route re-origination
US10116559B2 (en) Operations, administration and management (OAM) in overlay data center environments
CN109076018B (zh) 利用is-is协议实现分段路由网络中网元的方法和设备
US10574763B2 (en) Session-identifer based TWAMP data session provisioning in computer networks
US11038791B2 (en) Techniques for exposing maximum node and/or link segment identifier depth utilizing OSPF
WO2017037615A1 (en) A method and apparatus for modifying forwarding states in a network device of a software defined network
US10749797B2 (en) Service label routing in a network
US8711838B1 (en) Using network labels without standard-defined syntax and semantics
EP3456020A1 (en) Mechanism for inline packet response generation in software defined networks
US11522792B2 (en) Method for discovering forwarding path and related device thereof
US11876881B2 (en) Mechanism to enable third party services and applications discovery in distributed edge computing environment
WO2015106421A1 (zh) 加载代码的方法以及网络装置
WO2022214854A1 (en) Methods and systems for efficient metadata and data delivery between a network interface and applications

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: 14878618

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014878618

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014878618

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2016537089

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112016016243

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 112016016243

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20160713