CN106982170A - Multi-link load balance method and device based on linux system - Google Patents

Multi-link load balance method and device based on linux system Download PDF

Info

Publication number
CN106982170A
CN106982170A CN201710256938.3A CN201710256938A CN106982170A CN 106982170 A CN106982170 A CN 106982170A CN 201710256938 A CN201710256938 A CN 201710256938A CN 106982170 A CN106982170 A CN 106982170A
Authority
CN
China
Prior art keywords
network interface
linux system
virtual network
equipment
load balance
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.)
Pending
Application number
CN201710256938.3A
Other languages
Chinese (zh)
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.)
Haijia Network Science & Technology Co Ltd Shanghai
Original Assignee
Haijia Network Science & Technology Co Ltd Shanghai
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 Haijia Network Science & Technology Co Ltd Shanghai filed Critical Haijia Network Science & Technology Co Ltd Shanghai
Priority to CN201710256938.3A priority Critical patent/CN106982170A/en
Publication of CN106982170A publication Critical patent/CN106982170A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches

Landscapes

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

Abstract

Present invention is disclosed a kind of multi-link load balance method and device based on linux system, method is included in the virtual network interface equipment created in the network equipment of operation linux system for receiving IP packets;The IP packets received are configured to ethernet data frame and send the ethernet data frame into the purpose network equipment by switch device by the virtual network interface equipment.The present invention has the advantages that to realize the multi-link load balance based on IP packets in a local network.

Description

Multi-link load balance method and device based on linux system
Technical field
The present invention relates to network technique field, more particularly, to a kind of multi-link load balance side based on linux system Method and device.
Background technology
The service of enterprise network balancing link load can balance the traffic load of network link, be entered according to the real-time response time Row judges, transfers to the link of most lightly loaded to handle task.
In the conventional method for realizing balancing link load, TEQL (True Link Equalizer) method is merely able to fit For in wide area network, it is impossible to suitable for LAN, and it realizes that load balancing is, by packet mode in a balanced way, not consider Speed difference between each data link.Network interface card BONDING patterns are that two pieces of network interface cards with identical IP address are parallel Link aggregation works into a logical links, wherein, it is necessary to which interchanger supports port to gather in network interface card BONDING patterns 0/4 Close, and do not support or not the multilink based on three-layer network IP bags to bear in multi-to-multi link mode, network interface card BONDING patterns 6 Carry balanced.
How multi-link load balance based on three-layer network IP bag be urgent need to resolve the problem of is realized in a local network.
The content of the invention
It is an object of the invention to the defect for overcoming prior art, there is provided a kind of multilink load based on linux system Equalization methods and device, the multi-link load balance based on IP packets can be realized in a local network.
To achieve the above object, the present invention proposes a kind of following technical scheme:A kind of multilink based on linux system is born Equalization methods are carried, including:
S1, creates the virtual network interface equipment for receiving IP packets in the network equipment of operation linux system;
S2, the virtual network interface equipment by the IP packets received be configured to ethernet data frame and will it is described with Too net data frame is sent into the purpose network equipment.
Preferably, in step S1, virtual network device include virtual network interface, and with the virtual network interface phase Corresponding queue rule, the physical network interface of the network equipment of the operation linux system need to be tied to virtual network interface In corresponding queue rule.
Preferably, in step S2, carry out subpackage to the IP packets that receive, and by the IP packets after subpackage construct with Too net data frame.Preferably, in step S2, virtual network interface equipment rotates forwarding Ethernet on the physical network interface Data frame.
Another technical scheme is also provided:A kind of multi-link load balance device based on linux system, including
Virtual network interface equipment creating unit, is created in the network equipment of operation linux system for receiving IP numbers According to the virtual network interface equipment of bag;
Ethernet frame structural unit, for the IP received packets to be configured into ethernet data frame, and will it is described with Too net data frame is sent into the purpose network equipment.
Preferably, virtual network device includes virtual network interface, and the team corresponding with the virtual network interface Row rule, the physical network interface of the network equipment of the operation linux system need to be tied to the corresponding team of virtual network interface In row rule.
Preferably, the ethernet frame structural unit carries out subpackage to IP packets, and constructs ethernet data frame.
Preferably, the virtual network interface equipment rotates forwarding ethernet data frame on the physical network interface.
The beneficial effects of the invention are as follows:
Compared with prior art, the multi-link load balance method and device of the present invention based on linux system, energy It is enough to realize the multi-link load balance based on IP packets, further improve network throughput performance;Can also realize base simultaneously In IP datagram multilink connection there is provided link redundancy.
Brief description of the drawings
Fig. 1 is flow chart of the method for the present invention schematic diagram;
Fig. 2 is embodiments of the invention structured flowchart schematic diagram;
Fig. 3 is the apparatus structure block diagram representation of the present invention.
Embodiment
Below in conjunction with the accompanying drawing of the present invention, the technical scheme to the embodiment of the present invention carries out clear, complete description.
A kind of disclosed multi-link load balance method based on linux system, applied in LAN, energy It is enough to realize the multi-link load balance based on three layers of IP packet.
As shown in figure 1, a kind of multi-link load balance method based on linux system, including
S1, creates the virtual network interface equipment for receiving IP packets in the network equipment of operation linux system;
Specifically, load balancing needs two-way realization, the network equipment of both link ends needs to simultaneously participate in, can be fine Realize that loaded link is balanced.Accordingly, it would be desirable to be created in the network equipment that both link ends run linux system for receiving IP The virtual network interface equipment of packet.
Virtual network device includes virtual network interface, and the qdisc corresponding with the virtual network interface (queueing discipline, queue discipline).If linux kernel is sent out by some physical network interface on the network equipment Packet is sent, then needs to add in data packet queue packet according to the qdisc configured for this physical network interface, kernel Packet is taken out inside qdisc as much as possible, it is forwarded from physical network interface.
In order to realize load balancing, it is necessary to which virtual network interface is associated with physical network interface, accordingly, it would be desirable to will Physical network interface is tied in the corresponding queue rule of virtual network interface, is bound physical interface equipment by such as issuing orders Into queue rule:
Tc qdisc add dev DEV root teq10, wherein, DEV is the physical network interface on the network equipment, Teq10 is the corresponding queue rule of virtual network interface.
As shown in Fig. 2 in the present embodiment, being carried out by taking the network equipment of two operation linux systems in LAN as an example Detailed description.Described two network equipments include two physical network interface Ethernet2 and Ethernet3, described two The individual network equipment is connected by interchanger, sets up two data link.Next, being created on the network equipment at data link two ends Virtual network interface equipment is built, according to establishment of such as issuing orders:
The network equipment 1:
tc qdisc add dev eth2 root teq10
tc qdisc add dev eth3 root teq10
ip link set teq10 up
The network equipment 2:
tc qdisc add dev eth2 root teq10
tc qdisc add dev eth3 root teq10
ip link set teq10 up
The physical network interface of following Configuration network equipment 1 and the IP address of virtual network interface:
ip addr add dev teq10 192.168.4.82/24
ip addr add dev eth2 192.168.2.82/24
ip addr add dev eth3 192.168.3.82/24
The physical network interface of Configuration network equipment 2 and the IP address of virtual network interface:
ip addr add dev teq10 192.168.4.82/24
ip addr add dev eth2 192.168.2.82/24
ip addr add dev eth3 192.168.3.82/24
Wherein, the data that the interfaces of physical network interface Ethernet 2 are received on the network equipment 1 by interchanger send to On physical network interface Ethernet 2 on the network equipment 2, the interfaces of physical network interface Ethernet 3 are received on the network equipment To data sent by interchanger to the network equipment 2 on physical network interface Ethernet 3, altogether formed two Data-Links Road.
With reference to shown in Fig. 1 and Fig. 2, the IP packets received are configured to by step S2, the virtual network interface equipment Ethernet data frame simultaneously sends the ethernet data frame into the purpose network equipment.
Specifically, when the virtual network interface teq10 interfaces on the network equipment 1 receive IP packets, according to dispatching algorithm To IP packets carry out subpackage, and packet header add 14 bytes Composition of contents ethernet frame, i.e., the purpose MAC of 6 bytes, The source MAC of 6 bytes, and 2 bytes type, the upper strata IP agreement that the types of 2 bytes is indicated.
After IP packets are converted into ethernet frame, the corresponding queue rule of interface rotates candidate from physical interface Interface is managed, and sends ethernet frame into interchanger from the physical interface of selection.
When queue rule distributes ethernet data frame to Ethernet 2 on the network equipment 1, the interfaces of Ethernet 2 It is forwarded in interchanger, because the interfaces of Ethernet 2 on the network equipment 1 with the Ethernet 2 on the network equipment 2 belong to same One subnet, therefore, ethernet data frame are forwarded in the interfaces of Ethernet 2 on the network equipment 2.
As shown in figure 3, a kind of multi-link load balance device based on linux system, including
Virtual network interface equipment creating unit, is created in the network equipment of operation linux system for receiving IP numbers According to the virtual network interface equipment of bag;
Ethernet frame structural unit, for the IP received packets to be configured into ethernet data frame, and will it is described with Too net data frame is sent into the purpose network equipment.
Further, virtual network device includes virtual network interface, and corresponding with the virtual network interface Queue rule.If linux kernel sends packet by some physical network interface on the network equipment, need according to for this The qdisc of individual physical network interface configuration adds packet in data packet queue, and kernel takes inside qdisc as much as possible Go out packet, it is forwarded from physical network interface, accordingly, it would be desirable to by the physical network interface on the network equipment It need to be tied in the corresponding queue rule of virtual network interface, be bound according to such as issuing orders:
tc qdisc add dev DEV root teq10
Wherein, DEV is physical network interface, and teq10 is the corresponding queue rule of virtual network interface.
The ethernet frame structural unit will receive after IP packets and carry out subpackage, and structure to IP packets according to algorithm Make ethernet data frame.Specifically, adding the Composition of contents ethernet frame of 14 bytes, i.e., the purpose of 6 bytes in IP packet header Address MAC, the source address MAC of 6 bytes, and 2 bytes type, the type of 2 bytes indicates to be wrapped in ethernet frame The protocol type contained is IP agreement.
Further, the virtual network interface equipment rotates forwarding Ethernet data on the physical network interface Frame.Specifically, after IP packets are converted into ethernet frame, the corresponding queue rule of interface rotates selection from physical interface Physical interface, and send ethernet frame into interchanger from the physical interface of selection.
The present invention can realize the multi-link load balance based on IP packets, further improve network throughput performance;Together When can also be realize based on IP datagram multilink connection there is provided link redundancy.
The technology contents and technical characteristic of the present invention have revealed that as above, but those skilled in the art still may base Make a variety of replacements and modification without departing substantially from spirit of the present invention, therefore, the scope of the present invention in teachings of the present invention and announcement The content disclosed in embodiment should be not limited to, and various replacements and modification without departing substantially from the present invention should be included, and is this patent Shen Please claim covered.

Claims (8)

1. a kind of multi-link load balance method based on linux system, it is characterised in that including:
S1, creates the virtual network interface equipment for receiving IP packets in the network equipment of operation linux system;
The IP packets received are configured to ethernet data frame and by the Ethernet by S2, the virtual network interface equipment Data frame is sent into the purpose network equipment.
2. a kind of multi-link load balance method based on linux system according to claim 1, it is characterised in that step In rapid S1, virtual network interface equipment includes virtual network interface, and the queue rule corresponding with the virtual network interface Then, the physical network interface of the network equipment of the operation linux system need to be tied to the corresponding queue rule of virtual network interface In then.
3. a kind of multi-link load balance method based on linux system according to claim 1, it is characterised in that step In rapid S2, subpackage is carried out to the IP packets received, and the IP packets after subpackage are constructed into ethernet data frame.
4. a kind of multi-link load balance method based on linux system according to claim 2, it is characterised in that step In rapid S2, virtual network interface equipment rotates forwarding ethernet data frame on the physical network interface.
5. a kind of multi-link load balance device based on linux system, it is characterised in that including
Virtual network interface equipment creating unit, is created in the network equipment of operation linux system for receiving IP packets Virtual network interface equipment;
Ethernet frame structural unit, for the IP received packets to be configured into ethernet data frame, and by the Ethernet Data frame is sent into the purpose network equipment.
6. a kind of multi-link load balance device based on linux system according to claim 5, it is characterised in that empty Intending the network equipment includes virtual network interface, and the queue rule corresponding with the virtual network interface, the operation The physical network interface of the network equipment of linux system need to be tied in the corresponding queue rule of virtual network interface.
7. a kind of multi-link load balance device based on linux system according to claim 5, it is characterised in that institute State ethernet frame structural unit and subpackage is carried out to IP packets, and construct ethernet data frame.
8. a kind of multi-link load balance device based on linux system according to claim 5, it is characterised in that institute State virtual network interface equipment and forwarding ethernet data frame is rotated on the physical network interface.
CN201710256938.3A 2017-04-19 2017-04-19 Multi-link load balance method and device based on linux system Pending CN106982170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710256938.3A CN106982170A (en) 2017-04-19 2017-04-19 Multi-link load balance method and device based on linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710256938.3A CN106982170A (en) 2017-04-19 2017-04-19 Multi-link load balance method and device based on linux system

Publications (1)

Publication Number Publication Date
CN106982170A true CN106982170A (en) 2017-07-25

Family

ID=59345802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710256938.3A Pending CN106982170A (en) 2017-04-19 2017-04-19 Multi-link load balance method and device based on linux system

Country Status (1)

Country Link
CN (1) CN106982170A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109639590A (en) * 2019-01-15 2019-04-16 网宿科技股份有限公司 Realize the data transmission method and routing node device of the equilibrium of non-equivalence line load
CN114285786A (en) * 2021-12-24 2022-04-05 中国农业银行股份有限公司 Method and device for constructing network link library

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335663A (en) * 2007-06-26 2008-12-31 中国科学院声学研究所 Wireless local area network access method
KR20090090806A (en) * 2008-02-22 2009-08-26 삼성전자주식회사 Method and apparatus for providing ip multicasting packet ternaling
CN101867521A (en) * 2010-06-11 2010-10-20 郭小雪 Multilink accessing and flow load dispatching managing method
CN102752203A (en) * 2012-06-30 2012-10-24 深圳市同洲电子股份有限公司 Method and network device for creating multiple virtual network interfaces
CN103176780A (en) * 2011-12-22 2013-06-26 中国科学院声学研究所 Binding system and method of multiple network interfaces

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335663A (en) * 2007-06-26 2008-12-31 中国科学院声学研究所 Wireless local area network access method
KR20090090806A (en) * 2008-02-22 2009-08-26 삼성전자주식회사 Method and apparatus for providing ip multicasting packet ternaling
CN101867521A (en) * 2010-06-11 2010-10-20 郭小雪 Multilink accessing and flow load dispatching managing method
CN103176780A (en) * 2011-12-22 2013-06-26 中国科学院声学研究所 Binding system and method of multiple network interfaces
CN102752203A (en) * 2012-06-30 2012-10-24 深圳市同洲电子股份有限公司 Method and network device for creating multiple virtual network interfaces

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109639590A (en) * 2019-01-15 2019-04-16 网宿科技股份有限公司 Realize the data transmission method and routing node device of the equilibrium of non-equivalence line load
CN109639590B (en) * 2019-01-15 2022-08-30 网宿科技股份有限公司 Data transmission method for realizing load balance of non-equivalent line and routing node equipment
CN114285786A (en) * 2021-12-24 2022-04-05 中国农业银行股份有限公司 Method and device for constructing network link library
CN114285786B (en) * 2021-12-24 2023-12-08 中国农业银行股份有限公司 Construction method and device of network link library

Similar Documents

Publication Publication Date Title
US9013994B2 (en) Distributed chassis architecture having integrated service appliances
CN104780088B (en) A kind of transmission method and equipment of service message
US20190044888A1 (en) Methods and apparatus for providing services in a distributed switch
CN104125191B (en) Processing method, equipment and the system of point-to-point protocol based on Ethernet
CN103081418B (en) Computer system and communication method in computer system
CN107566440A (en) The automatic discovery that is serviced in the network environment of software definition and automatic scalable
CN106576073B (en) Method and system for transmitting data through aggregated connections
CN103391296B (en) A kind of controller, transponder and Path Setup method and system
CN108886825A (en) Distributed software defines packet radio core system
EP2680536B1 (en) Methods and apparatus for providing services in a distributed switch
CN102904825B (en) A kind of message transmitting method based on Hash and equipment
CN100591048C (en) Method for equilibrating network-flow load and the third-level exchanger
CN105791145B (en) Message transmitting method and device based on equal cost multipath ECMP
CN103905284B (en) A kind of flow load sharing method and apparatus based on EVI networks
US9450877B1 (en) Methods and apparatus for load balancing communication sessions
CN106686137B (en) Network isolating device load-balancing method based on L2 data forwarding
CN103095600A (en) Loading balancing method based on Trill network and routing device
CN105577566A (en) Message gathering transmission method, device and system
CN106130920A (en) A kind of message forwarding method and device
CN106982170A (en) Multi-link load balance method and device based on linux system
CN104469822A (en) Testing method, base station and system
CN107733930A (en) For forwarding Internet protocol in multiple WAN network gateways(IP)The method and system of packet
CN102255816A (en) Method and device for load sharing
CN103391251B (en) A kind of method and apparatus reducing redundant flow in PBB network
CN110391961A (en) A kind of tunnel binding method, equipment and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170725