Switch data forwarding method and device

文档序号:1630667 发布日期:2020-01-14 浏览:17次 中文

阅读说明:本技术 一种交换机数据转发方法及装置 (Switch data forwarding method and device ) 是由 徐东远 张超 张兴隆 张鹏飞 叶有平 于 2019-09-03 设计创作,主要内容包括:本发明提供一种交换机数据转发方法,所述方法包括:接收待转发的数据;通过对所述数据进行帧解析,判断所述数据帧的类型;若所述数据帧的类型为时间触发帧,则对所述数据帧的接收时间进行判断;若所述数据帧的接收时间在规划时间表内,根据预设的数据转发表转发所述数据帧;若所述数据帧的接收时间不在规划时间表内,则丢弃数据帧。(The invention provides a data forwarding method for a switch, which comprises the following steps: receiving data to be forwarded; judging the type of the data frame by carrying out frame analysis on the data; if the type of the data frame is a time trigger frame, judging the receiving time of the data frame; if the receiving time of the data frame is in a planning time table, forwarding the data frame according to a preset data forwarding table; and if the receiving time of the data frame is not in the planning time table, discarding the data frame.)

1. A switch data forwarding method, the method comprising:

receiving data to be forwarded;

judging the type of the data frame by carrying out frame analysis on the data;

if the type of the data frame is a time trigger frame, judging the receiving time of the data frame;

if the receiving time of the data frame is in a planning time table, forwarding the data frame according to a preset data forwarding table; and if the receiving time of the data frame is not in the planning time table, discarding the data frame.

2. The method of claim 1, further comprising:

if the type of the data frame is an Ethernet frame, judging whether the current moment has time to trigger the data of the frame to be sent;

if the data with the time trigger frame is to be sent, the data with the type of the data frame being the time trigger frame is sent preferentially;

and if the data of the time trigger frame is not sent, the type of the sent data frame is the data of the Ethernet frame.

3. The method according to claim 2, wherein the type of the data frame to be sent is data of an ethernet frame, and specifically includes:

judging the sending mode of the data;

if the sending mode of the data is a multicast frame, sending the data to a multicast output arbiter so that the multicast output arbiter completes data sending;

and if the sending mode of the data is a unicast frame, establishing a sending link for the data, and sending the data to an output arbiter to finish data sending.

4. The method of claim 2, wherein after determining the type of the data frame is an ethernet frame, the method further comprises:

and storing the Ethernet frame to a virtual output queue buffer area.

5. The method of claim 1, wherein after determining that the time of receipt of the data frame is within the scheduled schedule, the method further comprises:

and storing the time trigger frame into a corresponding virtual output queue buffer area according to the data forwarding table.

6. The method of claim 1, wherein the scheduling schedule is used to determine a forwarding time instant for the data frame.

7. A switch data forwarding apparatus, comprising a receiving unit, a judging unit, and a forwarding unit, wherein:

the receiving unit is used for receiving data to be forwarded;

the judging unit is used for judging the type of the data frame by carrying out frame analysis on the data received by the receiving unit; when the type of the data frame is a time trigger frame, judging the receiving time of the data frame;

the forwarding unit is used for forwarding the data frame according to a preset data forwarding table when the receiving time of the data frame is in a planning time table; and when the receiving time of the data frame is not in the planning time table, discarding the data frame.

8. The apparatus according to claim 7, wherein the determining unit is further configured to determine whether there is time to trigger frame data to be transmitted at the current time when the type of the data frame is an ethernet frame;

the forwarding unit is further configured to preferentially send data of which the type is the time trigger frame when the data of the time trigger frame is to be sent; when there is no time trigger frame data to send, the type of the sending data frame is data of an ethernet frame.

Technical Field

The invention discloses a time planning network switch exchange engine algorithm, belonging to the technical field of communication.

Background

The existing switch switching engine algorithm is based on event type Ethernet frame data forwarding application, and due to uncertainty of event triggering, the existing switch switching engine algorithm is low in safety, stability and reliability, and low in system bandwidth utilization rate.

Disclosure of Invention

The invention aims to provide a switching engine algorithm for a time planning network switch, which aims at the characteristics of a time planning network and the implementability of hardware, so that the switch can efficiently finish the forwarding of different types of data frames (suitable for time trigger frames and Ethernet frames), the stability and the reliability of the whole network system are ensured, and the bandwidth utilization rate of the system is improved as much as possible.

In a first aspect, the present invention provides a method for forwarding switch data, where the method includes:

receiving data to be forwarded;

judging the type of the data frame by carrying out frame analysis on the data;

if the type of the data frame is a time trigger frame, judging the receiving time of the data frame;

if the receiving time of the data frame is in a planning time table, forwarding the data frame according to a preset data forwarding table; and if the receiving time of the data frame is not in the planning time table, discarding the data frame.

Optionally, the method further includes:

if the type of the data frame is an Ethernet frame, judging whether the current moment has time to trigger the data of the frame to be sent;

if the data with the time trigger frame is to be sent, the data with the type of the data frame being the time trigger frame is sent preferentially;

and if the data of the time trigger frame is not sent, the type of the sent data frame is the data of the Ethernet frame.

Optionally, the type of the data frame to be sent is data of an ethernet frame, and specifically includes:

judging the sending mode of the data;

if the sending mode of the data is a multicast frame, sending the data to a multicast output arbiter so that the multicast output arbiter completes data sending;

and if the sending mode of the data is a unicast frame, establishing a sending link for the data, and sending the data to an output arbiter to finish data sending.

Optionally, after determining that the type of the data frame is an ethernet frame, the method further includes:

and storing the Ethernet frame to a virtual output queue buffer area.

Optionally, after determining that the receiving time of the data frame is in the scheduled time table, the method further includes:

and storing the time trigger frame into a corresponding virtual output queue buffer area according to the data forwarding table.

Optionally, the scheduling schedule is used to determine a forwarding time of the data frame.

In a second aspect, the present invention provides a switch data forwarding apparatus, which is characterized in that the apparatus includes a receiving unit, a determining unit, and a forwarding unit, wherein:

the receiving unit is used for receiving data to be forwarded;

the judging unit is used for judging the type of the data frame by carrying out frame analysis on the data received by the receiving unit; when the type of the data frame is a time trigger frame, judging the receiving time of the data frame;

the forwarding unit is used for forwarding the data frame according to a preset data forwarding table when the receiving time of the data frame is in a planning time table; and when the receiving time of the data frame is not in the planning time table, discarding the data frame.

Optionally, the determining unit is further configured to determine whether there is time to trigger frame data to be sent at the current time when the type of the data frame is an ethernet frame;

the forwarding unit is further configured to preferentially send data of which the type is the time trigger frame when the data of the time trigger frame is to be sent; when there is no time trigger frame data to send, the type of the sending data frame is data of an ethernet frame.

The invention has the advantages and beneficial effects that: the invention provides a time planning network switching engine implementation scheme, which can ensure the reliability and stability of a time planning network system while ensuring the normal forwarding of data functions. The utilization rate of the time planning network system bandwidth is improved to the maximum extent.

Drawings

Fig. 1 is a schematic diagram of a virtual output queue module provided in the present application;

FIG. 2 is a block diagram of a switching engine algorithm provided herein;

FIG. 3 is a process for Ethernet frame link establishment as provided herein;

FIG. 4 is a state transition diagram of an output control module provided by the present application;

FIG. 5 illustrates an example of a time-planning network switching engine algorithm setup provided herein;

fig. 6 is a data flow diagram of a time-planning network according to the present application.

Detailed Description

The time planning network is a highly reliable distributed bus network protocol based on time planning. The time trigger service establishes a global clock in the whole network system, and the communication between the nodes is carried out based on the global time, so that the certainty of communication delay and time offset is ensured. Time-planning networks are increasingly used in aerospace and other safety-critical areas, including system integration in aerospace, ground transportation, and industrial process control, among others, and have been formed by the Society of Automotive Engineers (SAE) AS the AS6802 protocol standard.

The time planning network is added with time triggering service on the basis of Ethernet architecture, the whole network system is a master-free system, the time planning network needs periodic synchronization, in each comprehensive period, time planning network components establish and maintain clock synchronization by sending Protocol Control Frames (PCF), and the time planning network system has three components in total, namely a compression master device (generally a switch), a synchronization master device (generally an end system) and a synchronization slave device (generally other devices).

The time planning network can synchronize a local clock with clocks of other communication controllers and switches in the system, and transmits data frames according to scheduled sending time of a planning time schedule, so that the system cannot have two time trigger frames (TT) for competitive transmission; the time trigger communication is not based on priority, and is driven only by the time process and the planning time table, so that the time trigger frame prevents network communication from blocking, and the communication of the time trigger frame in the Ethernet is not influenced by any asynchronous Ethernet traffic load, and has fixed time delay. In addition to time triggered frames, there are also non-time triggered communications in the network, and in a time triggered system there are two types of data in the network: time triggered frames (TT), ethernet frames (BE).

The compression main equipment in the time planning network component occupies an important position, and the compression main equipment is generally realized by a switch; the main roles that the switch implements in them are two-fold: 1. the time synchronization stage plays a role in compression and is used for establishing time synchronization; 2. the switching function, which forwards data frames from different synchronous master devices and synchronous slave devices, determines the performance and bandwidth utilization rate of time-triggered Ethernet communication, and is realized by a data forwarding method of a switch.

Specifically, the implementation of the time-triggered ethernet switching engine algorithm mainly comprises the following modules: the system comprises a frame analyzing and filtering module, a virtual output queue module, a unicast request module, a multicast request module, a unicast output arbiter, a multicast output arbiter and an output control module;

a frame analysis and filtering module: the realization function is the time planning network data frame analysis function, if the frame is an Ethernet frame, the frame is put into a virtual output queue buffer area of the Ethernet frame; if the time trigger frame is a time trigger frame, firstly judging whether the time trigger frame (TT) arrives in a planning time table or not, and if not, discarding the time trigger frame; and if the time trigger frame is in the planning time table, putting the time trigger frame (TT) into a corresponding virtual output queue according to the data forwarding table.

A virtual output queue module: considering the influence of head-of-line blocking, the input port buffer of the switch adopts a virtual output queue: each input port is divided into 2N buffer areas, N are Ethernet frame virtual output queues, and each buffer area corresponds to each output port; n are virtual output queues of the time trigger frame, each buffer area corresponds to each output port, and the time trigger frame is forwarded to the corresponding output port according to the data forwarding table; the reason for directly establishing the link is based on the characteristics of the time planning network, and the time planning network is forwarded according to the preset data forwarding table, so that no conflict exists, and the link can be directly established (if the output control module is in a busy state at this time, an interrupt processing mode is adopted, and the priority of the time trigger frame is high).

A unicast request module: the module function aims at the Ethernet unicast frame, after the frame analysis and filtering module, the time trigger frame is found to be empty, the Ethernet frame virtual output queue is not empty, and one of the input port is selected to send a request to the corresponding output port according to the non-empty sequence number of the input port at the moment. Selection principle: forming a linked list from 1 to N, selecting the first linked list according to a sequential polling mode, if a rear link is established, placing the first digit of the linked list to the rearmost, and moving the rest serial numbers to the front by one digit; if no connection is established, the order is not changed.

A multicast request module: the function of the module aims at the Ethernet multicast frame, the multicast request is different from the unicast request, the multicast input buffer area is not realized by a virtual output queue, and the multicast selection is only to select one port from the input N ports; selection principle: forming a linked list (each number in the linked list represents each input port serial number, and the number is N in total), selecting the first linked list according to a sequential polling mode, if a link at the back is established, placing the first digit of the linked list to the back, and moving the rest serial numbers to the front by one digit; if no connection is established, the order is not changed.

Unicast output arbiter: the module function is directed to Ethernet unicast frames, and the function is to select one of the unicast requests from the input port to form a connection; selection principle: forming a linked list from 1 to N, selecting the first linked list according to a sequential polling mode, if a rear link is established, placing the first digit of the linked list to the rearmost, and moving the rest serial numbers to the front by one digit; if no connection is established, the order is not changed.

The multicast output arbitrator: the function of the module is directed to Ethernet multicast frames, and the function is to select one of the multicast requests from N input ports to form a connection; selection principle: forming a linked list from 1 to N, selecting the first linked list according to a sequential polling mode, if a rear link is established, placing the first digit of the linked list to the rearmost, and moving the rest serial numbers to the front by one digit; if no connection is established, the order is not changed.

An output control module: the output control module is mainly used for selecting the establishment of the output link. For each output port, if the virtual output queue module has time trigger frame, the output control module enters a time trigger frame sending state; if the virtual output queue module does not have a time trigger frame and has an Ethernet frame, the output control module enters an Ethernet frame sending state, if the Ethernet frame is a multicast frame, the output control module preferentially enters a multicast sending state, and if not, the output control module enters a unicast sending state; and if the virtual output queue module has neither time trigger frame nor Ethernet frame, the output control module is in an initialization state.

The main part of the data forwarding method of the time-planning network switch is explained in detail below with reference to the accompanying drawings.

As shown in fig. 1, the module is a virtual output queue module, and the main function is data frame buffering, and the time-triggered frame buffer is implemented by N first-in first-out queues (FIFO), where the depth of the FIFO is the size of two maximum time-triggered frames. Considering the factor of time planning, the design is reasonable and saves hardware resources; the Ethernet frame buffer area is realized by N first-in first-out queues, the depth of each first-in first-out queue buffer area is the size of 8 maximum Ethernet frames, and the depth of the buffer area is larger because the common Ethernet frames are event-triggered.

As shown in fig. 2, this section describes the whole time-planning network forwarding method, a data frame enters a frame analysis and filtering module first, if the analyzed frame is a time trigger frame, it needs to check whether the time is in the planning time table, if so, it enters a time trigger frame virtual output queue buffer area, and the time trigger frame is directly forwarded out by querying a data forwarding table; if the analyzed Ethernet frame is put into the Ethernet frame virtual output queue buffer, the Ethernet frame virtual output queue buffer enters a polling request stage (if no time trigger frame exists, because the priority of the time trigger frame is high), a permission stage and the link establishment and the transmission of the Ethernet frame are finally realized.

As shown in fig. 3, this section mainly describes the ethernet frame link establishment procedure, which is an example. An input 0 port having ethernet frames transmitted to an output 0 port and an output 1 port, an input 1 port having ethernet frames transmitted to the output 0 port, an input 2 port having ethernet frames transmitted to the output 2 port; for the input 0 port, there are requests to the output 0 port and requests to the output 1 port, since the polling pointer points to 0 at this time, the request is selected to be transmitted to the output 0 port, for the input 1 port, only the ethernet frame transmitted to the output 0 port is selected to be transmitted to the output 0 port, and for the input 2 port, only the ethernet frame transmitted to the output 2 port is selected to be transmitted to the output 2 port. And (3) a permission phase: because the output 0 port receives the requests from the input 0 port and the input 1 port, the input 1 port is selected according to the polling direction to establish connection; the output 2 port only receives the request of the input 2 port and establishes connection. And establishing a connected port, polling the pointer for updating, and updating the situation as shown in the figure.

As shown in FIG. 4, this section mainly illustrates the jump state diagram of the output control module; in the power-on initial stage, the output control module is in an initialization state; once the time trigger frame enters the virtual output queue buffer area, the output control module enters a time trigger frame sending state and directly forwards the time trigger frame; if the Ethernet frame exists (no time trigger frame), the output control module enters an Ethernet frame sending state, and enters different states according to whether the Ethernet frame to be forwarded is a multicast frame or a unicast frame, wherein the multicast frame has high priority, and preferentially enters a multicast state under the condition of existence at the same time.

As shown in fig. 5, this section mainly describes an example of a time-planning network data forwarding method. The input 0 port has a time trigger frame sent to the 1 port and also has an Ethernet frame sent to the output 0 port; because the priority of the time trigger frame is high, and because the time planning network is forwarded according to the preset data forwarding table, no conflict exists, the link can be directly established (different from an Ethernet frame forwarding method). The input port 1 is provided with a time trigger frame sent to the output port 0, an Ethernet frame sent to the output port 1 and an Ethernet frame sent to the output port 2, and the priority of the time trigger frame is high, so that the establishment from the input port 1 to the output port 0 is formed, and the time trigger data frame is directly forwarded; the input 2 port has an Ethernet frame sent to the output 2 port, and the Ethernet frame enters a request permission phase because no time triggers the frame, and finally forms a link establishment from the input 2 port to the output 2 port. By the example, it can be seen that the algorithm can improve the bandwidth utilization while ensuring the reliability and stability of the time-triggered ethernet.

As shown in fig. 6, this section mainly introduces the time-planning network data flow description. When data enters an input port, firstly, a frame analyzing and filtering module analyzes the data, and if the data is not in a planning time table, the data frame is discarded; if the frame arrives at the planning time table, whether the frame is an Ethernet frame or a time trigger frame is judged, and frames of different types are placed into corresponding virtual output queue buffer areas. If the frame is a time trigger frame, the forwarding is directly finished after the frame enters a virtual output queue buffer area, because the priority is highest; if the frame is an Ethernet frame, whether the frame is a multicast frame or a unicast frame is distinguished, if the frame is the multicast frame, the frame enters a multicast request module and reaches a multicast output arbiter to complete the establishment of multicast; if the unicast frame exists, entering a unicast request module and finishing the establishment of the unicast to a unicast output arbiter; and finally, the data flow is transmitted to an output arbiter, if the time trigger frame exists, the time trigger frame is preferably transmitted, then the Ethernet multicast frame is transmitted, and finally the Ethernet unicast frame is transmitted.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于对角分块带状矩阵增强的正交信分复用均衡方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!