CN113014516A - Method and device for transmitting data stream - Google Patents

Method and device for transmitting data stream Download PDF

Info

Publication number
CN113014516A
CN113014516A CN201911330850.7A CN201911330850A CN113014516A CN 113014516 A CN113014516 A CN 113014516A CN 201911330850 A CN201911330850 A CN 201911330850A CN 113014516 A CN113014516 A CN 113014516A
Authority
CN
China
Prior art keywords
port
data stream
data
destination
mac address
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
CN201911330850.7A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201911330850.7A priority Critical patent/CN113014516A/en
Publication of CN113014516A publication Critical patent/CN113014516A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The embodiment of the application discloses a method for transmitting data streams, wherein first equipment comprises a first port and a second port, and the first port and the second port are used for broadcasting and transmitting first data streams received by the first equipment. The first device may parse the first data stream while forwarding the first data stream in a broadcast manner, and determine that the first port is a target port according to a destination MAC address of the first data stream, where the target port is used to forward the first data stream to a destination receiving device of the first data stream. After the first device determines that the first port is the target port, the first device may send a first data stream through the first port and send a second data stream different from the first data stream through the second port. And the situation that equipment except the target receiving equipment receives the first data stream is avoided, so that potential safety hazards are solved. By using the scheme of the embodiment of the application, the time delay of the first equipment for forwarding the first data stream can be reduced, and the potential safety hazard can be avoided.

Description

Method and device for transmitting data stream
Technical Field
The present application relates to the field of communications, and in particular, to a method and an apparatus for transmitting a data stream.
Background
The switch can be used for two-layer forwarding, and the switch generates a certain forwarding delay when forwarding a data stream. To reduce forwarding delay, the data stream may be broadcast when received by the switch. However, in the broadcast mode, other devices besides the destination receiving device of the data stream can also receive the data stream, so that a safety hazard exists.
Therefore, a solution to solve the above problems is urgently needed.
Disclosure of Invention
The embodiment of the application provides a method and a device for transmitting a data stream, which can solve the problem of potential safety hazard in the process of transmitting the data stream by broadcasting.
In a first aspect, an embodiment of the present application provides a method for transmitting a data stream, and in particular, a first device includes a first port and a second port, where the first port and the second port may be used to broadcast and transmit a first data stream received by the first device. It can be understood that, instead of waiting for the forwarding of the first data stream after determining the corresponding forwarding port according to the destination MAC address, the first data stream is broadcast and transmitted, which can effectively reduce the time delay for the first device to forward the first data stream. In this embodiment of the present application, while forwarding a first data stream in a broadcast manner, a first device may parse the first data stream, and determine, according to a destination MAC address of the first data stream, that a first port is a target port, where the target port is used to forward the first data stream to a destination receiving device of the first data stream. After the first device determines that the first port is the target port, the first device may send a first data stream through the first port and send a second data stream different from the first data stream through the second port. Because the first data stream is different from the second data stream, the situation that the equipment which should not receive the first data stream originally receives the first data stream can be avoided, and therefore potential safety hazards are solved. By using the scheme of the embodiment of the application, the time delay of the first equipment for forwarding the first data stream can be reduced, and the potential safety hazard can be avoided.
In one implementation, the first device may store a correspondence between the MAC address and the port in advance, where the correspondence at least includes a correspondence between a destination MAC address of the first data flow and the first port. Thus, after the first device determines the destination MAC address of the first data flow, the first device may determine, according to the correspondence, that the first port is a destination port for forwarding the first data flow. After the first port is determined to be the target port, the first device can forward the second data stream through the second port, so that the device corresponding to the second port is prevented from receiving the first data stream, and potential safety hazards are avoided.
In one implementation, the correspondence between the destination MAC address of the first data flow and the first port may be learned by the first device. It is to be understood that the first device may either forward the data stream through the aforementioned destination port or receive the data stream through the destination port. When the first device receives the data flow through the target port, the source MAC address in the data flow is the same as the destination MAC address of the data flow sent by the first device through the target port. Therefore, the first device may learn to obtain the corresponding relationship through the data stream acquired by the target port, and specifically, when the first device acquires the third data stream through the target port, the first device may extract the source MAC address in the third data stream, and store the corresponding relationship between the source MAC address and the target port. After the first device stores the corresponding relationship, and after the first data stream is acquired, the first port target port can be determined according to the corresponding relationship.
In an implementation manner, in order to avoid that a device corresponding to a second port acquires valid information through a second data stream, the second data stream may be invalid data.
In one implementation, after the device corresponding to the second port receives the second data stream from the first device, the second data stream is checked. For example, it is checked whether the data length corresponding to the second data stream is greater than or equal to the minimum length of the ethernet packet, for example, the check code of the second data stream is verified, and so on. If the device corresponding to the second port does not check the second data stream, a corresponding error log may be generated accordingly. In order to avoid that the data length corresponding to the second data stream is smaller than the minimum length of the ethernet packet, the data length of the second data stream is greater than or equal to the minimum length of the ethernet packet. Correspondingly, in order to avoid the problem that the check code of the second data stream is not verified, the foregoing invalidation may also carry the check code of the second data stream, where the check code is used to enable the second data stream to pass through the second preset check, and the second device is a device interacting with the second port, that is, a device receiving the second data stream.
In a second aspect, an embodiment of the present application provides an apparatus for data stream transmission, which is applied to a first device, and includes a receiving unit, a determining unit, and a transmitting unit. The receiving unit is configured to receive a first data stream, where the first device includes a first port and a second port, and the first port and the second port are used to broadcast and send the first data stream. The determining unit is configured to determine, according to a destination MAC address of the first data flow, that the first port is a destination port, where the destination port is used to forward the first data flow to a destination receiving device of the first data flow; the sending unit is configured to send the first data stream through the first port, and send a second data stream through the second port, where the first data stream is different from the second data stream.
In an implementation manner, the determining unit is specifically configured to: determining a destination MAC address of the first data flow; the first device comprises a corresponding relation between the destination MAC address and the destination port, and the destination port corresponding to the destination MAC address is determined according to the corresponding relation.
In one implementation, the correspondence between the destination MAC address and the destination port is obtained as follows: acquiring a third data stream through the target port; determining a source MAC address of the third data flow, wherein the source MAC address of the third data flow is the same as the destination MAC address of the first data flow; and storing the corresponding relation between the target port and the target MAC address.
In one implementation, the second data stream is invalid data.
In one implementation, the data length of the invalid data is greater than or equal to the minimum length of the ethernet packet; or the invalid data includes a check code of the second data stream, where the check code of the second data stream is used to indicate that the second data stream passes through the check of the second device, and the second device is a device that receives the second data stream.
In a third aspect, an embodiment of the present application provides an apparatus for transmitting a data stream, where the apparatus includes: a first circuit and a second circuit; the first circuit is configured to receive a first data stream, and the apparatus further includes a first port and a second port, where the first port and the second port are configured to broadcast the first data stream; the second circuit is configured to determine, according to a destination Media Access Control (MAC) address of the first data stream, that the first port is a destination port, where the destination port is used to forward the first data stream to a destination receiving device of the first data stream; the second circuit is further configured to send the first data stream through the first port and send a second data stream through the second port, the first data stream being different from the second data stream.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an application scenario;
fig. 2 is a schematic diagram of a broadcast transmission data stream;
fig. 3 is a flowchart illustrating a method for transmitting a data stream according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a switch provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a switch port according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for transmitting a data stream according to an embodiment of the present disclosure.
Detailed Description
The embodiment of the application provides a data stream sending method and device, and can solve the problem of potential safety hazards in broadcasting and sending data streams.
For convenience of understanding, a possible application scenario of the embodiment of the present application is first described. Referring to fig. 1, an application scenario is shown.
Fig. 1 is a schematic view of an application scenario illustrating a network architecture of high-frequency transaction. High frequency trading is an automated trading technique that utilizes high performance computing to perform large numbers of trading activities in a short time. High frequency traders typically include investment banks, hedge funds, and institutional and individual investors. In order to shorten the time delay, a high-frequency trader usually hosts a high-frequency user trading terminal (UTM) in a data center machine room provided by a trading desk, where the high-frequency user trading terminal may also be referred to as a high-frequency trading client, and the high-frequency trading client may be a server with a data computing function.
The high frequency trading network is generally divided into two levels, namely a broker network and an exchange internal network, namely an exchange hosting room network 100 and an exchange internal network 200 shown in fig. 1. The exchange internal network 200 opens a network port to a broker through an Exchange Switch (ESW) 101. Taking broker 1 as an example, the broker network 100 includes a broker front-end machine (FEM) 102, a Broker Switch (BSW) 103, and a high-frequency trading client 104. The broker exchange 103 is responsible for communication between the broker front-end 101 and the high-frequency trading client 104, and the time delay needs to be shortened as much as possible. Specifically, when the broker switch 103 receives the data stream from the broker front-end processor 102, the data stream needs to be forwarded to the corresponding high-frequency trading client in time. In addition, the exchange internal network 200 includes an exchange firewall 201, an exchange front-end processor 202 and an exchange core area 203, which will not be described in detail herein.
It should be noted that fig. 1 is shown merely for ease of understanding, and in actual practice, exchange switch 101 may interact with multiple broker front-ends, for example, in addition to interacting with broker front-end 102 of the first broker shown in fig. 1, it may interact with broker front-ends of other brokers. In addition, the broker exchange 103 may interact with multiple high frequency trading clients, illustrated in fig. 1 with one high frequency trading client 104 as an example.
In practical applications, broker switch 103 is typically configured as a two-layer forwarding. Specifically, when the broker switch 103 receives a data stream from the broker front-end processor 102, a destination Media Access Control (MAC) address included in the data stream is extracted, and a locally stored MAC forwarding table is queried, so as to determine a destination port for forwarding the data stream, and further, the data stream is forwarded to a corresponding high-frequency trading client through the destination port. It can be understood that the switch needs to spend a certain time on extracting the destination MAC address and searching the MAC forwarding table, so that the switch may generate a certain forwarding delay when forwarding data. In a high-frequency transaction scene, the forwarding delay generated by adopting the method cannot meet the requirement of the high-frequency transaction on the forwarding delay.
The foregoing MAC forwarding table can be understood in conjunction with table 1 below. The MAC forwarding table may include a corresponding relationship between a MAC address and a port, and after the broker switch 103 obtains the destination MAC address, the destination MAC address may be used to match the MAC forwarding table, and the port corresponding to the destination MAC address may be determined as a port for forwarding the data flow. For example, if the destination MAC address of the data stream is 00-01-6C-06-a6-29, it may be determined that the port for forwarding the data stream is port 4, so the broker switch 103 may forward the data stream to the high-frequency trading client 104 through port 4.
TABLE 1
MAC address Port(s)
00-00-5e-00-01-01 1
28-6e-d4-89-37-68 2
00-80-C2-00-00-00 3
00-01-6C-06-A6-29 4
In order to reduce the delay of forwarding the data stream to the high-frequency trading client 104 by the broker switch 103, the inventor of the present application finds that, when the broker switch 103 receives the data stream from the broker front-end processor 104, the data stream may be forwarded to the high-frequency trading client 104 in a broadcast manner. In other words, the broker switch 103 need not extract the destination MAC address, nor query a locally stored MAC forwarding table to determine the destination port to forward the data flow. Thereby reducing the latency of the broker switch 103 in forwarding the data flow. However, in a broadcast manner, all high frequency transaction clients can receive the data stream. This can lead to a safety hazard for high frequency transaction, because the high frequency transaction client will receive a data stream that does not belong to itself.
As can be understood in conjunction with fig. 2, fig. 2 is a schematic diagram of a broadcast transmission data stream. As shown in fig. 2, broker switch 103 receives a data stream from broker front-end 102 through port 103 a. The broker switch 103 then forwards the data stream to the high frequency trading client in a broadcast manner. Specifically, ports 103b, 103c, and 103d in the broker switch 103 are interfaces for interacting with the high-frequency trading clients, and as shown in fig. 2, port 103b is an interface for interacting with the high-frequency trading client 104b, port 103c is an interface for interacting with the high-frequency trading client 104c, and port 103c is an interface for interacting with the high-frequency trading client 104 c. In a specific implementation, the broker switch 103 forwards the data stream to the high-frequency trading client in a broadcast manner, for example, the data stream may be forwarded to the high-frequency trading client 104b through the port 103b, the data stream may be forwarded to the high-frequency trading client 104c through the port 103c, and the data stream may be forwarded to the high-frequency trading client 104d through the port 103 d. It can be understood that if the destination receiving device corresponding to the data stream is the high-frequency transaction client 104c, the high-frequency transaction client 104b and the high-frequency transaction client 104d may also receive the data stream that does not belong to themselves originally, so that the high-frequency transaction has a potential safety hazard.
In order to solve the problem, embodiments of the present application provide a method for sending a data stream, which can not only reduce a time delay of forwarding the data stream by the broker switch 103, but also avoid a potential safety hazard.
Referring to fig. 3, this figure is a schematic flowchart of a method for transmitting a data stream according to an embodiment of the present application. The method for transmitting the data stream shown in fig. 3 can be implemented, for example, by the following steps S101 to S103.
S101: the first device receives a first data stream, and the first device comprises a first port and a second port, and the first port and the second port are used for broadcasting and transmitting the first data stream.
In this embodiment, the first device may be a switch. In a high frequency trading scenario, the first device may be the broker switch 103 shown in fig. 1. In an embodiment of the present application, the first device may receive the first data stream from another device, which is not specifically limited by the embodiment of the present application, and as an example, in a high frequency trading scenario, the first device may receive the first data stream from a front-end processor, which may be, for example, the broker front-end processor 102 shown in fig. 1.
In the present embodiment, the first device may comprise at least a first port and a second port, in other words, the first device may further comprise a third port or even a fourth port. Wherein the first port and the second port may be used to broadcast a first data stream received by the first device. The first data stream is not specifically limited in this embodiment, and the first data stream may be a unicast data stream or a broadcast data stream. When the first data stream is a unicast data stream, the first port and the second port may be configured in advance, so that the first port and the second port may broadcast and transmit the first data stream.
It should be noted that, in the embodiments of the present application, reference to "ports", such as the aforementioned first port, second port, third port and fourth port, refers to physical ports on the first device.
It can be understood that, since the first port and the second port are used for broadcasting the first data stream, after the first device receives the first data stream, the first port and the second port can broadcast the first data stream. The first port and the second port are not specifically limited in the embodiment of the application, and in a high-frequency trading scenario, after the broker switch receives the first data stream from the broker front-end processor, the first data stream may be forwarded to the high-frequency trading client, so that in the high-frequency trading scenario, the first port and the second port may be used as ports for interacting with the high-frequency trading client.
S102: the first device determines that the first port is a target port according to the destination MAC address of the first data flow, and the target port is used for forwarding the first data flow to a destination receiving device of the first data flow.
In this embodiment of the present application, while the first device sends the first data stream by using the first port and the second port in a broadcast manner, the first device may further determine, according to a destination MAC address of the first data stream, that the first port is a target port for forwarding the first data stream. The destination port is used for forwarding the first data stream to a destination receiving device of the first data stream.
The embodiment of the present application does not specifically limit a specific implementation manner of determining, by the first device, a target port of the first data stream, and as an example, a correspondence between the MAC address and the port may be stored in the first device in advance, where the correspondence may be, for example, a mapping relationship described in table 1. The corresponding relationship at least includes a corresponding relationship between a destination MAC address of the first data stream and the first port. Thus, after the first device determines the destination MAC address of the first data flow, the first device may determine, according to the correspondence, that the first port is a destination port for forwarding the first data flow.
Regarding the corresponding relationship between the destination MAC address of the first data stream and the first port, it should be noted that the corresponding relationship may be configured by the user in advance on the first device, or the corresponding relationship may be issued by the controller to the first device, or the corresponding relationship may be learned by the first device. The embodiments of the present application are not particularly limited.
It is understood that, in practical applications, the first device may either forward the data stream through the aforementioned destination port or receive the data stream through the destination port. When the first device receives the data flow through the target port, the source MAC address in the data flow is the same as the destination MAC address of the data flow sent by the first device through the target port. Therefore, the first device may learn to obtain the corresponding relationship through the data stream acquired by the target port, and specifically, when the first device acquires the third data stream through the target port, the first device may extract the source MAC address in the third data stream, and store the corresponding relationship between the source MAC address and the target port.
S103: the first device sends a first data stream through a first port and a second data stream through a second port, the first data stream and the second data stream being different.
After the first device determines that the first port is the target port according to the first data stream, in order to avoid that a device which should not receive the first data stream originally continues to receive the first data stream, the first device may forward the first data stream through the first port, and forward a second data stream different from the first data stream through the second port. In other words,
in this embodiment, before the first device determines that the first port is the destination port, the first port and the second port broadcast and transmit the first data stream, and after the first device determines that the first port is the destination port, the second port is no longer used to transmit the data in the first data, but is used to transmit other data, so as to achieve the purpose of transmitting a second data stream different from the first data stream through the second port. In other words, the second data stream comprises the partial data of the first data stream and the aforementioned further data. Generally, the destination MAC address is in the header of the first data stream, and thus, in general, the second data stream may include the header of the first data stream without including the payload in the first data stream. In other words, the device corresponding to the second port cannot receive the payload of the first data stream, thereby avoiding the potential safety hazard. The devices corresponding to the other ports mentioned herein may be high frequency transaction clients interacting with the other ports.
The second data stream is not specifically limited in the embodiment of the application, so that in order to avoid potential safety hazards, the device corresponding to the second port obtains valid information through the second data stream, and the second data stream may be invalid data. As mentioned above, the second data stream includes partial data of the first data stream and other data, which is not specifically limited in the embodiments of the present application, and the other data may be all zeros as an example. As yet another example, the aforementioned other data may be data randomly generated by the first device.
It will be appreciated that, in general, when a device corresponding to the second port receives the second data stream from the first device, the second data stream is checked. For example, it is checked whether the data length corresponding to the second data stream is greater than or equal to the minimum length of the ethernet packet, for example, the check code of the second data stream is verified, and so on. If the other data is all zero, the device corresponding to the second port may receive only a part of the data of the first data stream, for example, may receive only the header of the first data stream. In this way, the device corresponding to the second port does not verify the second data stream, and accordingly, a corresponding error log may be generated.
In order to avoid that the data length corresponding to the second data stream is smaller than the minimum length of the ethernet packet, in another implementation manner of the embodiment of the present application, the other data may be preset data, where the data length of the preset data is greater than or equal to the preset length. So that the data length of the second data stream is greater than or equal to the minimum length of the ethernet packet. The preset length is not specifically limited in the embodiment of the application, and a specific value of the preset length may be configured in advance by a user, for example. Correspondingly, in order to avoid the problem that the verification of the check code of the second data stream fails, in an implementation manner of the embodiment of the present application, the preset data may further carry the check code of the second data stream, where the check code is used to enable the second data stream to pass the second preset check, and the second device is a device interacting with the second port, that is, a device receiving the second data stream. Of course, the aforementioned preset data may also satisfy the above two conditions at the same time, that is: the data length of the preset data is greater than or equal to the preset length, and the preset data comprises the verification code of the second data stream. Therefore, not only is the potential safety hazard avoided, but also the condition that the result of the verification of the second data stream by other equipment is failed is avoided.
The method for transmitting the data stream provided by the embodiment of the present application is introduced above, and the method for transmitting the data stream provided by the embodiment of the present application is introduced below with reference to a specific application scenario.
Referring to fig. 4, the diagram is a schematic structural diagram of a switch provided in the embodiment of the present application. The switch 400 shown in fig. 4 may be a broker switch. Switch 400 may include a first circuit 401, a second circuit 402, a port 403a, a port 403b, a port 403c, and a port 403 d. The ports 403a, 403b, and 403c are ports through which the switch 400 interacts with the client device, and the port 403d is a port through which the switch 400 interacts with the broker front-end processor. The first circuit 401 may receive the first data stream from the broker front-end processor through the port 403d, and then the first circuit 402 forwards the first data stream to each high-frequency trading client in a broadcast manner. The first circuit 401 may forward the first data stream in a broadcast manner, and simultaneously may transmit a copy of the first data stream to the second circuit 402, where the second circuit 402 determines the port 403a as a target port according to the first data stream. After the second circuit 402 determines the destination port, the second circuit 402 controls the ports other than the destination port to stop forwarding the first data stream. For example, the destination port is 403a, the second circuit 402 may control the port 403b and the port 403c to stop forwarding the first data stream, and accordingly, control the port 403a to continue forwarding the first data stream. That is, the data stream forwarded by port 403a is a first data stream, and the data streams forwarded by ports 403b and 403c are a second data stream different from the first data stream. The port 403a mentioned here can be regarded as the first port mentioned earlier, the port 403b as the second port, and the port 403c as the third port.
It should be noted that fig. 4 is only shown for convenience of understanding, and does not constitute a limitation to the embodiments of the present application, and in practical applications, the number of ports included in the broker switch is not limited to 4 shown in fig. 4, and the number of ports of the broker switch interacting with the high-frequency trading client is not limited to 3 shown in fig. 4.
A specific implementation of the second circuit controlling the port 403b and the port 403c to forward the second data stream and controlling the port 403a to forward the first data stream is described below with reference to fig. 5. Specifically, the manner in which the second circuit 402 controls each port is similar, and the second circuit 402 controls the port 403b as an example. Fig. 5 is a schematic diagram of a control port 403b of a second circuit 402 according to an embodiment of the present disclosure.
As shown in fig. 5, the port 403b has two data inputs, one of which is a first data stream 501, the first data stream 501 may be output to the port 403b by the first circuit 401, and the other data stream is other data 502, which may be all zeros or predetermined data mentioned above. The port 403b also has an input for a control signal 503, which control signal 503 is output by the second circuit 402 to the port 403 b. Specifically, the control signal 503 may be used to control the output 504 of the port 403b, where the data output by the port 403b is one of the first data stream 501 and the invalid data 502. It will be appreciated that the output 504 of port 403b is the data that port 403b actually forwards to the high frequency transaction client. The port 403b may be configured to output the first data stream 501 before the second circuit 402 determines the destination port, and the port 403b determines whether to output the first data stream 501 or the invalid data 502 according to the control signal 503 after the second circuit 402 determines the destination port. It is to be appreciated that if the second circuit 402 determines that the destination port is the port 403b, the second circuit 402 may output a first control signal to instruct the port 403b to continue outputting the first data stream 501. If the second circuit 402 determines that the target port is not port 403b, the second circuit 402 may output a second control signal to instruct port 403b to output invalid data 502.
It should be noted that the first circuit 401 and the second circuit 402 shown in fig. 4 may be integrated on one chip, and of course, the first circuit 401 and the second circuit 402 may be located on different chips.
In the port 403a, the port 403b, the port 403c, and the port 403d shown in fig. 4, which can complete data receiving and sending, in practical applications, the port 403a, the port 403b, the port 403c, and the port 403d may be implemented by Clock and Data Recovery (CDR) chips, and one port may correspond to one CDR chip. Of course, the CDR chip, the first circuit 401 and the second circuit 402 may also be integrated on one chip, and the embodiment of the present application is not particularly limited.
Based on the method for sending data stream provided in the foregoing embodiment, the embodiment of the present application further provides a chip for sending data stream, where the chip may be applied to a first device, and a structure of the first device may refer to a structure of a switch shown in fig. 4. The chip may comprise, for example, a first circuit 401 and a second circuit 402 as shown in fig. 4.
The first circuit 401 is configured to receive a first data stream, and the first device further includes a first port and a second port, which are used to broadcast and transmit the first data stream, and the first port and the second port may be, for example, a port 403a and a port 403b shown in fig. 4. After the first circuit 401 receives the first data stream, the first data stream may be forwarded through the first port and the second port. The second circuit 402 is configured to determine, according to a destination MAC address of the first data flow, that the first port is a destination port, where the destination port is used to forward the first data flow to a destination receiving device of the first data flow. The second circuit 402 is further configured to send the first data stream through the first port and send a second data stream through the second port, where the first data stream is different from the second data stream.
It should be noted that, when the first circuit 401 sends the first data stream through the first port and the second port by broadcasting, a hard forwarding manner may be adopted, that is, the first data stream is directly forwarded through the circuit logic. Of course, the first circuit 401 may also include a programmable chip, and if the first circuit 401 includes a programmable chip, a memory code may be stored in the programmable chip, and the first circuit may call a program stored in the memory code, so as to implement broadcasting and sending a data stream through the first port and the second port.
Similarly, the second circuit 402 may forward the first data stream through the first port and the second data stream through the second port in a hard forwarding manner, i.e., directly through the circuit logic. Of course, the second circuit 402 may also include a programmable chip, and if the second circuit 402 is a programmable chip, a memory code may be stored in the programmable chip, and the second circuit 402 may call a program stored in the memory code, so as to implement forwarding the first data stream through the first port and forwarding the second data stream through the second port.
Based on the method for transmitting the data stream provided in the foregoing embodiment, the present application embodiment further provides a device for transmitting the data stream, which can be applied to the first device, and is configured to perform the method for transmitting the data stream shown in fig. 3 above. Referring to fig. 6, fig. 6 is a schematic structural diagram of an apparatus for transmitting a data stream according to an embodiment of the present application.
The apparatus 600 for transmitting a data stream shown in fig. 6 may include, for example, a receiving unit 601, a determining unit 602, and a transmitting unit 603.
The receiving unit 601 is configured to receive a first data stream, where the first device includes a first port and a second port, and the first port and the second port are used to broadcast and transmit the first data stream. The determining unit 602 is configured to determine, according to a destination media access control MAC address of the first data flow, that the first port is a target port, where the target port is used to forward the first data flow to a destination receiving device of the first data flow. The sending unit 603 is configured to send the first data stream through the first port, and send a second data stream through the second port, where the first data stream is different from the second data stream.
In an implementation manner, the determining unit 602 is specifically configured to: determining a destination MAC address of the first data flow; the first device comprises a corresponding relation between the destination MAC address and the destination port, and the destination port corresponding to the destination MAC address is determined according to the corresponding relation.
In one implementation, the correspondence between the destination MAC address and the destination port is obtained as follows: acquiring a third data stream through the target port; determining a source MAC address of the third data flow, wherein the source MAC address of the third data flow is the same as the destination MAC address of the first data flow; and storing the corresponding relation between the target port and the target MAC address.
In one implementation, the second data stream is invalid data.
In one implementation, the data length of the invalid data is greater than or equal to the length of the ethernet packet; or the invalid data includes a check code of the second data stream, where the check code of the second data stream is used to indicate that the second data stream passes through the check of the second device, and the second device is a device that receives the second data stream.
Since the apparatus 600 is an apparatus corresponding to the method provided in the above method embodiment, and the specific implementation of each unit of the apparatus 600 is the same as that of the above method embodiment, for the specific implementation of each unit of the apparatus 600, reference may be made to the description part of the above method embodiment, and details are not repeated here.
In the embodiment of the present application, the receiving unit 601 may be implemented by the first circuit 401 shown in fig. 4, and the determining unit 602 and the sending unit 603 may be implemented by the second circuit 402 shown in fig. 4.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is only a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, each service unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware form, and can also be realized in a software service unit form.
The integrated unit, if implemented in the form of a software business unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those skilled in the art will recognize that, in one or more of the examples described above, the services described in this disclosure may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the services may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above embodiments are intended to explain the objects, aspects and advantages of the present invention in further detail, and it should be understood that the above embodiments are merely illustrative of the present invention.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (11)

1. A method for data stream transmission, the method comprising:
a first device receives a first data stream, wherein the first device comprises a first port and a second port, and the first port and the second port are used for broadcasting and sending the first data stream;
the first device determines the first port as a target port according to a destination Media Access Control (MAC) address of the first data stream, wherein the target port is used for forwarding the first data stream to a destination receiving device of the first data stream;
the first device sends the first data stream through the first port and sends a second data stream through the second port, the first data stream being different from the second data stream.
2. The method of claim 1, wherein the first device determining a destination port according to a destination MAC address of the first data flow comprises:
the first device determines a destination MAC address of the first data flow;
the first device comprises a corresponding relation between the destination MAC address and the destination port, and the first device determines the destination port corresponding to the destination MAC address according to the corresponding relation.
3. The method of claim 2, wherein the correspondence between the destination MAC address and the destination port is obtained by:
the first device acquires a third data stream through the target port;
the first device determines a source MAC address of the third data flow, where the source MAC address of the third data flow is the same as the destination MAC address of the first data flow;
and the first equipment stores the corresponding relation between the target port and the destination MAC address.
4. The method of any of claims 1-3, wherein the second data stream is invalid data.
5. The method of claim 4, wherein the data length of the invalid data is greater than or equal to the length of an Ethernet packet; or the invalid data includes a check code of the second data stream, where the check code of the second data stream is used to indicate that the second data stream passes through the check of the second device, and the second device is a device that receives the second data stream.
6. An apparatus for data stream transmission, applied to a first device, the apparatus comprising:
a receiving unit, configured to receive a first data stream, where the first device includes a first port and a second port, and the first port and the second port are used to broadcast and send the first data stream;
a determining unit, configured to determine, according to a destination media access control MAC address of the first data flow, that the first port is a target port, where the target port is used to forward the first data flow to a destination receiving device of the first data flow;
a sending unit, configured to send the first data stream through the first port, and send a second data stream through the second port, where the first data stream is different from the second data stream.
7. The apparatus according to claim 6, wherein the determining unit is specifically configured to:
determining a destination MAC address of the first data flow;
the first device comprises a corresponding relation between the destination MAC address and the destination port, and the destination port corresponding to the destination MAC address is determined according to the corresponding relation.
8. The apparatus of claim 7, wherein the correspondence between the destination MAC address and the destination port is obtained by:
acquiring a third data stream through the target port;
determining a source MAC address of the third data flow, wherein the source MAC address of the third data flow is the same as the destination MAC address of the first data flow;
and storing the corresponding relation between the target port and the target MAC address.
9. The apparatus of any of claims 6-8, wherein the second data stream is invalid data.
10. The apparatus according to claim 9, wherein the data length of the invalid data is greater than or equal to the length of an ethernet packet; or the invalid data includes a check code of the second data stream, where the check code of the second data stream is used to indicate that the second data stream passes through the check of the second device, and the second device is a device that receives the second data stream.
11. A chip for data streaming, the chip comprising: a first circuit and a second circuit;
the first circuit is configured to receive a first data stream, and the first device includes a first port and a second port, where the first port and the second port are configured to broadcast the first data stream;
the second circuit is configured to determine, according to a destination Media Access Control (MAC) address of the first data stream, that the first port is a destination port, where the destination port is used to forward the first data stream to a destination receiving device of the first data stream;
the second circuit is further configured to send the first data stream through the first port and send a second data stream through the second port, the first data stream being different from the second data stream.
CN201911330850.7A 2019-12-20 2019-12-20 Method and device for transmitting data stream Pending CN113014516A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911330850.7A CN113014516A (en) 2019-12-20 2019-12-20 Method and device for transmitting data stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911330850.7A CN113014516A (en) 2019-12-20 2019-12-20 Method and device for transmitting data stream

Publications (1)

Publication Number Publication Date
CN113014516A true CN113014516A (en) 2021-06-22

Family

ID=76382531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911330850.7A Pending CN113014516A (en) 2019-12-20 2019-12-20 Method and device for transmitting data stream

Country Status (1)

Country Link
CN (1) CN113014516A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664456A (en) * 2012-04-25 2012-09-12 广东电网公司珠海供电局 Multicast management method and device for intelligent substation process level
WO2015085558A1 (en) * 2013-12-12 2015-06-18 华为技术有限公司 Method, device and system for dynamically allocating ip address
CN106850382A (en) * 2016-12-05 2017-06-13 北京神州绿盟信息安全科技股份有限公司 A kind of flow lead method and device
WO2017181757A1 (en) * 2016-04-18 2017-10-26 中兴通讯股份有限公司 Packet forwarding method and device
WO2017206787A1 (en) * 2016-06-02 2017-12-07 中兴通讯股份有限公司 Message forwarding control method for communication network device, and communication network device
CN107547243A (en) * 2017-05-24 2018-01-05 新华三技术有限公司 A kind of message forwarding method and device
CN108243123A (en) * 2016-12-23 2018-07-03 中兴通讯股份有限公司 Processing method, device, controller and the interchanger of broadcasting packet

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664456A (en) * 2012-04-25 2012-09-12 广东电网公司珠海供电局 Multicast management method and device for intelligent substation process level
WO2015085558A1 (en) * 2013-12-12 2015-06-18 华为技术有限公司 Method, device and system for dynamically allocating ip address
WO2017181757A1 (en) * 2016-04-18 2017-10-26 中兴通讯股份有限公司 Packet forwarding method and device
WO2017206787A1 (en) * 2016-06-02 2017-12-07 中兴通讯股份有限公司 Message forwarding control method for communication network device, and communication network device
CN106850382A (en) * 2016-12-05 2017-06-13 北京神州绿盟信息安全科技股份有限公司 A kind of flow lead method and device
CN108243123A (en) * 2016-12-23 2018-07-03 中兴通讯股份有限公司 Processing method, device, controller and the interchanger of broadcasting packet
CN107547243A (en) * 2017-05-24 2018-01-05 新华三技术有限公司 A kind of message forwarding method and device

Similar Documents

Publication Publication Date Title
US10521283B2 (en) In-node aggregation and disaggregation of MPI alltoall and alltoallv collectives
US7328284B2 (en) Dynamic configuration of network data flow using a shared I/O subsystem
US7197572B2 (en) System and method for implementing logical switches in a network system
US7356608B2 (en) System and method for implementing LAN within shared I/O subsystem
US20030208631A1 (en) System and method for dynamic link aggregation in a shared I/O subsystem
US20030217183A1 (en) System and method for span port configuration
US11082346B2 (en) Tapping network data to perform load balancing
US20030208645A1 (en) System and method for eventless detection of newly delivered variable length messages from a system area network
CN107508836B (en) A kind of method and device that acl rule issues
US20130325684A1 (en) System for latency reduction in high frequency trading networks
CN110011941B (en) Message forwarding method and device
US12081365B2 (en) Distributed system with fault tolerance and self-maintenance
US8655769B2 (en) Method and system for improving equity trade order acknowledgement times
CN111769909B (en) Device and method based on cascade retransmission of market data
JP2023539430A (en) Electronic trading system and method based on point-to-point mesh architecture
US11315183B2 (en) Electronic trading system and method based on point-to-point mesh architecture
US20070005335A1 (en) Methods for protocol compatibility
CN101207617A (en) Method for data transmission of network storing system
EP4193256A1 (en) Highly deterministic latency in a distributed system
CN103209213B (en) Data transmission method and system for data subscription
CN113014516A (en) Method and device for transmitting data stream
CA2371634A1 (en) Method and system for multi-initiator support to streaming devices in a fibre channel network
US9391791B2 (en) Preprocessing unit for network data
CN108121496B (en) Data storage method, device and system
CN109451090A (en) A kind of domain name analytic 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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210622

WD01 Invention patent application deemed withdrawn after publication