CN110557354B - Method and device for realizing communication between nodes and electronic equipment - Google Patents
Method and device for realizing communication between nodes and electronic equipment Download PDFInfo
- Publication number
- CN110557354B CN110557354B CN201810550194.0A CN201810550194A CN110557354B CN 110557354 B CN110557354 B CN 110557354B CN 201810550194 A CN201810550194 A CN 201810550194A CN 110557354 B CN110557354 B CN 110557354B
- Authority
- CN
- China
- Prior art keywords
- sas
- ethernet
- physical channel
- message
- target
- 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.)
- Active
Links
- 238000004891 communication Methods 0.000 title claims abstract description 72
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004806 packaging method and process Methods 0.000 claims abstract description 4
- 238000005538 encapsulation Methods 0.000 claims description 13
- 230000004931 aggregating effect Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 5
- 230000002776 aggregation Effects 0.000 claims description 4
- 238000004220 aggregation Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 abstract description 22
- 230000008878 coupling Effects 0.000 abstract description 9
- 238000010168 coupling process Methods 0.000 abstract description 9
- 238000005859 coupling reaction Methods 0.000 abstract description 9
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 101100518639 Caenorhabditis elegans phy-2 gene Proteins 0.000 description 4
- 101100518633 Caenorhabditis elegans dpy-18 gene Proteins 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000005304 joining Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000011897 real-time detection Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/9057—Arrangements for supporting packet reassembly or resequencing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0028—Serial attached SCSI [SAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the application provides a method and a device for realizing communication between nodes and electronic equipment. The method is applied to the user nodes in the serial connection small computer system interface SAS network system; the method comprises the following steps: acquiring target data to be transmitted sent by a target program; constructing an Ethernet message carrying target data; packaging the Ethernet message into an SAS protocol message; sending the SAS protocol message to an SAS-HBA in the user node so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol message, the target user node decapsulates the SAS protocol message into an Ethernet message and decapsulates the Ethernet message into target data; the SAS-HBA is a host bus adapter adopting an SAS protocol. The scheme can realize that the SAS network system is compatible with the communication interface of the Ethernet, thereby reducing the coupling of the application layer and the data transmission layer of the user node.
Description
Technical Field
The present application relates to the field of data communication technologies, and in particular, to a method, an apparatus, and an electronic device for implementing communication between nodes.
Background
SAS (Serial Attached SCSI) is a new generation of SCSI (Small computer system Interface) technology. Among them, the SAS employs a serial technique to obtain a higher transmission speed, and improves an internal space by shortening a connection line, and the like. SCSI is a stand-alone processor standard for system-level interfaces between computers and intelligent devices (hard disks, floppy drives, optical drives, printers, scanners, etc.).
For the SAS network system, communication between user nodes may use a SAS-HBA (Host Bus Adapter) for data transmission. In the prior art, in order to implement communication between user nodes, a communication interface adopted by an application layer of a user node is an SAS communication interface.
Although the user nodes can communicate with each other in the prior art, the application layer and the data transmission layer of the user nodes have high coupling, so that the program relying on the communication interface of the ethernet cannot be applied to the user nodes of the SAS network system. The programs relying on the communication interface of the ethernet are relatively common programs in the market, which undoubtedly seriously affects the use experience of users.
Therefore, how to implement the communication interface of the SAS network system compatible with the ethernet, so as to reduce the coupling between the application layer and the data transmission layer of the user node is a problem to be solved urgently.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and an electronic device for implementing inter-node communication, so as to implement a communication interface compatible with ethernet in an SAS network system, thereby reducing the coupling between an application layer and a data transmission layer of a user node. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for implementing inter-node communication, which is applied to a user node in a serial connection small computer system interface SAS network system; the method comprises the following steps:
acquiring target data to be transmitted sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
constructing an Ethernet message carrying the target data;
packaging the Ethernet message into an SAS protocol message;
sending the SAS protocol message to an SAS-HBA in the user node so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data; the SAS-HBA is a host bus adapter adopting an SAS protocol.
Optionally, the step of encapsulating the ethernet packet into an SAS protocol packet includes:
and adding an SAS header to the Ethernet message, and assigning a value to an Ethernet frame header field in the Ethernet message to obtain an SAS protocol message.
Optionally, the step of encapsulating the ethernet packet into an SAS protocol packet includes:
aggregating a plurality of Ethernet messages to be transmitted, which comprise the Ethernet message, to obtain an aggregated Ethernet message; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value;
and adding an SAS header to the aggregated Ethernet message, and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
Optionally, the step of sending the SAS protocol packet to the SAS-HBA in the user node so that the SAS-HBA sends the SAS protocol packet to a destination user node serving as a data receiver through a forwarding node includes:
and sending the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node by using a physical channel with a source SAS address in the SAS protocol message.
Optionally, the initial SAS address of each physical channel in the SAS-HBA is different.
Optionally, the method further comprises:
when detecting that the data flow of a first physical channel in the SAS-HBA of the SAS-HBA meets the busy condition of a preset channel, searching a target physical channel meeting the preset idle condition; wherein the first physical channel is any one of the SAS-HBA or a predetermined physical channel;
and when the target physical channel is found, resetting the SAS address of the target physical channel as the SAS address of the first physical channel.
Optionally, the step of resetting the SAS address of the target physical channel to the SAS address of the first physical channel includes:
disabling the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after setup is complete, the target physical channel is enabled.
In a second aspect, an embodiment of the present application provides an apparatus for implementing inter-node communication, which is applied to a user node in a serial connection small computer system interface SAS network system; the device comprises:
the data acquisition unit is used for acquiring target data to be transmitted sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
an ethernet packet constructing unit, configured to construct an ethernet packet carrying the target data;
a message encapsulation unit, configured to encapsulate the ethernet message into an SAS protocol message;
a message sending unit, configured to send the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a destination user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data; the SAS-HBA is a host bus adapter adopting an SAS protocol.
Optionally, the packet encapsulation unit includes:
and the first message encapsulation unit is used for adding an SAS header to the Ethernet message and assigning a value to an Ethernet frame header field in the Ethernet message to obtain an SAS protocol message.
Optionally, the packet encapsulation unit includes:
the aggregation unit is used for aggregating a plurality of Ethernet messages to be transmitted, which contain the Ethernet messages, to obtain the aggregated Ethernet messages; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value;
and the second message encapsulation unit is used for adding an SAS header to the aggregated Ethernet message and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
Optionally, the message sending unit is specifically configured to:
and sending the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node by using a physical channel with a source SAS address in the SAS protocol message.
Optionally, the initial SAS address of each physical channel in the SAS-HBA is different.
Optionally, the apparatus further comprises:
the physical channel searching unit is used for searching a target physical channel meeting a preset idle condition when detecting that the data flow of a first physical channel in the SAS-HBA of the physical channel searching unit meets the preset channel busy condition; wherein the first physical channel is any one of the SAS-HBA or a predetermined physical channel;
and the address resetting unit is used for resetting the SAS address of the target physical channel to the SAS address of the first physical channel when the target physical channel is found.
Optionally, the address resetting unit is specifically configured to:
when the target physical channel is found, forbidding the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after setup is complete, the target physical channel is enabled.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device is a user node in a serial attached small computer system interface SAS network system, and includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the method for realizing the communication between the nodes provided by the embodiment of the application when executing the program stored on the memory.
In the scheme provided by the embodiment of the application, after the user node obtains the target data to be transmitted sent by the target program, the target data is firstly encapsulated into the ethernet message, and then the SAS protocol message is constructed and transmitted, so that the program depending on the communication interface of the ethernet can be applied to the user node. Therefore, the communication interface of the SAS network system compatible with the Ethernet can be realized through the scheme, so that the aim of reducing the coupling of the application layer and the data transmission layer of the user node is fulfilled.
Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings 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 of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for implementing communication between nodes according to an embodiment of the present disclosure;
fig. 2 is a message format of an SAS protocol message provided in the embodiment of the present application;
FIG. 3(a) is a schematic diagram of physical lanes included in a SAS port prior to dynamic adjustment, and FIG. 3(b) is a schematic diagram of physical lanes included in a SAS port after dynamic adjustment;
fig. 4 is a schematic topology diagram of an SAS network system provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus for implementing inter-node communication according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to achieve a communication interface of an SAS network system compatible with an ethernet, and thus reduce the coupling between an application layer and a data transmission layer of a user node, embodiments of the present application provide a method, an apparatus, and an electronic device for implementing inter-node communication.
First, a method for implementing inter-node communication provided in the embodiments of the present application is described below.
It should be noted that the method for implementing inter-node communication provided in the embodiments of the present application is applied to a user node in an SAS network system. The device type of the user node may be: computers, printers, scanners, etc.
In addition, the SAS network system described in the embodiment of the present application may be a local area network system, and in the local area network system, each user node may perform data transfer through an SAS switch. Of course, the SAS network system described in the embodiment of the present application may also be a wide area network system, in which each user node may perform data transfer through an SAS switch and an SAS gateway.
It should be emphasized that the user node in the SAS network system is a device for performing data transmission by using the SAS protocol in the data transmission layer, and particularly, the SAS-HBA is used as a network card device. Similarly, an SAS switch is a switch in which the data transport layer uses the SAS protocol for data transmission, and an SAS gateway is a gateway in which the data transport layer uses the SAS protocol for data transmission.
As shown in fig. 1, a method for implementing communication between nodes provided in the embodiment of the present application may include the following steps:
s101, obtaining target data to be transmitted sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
after the target program sends the target data to be transmitted, the user node can obtain the target data to be transmitted sent by the target program, and then perform subsequent processing on the target data.
It is understood that the target data issued by the target program may be: it is reasonable to use data generated by the program itself based on user data generated by user operation.
S102, constructing an Ethernet message carrying the target data;
the target data to be transmitted sent by the target program is application layer data, and the target program is a program depending on a communication interface of the ethernet, so that the user node can construct an ethernet message carrying the target data after obtaining the target data to be transmitted sent by the target program. And because the data transmission protocol of the ethernet can be a TCP/IP protocol, the ethernet message can be a TCP/IP protocol message. The TCP/IP Protocol is a shorthand of Transmission control Protocol/Internet Protocol, the translated name is transmission control Protocol/Internet interconnection Protocol, also called network communication Protocol, is the most basic Protocol of Internet and Internet, and consists of IP Protocol of network layer and TCP Protocol of transmission layer.
It should be noted that, in the embodiment of the present application, a specific construction manner of constructing the ethernet packet carrying the target data is the same as that in the prior art. And the ethernet message carries a source IP address and a destination IP address, wherein the source IP address is the IP address of the user node, and the destination IP address is the IP address of the destination user node as a data receiver. The IP Address is an Internet Protocol Address, which is a way of addressing a host on the Internet, and is also called an Internet Protocol Address.
S103, packaging the Ethernet message into an SAS protocol message;
after the ethernet packet is constructed, in order to ensure that the target data can be transmitted in the data transmission layer, the user node may encapsulate the ethernet packet into an SAS protocol packet, where the SAS protocol packet is a packet conforming to the SAS transmission specification.
It should be noted that the SAS protocol message carries an active SAS address and a destination SAS address. Wherein, the source SAS address is: the SAS address of the user node as the data sender specifically refers to: a SAS address of a physical channel in a first SAS-HBA (Host Bus Adapter) that is a SAS-HBA installed in a user node as a data sender. And the destination SAS address is: the SAS address of the user node as the data receiver specifically refers to: a SAS address of a physical channel in a second SAS-HBA, which is a SAS-HBA installed in a user node as a data receiving side.
As will be appreciated by those skilled in the art, according to the SAS protocol, each user node in the SAS network system reads a SAS address from its corresponding SAS-HBA and broadcasts the SAS address to other user nodes in the SAS network system when joining the SAS network system. In this way, each user node in the SAS network system may store the SAS address of each user node in the SAS network system in an address linked list.
Also, any SAS-HBA may comprise multiple physical channels, each provided with an 8 byte SAS address. Also, for one SAS-HBA, physical lanes having the same SAS address belong to one SAS port, so that the number of SAS ports is the same as the number of SAS addresses. It should be noted that, in an implementation manner, the initial SAS address of each physical channel in any SAS-HBA may be different, and at this time, one SAS port includes one physical channel, so that network card devices with the same number as that of the physical channels may be constructed, thereby implementing physical isolation between TCP/IP channels.
Optionally, in an implementation manner, the step of encapsulating the ethernet packet into an SAS protocol packet may include:
and adding an SAS header to the Ethernet message, and assigning a value to an Ethernet frame header field in the Ethernet message to obtain an SAS protocol message.
In this embodiment, the fields included in the SAS header added to the ethernet packet are the same as the fields included in the header of the SAS protocol packet in the prior art, and specifically, may at least include: source SAS address, destination SAS address, SAS packet body length, SAS header length, etc. Fig. 2 shows a message format of an SAS protocol message, and as shown in fig. 2, the SAS header is an SAS header, and an ethernet header, an IP header, a TCP header, data, and a frame check sequence constitute a message body of the SAS protocol message.
In addition, the value of the source MAC (Media Access Control) address in the header field of the ethernet frame may be: the lower 6 bits of the source SAS address; and the value of the destination MAC address in the header field of the ethernet frame may be: the lower 6 bits of the destination SAS address are, of course, not limited thereto. Wherein, the source MAC address is the MAC address of the user node, and the destination MAC address is the MAC address of the destination user node.
Optionally, in order to improve the bandwidth utilization, for an ethernet packet with a small data volume, multiple ethernet packets with a small data volume may be aggregated and encapsulated into one SAS protocol packet. Based on the requirement, in another implementation manner, the step of encapsulating the ethernet packet into an SAS protocol packet may include:
aggregating a plurality of Ethernet messages to be transmitted containing the Ethernet message to obtain an aggregated Ethernet message; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value;
and adding an SAS header to the aggregated Ethernet message, and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
It should be noted that the ethernet messages are extracted according to the transmission sequence, that is, the ethernet messages are continuously transmitted messages. And, on the premise of ensuring higher bandwidth, the predetermined data amount threshold value can be set according to actual conditions. In addition, the specific implementation manner of adding an SAS header to the aggregated ethernet packet and assigning a value to the ethernet frame header field in the ethernet packet may refer to the related contents described above.
And S104, sending the SAS protocol message to the SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node.
After generating the SAS protocol packet, the user node may send the SAS protocol packet to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol packet to a destination user node serving as a data receiver through a forwarding node. Furthermore, when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data.
Specifically, the user node sends the SAS protocol packet to the SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol packet to a destination user node serving as a data receiver through a forwarding node by using a physical channel having a source SAS address in the SAS protocol packet. Correspondingly, the SAS-HBA in the destination user node may receive the SAS protocol packet sent by the forwarding device, and then the destination user node decapsulates the SAS protocol packet twice, thereby finally obtaining the target data.
It will be appreciated that for a local area network, the forwarding node is a SAS switch. Furthermore, the SAS-HBA transmits the SAS protocol packet to the SAS switch by using the physical channel having the source SAS address in the SAS protocol packet, and the SAS switch transmits the SAS protocol packet to the destination node. It should be noted that the process of forwarding the SAS protocol message after the SAS switch receives the SAS protocol message is the same as the process of forwarding an SAS protocol message after the SAS switch of the SAS network system in the prior art receives an SAS protocol message, and details are not described here.
In the scheme provided by the embodiment of the application, after the user node obtains the target data to be transmitted sent by the target program, the target data is firstly encapsulated into the ethernet message, and then the SAS protocol message is constructed and transmitted, so that the program depending on the communication interface of the ethernet can be applied to the user node. Therefore, the communication interface of the SAS network system compatible with the Ethernet can be realized through the scheme, so that the aim of reducing the coupling of the application layer and the data transmission layer of the user node is fulfilled.
In addition, because the physical channels with the same SAS address are classified as an SAS port, in order to increase the communication bandwidth, the traffic pressure of the port can be monitored, and the number of the physical channels included in the port can be dynamically adjusted. Based on the requirement, the method for implementing communication between nodes provided by the embodiment of the present application may further include the following steps:
A. when detecting that the data flow of a first physical channel in the SAS-HBA of the SAS-HBA meets the busy condition of a preset channel, searching a target physical channel meeting the preset idle condition; wherein, the first physical channel is any one physical channel or a preset physical channel in the SAS-HBA;
in the operation process of the user node, the user node can detect the data traffic of each physical channel in the self SAS-HBA through a real-time detection mode, a timing detection mode or a polling detection mode, and then when the data traffic of a first physical channel in the self SAS-HBA is detected to meet a preset channel busy condition, a target physical channel meeting a preset idle condition is searched, wherein the first physical channel is any one physical channel in the SAS-HBA. Certainly, in the operation process of the user node, the user node may detect the data traffic of a predetermined physical channel in its own SAS-HBA, and then search for a target physical channel that meets a predetermined idle condition when detecting that the data traffic of the predetermined physical channel meets a predetermined channel busy condition.
For example, the busy condition of the predetermined channel may be that the unit data traffic exceeds the upper limit of the predetermined traffic, and the idle condition may be that the unit data traffic is lower than the lower limit of the predetermined traffic, but is not limited thereto.
B. And when the target physical channel is found, resetting the SAS address of the target physical channel as the SAS address of the first physical channel.
When the target physical channel is found, the user node may reset the SAS address of the target physical channel to the SAS address of the first physical channel, so that the number of physical channels in the SAS port where the busy physical channel is located is increased, that is, the ports are aggregated. By dynamically adjusting the number of physical channels included in the SAS port, the communication bandwidth can be dynamically controlled.
Specifically, the step of resetting the SAS address of the target physical lane to the SAS address of the first physical lane may include:
disabling the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after the setup is completed, the target physical channel is enabled.
For ease of understanding the process of dynamically adjusting the number of physical lanes included in a SAS port, reference may be made to the exemplary diagrams shown in fig. 3(a) and 3 (b). Referring to fig. 3(a), SAS addresses of the physical channels are all different, and at this time, the physical channels belong to different SAS ports, specifically: SAS port1 includes physical channel ph 1, SAS port2 includes physical channel ph 2, SAS port3 includes physical channel ph 3, and SAS port4 includes physical channel ph 4. When detecting that the data traffic of phy1 meets a predetermined channel busy condition and detecting that the data traffic of phys 2, 3 and 4 meets a predetermined idle condition, the SAS addresses of phys 2, 3 and 4 may be set as the SAS address of phys 1, so that the physical channel included in port11 is adjusted to phys 1, 2, 3 and 4 by only including phys 1, that is, phys 1, phys 2, phys 3 and phys 4 are aggregated into port1, as shown in fig. 3(b), thereby achieving the purpose of dynamically controlling the communication bandwidth.
Note that, since phy2, phy3, and phy4 are dynamically aggregated in the SAS ports corresponding to phy1, the SAS addresses of phy2, phy3, and phy4 are deleted from the address chain table, and the SAS addresses of phy1 are retained in the address chain table as the SAS addresses of phy2, phy3, and phy4 belonging to the same SAS port. And the user node retransmits the untransmitted messages of phy2, phy3, and phy4 before aggregation, specifically, retransmits the untransmitted messages by using the SAS address corresponding to the port1, and the retransmitted messages can be transmitted through four physical channels.
For clarity, the methods provided in the examples of the present application are described below with reference to specific examples.
Fig. 4 is a schematic topology diagram of an SAS network system according to an embodiment of the present disclosure. As shown in fig. 4, a method for implementing communication between nodes may include the following steps:
(1) after receiving the socket communication request, the application layer of the node-1 obtains an application layer data packet corresponding to the socket communication request and sends the application layer data packet to a TCP/IP stack of the node-1 belonging to the software;
(2) the TCP/IP stack of the node-1 constructs an Ethernet message carrying the application layer data packet and sends the Ethernet message to a virtual Ethernet driver of the node-1 belonging to the software;
(3) the virtual Ethernet driver of the node-1 packages the Ethernet message into an SAS protocol message and sends the SAS protocol message to the SAS-HBA driver of the node-1 belonging to the software;
(4) the SAS-HBA driver of the node-1 sends the SAS protocol message to the SAS-HBA of the node-1 belonging to the hardware;
(5) the SAS-HBA of the node-1 sends the SAS protocol message to the SAS switch;
(6) the SAS switch forwards the received SAS protocol message to a node-n serving as a data receiver;
(7) the SAS-HBA of the node-n belonging to the hardware receives the SAS protocol message forwarded by the SAS switch and transmits the message to the SAS-HBA drive of the node-n belonging to the software;
(8) the SAS-HBA driver of the node-n sends the received SAS protocol message to the virtual Ethernet driver of the node-n belonging to the software;
(9) the virtual Ethernet driver of the node-n decapsulates the SAS protocol message into an Ethernet message and transmits the Ethernet message to a TCP/IP protocol stack belonging to software;
(10) and the TCP/IP protocol stack of the node-n analyzes the Ethernet message into an application layer data packet.
Furthermore, the SAS-HBAs of the node-1 and the node-n can monitor the data traffic of each physical channel or a preset physical channel, so as to dynamically adjust the number of the physical channels in the SAS port and realize the dynamic control of the TCP/IP communication bandwidth.
Therefore, the solution provided by the embodiment can realize that the SAS network system is compatible with the communication interface of the ethernet, thereby reducing the coupling between the application layer and the data transmission layer of the user node.
Corresponding to the method embodiment, the embodiment of the application provides a device for realizing communication between nodes, which is applied to a user node in a serial connection small computer system interface (SAS) network system. As shown in fig. 5, the apparatus for implementing communication between nodes may include:
a data obtaining unit 510, configured to obtain target data to be transmitted, which is sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
an ethernet packet constructing unit 520, configured to construct an ethernet packet carrying the target data;
a message encapsulation unit 530, configured to encapsulate the ethernet message into an SAS protocol message;
a message sending unit 540, configured to send the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a destination user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data; the SAS-HBA is a host bus adapter adopting an SAS protocol.
In the scheme provided by the embodiment of the application, after the user node obtains the target data to be transmitted sent by the target program, the target data is firstly encapsulated into the ethernet message, and then the SAS protocol message is constructed and transmitted, so that the program depending on the communication interface of the ethernet can be applied to the user node. Therefore, the communication interface of the SAS network system compatible with the Ethernet can be realized through the scheme, so that the aim of reducing the coupling of the application layer and the data transmission layer of the user node is fulfilled.
Optionally, the packet encapsulating unit 530 may include:
and the first message encapsulation unit is used for adding an SAS header to the Ethernet message and assigning a value to an Ethernet frame header field in the Ethernet message to obtain an SAS protocol message.
Optionally, the packet encapsulating unit 530 may include:
the aggregation unit is used for aggregating a plurality of Ethernet messages to be transmitted, which contain the Ethernet messages, to obtain the aggregated Ethernet messages; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value;
and the second message encapsulation unit is used for adding an SAS header to the aggregated Ethernet message and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
Optionally, the message sending unit 540 is specifically configured to:
and sending the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node by using a physical channel with a source SAS address in the SAS protocol message.
Optionally, the initial SAS address of each physical channel in the SAS-HBA is different.
Optionally, the apparatus further comprises:
the physical channel searching unit is used for searching a target physical channel meeting a preset idle condition when detecting that the data flow of a first physical channel in the SAS-HBA of the physical channel searching unit meets the preset channel busy condition; wherein the first physical channel is any one of the SAS-HBA or a predetermined physical channel;
and the address resetting unit is used for resetting the SAS address of the target physical channel to the SAS address of the first physical channel when the target physical channel is found.
Optionally, the address resetting unit is specifically configured to:
when the target physical channel is found, forbidding the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after setup is complete, the target physical channel is enabled.
The embodiment of the present application further provides an electronic device, as shown in fig. 6, which includes a processor 610, a communication interface 620, a memory 630 and a communication bus 640, where the processor 610, the communication interface 620, and the memory 630 complete communication with each other through the communication bus 640,
a memory 630 for storing computer programs;
the processor 610 is configured to implement the method steps for implementing the inter-node communication provided in the embodiment of the present application when executing the program stored in the memory 630.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps for implementing inter-node communication provided in the embodiment of the present application are implemented.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (11)
1. A method for realizing communication between nodes is characterized in that the method is applied to user nodes in a serial connection small computer system interface SAS network system; the method comprises the following steps:
acquiring target data to be transmitted sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
constructing an Ethernet message carrying the target data;
packaging the Ethernet message into an SAS protocol message;
sending the SAS protocol message to an SAS-HBA in the user node so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data; the SAS-HBA is a host bus adapter adopting an SAS protocol;
wherein, the step of encapsulating the ethernet packet into an SAS protocol packet includes:
adding an SAS header to the Ethernet message, and assigning a value to an Ethernet frame header field in the Ethernet message to obtain an SAS protocol message; or,
aggregating a plurality of Ethernet messages to be transmitted, which comprise the Ethernet message, to obtain an aggregated Ethernet message; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value; and adding an SAS header to the aggregated Ethernet message, and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
2. The method according to claim 1, wherein the step of sending the SAS protocol packet to a SAS-HBA in the user node so that the SAS-HBA sends the SAS protocol packet to a destination user node as a data receiver through a forwarding node comprises:
and sending the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node by using a physical channel with a source SAS address in the SAS protocol message.
3. The method of claim 2 wherein the initial SAS address of each physical lane in the SAS-HBA is different.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
when detecting that the data flow of a first physical channel in the SAS-HBA of the SAS-HBA meets the busy condition of a preset channel, searching a target physical channel meeting the preset idle condition; wherein the first physical channel is any one of the SAS-HBA or a predetermined physical channel;
and when the target physical channel is found, resetting the SAS address of the target physical channel as the SAS address of the first physical channel.
5. The method of claim 4, wherein the step of resetting the SAS address of the target physical channel to the SAS address of the first physical channel comprises:
disabling the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after setup is complete, the target physical channel is enabled.
6. A device for realizing communication between nodes is characterized in that the device is applied to a user node in a serial connection small computer system interface (SAS) network system; the device comprises:
the data acquisition unit is used for acquiring target data to be transmitted sent by a target program; wherein, the target program is a program depending on the communication interface of the Ethernet;
an ethernet packet constructing unit, configured to construct an ethernet packet carrying the target data;
a message encapsulation unit, configured to encapsulate the ethernet message into an SAS protocol message;
a message sending unit, configured to send the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a destination user node serving as a data receiving party through a forwarding node; when receiving the SAS protocol packet, the destination user node decapsulates the SAS protocol packet into the ethernet packet, and decapsulates the ethernet packet into the target data; the SAS-HBA is a host bus adapter adopting an SAS protocol;
wherein, the packet encapsulation unit includes:
a first packet encapsulation unit, configured to add an SAS header to the ethernet packet, and assign a value to an ethernet frame header field in the ethernet packet to obtain an SAS protocol packet; or,
the packet encapsulation unit includes:
the aggregation unit is used for aggregating a plurality of Ethernet messages to be transmitted, which contain the Ethernet messages, to obtain the aggregated Ethernet messages; the Ethernet messages to be transmitted correspond to the same data receiver, and the data volume of the Ethernet messages to be transmitted is not greater than a preset data volume threshold value;
and the second message encapsulation unit is used for adding an SAS header to the aggregated Ethernet message and assigning values to Ethernet frame header fields in the Ethernet message to obtain an SAS protocol message.
7. The apparatus according to claim 6, wherein the message sending unit is specifically configured to:
and sending the SAS protocol message to an SAS-HBA in the user node, so that the SAS-HBA sends the SAS protocol message to a target user node serving as a data receiving party through a forwarding node by using a physical channel with a source SAS address in the SAS protocol message.
8. The apparatus of claim 7 wherein the initial SAS address of each physical lane in the SAS-HBA is different.
9. The apparatus of claim 7 or 8, further comprising:
the physical channel searching unit is used for searching a target physical channel meeting a preset idle condition when detecting that the data flow of a first physical channel in the SAS-HBA of the physical channel searching unit meets the preset channel busy condition; wherein the first physical channel is any one of the SAS-HBA or a predetermined physical channel;
and the address resetting unit is used for resetting the SAS address of the target physical channel to the SAS address of the first physical channel when the target physical channel is found.
10. The apparatus of claim 9, wherein the address reset unit is specifically configured to:
when the target physical channel is found, forbidding the target physical channel;
setting the SAS address of the target physical channel as the SAS address of the first physical channel;
after setup is complete, the target physical channel is enabled.
11. An electronic device is a user node in a serial connection small computer system interface (SAS) network system and is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810550194.0A CN110557354B (en) | 2018-05-31 | 2018-05-31 | Method and device for realizing communication between nodes and electronic equipment |
PCT/CN2018/120069 WO2019227891A1 (en) | 2018-05-31 | 2018-12-10 | Method and apparatus for implementing communication between nodes, and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810550194.0A CN110557354B (en) | 2018-05-31 | 2018-05-31 | Method and device for realizing communication between nodes and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110557354A CN110557354A (en) | 2019-12-10 |
CN110557354B true CN110557354B (en) | 2020-10-13 |
Family
ID=68698600
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810550194.0A Active CN110557354B (en) | 2018-05-31 | 2018-05-31 | Method and device for realizing communication between nodes and electronic equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110557354B (en) |
WO (1) | WO2019227891A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114157684B (en) * | 2020-08-18 | 2024-01-02 | 华为终端有限公司 | Message processing method, device and storage medium |
CN112636789A (en) * | 2020-12-31 | 2021-04-09 | 广东电网有限责任公司电力调度控制中心 | Virtual MAC method and device for power line communication |
CN114338262B (en) * | 2021-11-26 | 2024-02-20 | 国网信息通信产业集团有限公司 | Energy cabin communication method and system and electronic equipment |
CN114338798B (en) * | 2021-12-27 | 2023-04-25 | 北京神经元网络技术有限公司 | Data transmission method, device, system, equipment and storage medium |
CN114928589B (en) * | 2022-03-17 | 2024-04-12 | 京东科技信息技术有限公司 | Data transmission method, data transmission device, computer readable medium and apparatus |
CN115086446B (en) * | 2022-08-16 | 2022-12-02 | 国能日新科技股份有限公司 | Data transmission method, system, device, equipment and computer readable storage medium |
CN116016725B (en) * | 2023-03-24 | 2023-06-13 | 深圳开鸿数字产业发展有限公司 | Information transmission method, computer device and storage medium |
CN116436994B (en) * | 2023-06-15 | 2023-08-25 | 杭州禾芯半导体有限公司 | Profinet protocol message transmission method, device, equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104111805A (en) * | 2014-07-15 | 2014-10-22 | 华为技术有限公司 | I/O demand processing method and storage system |
CN104657316A (en) * | 2015-03-06 | 2015-05-27 | 北京百度网讯科技有限公司 | Server |
US9229660B2 (en) * | 2012-07-27 | 2016-01-05 | Fujitsu Limited | Storage system and method for controlling storage system |
CN105867843A (en) * | 2016-03-25 | 2016-08-17 | 天津书生云科技有限公司 | Data transmission method and device |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4347351B2 (en) * | 2007-02-15 | 2009-10-21 | 富士通株式会社 | Data encryption apparatus, data decryption apparatus, data encryption method, data decryption method, and data relay apparatus |
US8140696B2 (en) * | 2007-03-12 | 2012-03-20 | International Business Machines Corporation | Layering serial attached small computer system interface (SAS) over ethernet |
US20090222569A1 (en) * | 2008-02-29 | 2009-09-03 | Atrato, Inc. | Storage system front end |
CN101729580A (en) * | 2008-10-24 | 2010-06-09 | 成都市华为赛门铁克科技有限公司 | Storage method and system, terminal service panel, control panel and storage channel panel |
US8812707B2 (en) * | 2011-05-25 | 2014-08-19 | Lsi Corporation | Transmitting internet protocol over SCSI in a high availability cluster |
CN105472047B (en) * | 2016-02-03 | 2019-05-14 | 天津书生云科技有限公司 | Storage system |
US20130124774A1 (en) * | 2011-11-16 | 2013-05-16 | Ankit Sihare | Method and system to enable pre-boot executable environment operating system install using switch in scalable direct attached storage environment |
US9021173B2 (en) * | 2012-10-26 | 2015-04-28 | International Business Machines Corporation | High speed differential wiring strategy for serially attached SCSI systems |
US9582307B2 (en) * | 2012-11-01 | 2017-02-28 | International Business Machines Corporation | Efficient data transmission in an overlay virtualized network |
US20150301964A1 (en) * | 2014-02-18 | 2015-10-22 | Alistair Mark Brinicombe | Methods and systems of multi-memory, control and data plane architecture |
-
2018
- 2018-05-31 CN CN201810550194.0A patent/CN110557354B/en active Active
- 2018-12-10 WO PCT/CN2018/120069 patent/WO2019227891A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9229660B2 (en) * | 2012-07-27 | 2016-01-05 | Fujitsu Limited | Storage system and method for controlling storage system |
CN104111805A (en) * | 2014-07-15 | 2014-10-22 | 华为技术有限公司 | I/O demand processing method and storage system |
CN104657316A (en) * | 2015-03-06 | 2015-05-27 | 北京百度网讯科技有限公司 | Server |
CN105867843A (en) * | 2016-03-25 | 2016-08-17 | 天津书生云科技有限公司 | Data transmission method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110557354A (en) | 2019-12-10 |
WO2019227891A1 (en) | 2019-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110557354B (en) | Method and device for realizing communication between nodes and electronic equipment | |
CN107046542B (en) | Method for realizing consensus verification by adopting hardware at network level | |
JP6918784B2 (en) | Data packet transmission method and device in IPv6 network | |
US20120201246A1 (en) | Multicast Traffic Management in a Network Interface | |
WO2019134383A1 (en) | Method for controlling network congestion, access device, and computer readable storage medium | |
WO2017054576A1 (en) | Unicast tunnel building method, apparatus and system | |
CN104518973B (en) | A kind of reliable multicast transmission method of the data based on SDN environment | |
EP2680507B1 (en) | Packet forwarding method and system, and relay agent device | |
CN103944867A (en) | Dynamic host configuration protocol (DHCP) message processing method, device and system | |
US10797986B2 (en) | Link discovery method and apparatus | |
KR102025680B1 (en) | SDN based ARP implementation method and device | |
WO2021088813A1 (en) | Packet encapsulating method and apparatus, and packet decapsulating method and apparatus | |
WO2024000937A1 (en) | Multi-modal network control system and method supporting mobile access of terminal | |
CN107770072A (en) | A kind of method and apparatus for sending and receiving message | |
WO2020073907A1 (en) | Method and apparatus for updating forwarding entry | |
CN102546308B (en) | The method and system of neighbor uni-cast agency is realized based on duplicate address detection | |
WO2019100794A1 (en) | Message processing method and apparatus | |
CN104486217A (en) | Cross network message transmitting method and equipment | |
WO2014110737A1 (en) | Method, device, and system for configuring device in network | |
US12003417B2 (en) | Communication method and apparatus | |
WO2017202034A1 (en) | Data packet sending and receiving method and device, and electronic apparatus | |
WO2021031092A1 (en) | Packet processing method and network device | |
CN108667735A (en) | A kind of retransmission method and device of multicast packet | |
CN107547691B (en) | Address resolution protocol message proxy method and device | |
US20080056263A1 (en) | Efficient transport layer processing of incoming packets |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |