CN109617853B - Gigabit network port auto-negotiation device and method based on FPGA - Google Patents

Gigabit network port auto-negotiation device and method based on FPGA Download PDF

Info

Publication number
CN109617853B
CN109617853B CN201811177668.8A CN201811177668A CN109617853B CN 109617853 B CN109617853 B CN 109617853B CN 201811177668 A CN201811177668 A CN 201811177668A CN 109617853 B CN109617853 B CN 109617853B
Authority
CN
China
Prior art keywords
code stream
module
auto
data code
terminal device
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
Application number
CN201811177668.8A
Other languages
Chinese (zh)
Other versions
CN109617853A (en
Inventor
王斐
秦铆
熊晶
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongyu High Tech Wuhan Information Technology Co ltd
Original Assignee
Zhongyu High Tech Wuhan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongyu High Tech Wuhan Information Technology Co ltd filed Critical Zhongyu High Tech Wuhan Information Technology Co ltd
Priority to CN201811177668.8A priority Critical patent/CN109617853B/en
Publication of CN109617853A publication Critical patent/CN109617853A/en
Application granted granted Critical
Publication of CN109617853B publication Critical patent/CN109617853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/351Switches specially adapted for specific applications for local area network [LAN], e.g. Ethernet switches
    • H04L49/352Gigabit ethernet switching [GBPS]

Landscapes

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

Abstract

The invention relates to a gigabit network port auto-negotiation device and method based on FPGA, the device includes GTP Transceiver module, data receiving and analyzing module, auto-negotiation control module and data sending execution module; a GTP _ RX sub-module and a GTP _ TX sub-module are arranged in the GTP Transceiver module; the GTP _ RX submodule is used for carrying out serial-parallel conversion on the serial data code stream received through the gigabit network port to obtain a parallel data code stream; the data receiving and analyzing module is used for analyzing and counting the parallel data code stream to generate a state signal; the auto-negotiation control module is used for sending auto-negotiation information to the data sending execution module according to the state signal; the data sending execution module sends a corresponding auto-negotiation parallel data code stream to the GTP-TX sub-module according to the auto-negotiation information; and the GTP-TX sub-module is used for performing parallel-serial conversion on the auto-negotiation parallel data code stream to obtain an auto-negotiation serial data code stream and sending the auto-negotiation serial data code stream out through a gigabit network port. The invention not only meets the requirement of high bandwidth, but also reserves the function of a hundred-million network interface.

Description

Gigabit network port auto-negotiation device and method based on FPGA
Technical Field
The invention relates to the field of network port communication, in particular to a gigabit network port auto-negotiation device and method based on an FPGA (field programmable gate array).
Background
Ethernet evolved from 10M, undergoing several transitions, to the now gigabit ethernet. Gigabit ethernet is characterized by high efficiency, high speed, and high performance, and has been widely used in the financial, commercial, educational, government, and electrical industries, etc.
When the Ethernet is developed to the fast Ethernet of 100Mb/s, in order to realize the mixed communication with the 10Mb/s Ethernet equipment, the self-negotiation concept is provided. Auto-negotiation runs two sites, communicating automatically with optimal performance, even when the ethernet devices are different, including rate (10/100Mb/s) and duplex mode (half/full duplex). With the development of the current gigabit ethernet, the communication capacity supported by the ethernet device is more diversified, and the negotiation content of the auto-negotiation is increased.
In order to realize the detection, test and control of the intelligent power grid automation equipment, optical digital test equipment with an optical network port is needed, SV messages of hundreds of megas or even gigabytes are needed to be analyzed and analyzed according to the actual test condition of an intelligent substation, and the requirements of more than 8 hundreds of megas of ports cannot be met due to the small size of some handheld devices; in addition, in the multi-network-port optical digital testing instrument, too many PHY chips are used in the circuit, so that the hardware circuit is complex, the power consumption is high, and the cost is high; therefore, how to solve the high bandwidth requirement and retain the original hundred mega-port function is a problem to be solved urgently.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a gigabit network port auto-negotiation device and method based on FPGA, which not only meet the requirement of high bandwidth, but also reserve the function of a hundred-megabyte network port, and can save PHY chips, so that hardware circuits are simple, efficient and low in power consumption.
The technical scheme for solving the technical problems is as follows: a gigabit network port auto-negotiation device based on FPGA comprises a GTP Transceiver module, a data receiving and analyzing module, an auto-negotiation control module and a data sending execution module;
the GTP Transceiver module is a RocktIO Transceiver module integrated by a FPGA-based Spartan6 device, and is provided with a GTP _ RX sub-module and a GTP _ TX sub-module;
the GTP _ RX submodule is used for carrying out serial-parallel conversion on a serial data code stream received through the gigabit network port to obtain a parallel data code stream;
the data receiving and analyzing module is used for analyzing and counting the parallel data code stream to generate a state signal;
the auto-negotiation control module is used for sending auto-negotiation information to the data sending execution module according to the state signal;
the data sending execution module sends a corresponding auto-negotiation parallel data code stream to the GTP-TX sub-module according to the auto-negotiation information;
and the GTP-TX sub-module is used for performing parallel-serial conversion on the auto-negotiation parallel data code stream to obtain an auto-negotiation serial data code stream and sending the auto-negotiation serial data code stream out through a gigabit network port.
The invention has the beneficial effects that: the gigabit network port auto-negotiation device based on the FPGA is realized based on the FPGA chip, so that the gigabit network port auto-negotiation device has the advantages of good expansibility and operation real-time property, simple structure, low power consumption, short development period and low development cost, meets the requirement of high bandwidth, and reserves the function of a gigabit network port; in addition, the PHY chip is saved, the hardware circuit built around the PHY chip is saved, the gigabit network port module is directly connected and communicated with the FPGA, the hardware circuit is simplified, and some intermediate signals are saved.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the system also comprises an upper layer packet receiving module, an upper layer packet sending module and a CPU module;
the GTP Transceiver module is used for receiving and decoding a network data packet through the GTP _ RX submodule to obtain packet data;
the data receiving and analyzing module is also used for transmitting the packet message data to the upper layer packet receiving module;
the upper layer packet receiving module is used for performing packet analysis on the packet text data under the control of the auto-negotiation control module to obtain a data packet;
the CPU module is used for analyzing and counting the data packet and generating packet sending content;
the upper-layer packet sending module is used for preprocessing the packet sending content generated by the CPU module under the control of the auto-negotiation control module, calculating a packet and storing the packet;
the data sending execution module is further configured to read the packet stored in the upper packet sending module and send the packet to the GTP _ TX sub-module;
and the GTP Transceiver module is also used for packaging the packet and sending out the packet through the GTP _ TX sub-module.
The beneficial effect of adopting the further scheme is that: the gigabit network port auto-negotiation device based on the FPGA can unpack the received packet text data, extract the packet text content and store the content for a CPU to read, analyze and count; meanwhile, the CPU of the local device can organize the text content, and then the FPGA packages the data and sends the data.
Based on the gigabit network port auto-negotiation device based on the FPGA, the invention also provides a gigabit network port auto-negotiation method based on the FPGA.
A gigabit network port auto-negotiation method based on FPGA, a local device and an opposite device perform network port auto-negotiation, and the local device and the opposite device are both in auto-negotiation mode, the local device and the opposite device are both the gigabit network port auto-negotiation device based on FPGA, the network port auto-negotiation method comprises the following steps,
s1, the local terminal device sends a first parallel data code stream to the opposite terminal device for a first preset time;
s2, after lasting for a first preset time, the opposite terminal device sends a second parallel data code stream to the local terminal device;
s3, the local device analyzes and judges the second parallel data code stream, if the second parallel data code stream is valid, S4 is executed, and if not, S1 is skipped;
s4, the home terminal device sends a third parallel data code stream and a fourth parallel data code stream to the opposite terminal device according to the sequence;
s5, after receiving the fourth parallel data code stream, the opposite terminal device sends a fifth parallel data code stream to the home terminal device;
s6, the local device analyzes and judges the fifth parallel data code stream, if the fifth parallel data code stream is valid, the local device and the opposite device successfully perform CFG interactive communication handshake, and S7 is executed, otherwise, S5 is skipped;
s7, after the CFG interactive communication handshake between the local terminal device and the opposite terminal device lasts for a second preset time, the local terminal device sends a sixth parallel data code stream to the opposite terminal device;
s8, after receiving the sixth parallel data code stream, the opposite terminal device sends a seventh parallel data code stream to the home terminal device;
s9, the local terminal device analyzes and judges the seventh parallel data code stream, when the seventh parallel data code stream is effective, the local terminal device and the opposite terminal device enter an IDLE state and execute S10, otherwise, the local terminal device jumps to S8;
s10, after the home device and the peer device enter an IDLE state for a third preset time, the home device and the peer device enter a packet receiving and sending state.
The invention has the beneficial effects that: the gigabit network port auto-negotiation method based on the FPGA is realized based on the FPGA, has the auto-negotiation function of 1000BASE-X in the 802.3 standard, completes the gigabit auto-negotiation process with the same PHY chip, meets the requirement of high bandwidth, and reserves the function of a hundred megabytes network port.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the first parallel data code stream is a CFG code word with a configuration content of 0;
the effective second parallel data code stream is a plurality of continuous CFG code words with the same configuration content and different 0;
the third parallel data code stream is a plurality of continuous CFG code words with the same configuration content;
the fourth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the effective fifth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the sixth parallel data code stream is a plurality of continuous IDLE code words with the same configuration content;
and the effective seventh parallel data code stream is a plurality of continuous IDLE code words with the same configuration content.
Further, the specific process of sending the preset parallel data code stream by the home terminal device is that an FPGA internal resource rockio transceiver module built in the home terminal device performs parallel-to-serial conversion on the preset parallel data code stream to form a serial data code stream, and the serial data code stream is sent out by a home terminal network port;
the specific process of receiving the preset parallel data code stream by the opposite-end device is that the opposite-end device receives the serial data code stream through the opposite-end network port, and performs serial-parallel conversion on the serial data code stream through a Field Programmable Gate Array (FPGA) internal resource RocktIO transceiver module built in the opposite-end device to form the preset parallel data code stream.
Further, in S10, after the local device and the peer device enter the packet receiving and sending state, the local device and the peer device perform normal network communication.
Further, the specific process of performing normal network communication between the home terminal device and the opposite terminal device is that the home terminal device performs serial-parallel conversion on the packet text data transmitted by the opposite terminal device through a built-in FPGA internal resource rockio transceiver module, and uploads the packet text data to the CPU for the CPU to perform analysis and statistics;
or
The local terminal device organizes the packet sending content to be sent through the CPU, transmits the packet sending content to a built-in FPGA internal resource RockETIO receiving and sending module for parallel-serial conversion, and then sends the packet sending content to the opposite terminal device.
Further, the following steps are included during the execution of the S10 or after the execution of the S10 is completed,
s11, when the local device receives the valid second parallel data code stream again, the local device and the opposite device exit the packet receiving and sending state, and repeatedly execute the steps S1-S10.
Further, before the step of S1, the method further comprises the following steps,
and S0, judging whether the local terminal device and the opposite terminal device are both in the auto-negotiation mode, if so, starting to execute the S1, and if not, directly entering a packet receiving and sending state by the local terminal device and the opposite terminal device.
The beneficial effect of adopting the further scheme is that: the method of the invention not only can realize the communication with the opposite terminal in the auto-negotiation mode, but also can realize the communication with the opposite terminal in the forced mode.
Drawings
Fig. 1 is a block diagram of a gigabit network port auto-negotiation apparatus according to the present invention;
fig. 2 is a flowchart of a gigabit network port auto-negotiation method based on an FPGA according to the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
As shown in fig. 1, an FPGA-based gigabit network port auto-negotiation apparatus includes a GTPTransceiver module 150, a data receiving and analyzing module 130, an auto-negotiation control module 120, and a data sending and executing module 140;
the GTP Transceiver module 150 is a RocktIO Transceiver module integrated by a FPGA-based Spartan6 device, and is provided with a GTP _ RX sub-module and a GTP _ TX sub-module;
the GTP _ RX submodule is used for carrying out serial-parallel conversion on a serial data code stream received through the gigabit network port to obtain a parallel data code stream;
the data receiving and analyzing module 130 is configured to analyze and count the parallel data code stream, and generate a status signal;
the auto-negotiation control module 120 is configured to send auto-negotiation information to the data sending execution module according to the status signal;
the data sending execution module 140 sends a corresponding auto-negotiation parallel data code stream to the GTP _ TX sub-module according to the auto-negotiation information;
and the GTP-TX sub-module is used for performing parallel-serial conversion on the auto-negotiation parallel data code stream to obtain an auto-negotiation serial data code stream and sending the auto-negotiation serial data code stream out through a gigabit network port.
In this embodiment, the present invention further includes an upper layer packet receiving module 160, an upper layer packet sending module 170, and a CPU module;
the GTP Transceiver module 150 is configured to receive and decode a network data packet through the GTP _ RX sub-module to obtain packet data;
the data receiving and analyzing module 130 is further configured to transmit the packet data to the upper layer packet receiving module;
the upper layer packet receiving module 160 is configured to perform packet parsing on the packet data under the control of the auto-negotiation control module 120 to obtain a data packet;
the CPU module is used for analyzing and counting the data packet and organizing the packet sending content;
the upper layer packet sending module 170 is configured to prepare the content of the CPU module organization packet sending under the control of the auto-negotiation control module 120, and calculate and store a packet;
the data sending execution module 140 is further configured to read the packet stored in the upper packet sending module and send the packet to the GTP _ TX sub-module;
the GTP Transceiver module 150 is further configured to pack the packet and send the packet through the GTP _ TX sub-module.
The following explains the gigabit network port auto-negotiation device based on the FPGA in detail:
the gigabit network port auto-negotiation device based on the FPGA is designed with a gigabit optical network port;
the gigabit optical network port inserted by the gigabit network port auto-negotiation device based on the FPGA can convert an input optical digital signal into an electrical digital signal, namely a gigabit serial code stream, and transmit the gigabit serial code stream to the GTP Transceiver module 150; meanwhile, the GTP Transceiver module 150 may also transmit the gigabit serial code stream to the gigabit optical network port, and convert the gigabit serial code stream into an optical digital signal through the gigabit optical network port to be transmitted.
Particularly, the GTP Transceiver module 150 is a high-performance and low-power-consumption rockio high-speed serial Transceiver integrated with a Spartan6 device of the FPGA, and can support a data transmission rate of 614Mbps to 3.125 Gbps. The GTP Transceiver module 150 includes a GTP _ RX link and a GTP _ TX link.
In this embodiment, first, the GTP Transceiver module 150 is configured to perform serial-to-parallel conversion on a serial data stream transmitted from the gigabit network port through a rockio decoding module therein to obtain parallel data rx _ data, and attach an rx _ charisk signal that identifies the parallel data as a feature code. The parallel data rx _ data and rx _ charisk signals form a parallel data code stream.
The parallel data code stream follows 802.3 standard, and the defined code stream comprises CFG configuration code stream/C/, IDLE IDLE code stream/I/; the CFG configuration code stream/C/divide/C1/code stream and/C2/code stream,/C1/code stream and/C2/code stream are alternately appeared; IDLE IDLE code stream/I/divide again/I1/code stream and/I2/code stream; the code stream/C1 is defined as/K28.5/D21.5/cfg _ reg/combination; the/C2/code stream is defined as/K28.5/D2.2/cfg _ reg/combination; the/I1/code stream is defined as/K28.5/D5.6/combination; the/I2/codestream is defined as/K28.5/D16.2/combination.
The data receiving and analyzing module 130 is used for monitoring a CFG configuration code stream/C/and an IDLE IDLE code stream/I/; for the received CFG configuration code stream/C/, analyzing a CFG _ reg field in the code stream, and storing the field information; counting the continuous number and content of cfg _ reg fields by using a function to generate an ability _ flag signal, an ack _ flag signal or a consistency _ flag signal; the availability _ flag signal indicates that a plurality (more than 3) of cfg _ reg field flags with the same configuration content are received in succession; ACK _ flag indicates that a plurality (more than 3) of cfg _ reg field flags with the same configuration content and with ACK are received continuously; consistency _ flag indicates that a consecutive number (3 or more) of cfg _ reg fields with ACK and identical configuration content are received and marked consistent with the fields in the affinity _ flag signal. For the received IDLE code stream/I/, whether the code stream belongs to the/I1/code stream or the/I2/code stream is counted, and an IDLE _ flag signal is generated, wherein the IDLE _ flag signal indicates that a plurality (more than 3)/I2/code streams are received continuously. These signals are passed to auto-negotiation control module 120, which causes auto-negotiation control module 120 to provide auto-negotiation processing and management functions.
The auto-negotiation control module 120 is used to control the whole auto-negotiation to be performed in order, and it controls the whole process of auto-negotiation according to the link data received by the data receiving and analyzing module 130 and the state information of the peer device, including: the negotiation information to be transmitted is transferred to the data transmission executing module 140, and it is informed that the upper layer packet receiving module 160 can analyze the content of the received packet for storage, and it is informed that the upper layer packet transmitting module 170 can transfer the packet data that is desired to be transmitted to the data transmission executing module 140.
Specifically, the home device and the peer device are taken as examples (in this specific embodiment, a gigabit gateway auto-negotiation device based on the FPGA is located at the home terminal and becomes the home device, and a gigabit gateway auto-negotiation device based on the FPGA is located at the peer terminal and is referred to as the peer device).
The auto-negotiation control module 120 of the local device first controls to send a CFG configuration code stream/C with CFG _ reg of 0 to the opposite device, and simultaneously monitors a mode signal of the opposite device.
If the IDLE _ flag is valid, and the mode is 0, it is determined that the opposite device is in the forced gigabit mode, the home device enters an IDLE state, and after the auto-negotiation control module 120 of the home device controls the transmit/I2/code stream 10MS, the home device can perform normal packet receiving and transmitting with the opposite device, that is, enter a normal operating state, and set the link _ flag to be valid.
If the availability _ flag is valid, and the mode is 1, it is determined that the peer device is in the auto-negotiation mode, and the auto-negotiation control module 120 of the local device analyzes the received CFG _ reg field (since the peer device is in the auto-negotiation mode, the peer device responds to send the CFG _ reg field to the local device after sending CFG configuration code stream/C/of which CFG _ reg is 0 to the peer device). If the capability contained in the contents of the cfg _ reg field matches or is lower than the capability of itself (the home device), the tx _ cfg _ reg takes the contents of the cfg _ reg field; if the capacity is higher than the capacity of the device (the local device), the tx _ cfg _ reg adopts the content in the cfg _ reg field corresponding to the capacity of the device (the local device); the auto-negotiation control module 120 of the local device controls the data transmission execution module 140 to transmit the content (CFG configuration code stream/C /) to the peer device; when the content in the CFG _ reg field transmitted by the peer device matches the capability of the peer device (home device), the auto-negotiation control module 120 of the home device controls the data transmission execution module 140 to transmit/receive the CFG configuration code stream/C with ACK to the peer device; when the cfg _ reg field transmitted by the peer device also contains ACK and the constancy _ flag signal is valid, the auto-negotiation control module 120 of the home device enters an IDLE state, and the auto-negotiation control module 120 of the home device controls the data transmission execution module 140 to transmit the/I2/code stream to the peer device; when the auto-negotiation control module 120 of the local device receives the fact that the data receiving and analyzing module 130 informs the opposite device that the I2/code stream is also sent, and the idle _ flag signal is valid, the auto-negotiation control module 120 of the local device enters a link state, in which the local device and the opposite device can perform a normal packet receiving and sending state, and the link _ flag is set valid.
When the home device and the peer device are both in a normal packet receiving and sending state and the auto-negotiation control module 120 of the home device receives the availability _ flag again, the auto-negotiation process is restarted, and the whole operation process is repeated.
The data transmission executing module 140 is an executing and transmitting module, and transmits corresponding data according to the status signal and tx _ cfg _ reg transmitted from the auto-negotiation controlling module 120; if it is indicated to be in/C/state, then sending out data in CFG configuration code stream/C/format according to tx _ CFG _ reg content; since the CFG configuration code stream/C/Yes/C1 code stream/and/C2/code stream appear alternately, a variable signal inv _ flag needs to be set to indicate whether D21.5 or D2.2 is sent, and the signal is inverted once when the signal is sent once. If the/I2/state is indicated, sending out the data in a/I2/code stream format; if the LINK state is indicated, the data transmitted by the upper layer packet sending module 170 is acquired and is packed into a packet format to be inserted into the IDLE stream/I/for sending.
The rockio coding circuit in the GTP Transceiver module 150 converts the parallel data code stream to be sent by the data sending execution module 140 into a serial data code stream, transmits the serial data code stream to the optical gigabit network port, and converts the serial data code stream into an optical serial signal to be sent out.
When the auto-negotiation control module 120 is in the LINK state, the LINK _ flag is effectively transferred to the upper layer packet receiving module 160 and the upper layer packet sending module 170.
When the link _ flag is valid, the upper layer packet receiving module 160 gates the data decoded by the GTP Transceiver module 150 for packet parsing, extracts a complete and CRC correct packet and stores the packet in the RAM, which can be read by the CPU module for data packet analysis and statistics.
When the link _ flag is valid, the upper layer packet sending module 170 prepares the content of the CPU module organized packet sending, calculates the message CRC, stores the message CRC in the RAM, and provides the message CRC for the data sending execution module 140 to read, and then sends out the message CRC.
The device can simultaneously carry out large-batch tests on the optical digital protection IED, the fault recording IED, the measurement and control IED and other IED devices on the intelligent power grid, and meets the requirements of high bandwidth and high-speed test execution; the test quality and capability are improved; the invention is realized based on the FPGA chip, so the invention has the advantages of good expansibility and operation real-time property, simple structure, low power consumption, short development period and low development cost, not only meets the requirement of high bandwidth, but also reserves the function of a hundred million network ports; in addition, PHY chips are saved, ports of equipment are saved, material cost is reduced, and power consumption of the equipment is saved; and also allows the testing capability of the device to be in a qualitative fly-through.
Based on the gigabit network port auto-negotiation device based on the FPGA, the invention also provides a gigabit network port auto-negotiation method based on the FPGA.
As shown in fig. 2, in a gigabit network port auto-negotiation method based on FPGA, a local device and an opposite device perform network port auto-negotiation, and both the local device and the opposite device are in an auto-negotiation mode, both the local device and the opposite device are the gigabit network port auto-negotiation device based on FPGA, the network port auto-negotiation method includes the following steps,
s1, the local terminal device sends a first parallel data code stream to the opposite terminal device for a first preset time;
s2, after lasting for a first preset time (10ms), the opposite terminal device sends a second parallel data code stream to the local terminal device;
s3, the local device analyzes and judges the second parallel data code stream, if the second parallel data code stream is valid, S4 is executed, and if not, S1 is skipped;
s4, the home terminal device sends a third parallel data code stream and a fourth parallel data code stream to the opposite terminal device according to the sequence;
s5, after receiving the fourth parallel data code stream, the opposite terminal device sends a fifth parallel data code stream to the home terminal device;
s6, the local device analyzes and judges the fifth parallel data code stream, if the fifth parallel data code stream is valid, the local device and the opposite device successfully perform CFG interactive communication handshake, and S7 is executed, otherwise, S5 is skipped;
s7, after the CFG interactive communication handshake between the home terminal device and the opposite terminal device lasts for a second preset time (10ms), the home terminal device sends a sixth parallel data code stream to the opposite terminal device;
s8, after receiving the sixth parallel data code stream, the opposite terminal device sends a seventh parallel data code stream to the home terminal device;
s9, the local terminal device analyzes and judges the seventh parallel data code stream, when the seventh parallel data code stream is effective, the local terminal device and the opposite terminal device enter an IDLE state and execute S10, otherwise, the local terminal device jumps to S8;
s10, after the home device and the peer device enter an IDLE state for a third preset time (10ms), the home device and the peer device enter a packet receiving and transmitting state.
In this particular embodiment:
the first parallel data code stream is a CFG code word with configuration content of 0;
the effective second parallel data code stream is a plurality of continuous CFG code words with the same configuration content and different 0;
the third parallel data code stream is a plurality of continuous CFG code words with the same configuration content;
the fourth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the effective fifth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the sixth parallel data code stream is a plurality of continuous IDLE code words with the same configuration content;
and the effective seventh parallel data code stream is a plurality of continuous IDLE code words with the same configuration content.
The specific process of sending the preset parallel data code stream by the home terminal device is that an FPGA internal resource RocktIO receiving and sending module arranged in the home terminal device carries out parallel-to-serial conversion on the preset parallel data code stream to form a serial data code stream, and the serial data code stream is sent out by a home terminal network port;
the specific process of receiving the preset parallel data code stream by the opposite-end device is that the opposite-end device receives the serial data code stream through the opposite-end network port, and performs serial-parallel conversion on the serial data code stream through a Field Programmable Gate Array (FPGA) internal resource RocktIO transceiver module built in the opposite-end device to form the preset parallel data code stream. The preset parallel data code stream is specifically a first parallel data code stream, a second parallel data code stream, a third parallel data code stream, a fourth parallel data code stream, a fifth parallel data code stream, a sixth parallel data code stream or a seventh parallel data code stream.
In S10, after the local device and the peer device enter the packet receiving and sending state, the local device and the peer device perform normal network communication.
The specific process of the home terminal device and the opposite terminal device performing normal network communication is,
the home terminal device carries out serial-parallel conversion on the packet text data transmitted by the opposite terminal device through a built-in FPGA internal resource RockETIO transceiver module, and uploads the packet text data to a CPU for the CPU to carry out analysis and statistics;
or
The local terminal device generates packet sending contents to be sent through a CPU, transmits the packet sending contents to a built-in FPGA internal resource RockETIO receiving and sending module for preprocessing, calculates and stores packet texts, and sends the packet texts to the opposite terminal device after parallel-serial conversion.
Further comprising the following steps during the execution of the S10 or after the completion of the execution of the S10,
s11, when the local device receives the valid second parallel data code stream again, the local device and the opposite device exit the packet receiving and sending state, and repeatedly execute the steps S1-S10.
The following steps are also included before said S1,
and S0, judging whether the local terminal device and the opposite terminal device are both in the auto-negotiation mode, if so, starting to execute the S1, and if not, directly entering a packet receiving and sending state by the local terminal device and the opposite terminal device.
The following explains the gigabit network port auto-negotiation method based on the FPGA in detail:
the local device needs to convert serial data code stream transmitted from the opposite device into parallel and serial data code stream, and count and analyze the converted parallel data code stream. Marking the network port operation mode of the opposite terminal device by using a mode; marking whether the content in the parallel data code stream transmitted by the opposite terminal device and formed after serial-parallel conversion is IDLE code word data or configuration CFG code word data by using type; and counting the continuous number of IDLE code word data or CFG code word data, and generating an IDLE signal IDLE _ flag indicating that more than 3 continuous configuration contents are the same, or generating a CFG signal reliability _ flag indicating that more than 3 continuous configuration contents are the same, or generating a CFG signal consistency _ flag indicating that more than 3 continuous configuration contents are the same and with ACK.
The local terminal device judges according to the mode signal, if the mode is 0, the opposite terminal device is in a forced mode, the local terminal device sends CFG code word data of 10 milliseconds to the opposite terminal device, the opposite terminal device can not provide negotiation information for the local terminal device in the mode, ACK code word data can not be provided for the local terminal device, and therefore the local terminal device is in a DOWN state; however, the opposite end device can identify the CFG code data itself, and the local end device is considered to be a port matched with the local end device, so that the local end device is directly set to be in an UP state, and the local end device directly enter a normal packet receiving and sending state.
The local terminal device judges according to the mode signal, if the mode is 1, the opposite terminal device is in the auto-negotiation mode, the opposite terminal device sends CFG code word data containing the auto-negotiation capability to the local terminal device, and at this stage, the local terminal device responds to send the CFG code word data with the configuration content of 0 to the opposite terminal device.
After the home terminal device sends CFG code word data with configuration content of 0 to the opposite terminal device for 10ms, if the home terminal device monitors that the ability _ flag is valid, and the configuration content of the CFG code word data sent by the opposite terminal device is not 0; the home terminal device enters a stage of sending a plurality of continuous CFG code word data with the same configuration content as the opposite terminal device, and then enters a stage of sending CFG code word data with the same configuration content and ACK after more than 3 CFG code word data are sent continuously, and when the home terminal device monitors that the consistency _ flag is valid, the CFG interactive communication handshake of the home terminal device and the opposite terminal device configuration capability is successful.
After the home terminal device and the opposite terminal device continue the CFG handshake for 10ms, the home terminal device starts to enter a stage of sending IDLE code word data to the opposite terminal device. And the local device monitors the IDLE _ flag until the IDLE _ flag is judged to be valid, namely the content of the parallel data code stream sent by the opposite-end device is IDLE code word data, and the IDLE code word data enter an IDLE state.
When the IDLE state of the local device and the IDLE state of the opposite device last for 10ms, the local device enters a packet sending state, and simultaneously can receive packets sent by the opposite device, and both the local device and the opposite device enter a packet sending and receiving normal state stage; the link _ flag signal is then asserted.
The LINK _ flag signal is valid, and the local terminal device and the opposite terminal device enter the LINK state and can mutually receive and transmit network data packets; the local device organizes the package sending content by the CPU module, transmits the package sending content to the FPGA, and then the FPGA strictly packages and sends the package according to the network package structure. Meanwhile, the FPGA of the local terminal device can analyze the network data packet of the opposite terminal device, can store the network data packet in batches and then upload the network data packet to the CPU module, so that the CPU module can analyze and count the data packet.
The gigabit network port auto-negotiation method based on the FPGA is realized based on the FPGA, has the auto-negotiation function of 1000BASE-X in the 802.3 standard, completes the gigabit auto-negotiation process with the same PHY chip, meets the requirement of high bandwidth, and reserves the function of a hundred megabytes network port.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. The utility model provides a giga net gape auto-negotiation device based on FPGA which characterized in that: the system comprises a GTP Transceiver module, a data receiving and analyzing module, an auto-negotiation control module and a data sending execution module;
the GTP Transceiver module is a RocktIO Transceiver module integrated by a FPGA-based Spartan6 device, and is provided with a GTP _ RX sub-module and a GTP _ TX sub-module;
the GTP _ RX submodule is used for carrying out serial-parallel conversion on a serial data code stream received through the gigabit network port to obtain a parallel data code stream;
the data receiving and analyzing module is used for analyzing and counting the parallel data code stream to generate a state signal;
the auto-negotiation control module is used for sending auto-negotiation information to the data sending execution module according to the state signal;
the data sending execution module sends a corresponding auto-negotiation parallel data code stream to the GTP-TX sub-module according to the auto-negotiation information;
the GTP-TX sub-module is used for performing parallel-serial conversion on the auto-negotiation parallel data code stream to obtain an auto-negotiation serial data code stream and sending the auto-negotiation serial data code stream out through a gigabit network port;
the gigabit network port auto-negotiation device based on the FPGA further comprises an upper layer packet receiving module, an upper layer packet sending module and a CPU module;
the GTP Transceiver module is used for receiving and decoding a network data packet through the GTP _ RX submodule to obtain packet data;
the data receiving and analyzing module is also used for transmitting the packet message data to the upper layer packet receiving module;
the upper layer packet receiving module is used for performing packet analysis on the packet text data under the control of the auto-negotiation control module to obtain a data packet;
the CPU module is used for analyzing and counting the data packet and generating packet sending content;
the upper-layer packet sending module is used for preprocessing the packet sending content generated by the CPU module under the control of the auto-negotiation control module, calculating a packet and storing the packet;
the data sending execution module is further configured to read the packet stored in the upper packet sending module and send the packet to the GTP _ TX sub-module;
and the GTP Transceiver module is also used for packaging the packet and sending out the packet through the GTP _ TX sub-module.
2. A gigabit network port auto-negotiation method based on FPGA is characterized in that: the network port auto-negotiation between the local device and the opposite device, and the local device and the opposite device are both in auto-negotiation mode, and the local device and the opposite device are both the gigabit network port auto-negotiation device based on FPGA described in claim 1, the network port auto-negotiation method includes the following steps,
s1, the local terminal device continuously sends a first parallel data code stream to the opposite terminal device within a first preset time;
s2, after lasting for a first preset time, the opposite terminal device sends a second parallel data code stream to the local terminal device;
s3, the local device analyzes and judges the second parallel data code stream, if the second parallel data code stream is valid, S4 is executed, and if not, S1 is skipped;
s4, the home terminal device sends a third parallel data code stream and a fourth parallel data code stream to the opposite terminal device according to the sequence;
s5, after receiving the fourth parallel data code stream, the opposite terminal device sends a fifth parallel data code stream to the home terminal device;
s6, the local device analyzes and judges the fifth parallel data code stream, if the fifth parallel data code stream is valid, the local device and the opposite device successfully perform CFG interactive communication handshake, and S7 is executed, otherwise, S5 is skipped;
s7, after the CFG interactive communication handshake between the local terminal device and the opposite terminal device lasts for a second preset time, the local terminal device sends a sixth parallel data code stream to the opposite terminal device;
s8, after receiving the sixth parallel data code stream, the opposite terminal device sends a seventh parallel data code stream to the home terminal device;
s9, the local terminal device analyzes and judges the seventh parallel data code stream, when the seventh parallel data code stream is effective, the local terminal device and the opposite terminal device enter an IDLE state and execute S10, otherwise, the local terminal device jumps to S8;
s10, after the home device and the peer device enter an IDLE state for a third preset time, the home device and the peer device enter a packet receiving and sending state.
3. The gigabit network port auto-negotiation method based on FPGA of claim 2, wherein:
the first parallel data code stream is a CFG code word with configuration content of 0;
the effective second parallel data code stream is a plurality of continuous CFG code words with the same configuration content and different 0;
the third parallel data code stream is a plurality of continuous CFG code words with the same configuration content;
the fourth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the effective fifth parallel data code stream is a plurality of continuous CFG code words with the same configuration content and ACK;
the sixth parallel data code stream is a plurality of continuous IDLE code words with the same configuration content;
and the effective seventh parallel data code stream is a plurality of continuous IDLE code words with the same configuration content.
4. The gigabit port auto-negotiation method based on FPGA of claim 2 or 3, wherein: the specific process of sending the preset parallel data code stream by the home terminal device is that an FPGA internal resource RocktIO receiving and sending module arranged in the home terminal device carries out parallel-to-serial conversion on the preset parallel data code stream to form a serial data code stream, and the serial data code stream is sent out by a home terminal network port;
the specific process of receiving the preset parallel data code stream by the opposite-end device is that the opposite-end device receives the serial data code stream through the opposite-end network port, and performs serial-parallel conversion on the serial data code stream through a Field Programmable Gate Array (FPGA) internal resource RocktIO transceiver module built in the opposite-end device to form the preset parallel data code stream.
5. The gigabit network port auto-negotiation method based on FPGA of claim 4, wherein: in S10, after the local device and the peer device enter the state of being able to send and receive packets,
and the local terminal device and the opposite terminal device carry out normal network communication.
6. The gigabit network port auto-negotiation method based on FPGA of claim 5, wherein: the specific process of the home terminal device and the opposite terminal device performing normal network communication is,
the home terminal device carries out serial-parallel conversion on the packet text data transmitted by the opposite terminal device through a built-in FPGA internal resource RockETIO transceiver module, and uploads the packet text data to a CPU for the CPU to carry out analysis and statistics;
or
The local terminal device organizes the packet sending content to be sent through the CPU, transmits the packet sending content to a built-in FPGA internal resource RockETIO receiving and sending module for parallel-serial conversion, and then sends the packet sending content to the opposite terminal device.
7. The gigabit port auto-negotiation method based on FPGA of claim 2 or 3, wherein: further comprising the following steps during the execution of the S10 or after the completion of the execution of the S10,
s11, when the local device receives the valid second parallel data code stream again, the local device and the opposite device exit the packet receiving and sending state, and repeatedly execute the steps S1-S10.
8. The gigabit port auto-negotiation method based on FPGA of claim 2 or 3, wherein: the following steps are also included before said S1,
and S0, judging whether the local terminal device and the opposite terminal device are both in the auto-negotiation mode, if so, starting to execute the S1, and if not, directly entering a packet receiving and sending state by the local terminal device and the opposite terminal device.
CN201811177668.8A 2018-10-10 2018-10-10 Gigabit network port auto-negotiation device and method based on FPGA Active CN109617853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811177668.8A CN109617853B (en) 2018-10-10 2018-10-10 Gigabit network port auto-negotiation device and method based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811177668.8A CN109617853B (en) 2018-10-10 2018-10-10 Gigabit network port auto-negotiation device and method based on FPGA

Publications (2)

Publication Number Publication Date
CN109617853A CN109617853A (en) 2019-04-12
CN109617853B true CN109617853B (en) 2021-10-26

Family

ID=66002384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811177668.8A Active CN109617853B (en) 2018-10-10 2018-10-10 Gigabit network port auto-negotiation device and method based on FPGA

Country Status (1)

Country Link
CN (1) CN109617853B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114302000B (en) * 2021-11-24 2023-10-20 深圳市三旺通信股份有限公司 PHY negotiation degradation method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101068167A (en) * 2007-05-30 2007-11-07 华为技术有限公司 Method for obtaining network interface mode and network equipment thereof
CN102523142A (en) * 2011-11-28 2012-06-27 曙光信息产业(北京)有限公司 GTX (Gigabit texture per second)-based 20-port gigabit Ethernet access system and method
CN102571504A (en) * 2010-12-07 2012-07-11 张�诚 FPGA (field programmable gate array)-based gigabit Ethernet
US9520827B2 (en) * 2006-08-05 2016-12-13 Anlinx Zilinx : the 11 less green technology for FPIC of smart window
CN106713179A (en) * 2017-01-05 2017-05-24 京信通信技术(广州)有限公司 Adaptive rate allocation method and network element
CN106911388A (en) * 2015-12-22 2017-06-30 杭州华为企业通信技术有限公司 The method and apparatus of self-adaptative adjustment different rates device port

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9520827B2 (en) * 2006-08-05 2016-12-13 Anlinx Zilinx : the 11 less green technology for FPIC of smart window
CN101068167A (en) * 2007-05-30 2007-11-07 华为技术有限公司 Method for obtaining network interface mode and network equipment thereof
CN102571504A (en) * 2010-12-07 2012-07-11 张�诚 FPGA (field programmable gate array)-based gigabit Ethernet
CN102523142A (en) * 2011-11-28 2012-06-27 曙光信息产业(北京)有限公司 GTX (Gigabit texture per second)-based 20-port gigabit Ethernet access system and method
CN106911388A (en) * 2015-12-22 2017-06-30 杭州华为企业通信技术有限公司 The method and apparatus of self-adaptative adjustment different rates device port
CN106713179A (en) * 2017-01-05 2017-05-24 京信通信技术(广州)有限公司 Adaptive rate allocation method and network element

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于FPGA光纤以太网自协商的设计与实现;刘小丽;《中国科技论文在线》;20101228;参见正文第3-6页,图8,图9 *

Also Published As

Publication number Publication date
CN109617853A (en) 2019-04-12

Similar Documents

Publication Publication Date Title
EA024623B1 (en) Data transmission method and system and data transmitter
CN111294235B (en) Data processing method, device, gateway and readable storage medium
CN109150605A (en) intelligent gateway, monitoring system and data processing method
CN106341183A (en) Method for monitoring optical module by netmanager software
CN111917753B (en) Modbus TCP message analysis method based on bit field
CN110177058B (en) Ethernet switch board state monitoring transceiver based on FPGA
WO2016082569A1 (en) Apparatus and method for implementing communication assisted by optical port link
CN109617853B (en) Gigabit network port auto-negotiation device and method based on FPGA
CN214101409U (en) Intelligent gateway
CN110191024B (en) Network traffic monitoring method and device
CN202111737U (en) Network management enhanced E1/ETH protocol converter
CN104104559A (en) E1 bit-error tester system
CN106254098B (en) Debugging data acquisition method and system and embedded wireless system
CN113783825B (en) Message flow statistics method and device
CN205142243U (en) Handheld network data isolator that intelligent substation used
CN112383543B (en) Power equipment monitoring data processing system
CN113395730B (en) Internet of things terminal network parameter reporting method, device and storage medium
CN102081383B (en) Device and method for secure network protocol for field control
CN112532644A (en) Real-time data analysis system based on Tbox new energy automobile
CN112687267A (en) Internet of things data semantic processing system
CN112583658A (en) Available bandwidth measuring method, storage medium and equipment
RU147248U1 (en) INTERFACE AND DIGITAL DATA PROCESSING DEVICE
CN112260968B (en) Method and device for processing telemetering data message
CN111372210A (en) Remote transmission method, terminal device, mobile terminal, and computer storage medium
Wang et al. Study of CAN-Modbus communication adapter for low-voltage distribution system

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