CN112804321A - Method, device, equipment and storage medium for caching and forwarding Ethernet data packet - Google Patents
Method, device, equipment and storage medium for caching and forwarding Ethernet data packet Download PDFInfo
- Publication number
- CN112804321A CN112804321A CN202110025605.6A CN202110025605A CN112804321A CN 112804321 A CN112804321 A CN 112804321A CN 202110025605 A CN202110025605 A CN 202110025605A CN 112804321 A CN112804321 A CN 112804321A
- Authority
- CN
- China
- Prior art keywords
- signal
- ethernet
- communication interface
- data
- sending
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004891 communication Methods 0.000 claims abstract description 116
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 96
- 230000005540 biological transmission Effects 0.000 claims abstract description 43
- 230000008859 change Effects 0.000 claims abstract description 18
- 238000012544 monitoring process Methods 0.000 claims abstract description 6
- 238000005070 sampling Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 6
- 230000003139 buffering effect Effects 0.000 claims description 3
- 230000006870 function Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/563—Data redirection of data network streams
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for caching and forwarding an Ethernet data packet, wherein the method is applied to a programmable device, the programmable device comprises an Ethernet MAC controller and a bidirectional storage block, the Ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting the Ethernet data packet, and the method comprises the following steps: when monitoring that a sending clock signal of the communication interface is a falling edge, detecting a sending enabling signal of the communication interface so as to write the Ethernet data packet into the bidirectional storage block; performing a counting operation on the counter based on a level change of the transmission enable signal; and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending. The transmission rate of a communication interface is not required to be considered, the Ethernet data packet is cached and forwarded at any rate, and the flexibility of data transmission is improved.
Description
Technical Field
The embodiments of the present invention relate to digital communication technologies, and in particular, to a method, an apparatus, a device, and a storage medium for caching and forwarding an ethernet packet.
Background
In the digital integrated service transmission device, there are often situations that ethernet data and other service (such as serial port, audio, telephone, video, etc.) data need to share bandwidth resources in a transmission link. In consideration of importance and cost of different services, a bandwidth compression technology is usually adopted to compress ethernet bandwidth, and bandwidth compression relates to caching of ethernet data packets, and therefore the problems of easy data loss, easy signal distortion and the like need to be overcome.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for caching and forwarding an Ethernet data packet, which aim to solve the problems of caching and forwarding the Ethernet data packet at any rate and avoiding data loss.
In a first aspect, an embodiment of the present invention provides a method for caching and forwarding an ethernet packet, which is applied to a programmable device, where the programmable device includes an ethernet MAC controller and a bidirectional storage block, the ethernet MAC controller includes a communication interface and a counter, the communication interface is used to transmit the ethernet packet, the counter is used to record the number of ethernet packets transmitted in the communication interface, and the method includes:
when the fact that the sending clock signal of the communication interface is a falling edge is monitored, detecting a sending enabling signal of the communication interface so as to write an Ethernet data packet into the bidirectional storage block;
performing a counting operation on the counter based on a level change of the transmission enable signal;
and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending.
In a second aspect, an embodiment of the present invention further provides a device for caching and forwarding ethernet packets, which is applied to a programmable device, where the programmable device includes an ethernet MAC controller and a bidirectional storage block, the ethernet MAC controller includes a communication interface and a counter, the communication interface is used to transmit the ethernet packets, the counter is used to record the number of ethernet packets transmitted in the communication interface, and the device includes:
the data packet caching module is used for detecting a sending enabling signal of the communication interface when monitoring that a sending clock signal of the communication interface is a falling edge so as to write the Ethernet data packet into the bidirectional storage block;
a packet counting module for performing a counting operation on the counter based on a level change of the transmission enable signal;
and the data packet sending module is used for reading the Ethernet data packet from the bidirectional storage block based on the counter when the receiving clock signal of the communication interface is monitored to be a falling edge so as to send the Ethernet data packet to a data sending end of a programmable device for sending.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for forwarding and caching ethernet packets according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for forwarding and caching ethernet packets according to the first aspect.
The invention provides a cache forwarding method of Ethernet data packets, which is applied to a programmable device, wherein the programmable device comprises an Ethernet MAC controller and a bidirectional storage block, the Ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting the Ethernet data packets, and the counter is used for recording the transmission number of the Ethernet data packets in the communication interface; according to the invention, when the sending clock signal of the communication interface is monitored to be a falling edge, the sending enabling signal of the communication interface is detected, so that the writing operation of the Ethernet data packet is carried out on the bidirectional storage block; performing a counting operation on the counter based on a level change of the transmission enable signal; and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending. The method has the advantages that the transmission rate of the communication interface is not required to be considered, the operation of storing the Ethernet data packet into the bidirectional storage block can be realized only by detecting the level change of the sending enabling signal of the communication interface, the method is simple and easy to operate, the counting operation of the counter is executed based on the level change of the sending enabling signal, the counting accuracy can be guaranteed, the loss of data in the transmission process is avoided, the falling edge of the receiving clock signal is monitored, the Ethernet data packet is read from the bidirectional storage block based on the number of the Ethernet data packets counted in the counter to realize the forwarding of the data, the interface transmission rate of the communication interface is not required to be matched with the forwarding rate of the Ethernet data packet, the Ethernet data packet can be cached and forwarded at any rate, and the flexibility of data transmission is improved.
Drawings
Fig. 1 is a flowchart of a method for caching and forwarding an ethernet packet according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a buffering and forwarding apparatus for ethernet packets according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
It should be noted that: in the description of the embodiments of the present invention, the terms "first," "second," "third," "fourth," and the like are used solely to distinguish one from another and are not intended to indicate or imply relative importance.
Example one
Fig. 1 is a flowchart of a method for caching and forwarding an ethernet packet according to an embodiment of the present invention, where this embodiment is applicable to a case where the ethernet packet is cached and forwarded in a transmission link of the ethernet packet, and the method is applied to a programmable device, where the programmable device includes an ethernet MAC controller and a bidirectional storage block, the ethernet MAC controller includes a communication interface and a counter, the communication interface is used to transmit the ethernet packet, the counter is used to record the number of ethernet packets transmitted in the communication interface, and the method can be executed by a device for caching and forwarding the ethernet packet, where the device can be implemented by software and/or hardware, and can be configured in a computer device, such as a server, a workstation, a personal computer, and the like, and the method specifically includes the following steps:
s101, when the fact that the sending clock signal of the communication interface is a falling edge is monitored, the sending enabling signal of the communication interface is detected, and writing operation of the Ethernet data packet is conducted on the bidirectional storage block.
In this embodiment, the ethernet MAC controller is composed of a hardware controller and a MAC communication protocol, where MAC (media Access control), that is, a media Access control layer protocol, is located in a lower half of a data link layer in an OSI seven-layer protocol and is mainly responsible for controlling and connecting a physical medium of a physical layer. The communication interface in this embodiment generally refers to an interface for connecting an ethernet MAC controller and a physical interface transceiver PHY, and for transmitting ethernet data, and such communication interfaces may include an mii (Media Independent interface) interface, an rmii (reduced Media Independent interface) interface, a gmii (Gigabit Media Independent interface) interface, an rgmii (reduced Media Independent interface) interface, and the like, where the interfaces are all bidirectional interfaces and generally have functions of sending a data signal, sending a clock signal, sending an enable signal, receiving a data signal, receiving a clock signal, receiving a data valid signal, and the like. It should be noted that the present embodiment does not limit a specific communication interface.
The bidirectional memory block of this embodiment further includes a write clock signal port for receiving a transmission clock signal transmitted from the communication interface, and a data input port for receiving an ethernet packet transmitted from the communication interface; before listening to the falling edge of the transmission clock signal of the communication interface, the embodiment further includes: sending a sending clock signal of the communication interface to a writing clock signal port; sending a sending data signal of the communication interface to the second highest bit to the zero bit of the data input port, wherein the sending data signal comprises an Ethernet data packet to be received and stored by the bidirectional storage block; the sending enabling signal of the communication interface is sent to the highest position of the data input port, so that the counter can count the number of Ethernet data packets stored and sent in the bidirectional storage block by inquiring the level change of the sending enabling signal; the read/write enable signal of the bidirectional memory block is set to a high level to maintain the bidirectional memory block in an enabled state.
In this embodiment, the bidirectional memory block further includes an input memory address, an indication signal; the input storage address is used for recording the storage address of the Ethernet data packet written into the bidirectional storage block, and the indication signal is used for indicating that the Ethernet data packet is in a writing state in the bidirectional storage block.
In one case, if the transmission enable signal is at a high level, the ethernet packet is written into the bidirectional storage block, and the input storage address is incremented by 1, and the indication signal is set to be at a high level.
In another case, if the transmission enable signal is at a low level and the indication signal is at a high level, the ethernet packet is written into the bidirectional memory block, 1 is added to the input memory address, and the indication signal is set at a low level. The indication signal is high level to indicate that the ethernet data packet is being cached and written into the bidirectional storage block at this time, but the sending enable signal is low level to indicate that the data sending signal of the communication interface has stopped, at this time, the sent ethernet data packet still needs to be stored into the bidirectional storage block, so that the input storage address continues to accumulate 1, and after all the ethernet data packets sent into the bidirectional storage block are completely written, the indication signal is set to low level to indicate that the writing operation is completed.
And S102, performing counting operation on the counter based on the level change of the transmission enabling signal.
Two level states exist due to the transmit enable signal of the communication interface: and the communication interface is in a state of continuously sending the Ethernet data packets to the bidirectional storage block when the sending enable signal is at a high level, the bidirectional storage block executes writing operation on the Ethernet data packets, the number of the Ethernet data packets sent to the bidirectional storage block by the communication interface recorded by the counter is always increased at the moment, namely, one data packet is sent by the communication interface, and one data packet is recorded by the counter. However, the communication interface stops sending ethernet packets to the bidirectional memory block only when the send enable signal changes from high to low, i.e. at the time of the falling edge.
Therefore, the present embodiment can perform the counting operation on the counter based on the level change of the transmission enable signal.
In a specific example, the bidirectional storage block includes a data input port, the most significant bit of the data input port is used for storing a transmission enable signal of the communication interface, and the second most significant bit to the zero bit of the data input port is used for storing a transmission data signal of the communication interface, S102 may include: sampling the highest bit of the data input port, wherein the sampling mode is not limited in this embodiment, but preferably a high-speed clock which is several times as high as a read-write clock of the bidirectional memory block is used for sampling, wherein the write clock of the bidirectional memory block can be replaced by a transmission clock of the communication interface, and the read clock of the bidirectional memory block can be replaced by a reception clock of the communication interface; inverting the transmitting enabling signal stored by the highest bit of the data input port at the current moment to obtain a first level signal; determining a transmission enable signal stored at the last moment of the highest bit of the data input port as a second level signal; performing an and operation on the first level signal and the second level signal to determine a falling edge of the transmission enable signal in the data input port; when it is determined that the transmit enable signal is a falling edge in the data input port, 1 is added to the counter.
In this embodiment, the bidirectional storage block further includes a data output port, where the data output port is configured to output the ethernet data packet stored in the bidirectional storage block to a data sending end of the programmable device for sending, and arrange bit width allocated to the data output port from high bit to low bit, where the highest bit of the data output port is used to store a received data valid signal of the communication interface, the second highest bit to zero bit of the data output port is used to store a received data signal of the communication interface, and the received data signal includes the ethernet data packet to be sent out.
In another specific example, S102 may include: sampling the highest bit of the data output port, and inverting the received data effective signal stored by the highest bit of the data output port at the current moment to obtain a third level signal; determining a received data valid signal stored at the last moment by the highest bit of the data output port as a fourth level signal; performing an and operation on the third level signal and the fourth level signal to determine a falling edge of the received data valid signal in the data output port; when it is determined that the received data valid signal is a falling edge in the data output port, the counter is decremented by 1.
And S103, when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending.
In a specific implementation of this embodiment, when it is monitored that the receiving clock signal of the communication interface is a falling edge, it is determined whether the counter is greater than zero; if yes, reading the Ethernet data packet from the bidirectional storage block, and accumulating 1 for the output storage address of the bidirectional storage block so as to send the Ethernet data packet to a data sending end of the programmable device through a data output port of the bidirectional storage block for sending; and if not, clearing the memory occupied by the received data effective signal and the received data signal of the communication interface in the Ethernet MAC controller.
If the reset signal of the communication interface is not at a low level, i.e. in an invalid state, the read-write enable signal of the bidirectional storage block is set to a high level from the beginning of working, so that the bidirectional storage block can always keep an enable state, can respond to the transmit enable signal and the receive data valid signal of the communication interface in time, can perform storage write-in operation and read-transmit operation on the Ethernet data packet at any rate, and ensure the flexibility and operability of data transmission.
In an embodiment of the present invention, when it is monitored that the reset signal of the communication interface is at a low level, all of the input storage address of the bidirectional storage block, the output storage address of the bidirectional storage block, the data output port of the bidirectional storage block, the counter, and the indication signal of the bidirectional storage block are cleared, so as to reset the bidirectional storage block.
The method provided by the embodiment of the invention is applied to a programmable device, the programmable device comprises an Ethernet MAC controller and a bidirectional storage block, the Ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting Ethernet data packets, the counter is used for recording the number of the Ethernet data packets transmitted in the communication interface, and the method comprises the following steps: when monitoring that a sending clock signal of the communication interface is a falling edge, detecting a sending enabling signal of the communication interface so as to write the Ethernet data packet into the bidirectional storage block; performing a counting operation on the counter based on a level change of the transmission enable signal; and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending. The method has the advantages that the transmission rate of the communication interface is not required to be considered, the operation of storing the Ethernet data packet into the bidirectional storage block can be realized only by detecting the level change of the sending enabling signal of the communication interface, the method is simple and easy to operate, the counting operation of the counter is executed based on the level change of the sending enabling signal, the counting accuracy can be guaranteed, the loss of data in the transmission process is avoided, the falling edge of the receiving clock signal is monitored, the Ethernet data packet is read from the bidirectional storage block based on the number of the Ethernet data packets counted in the counter to realize the forwarding of the data, the interface transmission rate of the communication interface is not required to be matched with the forwarding rate of the Ethernet data packet, the Ethernet data packet can be cached and forwarded at any rate, and the flexibility of data transmission is improved.
Example two
Fig. 2 is a schematic structural diagram of a buffering and forwarding apparatus for ethernet packets according to a second embodiment of the present invention, where the apparatus may be applied to a programmable device, where the programmable device includes an ethernet MAC controller and a bidirectional storage block, the ethernet MAC controller includes a communication interface and a counter, the communication interface is used to transmit the ethernet packets, the counter is used to record the number of ethernet packets transmitted in the communication interface, and the apparatus may specifically include the following modules:
a data packet caching module 201, configured to detect a sending enable signal of the communication interface when it is monitored that a sending clock signal of the communication interface is a falling edge, so as to perform a write operation of an ethernet data packet on the bidirectional storage block;
a packet counting module 202, configured to perform a counting operation on the counter based on a level change of the transmission enable signal;
and a data packet sending module 203, configured to, when it is monitored that the receiving clock signal of the communication interface is a falling edge, read an ethernet data packet from the bidirectional storage block based on the counter, so as to send the ethernet data packet to a data sending end of a programmable device for sending.
In one embodiment of the invention, the bidirectional memory block comprises a write clock signal port, a data input port; before the listening that the transmission clock signal of the communication interface is a falling edge, the apparatus further includes:
the clock signal sending module is used for sending a sending clock signal of the communication interface to the write clock signal port;
the data signal transmitting module is used for transmitting a transmitting data signal of the communication interface to the second highest bit to the zero bit of the data input port;
the enabling signal sending module is used for sending the sending enabling signal of the communication interface to the highest bit of the data input port;
and the storage block enabling state determining module is used for setting a read-write enabling signal of the bidirectional storage block to be at a high level so as to enable the bidirectional storage block to maintain an enabling state.
In one embodiment of the invention, the bidirectional memory block includes an input memory address, an indication signal; the packet caching module 201 may include:
the sending enabling signal detection submodule is used for detecting a sending enabling signal of the communication interface, if the sending enabling signal is at a high level, the first storage writing submodule is called, and if the sending enabling signal is at a low level and the indicating signal is at a high level, the second storage writing submodule is called;
the first storage writing submodule is used for writing the Ethernet data packet into the bidirectional storage block, accumulating 1 for the input storage address, and setting the indication signal to be in a high level, wherein the indication signal is used for indicating that the Ethernet data packet is in a writing state in the bidirectional storage block;
and the second storage writing submodule is used for writing the Ethernet data packet into the bidirectional storage block, accumulating 1 for the input storage address and setting the indication signal to be low level.
In one embodiment of the invention, the bidirectional memory block includes a data input port; the packet counting module 202 may include:
the first sampling submodule is used for sampling the highest bit of the data input port, and the highest bit of the data input port is used for storing a sending enabling signal of the communication interface;
the first level signal determination submodule is used for inverting the transmission enabling signal stored at the current moment at the highest bit of the data input port to obtain a first level signal;
a second level signal determination submodule for determining a transmission enable signal stored at the last time of the most significant bit of the data input port as a second level signal;
a first and operation execution submodule for performing and operation on the first level signal and the second level signal to determine a falling edge of the transmit enable signal in the data input port;
a first count submodule, configured to increment the counter by 1 when it is determined that the transmit enable signal is a falling edge in the data input port.
In one embodiment of the invention, the bidirectional memory block includes a data output port; the packet counting module 202 may include:
the second sampling submodule is used for sampling the highest bit of the data output port, and the highest bit of the data output port is used for storing a received data valid signal of the communication interface;
a third level signal determining submodule, configured to invert a received data valid signal stored at a current time at a highest bit of the data output port, so as to obtain a third level signal;
a fourth level signal determination submodule for determining a received data valid signal stored at the last time of the most significant bit of the data output port as a fourth level signal;
a second and operation straight sub-module, configured to perform an and operation on the third level signal and the fourth level signal to determine a falling edge of the received data valid signal in the data output port;
a second count submodule for decrementing the counter by 1 when the received data valid signal is determined to be a falling edge in the data output port.
In one embodiment of the invention, the bidirectional memory block comprises a data output port, an output memory address; the packet sending module 203 may include:
the judgment submodule is used for judging whether the counter is larger than zero, if so, the data sending submodule is called, and if not, the memory clearing submodule is called;
the data sending submodule is used for reading an Ethernet data packet from the bidirectional storage block and accumulating 1 for the output storage address so as to send the Ethernet data packet to a data sending end of a programmable device through the data output port for sending;
and the memory clearing submodule is used for clearing the memory occupied by the received data effective signal and the received data signal of the communication interface in the Ethernet MAC controller.
In one embodiment of the invention, the bidirectional storage block comprises an input storage address, an output storage address, a data output port and an indication signal, wherein the indication signal is used for indicating that the Ethernet data packet is in a writing state in the bidirectional storage block; the device further comprises:
and the reset module is used for resetting the input storage address, the output storage address, the data output port, the counter and the indication signal when monitoring that the reset signal of the communication interface is at a low level.
The device for caching and forwarding the Ethernet data packet provided by the embodiment of the invention can execute the method for caching and forwarding the Ethernet data packet provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention, as shown in fig. 3, the computer device includes a processor 300, a memory 301, a communication module 302, an input device 303, and an output device 304; the number of processors 300 in the computer device may be one or more, and one processor 300 is taken as an example in fig. 3; the processor 300, the memory 301, the communication module 302, the input device 303 and the output device 304 in the computer apparatus may be connected by a bus or other means, and fig. 3 illustrates the connection by a bus as an example.
The memory 301 is a computer-readable storage medium, and can be used to store software programs, computer-executable programs, and modules, such as modules corresponding to the ethernet packet caching and forwarding method in the embodiment of the present invention (for example, the packet caching module 201, the packet counting module 202, and the packet sending module 203 in the ethernet packet caching and forwarding device shown in fig. 2). The processor 300 executes various functional applications and data processing of the computer device by running software programs, instructions and modules stored in the memory 301, that is, implements the above-described ethernet packet caching and forwarding method.
The memory 301 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 301 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 301 may further include memory located remotely from processor 300, which may be connected to a computer device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
And the communication module 302 is used for establishing connection with the display screen and realizing data interaction with the display screen.
The input device 303 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus.
The output means 304 may comprise a display device such as a display screen.
It should be noted that the specific composition of the input device 303 and the output device 304 can be set according to actual situations.
The computer device provided in this embodiment of the present invention is capable of executing the method for forwarding the ethernet packet according to any embodiment of the present invention, and has corresponding functions and advantages.
Example four
The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for forwarding an ethernet packet according to any of the embodiments.
The Ethernet data packet caching and forwarding method is applied to a programmable device, the programmable device comprises an Ethernet MAC controller and a bidirectional storage block, the Ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting the Ethernet data packets, the counter is used for recording the number of the Ethernet data packets transmitted in the communication interface, and the method comprises the following steps:
when the fact that the sending clock signal of the communication interface is a falling edge is monitored, detecting a sending enabling signal of the communication interface so as to write an Ethernet data packet into the bidirectional storage block;
performing a counting operation on the counter based on a level change of the transmission enable signal;
and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending.
Of course, the computer program of the computer-readable storage medium provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the method for forwarding and caching ethernet packets provided in any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above ethernet packet caching and forwarding apparatus, each unit and each module included in the ethernet packet caching and forwarding apparatus are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. The method for caching and forwarding the Ethernet data packets is applied to a programmable device, the programmable device comprises an Ethernet MAC controller and a bidirectional storage block, the Ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting the Ethernet data packets, the counter is used for recording the number of the Ethernet data packets transmitted in the communication interface, and the method comprises the following steps:
when the fact that the sending clock signal of the communication interface is a falling edge is monitored, detecting a sending enabling signal of the communication interface so as to write an Ethernet data packet into the bidirectional storage block;
performing a counting operation on the counter based on a level change of the transmission enable signal;
and when the receiving clock signal of the communication interface is monitored to be a falling edge, reading the Ethernet data packet from the bidirectional storage block based on the counter so as to send the Ethernet data packet to a data sending end of the programmable device for sending.
2. The method of claim 1, wherein the bidirectional memory block comprises a write clock signal port, a data input port;
before the monitoring that the sending clock signal of the communication interface is a falling edge, the method further comprises the following steps:
sending a sending clock signal of the communication interface to the writing clock signal port;
sending a sending data signal of the communication interface to the second highest bit to the zero bit of the data input port;
sending a sending enable signal of the communication interface to the highest bit of the data input port;
and setting the read-write enabling signal of the bidirectional storage block to be high level so as to enable the bidirectional storage block to maintain an enabling state.
3. A method according to claim 1 or 2, wherein said bidirectional memory block comprises an input memory address, an indication signal;
the detecting a transmission enabling signal of the communication interface to perform writing operation of an ethernet packet to the bidirectional storage block includes:
detecting a transmission enable signal of the communication interface;
if the sending enable signal is in a high level, writing an Ethernet data packet into the bidirectional storage block, accumulating 1 for the input storage address, and setting the indication signal to be in a high level, wherein the indication signal is used for indicating that the Ethernet data packet is in a writing state in the bidirectional storage block;
and if the sending enable signal is at a low level and the indication signal is at a high level, writing an Ethernet data packet into the bidirectional storage block, accumulating 1 for the input storage address, and setting the indication signal to be at a low level.
4. The method of claim 1 or 2, wherein the bidirectional memory block comprises a data input port;
the performing a counting operation on the counter based on the level change of the transmission enable signal includes:
sampling the highest bit of the data input port, wherein the highest bit of the data input port is used for storing a sending enabling signal of the communication interface;
inverting the transmitting enabling signal stored by the highest bit of the data input port at the current moment to obtain a first level signal;
determining a transmission enable signal stored at the last moment of the highest bit of the data input port as a second level signal;
performing an and operation on the first level signal and the second level signal to determine a falling edge of the transmit enable signal in the data input port;
when it is determined that the transmit enable signal is a falling edge in the data input port, 1 is added to the counter.
5. The method of claim 1 or 2, wherein the bidirectional memory block comprises a data output port;
the performing a counting operation on the counter based on the level change of the transmission enable signal includes:
sampling the highest bit of the data output port, wherein the highest bit of the data output port is used for storing a received data valid signal of the communication interface;
inverting the received data effective signal stored by the highest bit of the data output port at the current moment to obtain a third level signal;
determining a received data valid signal stored at the last moment by the highest bit of the data output port as a fourth level signal;
performing an and operation on the third level signal and the fourth level signal to determine a falling edge of the received data valid signal in the data output port;
decrementing the counter by 1 when the receive data valid signal is determined to be a falling edge in the data output port.
6. The method of claim 1 or 2, wherein the bidirectional memory block comprises a data output port, an output memory address;
the reading of the ethernet packet from the bidirectional storage block based on the counter to send the ethernet packet to a data sending end of a programmable device for sending includes:
judging whether the counter is larger than zero;
if yes, reading an Ethernet data packet from the bidirectional storage block, and accumulating 1 for the output storage address so as to send the Ethernet data packet to a data sending end of a programmable device through the data output port for sending;
and if not, clearing the memory occupied by the received data effective signal and the received data signal of the communication interface in the Ethernet MAC controller.
7. The method according to any one of claims 1, 2 or 6, wherein the bidirectional memory block comprises an input memory address, an output memory address, a data output port, and an indication signal for indicating that the ethernet packet is in a write state in the bidirectional memory block;
the method further comprises the following steps:
when the reset signal of the communication interface is monitored to be in a low level, the input storage address, the output storage address, the data output port, the counter and the indication signal are all cleared.
8. The device for buffering and forwarding the ethernet data packet is applied to a programmable device, the programmable device comprises an ethernet MAC controller and a bidirectional storage block, the ethernet MAC controller comprises a communication interface and a counter, the communication interface is used for transmitting the ethernet data packet, the counter is used for recording the number of ethernet data packets transmitted in the communication interface, and the device comprises:
the data packet caching module is used for detecting a sending enabling signal of the communication interface when monitoring that a sending clock signal of the communication interface is a falling edge so as to write the Ethernet data packet into the bidirectional storage block;
a packet counting module for performing a counting operation on the counter based on a level change of the transmission enable signal;
and the data packet sending module is used for reading the Ethernet data packet from the bidirectional storage block based on the counter when the receiving clock signal of the communication interface is monitored to be a falling edge so as to send the Ethernet data packet to a data sending end of a programmable device for sending.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for cache forwarding of ethernet packets according to any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the method for cache forwarding of ethernet packets according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110025605.6A CN112804321A (en) | 2021-01-08 | 2021-01-08 | Method, device, equipment and storage medium for caching and forwarding Ethernet data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110025605.6A CN112804321A (en) | 2021-01-08 | 2021-01-08 | Method, device, equipment and storage medium for caching and forwarding Ethernet data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112804321A true CN112804321A (en) | 2021-05-14 |
Family
ID=75809470
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110025605.6A Pending CN112804321A (en) | 2021-01-08 | 2021-01-08 | Method, device, equipment and storage medium for caching and forwarding Ethernet data packet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112804321A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117527529A (en) * | 2024-01-05 | 2024-02-06 | 平湖科谱激光科技有限公司 | Ethernet data storage method and device capable of automatically recovering from normal state |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5126975A (en) * | 1990-10-24 | 1992-06-30 | Integrated Device Technology, Inc. | Integrated cache SRAM memory having synchronous write and burst read |
CN1921002A (en) * | 2005-08-25 | 2007-02-28 | 联发科技股份有限公司 | Memory controller and memory system |
CN102065569A (en) * | 2009-11-17 | 2011-05-18 | 中国科学院微电子研究所 | Ethernet MAC sublayer controller suitable for WLAN |
CN111274171A (en) * | 2018-12-04 | 2020-06-12 | 珠海格力电器股份有限公司 | Data transmission device and method |
CN111367495A (en) * | 2020-03-06 | 2020-07-03 | 电子科技大学 | Asynchronous first-in first-out data cache controller |
-
2021
- 2021-01-08 CN CN202110025605.6A patent/CN112804321A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5126975A (en) * | 1990-10-24 | 1992-06-30 | Integrated Device Technology, Inc. | Integrated cache SRAM memory having synchronous write and burst read |
CN1921002A (en) * | 2005-08-25 | 2007-02-28 | 联发科技股份有限公司 | Memory controller and memory system |
CN102065569A (en) * | 2009-11-17 | 2011-05-18 | 中国科学院微电子研究所 | Ethernet MAC sublayer controller suitable for WLAN |
CN111274171A (en) * | 2018-12-04 | 2020-06-12 | 珠海格力电器股份有限公司 | Data transmission device and method |
CN111367495A (en) * | 2020-03-06 | 2020-07-03 | 电子科技大学 | Asynchronous first-in first-out data cache controller |
Non-Patent Citations (1)
Title |
---|
孙冬雪等: "基于DDR3 SDRAM的大容量异步FIFO缓存系统的设计与实现", 《电子设计工程》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117527529A (en) * | 2024-01-05 | 2024-02-06 | 平湖科谱激光科技有限公司 | Ethernet data storage method and device capable of automatically recovering from normal state |
CN117527529B (en) * | 2024-01-05 | 2024-03-19 | 平湖科谱激光科技有限公司 | Ethernet data storage method and device capable of automatically recovering from normal state |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11876702B2 (en) | System and method for facilitating efficient address translation in a network interface controller (NIC) | |
US7864672B1 (en) | Method for tracking source and destination internet protocol data | |
KR101203471B1 (en) | Method of transmitting ethernet frame in a network bridge and the bridge apparatus | |
CN108600053B (en) | Wireless network data packet capturing method based on zero copy technology | |
US9350631B2 (en) | Identifying flows causing undesirable network events | |
CN101291194A (en) | Method and system for keeping sequence of report | |
US20230300051A1 (en) | In-band Edge-to-Edge Round-Trip Time Measurement | |
CN112260899B (en) | Network monitoring method and device based on MMU (memory management unit) | |
WO2022105691A1 (en) | Method for preventing ipfix message loss, application thereof, and asic chip | |
CN112804321A (en) | Method, device, equipment and storage medium for caching and forwarding Ethernet data packet | |
CN101014009A (en) | System and method for controlling packet transfer | |
CN112995809A (en) | Control method and device of FC switch, FC switch and storage medium | |
US7054962B2 (en) | Embedded system having broadcast data storing controller | |
CN112737940A (en) | Data transmission method and device | |
JP4630524B2 (en) | Network transmitter with data frame priority management for data transmission | |
CN111600809B (en) | Gigabit single optical port server adapter | |
CN117354253A (en) | Network congestion notification method, device and storage medium | |
CN112003796B (en) | Broadcast message processing method, system, equipment and computer storage medium | |
US6629164B1 (en) | Character counter and match registers in a serial interface | |
EP0739561A1 (en) | Apparatus and method for selectively storing error statistics | |
JP3255148B2 (en) | Communications system | |
US20230403219A1 (en) | High speed data packet pcap capture and storage with error detection-correction | |
EP4425876A1 (en) | Data processing method and apparatus, and network device and storage medium | |
US8069270B1 (en) | Accelerated tape backup restoration | |
CN116418750A (en) | PFC storm detection method and related equipment |
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 | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20231027 |
|
AD01 | Patent right deemed abandoned |