CN104104518A - Virtual method of multiple Ethernet controllers in embedded system - Google Patents
Virtual method of multiple Ethernet controllers in embedded system Download PDFInfo
- Publication number
- CN104104518A CN104104518A CN201310127678.1A CN201310127678A CN104104518A CN 104104518 A CN104104518 A CN 104104518A CN 201310127678 A CN201310127678 A CN 201310127678A CN 104104518 A CN104104518 A CN 104104518A
- Authority
- CN
- China
- Prior art keywords
- port
- vlan
- ethernet
- exchange chip
- message
- 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
Links
Landscapes
- Small-Scale Networks (AREA)
Abstract
The invention discloses a virtual method of multiple Ethernet controllers in an embedded system, comprising the following steps: a switch chip is set to a management mode, and all packets which come from an LAN port of the switch chip are forwarded to an IMP port; an IEEE802.1Q VLAN function of the switch chip is enabled, and a VLAN learning mode is set to a learning mode based on MAC and PVID; a unicast lookup failure forwarding mode of the switch chip is set as forwarding to the LAN port; as for a switch chip having N LAN ports, N IEEE802.1Q VLANs are divided inside the switch chip, and each LAN port and the IMP port are positioned at the same VLAN, wherein N is a natural number; and MAC addresses of ethernet controllers corresponding to the N LAN ports are added into a static address table of the switch chip. By the method, design complexity of an interface circuit between the Ethernet controllers and a CPU and hardware costs can be reduced, and Ethernet drive program design difficulty and time cost are minimized.
Description
Technical field
The present invention relates to use in a kind of embedded system the method for the virtual multiple ethernet controllers of single management type Ethernet switching chip.
Background technology
For the embedded system of network-oriented application, in order to increase network throughput, system has generally all configured multiple independently ethernet controllers, and each ethernet controller is by independently driver and protocol stack carry out alternately.This design has weak point on hardware and software, is embodied in:
(1) on hardware, need to consider the circuit interface between each ethernet controller and CPU, interface circuit complexity, hardware cost is high;
(2), on software, need to write driver for each ethernet controller, if these ethernet controller models are identical, driver code can be reused, if model difference, just must write different drivers, strengthen difficulty and the time cost of Software for Design.
Summary of the invention
Object of the present invention, be to provide the method for virtual multiple ethernet controllers in a kind of embedded system, in the ethernet controller subordinate act that it fictionalizes, be equal to independently ethernet controller, reduce complexity and the hardware cost of interface circuit design between ethernet controller and CPU, reduce difficulty and the time cost of ethernet driver design.
In order to reach above-mentioned purpose, solution of the present invention is:
In embedded system, a method for virtual multiple ethernet controllers, comprises the steps:
(1) exchange chip is set to management mode, makes all message repeatings that come from exchange chip LAN port to IMP port;
(2) enable the IEEE802.1Q functionality of vlan of exchange chip, it is the mode of learning based on MAC and PVID that VLAN mode of learning is set;
(3) clean culture that exchange chip is set is searched unsuccessfully forward mode for to LAN port repeat;
(4) for the exchange chip with N LAN port, at N IEEE802.1Q VLAN of exchange chip internal separation, each LAN port is positioned at same VLAN with IMP port respectively, and wherein, N is natural number:
(5) MAC Address of the corresponding ethernet controller of this N LAN port is added in the static address table of exchange chip.
Ethernet controller in embedded system receives the Ethernet message from IMP port, forwards the packet the driver of the virtual ethernet controller corresponding to same LAN port according to the VLAN label in message, specifically comprises following content:
(a) in operating system, add multiple ethernet device drivers, a port of each driver and exchange chip is corresponding; Drive sending strategy by: the message that protocol stack is sent here is stamped the VLAN label of the corresponding IEEE802.1Q VLAN of port, the original ethernet controller driver of the system that is then transmitted to; The reception strategy driving is: original system ethernet controller driver is forwarded after the message coming removes IEEE802.1Q VLAN label and sends into protocol stack;
(b) the reception strategy of the original ethernet controller driver of amendment system is: the message of receiving is no longer sent into protocol stack, but gives corresponding virtual ethernet controller driver according to VLAN label forwarding.
Adopt after such scheme, the present invention is by carrying out suitable configuration and add virtual ethernet driver in embedded system to exchange chip, from the outside of embedded system and from the angle of embedded system, in the port subordinate act of Ethernet switching chip, be equal to independently ethernet controller, reduce complexity and the hardware cost of interface circuit design between ethernet controller and CPU, reduce difficulty and the time cost of ethernet driver design.
Brief description of the drawings
Fig. 1 is the division methods schematic diagram of VLAN in the present invention;
Fig. 2 is the Hardware Design figure of the embodiment of the present invention;
Fig. 3 is flow chart of the present invention.
Embodiment
The method that the invention provides virtual multiple ethernet controllers in a kind of embedded system, comprises the steps:
(1) exchange chip is set to management mode, makes all message repeatings that come from exchange chip LAN port to IMP(Inband Management Port) port;
(2) enable the IEEE802.1Q functionality of vlan of exchange chip, it is the mode of learning based on MAC and PVID that VLAN mode of learning is set, and this is prior art, no longer describes in detail;
(3) clean culture that exchange chip is set is searched unsuccessfully forward mode for to LAN port repeat;
(4) be natural number for thering is N(N) exchange chip of individual LAN port, at N IEEE802.1Q VLAN of exchange chip internal separation, make each LAN port be positioned at same VLAN with IMP port respectively, isolation mutually between LAN port, the division methods of VLAN can be referring to shown in Fig. 1;
(5) MAC Address of the corresponding ethernet controller of this N LAN port is added in the static address table of exchange chip.
Ethernet controller in embedded system receives the Ethernet message from IMP port, forwards the packet the driver of the virtual ethernet controller corresponding to same LAN port according to the VLAN label in message.Due to exchange chip in internal separation IEEE802.1Q VLAN, Ethernet message can be stamped IEEE802.1Q VLAN label by exchanged chip the process that enters CPU from LAN port repeat to IMP port, if this message is want correctly to be identified by protocol stack, must remove VLAN label.Similarly, if operating system is want to E-Packet to LAN port by IMP port, also must add the label of corresponding VLAN.This just need to amendment system in original ethernet driver, add virtual ethernet driver, specific practice following (as shown in Figure 3) simultaneously:
(1) in operating system, add multiple ethernet device drivers, a port of each driver and exchange chip is corresponding.Drive sending strategy (protocol stack is called sending strategy by driver by Ethernet message transmitting system) by: the message that protocol stack is sent here is stamped the VLAN label of the corresponding IEEE802.1Q VLAN of port, the original ethernet controller driver of the system that is then transmitted to.The reception strategy (ethernet controller is received message, message is passed to driver and be called reception strategy) driving is: original system ethernet controller driver is forwarded after the message coming removes IEEE802.1Q VLAN label and sends into protocol stack.
(2) the reception strategy of the original ethernet controller driver of amendment system is: the message of receiving is no longer sent into protocol stack, but gives corresponding virtual ethernet controller driver according to VLAN label forwarding.
Below taking a concrete embedded system as example illustrates whole implementation process.The CPU of this embedded system adopts the P1020 chip of freescale company, and exchange chip adopts the BCM53101M chip of Broadcom company, and operating system adopts linux operating system, and the Hardware Design figure is as Fig. 2.In native system, BCM53101M exchange chip will be invented 6 independently ethernet controllers.
1, below the be correlated with concrete steps of setting of exchange chip are described.Step 1: reset exchange chip, after resetting, the setting of exchange chip is all set to default setting.Step 2: IMP port speed is set to 1000Mbps.Because the port speed of port 0-port 5 is 100Mbps, the message repeating of these 6 ports can cause the speed of IMP port to reach 600Mbps to IMP port, therefore must be set to 1000Mbps ability rate matched by IMP port speed.Step 3: at independently IEEE802.1Q VLAN of 6 of exchange chip internal separation, each LAN port and IMP port are positioned at a vlan domain, realize the isolation between LAN port.Step 4: forward mode that exchange chip clean culture searches failure is set for to LAN port repeat, add the MAC Address of 6 ports in exchange chip static address table, solved the problem that study causes message to forward less than the MAC Address of port 0-port 5 after exchange chip internal mac address aging.
2, how the reception strategy that illustrates original ethernet driver in system is below revised, and how the virtual ethernet driver of interpolation works.
In system, the reception strategy of original ethernet driver is:
(1) eTSEC receives Ethernet message;
(2) judge that whether message is legal, if legal, forward (3) to, illegal forwarding to (4);
(3) message is passed to upper-layer protocol stack;
(4) finish.
In system, the amended reception strategy of original ethernet driver is:
(1) eTSEC receives Ethernet message;
(2) judge that message, whether with IEEE802.1Q VLAN label, if so, forwards the packet to corresponding virtual device driver according to VLAN ID, forward (5) to; If not, forward (3) to;
(3) judge that whether message is legal, if legal, forward (4) to, illegal forwarding to (5);
(4) message is passed to upper-layer protocol stack;
(5) finish.
The reception strategy of virtual ethernet controller driver is:
(1) virtual ethernet controller receives that eTSEC forwards the Ethernet message of coming;
(2) remove the IEEE802.1Q VLAN label in message;
(3) judge that whether message is legal, if legal, forward (4) to, illegal forwarding to (5);
(4) message is passed to upper-layer protocol stack;
(5) finish.
The sending strategy of virtual ethernet controller driver is:
(1) virtual ethernet controller is received the message that upper-layer protocol stack is sent;
(2) add the IEEE802.1Q VLAN label of the corresponding vlan domain of virtual ethernet controller to message;
(3) forward the packet to ethernet controller eTSEC;
(4) finish.
Above embodiment only, for explanation technological thought of the present invention, can not limit protection scope of the present invention with this, every technological thought proposing according to the present invention, and any change of doing on technical scheme basis, within all falling into protection range of the present invention.
Claims (2)
1. a method for virtual multiple ethernet controllers in embedded system, is characterized in that comprising the steps:
(1) exchange chip is set to management mode, makes all message repeatings that come from exchange chip LAN port to IMP port;
(2) enable the IEEE802.1Q functionality of vlan of exchange chip, it is the mode of learning based on MAC and PVID that VLAN mode of learning is set;
(3) clean culture that exchange chip is set is searched unsuccessfully forward mode for to LAN port repeat;
(4) for the exchange chip with N LAN port, at N IEEE802.1Q VLAN of exchange chip internal separation, each LAN port is positioned at same VLAN with IMP port respectively, and wherein, N is natural number:
(5) MAC Address of the corresponding ethernet controller of this N LAN port is added in the static address table of exchange chip.
2. the method for virtual multiple ethernet controllers in a kind of embedded system as claimed in claim 1, it is characterized in that: the ethernet controller in embedded system receives the Ethernet message from IMP port, the driver that forwards the packet the virtual ethernet controller corresponding to same LAN port according to the VLAN label in message, specifically comprises following content:
(a) in operating system, add multiple ethernet device drivers, a port of each driver and exchange chip is corresponding; Drive sending strategy by: the message that protocol stack is sent here is stamped the VLAN label of the corresponding IEEE802.1Q VLAN of port, the original ethernet controller driver of the system that is then transmitted to; The reception strategy driving is: original system ethernet controller driver is forwarded after the message coming removes IEEE802.1Q VLAN label and sends into protocol stack;
(b) the reception strategy of the original ethernet controller driver of amendment system is: the message of receiving is no longer sent into protocol stack, but gives corresponding virtual ethernet controller driver according to VLAN label forwarding.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310127678.1A CN104104518A (en) | 2013-04-12 | 2013-04-12 | Virtual method of multiple Ethernet controllers in embedded system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310127678.1A CN104104518A (en) | 2013-04-12 | 2013-04-12 | Virtual method of multiple Ethernet controllers in embedded system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104104518A true CN104104518A (en) | 2014-10-15 |
Family
ID=51672344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310127678.1A Pending CN104104518A (en) | 2013-04-12 | 2013-04-12 | Virtual method of multiple Ethernet controllers in embedded system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104104518A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104283714A (en) * | 2014-10-22 | 2015-01-14 | 上海斐讯数据通信技术有限公司 | Exchanger and system and method for achieving multiple management VLANs |
CN105610666A (en) * | 2015-12-18 | 2016-05-25 | 曙光信息产业(北京)有限公司 | Interface extension method and device based on linux operating system |
CN107147572A (en) * | 2017-07-17 | 2017-09-08 | 厦门四信通信科技有限公司 | A kind of method that many standalone gateways of software construction are used based on separate unit gateway |
CN107222335A (en) * | 2017-05-25 | 2017-09-29 | 深圳震有科技股份有限公司 | Realize the method and system of the different VLAN of configuration many IP common ports |
CN107566238A (en) * | 2017-08-30 | 2018-01-09 | 成都安恒信息技术有限公司 | A kind of method of User space configuration physical interface automatic identification vlan frames and non-vlan frames |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070110077A1 (en) * | 2005-11-11 | 2007-05-17 | Hitachi, Ltd. | Virtual network management method, virtual network management program, virtual network management system, and virtual network means |
CN101115006A (en) * | 2007-08-21 | 2008-01-30 | 杭州华三通信技术有限公司 | Three-layer packet forwarding method and routing device and two-layer switch module |
CN101741664A (en) * | 2009-12-21 | 2010-06-16 | 中兴通讯股份有限公司 | Method and device for realizing Ethernet interface system |
CN101867520A (en) * | 2010-06-12 | 2010-10-20 | 迈普通信技术股份有限公司 | Method for exchanging data between board cards in distribution type system |
CN102355415A (en) * | 2011-09-27 | 2012-02-15 | 瑞斯康达科技发展股份有限公司 | Method and device for transmitting messages between CPUs (Central Processing Unit) |
CN102932174A (en) * | 2012-10-25 | 2013-02-13 | 华为技术有限公司 | Method, device and physical host for managing physical network card |
-
2013
- 2013-04-12 CN CN201310127678.1A patent/CN104104518A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070110077A1 (en) * | 2005-11-11 | 2007-05-17 | Hitachi, Ltd. | Virtual network management method, virtual network management program, virtual network management system, and virtual network means |
CN101115006A (en) * | 2007-08-21 | 2008-01-30 | 杭州华三通信技术有限公司 | Three-layer packet forwarding method and routing device and two-layer switch module |
CN101741664A (en) * | 2009-12-21 | 2010-06-16 | 中兴通讯股份有限公司 | Method and device for realizing Ethernet interface system |
CN101867520A (en) * | 2010-06-12 | 2010-10-20 | 迈普通信技术股份有限公司 | Method for exchanging data between board cards in distribution type system |
CN102355415A (en) * | 2011-09-27 | 2012-02-15 | 瑞斯康达科技发展股份有限公司 | Method and device for transmitting messages between CPUs (Central Processing Unit) |
CN102932174A (en) * | 2012-10-25 | 2013-02-13 | 华为技术有限公司 | Method, device and physical host for managing physical network card |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104283714A (en) * | 2014-10-22 | 2015-01-14 | 上海斐讯数据通信技术有限公司 | Exchanger and system and method for achieving multiple management VLANs |
CN105610666A (en) * | 2015-12-18 | 2016-05-25 | 曙光信息产业(北京)有限公司 | Interface extension method and device based on linux operating system |
CN107222335A (en) * | 2017-05-25 | 2017-09-29 | 深圳震有科技股份有限公司 | Realize the method and system of the different VLAN of configuration many IP common ports |
CN107147572A (en) * | 2017-07-17 | 2017-09-08 | 厦门四信通信科技有限公司 | A kind of method that many standalone gateways of software construction are used based on separate unit gateway |
CN107566238A (en) * | 2017-08-30 | 2018-01-09 | 成都安恒信息技术有限公司 | A kind of method of User space configuration physical interface automatic identification vlan frames and non-vlan frames |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2282453B1 (en) | Routing frames in a shortest path computer network for a multi-homed legacy bridge node | |
EP2202923B1 (en) | Routing frames in a computer network using bridge identifiers | |
US7995499B2 (en) | Minimizing spanning-tree protocol event processing and flooding in distribution networks | |
CN104104518A (en) | Virtual method of multiple Ethernet controllers in embedded system | |
JP2014527340A5 (en) | ||
CN104937885A (en) | Global VLANs for fabric switches | |
EP2911354A1 (en) | Method, device and system for bidirectional flow on same path in aggregation group | |
EP2928133B1 (en) | Method and apparatus for accessing shortest-route bridge network in multi-homed manner | |
WO2015127643A1 (en) | Method and communication node for learning mac address in a layer-2 communication network | |
RU2641483C2 (en) | Connection fault management in communication network | |
CN104125128A (en) | Method for supporting VLAN (virtual local area network) by aid of Linux soft bridge | |
US20140086100A1 (en) | Multi-Chassis Cluster Synchronization Using Shortest Path Bridging (SPB) Service Instance Identifier (I-SID) Trees | |
WO2013097639A1 (en) | Expanding member ports of a link aggregation group between clusters | |
TW201534081A (en) | Network devices and loopback detection methods | |
US20150381466A1 (en) | Micro-OAM for Link Groups | |
US9860160B2 (en) | Multipath switching using per-hop virtual local area network classification | |
CN102045250B (en) | Forwarding method for multicast message in VPLS, and service provider edge equipment | |
EP2775663B1 (en) | Method and device for recovering customer service | |
US9755970B2 (en) | Information processing method, device and system | |
WO2012143943A3 (en) | Multi-host ethernet controller | |
CN102647359B (en) | Method for implementing network bridge IGMP (internet group management protocol) Snooping based on DSA TAG (digital signature algorithm tag) and user-defined protocol stack | |
JP2016019031A (en) | Filtering device and filtering method | |
JP5931842B2 (en) | Switch device and switch device control method | |
CN102882760A (en) | Method, module, equipment and system for message processing in virtual private local area network service network | |
US9729346B2 (en) | Method for layer 2 forwarding in a multi-node switch cluster |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20141015 |
|
RJ01 | Rejection of invention patent application after publication |