CN109818982A - A method of it promoting network communication equipment and creates performance - Google Patents

A method of it promoting network communication equipment and creates performance Download PDF

Info

Publication number
CN109818982A
CN109818982A CN201910237042.XA CN201910237042A CN109818982A CN 109818982 A CN109818982 A CN 109818982A CN 201910237042 A CN201910237042 A CN 201910237042A CN 109818982 A CN109818982 A CN 109818982A
Authority
CN
China
Prior art keywords
fast
data packet
contract
header information
link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910237042.XA
Other languages
Chinese (zh)
Other versions
CN109818982B (en
Inventor
唐远生
匡道珍
黄嘉乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN JIXIANG TENDA TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN JIXIANG TENDA TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN JIXIANG TENDA TECHNOLOGY Co Ltd filed Critical SHENZHEN JIXIANG TENDA TECHNOLOGY Co Ltd
Priority to CN201910237042.XA priority Critical patent/CN109818982B/en
Publication of CN109818982A publication Critical patent/CN109818982A/en
Application granted granted Critical
Publication of CN109818982B publication Critical patent/CN109818982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a kind of method that promotion network communication equipment creates performance, gives out a contract for a project method by contrast standard protocol stack to illustrate that Fast_l2 module is given out a contract for a project method;The present invention is that data packet adds Ethernet and vlan header information according to the linking status information of preservation in Fast_l2 module, then the driving function ndo_start_xmit that gives out a contract for a project is called directly to send out corresponding data packet, skip the relevant treatment of entire agreement trestle and vlan, the memory for reducing two layered data processing packet of protocol stack to a certain extent uses and CPU is consumed, so that improving product creates performance;In addition, small with the kernel module committed memory that the invention is write, the more nervous network communication equipment of memory can be loaded, portable high;And only hook point need to be hung at ip_finish_output2 function and take data packet, and define fast_l2_ext pointer variable in link tracking struct nf_conn structural body and two layers of cache information of the link is taken to carry out package transmission, the kernel module coupling write with this method is low.

Description

A method of it promoting network communication equipment and creates performance
Technical field
The invention belongs to the communications field more particularly to a kind of methods for promoting network communication equipment and creating performance.
Background technique
Performance is to measure the most direct evaluation of a network communication equipment quality, and wherein performance indicator mainly includes handling up Amount, message forward rate, maximum concurrently link number, newly-built link number per second, Forwarding Delay, shake etc..
In communications equipment market with keen competition, to promote user's online experience and improving network communication equipment market competition Power, need to be with same hardware resource or cost, and the equipment for createing higher performance could stand in this strand of tide of communication equipment field Top of.
At CPU and the fixed situation of memory, the tuning that network communication equipment creates performance at present mainly has:
(1) the page_size parameter of kernel is adjusted.
(2) adjustment kernel link tracking parameter (be located at/proc/sys/net/netfilter/ catalogue under), as created Maximum link number limits nf_conntrack_max;The size nf_conntrack_htable_ of link tracking hash table Size promotes CPU hit rate, reduces CPU usage etc..
(3) code optimization (drop circulation optimizes CPU operation frequently and inefficiency code etc.).
However, the following problem that above-mentioned tuning method still has:
(1) after by adjusting schemes such as kernel proc catalogue parameter, code optimizations, the network equipment data packet forwarding still need to through Protocol stack is crossed, when data volume is huge, memory is consumed and CPU is particularly evident, and forward efficiency is lower, influence newly-built performance.
(2) the part low side network equipment, especially Household communication product, memory and CPU are poor, and product creates ability and do not reach Standard level is badly in need of certain methods and goes to optimize newly-built performance, to improve product competitiveness in the market.
To sum up, it is necessary to study a kind of method that promotion network communication equipment creates performance.
Summary of the invention
To solve drawbacks described above, the present invention proposes a kind of method that promotion network communication equipment creates performance, in Fast_ L2 module is that data packet adds Ethernet and vlan header information according to the linking status information of preservation, then calls directly driving The function ndo_start_xmit that gives out a contract for a project directly transmits data packet, the relevant treatment of entire agreement trestle and vlan is skipped, certain CPU usage is reduced in degree, to improve newly-built performance.
The technical scheme of the present invention is realized as follows:
The present invention discloses a kind of method that promotion network communication equipment creates performance, is given out a contract for a project by contrast standard protocol stack Method is given out a contract for a project method to illustrate Fast_l2 module;Standard protocol stack method of giving out a contract for a project includes the following steps: that (S1) protocol stack establishes chain Connect tracking;(S2) data packet completes NAT, and determines and need to forward to two layers;(S3) pass through ip_output interface;(S4) pass through Ip_finish_output2 interface;(S5) Vlan ethernet layer information is added;(S6) pass through dev_queue_xmit interface; (S7) pass through hard_start_xmit interface;Fast_l2 module method of giving out a contract for a project includes the following steps: that (A1) Fast_l2 module opens It is dynamic;(A2) cache container is initialized;(A3) after protocol stack establishes the link tracking in step (S1), storage allocation, cache are requested Container allocation space, for saving the link ethernet layer header information;(A4) protocol stack data packet passes through ip_ in step (S4) Finish_output2 interface, data packet enter Fast_l2 module;(A5) judge cache with the presence or absence of link belonging to data packet Ethernet layer header information, if it is not, then going to step (A6);If so, going to step (A8);(A6) link is added Ethernet layer header information is to cache;(A7) judge whether cache succeeds, if it is not, being then back to step (S5);If so, jumping Go to step (A8);(A8) ethernet layer header information is added;(A9) step (A8) and step (S7), which are called, drives function of giving out a contract for a project Ndo_start_xmit directly transmits data packet;(A10) terminate.
In step (S1), when link tracking creates, distributed in one piece by Fast_l2cache container to fast_l2_ext Space is deposited, link tracking discharges the memory that corresponding fast_l2_ext is directed toward and returns to cache container when destroying.
In step (A4), the data packet into Fast_l2 module is determined by link tracking member fast_l2_ext variable Whether Ethernet, vlan header information have been saved in the memory of fast_l2_ext direction.
Wherein, every link tracking struct nf_conn structural body has a member variable fast_l2_ext, this at Member's variable is used to save interface used in Ethernet and vlan header information and hair data packet.
Wherein, the Ethernet header information cache of every link is discharged when linking and destroying.
Compared with prior art, the present invention has the advantage that
(1) present invention is that data packet adds Ethernet and vlan according to the linking status information of preservation in Fast_l2 module Then header information calls directly the driving function ndo_start_xmit that gives out a contract for a project and sends out corresponding data packet, skip entire The relevant treatment of agreement trestle and vlan, the memory that this method reduces two layered data processing packet of protocol stack to a certain extent use And CPU consumption, so that improving product creates performance.
(2) the kernel module committed memory write with the invention is small, and the more nervous network communication equipment of memory can add It carries, it is portable high;And hook point need to be only hung at ip_finish_output2 function and takes data packet, and is tracked in link Struct nf_conn structural body defines fast_l2_ext pointer variable and two layers of cache information of the link is taken to carry out package hair It send, the kernel module coupling write with this method is low.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow diagram that the present invention promotes that network communication equipment creates the method for performance.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In order to facilitate and clarify the description of subsequent embodiment, carried out specifically to a specific embodiment of the invention Before bright, part term is explained, following explanation is applied to this specification and claims.
English word NAT, ip_output, ip_finish_output2, Vlan, the dev_queue_ occurred in the present invention xmi、hard_start_xmit、Fast_l2、cache、ndo_start_xmit、Fast_l2cache、fast_l2_ext、 Struct nf_conn etc. is code, do not represent it is other in all senses.
Referring to Fig.1, the present invention discloses a kind of method that promotion network communication equipment creates performance, is assisted by contrast standard View stack gives out a contract for a project method to illustrate that Fast_l2 module is given out a contract for a project method, the data packet transmission of every link can skip agreement trestle and The relevant treatment of vlan, the memory for reducing two layered data processing packet of protocol stack uses and CPU is consumed, so that improving product creates property Energy;Standard protocol stack method of giving out a contract for a project includes the following steps: that (S1) protocol stack establishes the link tracking;(S2) data packet completes NAT, and It determines and needs to forward to two layers;(S3) pass through ip_output interface;(S4) pass through ip_finish_output2 interface;(S5) add Add Vlan ethernet layer information;(S6) pass through dev_queue_xmit interface;(S7) pass through hard_start_xmit interface; Fast_l2 module give out a contract for a project method include the following steps: (A1) Fast_l2 module start;(A2) cache container is initialized;(A3) After protocol stack establishes the link tracking in step (S1), storage allocation, cache container allocation space, for saving the link are requested Ethernet layer header information;(A4) in step (S4) protocol stack data packet by ip_finish_output2 interface, data packet into Enter Fast_l2 module;(A5) cache is judged with the presence or absence of the ethernet layer header information linked belonging to data packet, if it is not, then jumping Go to step (A6);If so, going to step (A8);(A6) the link ethernet layer header information is added to cache;(A7) Judge whether cache succeeds, if it is not, being then back to step (S5);If so, going to step (A8);(A8) Ethernet is added Layer header information;(A9) step (A8) and step (S7), which are called, drives the function ndo_start_xmit that gives out a contract for a project to directly transmit data Packet;(A10) terminate.
In step (S1), when link tracking creates, distributed in one piece by Fast_l2cache container to fast_l2_ext Space is deposited, link tracking discharges the memory that corresponding fast_l2_ext is directed toward and returns to cache container when destroying.
In step (A4), the data packet into Fast_l2 module is determined by link tracking member fast_l2_ext variable Whether Ethernet, vlan header information have been saved in the memory of fast_l2_ext direction.
Wherein, every link tracking struct nf_conn structural body has a member variable fast_l2_ext, this at Member's variable is used to save interface used in Ethernet and vlan header information and hair data packet.
Wherein, the Ethernet header information cache of every link is discharged when linking and destroying.
Newly-built performance is promoted since the invention is suitable for all-network communication equipment, therefore by the invention with the shape of kernel module Formula (Fast_l2 kernel module) is described, and referring to Fig.1, implementation process is specific as follows for the flow diagram which realizes:
The process that three layers of standard protocol stack (ip layers) sends data packet to two layers is as shown in the black thick line left side Fig. 1, black thick line The right is then that Fast_l2 kernel module of the present invention optimizes the data packet after newly-built performance and gives out a contract for a project process.
Every link tracking struct nf_conn structural body has a member variable fast_l2_ext, which becomes Amount is used to save interface used in Ethernet and vlan header information and hair data packet.
When link tracking creation, one piece of memory is distributed to fast_l2_ext by Fast_l2cache container (memory pool) Space, link tracking discharge the memory that corresponding fast_l2_ext is directed toward and return to cache container when destroying;
After data packet has looked into routing at IP layers, finished NAT, pass through interface ip_output → ip_finish_output2 It is handled into two layers, Fast_l2 module adapter tube data packet at ip_finish_output2, takes over and successfully then enter Fast_l2 Module, otherwise data packet is added Ethernet and vlan header information by standard protocol stack and is sent.
Data packet into Fast_l2 module determines Ethernet, vlan by link tracking member fast_l2_ext variable Whether header information has been saved in the memory of fast_l2_ext direction;
If having saved relevant Ethernet and vlan header information in fast_l2_ext, corresponding interface is just called Ethernet and vlan header information are added for the data packet, driving is called directly after the completion of package and is given out a contract for a project function ndo_start_ Xmit directly transmits data packet.
If just calling corresponding interface by Ethernet without saving Ethernet and vlan header information in fast_l2_ext It is stored in vlan header information in the memory of fast_l2_ext direction;
Ethernet and vlan header information addition failure are then forwarded corresponding data packet by protocol stack, otherwise refer to the step Suddenly " if having saved relevant Ethernet and vlan header information in fast_l2_ext, just calling corresponding interface is the number According to packet addition Ethernet and vlan header information, it is direct that the driving function ndo_start_xmit that gives out a contract for a project is called directly after the completion of package Send data packet ".
Ethernet and vlan header information are added for data packet according to the linking status information of preservation in Fast_l2 module, Then it calls directly the driving function ndo_start_xmit that gives out a contract for a project and directly transmits data packet, skip entire agreement trestle and vlan Relevant treatment reduces CPU usage to a certain extent, to improve newly-built performance.
The present invention is that data packet adds Ethernet and the head vlan according to the linking status information of preservation in Fast_l2 module Then information calls directly the driving function ndo_start_xmit that gives out a contract for a project and sends out corresponding data packet, skips entire agreement The relevant treatment of trestle and vlan, this method reduce to a certain extent two layered data processing packet of protocol stack memory use and CPU consumption, so that improving product creates performance;In addition, small with the kernel module committed memory that the invention is write, memory compared with Nervous network communication equipment can load, portable high.And hook need to be only hung at ip_finish_output2 function Point takes data packet, and defines fast_l2_ext pointer variable in link tracking struct nf_conn structural body and take the link Two layers of cache information carry out package transmission, and the kernel module coupling write with this method is low.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Within mind and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (5)

1. a kind of method for promoting network communication equipment and creating performance, which is characterized in that it is given out a contract for a project by contrast standard protocol stack Method is given out a contract for a project method to illustrate Fast_l2 module;Standard protocol stack method of giving out a contract for a project includes the following steps:
(S1) protocol stack establishes the link tracking;
(S2) data packet completes NAT, and determines and need to forward to two layers;
(S3) pass through ip_output interface;
(S4) pass through ip_finish_output2 interface;
(S5) Vlan ethernet layer information is added;
(S6) pass through dev_queue_xmit interface;
(S7) pass through hard_start_xmit interface;
Fast_l2 module method of giving out a contract for a project includes the following steps:
(A1) Fast_l2 module starts;
(A2) cache container is initialized;
(A3) after protocol stack establishes the link tracking in step (S1), storage allocation, cache container allocation space, for protecting are requested Deposit the link ethernet layer header information;
(A4) protocol stack data packet passes through ip_finish_output2 interface in step (S4), and data packet enters Fast_l2 mould Block;
(A5) cache is judged with the presence or absence of the ethernet layer header information linked belonging to data packet, if it is not, then going to step (A6);If so, going to step (A8);
(A6) the link ethernet layer header information is added to cache;
(A7) judge whether cache succeeds, if it is not, being then back to step (S5);If so, going to step (A8);
(A8) ethernet layer header information is added;
(A9) step (A8) and step (S7), which are called, drives the function ndo_start_xmit that gives out a contract for a project to directly transmit data packet;
(A10) terminate.
2. promoting the method that network communication equipment creates performance as described in claim 1, which is characterized in that in step (S1), When link tracking creation, one piece of memory headroom, link tracking pin are distributed to fast_l2_ext by Fast_l2 cache container The memory that corresponding fast_l2_ext is directed toward is discharged when ruining and returns to cache container.
3. promoting the method that network communication equipment creates performance as claimed in claim 2, which is characterized in that in step (A4), Data packet into Fast_l2 module determines Ethernet, vlan header information by link tracking member fast_l2_ext variable Whether have been saved in the memory of fast_l2_ext direction.
4. the method as claimed in any one of claims 1-3 for promoting network communication equipment and creating performance, which is characterized in that every Item link tracking struct nf_conn structural body has a member variable fast_l2_ext, which is used to save Interface used in Ethernet and vlan header information and hair data packet.
5. as claimed in claim 4 promoted network communication equipment create performance method, which is characterized in that every link with Too net header information cache is discharged when linking and destroying.
CN201910237042.XA 2019-03-27 2019-03-27 Method for improving new building performance of network communication equipment Active CN109818982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910237042.XA CN109818982B (en) 2019-03-27 2019-03-27 Method for improving new building performance of network communication equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910237042.XA CN109818982B (en) 2019-03-27 2019-03-27 Method for improving new building performance of network communication equipment

Publications (2)

Publication Number Publication Date
CN109818982A true CN109818982A (en) 2019-05-28
CN109818982B CN109818982B (en) 2021-08-17

Family

ID=66610571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910237042.XA Active CN109818982B (en) 2019-03-27 2019-03-27 Method for improving new building performance of network communication equipment

Country Status (1)

Country Link
CN (1) CN109818982B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020150094A1 (en) * 2000-10-27 2002-10-17 Matthew Cheng Hierarchical level-based internet protocol multicasting
US20100238930A1 (en) * 2009-03-19 2010-09-23 Ambit Microsystems (Shanghai) Ltd. Router and method of forwarding ipv6 packets
CN103929418A (en) * 2014-03-28 2014-07-16 汉柏科技有限公司 Wireless Internet access method and system based on network safety equipment
CN104113463A (en) * 2014-07-24 2014-10-22 深圳市共进电子股份有限公司 Network bridge based data message processing method, device and network bridge
CN104796943A (en) * 2015-03-20 2015-07-22 北京汉柏科技有限公司 Method for wirelessly accessing internet by aid of user-state Ethernet protocols
CN107707481A (en) * 2017-11-27 2018-02-16 上海市共进通信技术有限公司 The message processing method of the WAN mouths of support Utag and Tag based on Vnet routers
CN109062542A (en) * 2018-03-15 2018-12-21 山东超越数控电子股份有限公司 A kind of method that domestic ten thousand Broadcom realizes network communication

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020150094A1 (en) * 2000-10-27 2002-10-17 Matthew Cheng Hierarchical level-based internet protocol multicasting
US20100238930A1 (en) * 2009-03-19 2010-09-23 Ambit Microsystems (Shanghai) Ltd. Router and method of forwarding ipv6 packets
CN103929418A (en) * 2014-03-28 2014-07-16 汉柏科技有限公司 Wireless Internet access method and system based on network safety equipment
CN104113463A (en) * 2014-07-24 2014-10-22 深圳市共进电子股份有限公司 Network bridge based data message processing method, device and network bridge
CN104796943A (en) * 2015-03-20 2015-07-22 北京汉柏科技有限公司 Method for wirelessly accessing internet by aid of user-state Ethernet protocols
CN107707481A (en) * 2017-11-27 2018-02-16 上海市共进通信技术有限公司 The message processing method of the WAN mouths of support Utag and Tag based on Vnet routers
CN109062542A (en) * 2018-03-15 2018-12-21 山东超越数控电子股份有限公司 A kind of method that domestic ten thousand Broadcom realizes network communication

Also Published As

Publication number Publication date
CN109818982B (en) 2021-08-17

Similar Documents

Publication Publication Date Title
CN103810115B (en) The management method and device of a kind of memory pool
CN104158755B (en) The methods, devices and systems of transmitting message
CN107122249A (en) A kind of task unloading decision-making technique based on edge cloud pricing mechanism
CN103024855A (en) Information forwarding method in opportunity network based on node excitation
CN101730086A (en) High speed downloading method of mobile terminal connecting multiple gateways and starting multiple threads
US9042225B2 (en) Minimizing power consumption in a network device
CN101521683A (en) Online game system and accessing method and client communication method thereof
CN110035440A (en) A kind of new distribution type access planar network architecture based on block chain
CN104572498B (en) The buffer memory management method and device of message
CN107317759A (en) A kind of thread-level dynamic equalization dispatching method of network interface card
CN103188042A (en) Matching method and matching accelerator of Internet protocol (IP) data package
CN102111383A (en) Method for preventing DOS attack by utilizing priority queue
CN104486442B (en) Data transmission method, the device of distributed memory system
CN107135189A (en) A kind of file transmitting method and physical machine
CN106911740A (en) A kind of method and apparatus of cache management
CN109818982A (en) A method of it promoting network communication equipment and creates performance
CN102148803A (en) Method and device for matching messages
CN107819853B (en) A kind of data transmission method and device
CN101702821A (en) Admittance method, device and communication system
CN104753813A (en) DMA (Direct Memory Access) message transfer method
CN110109865A (en) A kind of date storage method, device, equipment and readable storage medium storing program for executing
CN113766540B (en) Low-delay network content transmission method, device, electronic equipment and medium
CN108737557A (en) A kind of data pack transmission method, terminal and computer storage media
CN109117288A (en) A kind of message optimisation method of low latency bypass
CN103401806B (en) Message processing method and device

Legal Events

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