CN114500329A - Method and device for detecting lost frame - Google Patents

Method and device for detecting lost frame Download PDF

Info

Publication number
CN114500329A
CN114500329A CN202111519503.6A CN202111519503A CN114500329A CN 114500329 A CN114500329 A CN 114500329A CN 202111519503 A CN202111519503 A CN 202111519503A CN 114500329 A CN114500329 A CN 114500329A
Authority
CN
China
Prior art keywords
frame
target
header
time
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111519503.6A
Other languages
Chinese (zh)
Inventor
胡磊
陈奇强
吴双
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Chenxiao Technology Co ltd
Shenzhen Genew Technologies Co Ltd
Original Assignee
Hangzhou Chenxiao Technology Co ltd
Shenzhen Genew Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Chenxiao Technology Co ltd, Shenzhen Genew Technologies Co Ltd filed Critical Hangzhou Chenxiao Technology Co ltd
Priority to CN202111519503.6A priority Critical patent/CN114500329A/en
Publication of CN114500329A publication Critical patent/CN114500329A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss

Landscapes

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

Abstract

The application discloses a method and a device for detecting lost frames, and belongs to the field of communication. The method for detecting lost frames is executed by a network device with a plurality of interfaces, and comprises the following steps: acquiring a target frame to be transmitted by a target interface of the plurality of interfaces; determining whether a specified frame header mark exists in a frame header of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.

Description

Method and device for detecting lost frame
Technical Field
The application belongs to the field of communication, and particularly relates to a method and a device for detecting lost frames.
Background
As is known, good network synchronization performance has a large influence on user experience, and due to the influence of transmission conditions, a frame loss sometimes occurs during data transmission.
In the process of detecting the lost frame, the related technology needs to call various resources to monitor the lost frame, and the lost frame detection mode has the problem of occupying more resources.
Disclosure of Invention
The embodiment of the application provides a method and a device for detecting a lost frame, which can solve the problem that the mode for detecting the lost frame in the related technology uses more resources.
In a first aspect, an embodiment of the present application provides a method for detecting a lost frame, which is performed by a network device having multiple interfaces, where the method includes:
acquiring a target frame to be transmitted by a target interface of the plurality of interfaces;
determining whether a specified frame header mark exists in a frame header of the target frame;
determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame;
determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.
In a second aspect, an embodiment of the present application provides an apparatus for detecting a lost frame, where the apparatus includes:
an acquisition module for acquiring a target frame to be transmitted by a target interface among the plurality of interfaces;
the processing module is used for determining whether a specified frame head mark exists in the frame head of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, where the memory stores a program or instructions running on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, a target frame to be transmitted by a target interface in the plurality of interfaces is acquired; determining whether a specified frame header mark exists in a frame header of the target frame; determining, by a clock counter, whether a time for which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold. Therefore, whether the frame is lost or not can be directly determined through the clock counter, and compared with the traditional frame loss detection mode, the method uses less resources, so that the problem that the mode for detecting the frame is more resources in the related technology can be solved.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a method for detecting a lost frame according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another method for detecting a lost frame according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another method for detecting a lost frame according to an embodiment of the present application;
fig. 4 is a flowchart of another method for detecting a lost frame according to an embodiment of the present application;
fig. 5 is a block diagram illustrating a structure of an apparatus for detecting a lost frame provided in the present application;
fig. 6 is a block diagram of a network device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The method for detecting a lost frame according to the embodiments of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a flowchart of a method for detecting a lost frame according to an embodiment of the present disclosure. Referring to fig. 1, a method for detecting a lost frame according to an embodiment of the present application may be performed by a network device having multiple interfaces. In this embodiment, the network device having the plurality of interfaces may be a switch, a router, an optical modem, or the like. The plurality of ports may be 4 ports, 8 ports, 16 ports, etc.
The method for detecting the lost frame provided by the embodiment of the application can comprise the following steps:
step 110, obtaining a target frame to be transmitted by a target interface of the plurality of interfaces.
In this step, the plurality of interfaces may be interfaces on the network device into which optical fibers may be inserted.
The target frame in this embodiment may be a data frame received by the target interface, and the target frame may be a data frame targeted by the method for detecting a lost frame provided in this embodiment.
Following this step 110, the time recorded by the clock counter each time the target frame is received may also be stored.
Step 120, determining whether a specified frame header mark exists in the frame header of the target frame.
In this step, the target frame is data in transmission, and the designation frame header may be F628 (hexadecimal). Of course, in the embodiment of the present application, the designation frame header mark may also be other custom marks. These custom tags may be binary, decimal, or hexadecimal.
And step 130, determining whether the time for which the target frame is not transmitted through the target port is greater than a first threshold value through a clock counter under the condition that the specified frame header mark does not exist in the frame header of the target frame.
In this embodiment of the present application, in a case where the specified frame header flag does not exist in the frame header of the target frame, the current time may be recorded. And the time when the target frame is received can be recorded under the condition that the target frame is received each time. In this way, when the header of the target frame does not have the header mark of the designated frame, the difference between the current time recorded and the time when the target frame was received recorded last time may be used, and the absolute value of the difference may be used as the time when the target frame is not transmitted through the target port. In turn, a size relationship of a time when the target frame is not transmitted through the target port to a first threshold may be further calculated.
Where the network device has stored the time recorded by the clock counter each time the target frame is received, this step 130 may include: the determining, by the clock counter, whether the time at which the target frame is not transmitted through the target port is greater than a first threshold value comprises: acquiring the current time through the clock counter; acquiring the appointed time when the target port receives the target frame last time; determining whether a difference between the current time and the specified time is greater than a first threshold. In this way, the time when the target port does not transmit the target frame can be conveniently obtained, and the time is compared with the first threshold value. Further, subsequent determination of whether to drop a frame based thereon may be facilitated.
Step 140, determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.
In an embodiment of the present application, in a case where it is determined that a time during which the target frame is not transmitted through the target port is greater than a first threshold, it is determined that a lost frame is detected. The first threshold may be set according to needs, for example, the first threshold is 3 frames, 4 frames, or 5 frames. That is, in the event that it is determined that the time for which the target frame is not transmitted through the target port is greater than a first threshold, it is determined that a lost frame is detected. The smaller the first threshold value is, the shorter the time for detecting the lost frame is, and the larger the first threshold value is, the longer the time for detecting the lost frame is.
In the embodiment of the application, the clock counter can be free from external influence and can be triggered by a quartz crystal oscillator to count time according to a set period. For example, a clock counter of 640MHz (mega hertz) is used, where 640MHz (mega hertz) is 640 × 1000KHZ (kilohertz), i.e., the number of times the oscillation is completed per unit time, and is given in hertz (1 hertz 1 times per second); the method comprises the steps of firstly counting an 8-bit binary clock counter of 0-511 by adopting a clock counter of 640MHz, and recording as count512[8:0], wherein one cycle of the clock counter count512[8:0] is 0.8 mu s (microsecond), and the calculation process is 512/(640MHz) ═ 0.8 mu s. A 13-bit binary clock counter with a period of 8ms (milliseconds) from 0 to 9999 is counted again and is denoted as count8ms [13:0], wherein the clock counter count8ms [13:0] is incremented by 1 when the clock counter count512[8:0] is equal to 511, and one period of the clock counter cnt8ms [13:0] is 8ms (milliseconds). The time at which the destination port transmits the destination frame is clocked by the clock counter count8ms [13:0 ].
In one embodiment of the present application, a clock counter with other frequencies may be used, for example, a clock counter with a frequency of 100MHz (megahertz), the clock counter with a frequency of 100MHz (megahertz) being lower than the clock frequency of 640MHz (megahertz), the lower the clock counter frequency, the larger the counter, which represents the longer the clock counter clock cycle.
In the embodiment of the present application, the frame loss may mean a frame loss. The absence of frame information received or the absence of synchronization of frame information in the communication may be considered a lost frame.
In the embodiment of the application, a target frame to be transmitted by a target interface in the plurality of interfaces is acquired; determining whether a specified frame header mark exists in a frame header of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold. Therefore, whether the frame is lost or not can be directly determined through the clock counter, and compared with the traditional frame loss detection mode, the method uses less resources, so that the problem that the mode for detecting the frame is more resources in the related technology can be solved.
It should be further noted that, when the target port detects an missed frame, the transmission of the target frame may be transmitted through the working path channel, and the protection path channel may be in a closed state. When the target port detects a lost frame, the transmission channel of the target frame can be switched to the protection path channel from the working path channel.
It should also be noted that the network devices of the multiple interfaces may operate after power is plugged in. The timepiece timer may provide various times for the target frame when the network device is powered on, such as the time the target port transmits the target frame.
Fig. 2 is a block flow diagram of another method for detecting a lost frame according to an embodiment of the present disclosure. Referring to fig. 2, another method for detecting a lost frame according to an embodiment of the present application may be performed by a network device having multiple interfaces, and may include:
step 210, obtaining a target frame to be transmitted by a target interface of the plurality of interfaces.
In this step, the plurality of interfaces may be interfaces on the network device into which optical fibers are inserted.
Step 220, determining whether a specified frame header mark exists in the frame header of the target frame.
In this step, the target frame is data in transmission, and the designation frame header may be F628 (hexadecimal).
Step 230, determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, in a case where the designated frame header mark is not present in a frame header of the target frame.
In this step, the clock counter is not affected by the outside world, and can be triggered by the quartz crystal oscillator to count time according to the set period. For example, a clock counter using 640MHz (megahertz) may capture the time when the target port is not transmitting the target frame.
And 240, determining that a lost frame is detected under the condition that the time for not transmitting the target frame through the target port is greater than a first threshold value.
In this embodiment of the present application, in a case where the specified frame header flag does not exist in the frame header of the target frame, the current time may be recorded. And the time when the target frame is received can be recorded under the condition that the target frame is received each time. In this way, when the header of the target frame does not have the header mark of the designated frame, the difference between the current time recorded and the time when the target frame was received recorded last time may be used, and the absolute value of the difference may be used as the time when the target frame is not transmitted through the target port. In turn, a size relationship of a time when the target frame is not transmitted through the target port to a first threshold may be further calculated.
And 250, after determining that the lost frame is detected, inserting a specified identifier into the data frame under the condition that the data frame is received, wherein the specified identifier is used for indicating the state of the lost frame.
In this step, the specified flag may be various flags for indicating the frame loss status, such as 1 or 0. Taking the designation identifier as 1 as an example, all 1 designation identifiers may be inserted into a data frame received by the target port, so as to indicate that the data frame is in a lost frame state.
It should be understood that the data frame of the present application may be the aforementioned target frame.
In the method for detecting a lost frame provided by the embodiment of the application, after the lost frame is determined to be detected, a specified identifier is inserted into a data frame under the condition that the data frame is received, and the specified identifier is used for indicating a lost frame state. Therefore, after the lost frame is determined to be detected, the designated identifier for indicating the lost frame state is inserted into the data frame, and a receiver of the subsequent data frame can know that the data frame is in the lost frame state according to the designated identifier, so that the subsequent operation is facilitated.
Fig. 3 is a block diagram of a flow chart of another method for detecting a lost frame according to an embodiment of the present application. Referring to fig. 3, the method for detecting a lost frame according to the embodiment of the present application may be performed by a network device with multiple interfaces. The method for detecting the lost frame provided by the embodiment of the application can comprise the following steps:
step 310, obtaining a target frame to be transmitted by a target interface of the plurality of interfaces;
step 320, determining whether a specified frame header mark exists in the frame header of the target frame;
step 330, judging whether the header of the target frame is correct or not under the condition that the header of the specified frame exists in the header of the target frame;
in this step, the header of the target frame may be F628 (hexadecimal).
Step 340, adding 1 to the value of the frame error counter under the condition that the frame header of the target frame is erroneous;
step 350, determining that the frame loss is detected under the condition that the value of the frame error counter reaches a preset value.
In this step, under the condition that the value of the frame header error counter does not reach the preset value, the frame which is not lost is determined to be detected. The preset value can be set according to needs, for example, the preset value is 3 frames, 4 frames or 5 frames. That is, under the condition that the value of the frame header error counter reaches a preset value, the frame loss is determined to be detected. The smaller the preset value is, the shorter the time taken for detecting the lost frame is, and the larger the preset value is, the longer the time for detecting the lost frame is.
In this embodiment of the present application, when the specified frame header mark exists in the frame header of the target frame, and when the frame header of the target frame is incorrect, a value of a frame error counter is incremented by 1, and when the value of the frame error counter reaches a preset value, it is determined that a lost frame is detected. In the method for detecting the lost frame, under the condition that the head mark of the specified frame exists in the head of the target frame, the number of errors occurring in the head of the target frame is counted, and the lost frame is determined under the condition that the number of the errors occurring reaches a certain number of times. Therefore, the lost frame detection mode can be applied to the condition that the specified frame head mark exists in the frame head of the target frame, the detection range of the lost frame can be expanded, and the problem that the lost frame cannot be detected under the condition that the lost frame possibly occurs is solved.
In an embodiment of the present application, optionally, after step 330 in fig. 3, that is, in a case that the specified frame header mark exists in the frame header of the target frame, after determining whether the frame header of the target frame is correct, if the frame header of the target frame is correct, the method for detecting a lost frame according to the embodiment of the present application may further include: and setting the value of the frame error counter to be 0 under the condition that the frame header of the target frame is correct, and determining that the frame is not lost.
In the embodiment of the present application, under the condition that the specified frame header mark exists in the frame header of the target frame, whether the frame header of the target frame is correct is determined; and setting the value of the frame error counter to be 0 under the condition that the frame header of the target frame is correct, and determining that the frame is not lost. Therefore, under the condition that the frame header of the target frame is correct, the value of the frame error counter is set to be 0, so that the timing can be restarted by utilizing the frame error counter conveniently under the condition that the frame loss occurs in the follow-up process, and the accuracy of the frame loss statistics is ensured.
Fig. 4 is a block flow diagram of another method for detecting a lost frame according to an embodiment of the present disclosure. Referring to fig. 4, another method of detecting a lost frame may include:
step 410, a target frame to be transmitted by a target interface of the plurality of interfaces is obtained.
Step 420, storing the time recorded by the clock counter each time the target frame is received.
Step 430, determining whether the specified frame header mark exists in the frame header of the target frame.
If there is a designated frame header mark in the header of the target frame, go to step 440; in case no specified frame header marker is present in the header of the target frame, step 450 is performed.
Step 440, judging whether the header of the target frame is correct or not under the condition that the header of the specified frame exists in the header of the target frame. In case the frame header of the target frame is wrong, step 442 is performed. In case the header of the target frame is correct, step 444 is performed.
Step 442, adding 1 to the value of the frame error counter when the frame header of the target frame is erroneous; and determining that the frame loss is detected under the condition that the value of the frame error counter reaches a preset value.
And step 444, setting the value of the frame error counter to be 0 under the condition that the frame header of the target frame is correct, and determining that the frame is detected to be missed.
Step 450, acquiring the current time through the clock counter under the condition that the specified frame head mark does not exist in the frame head of the target frame; and acquiring the appointed time when the target port receives the target frame last time.
Step 460, determining whether the difference between the current time and the specified time is greater than a first threshold.
Step 470, determining that a lost frame is detected in case that the difference between the current time and the specified time is greater than a first threshold.
And 480, after determining that the lost frame is detected, inserting a specified identifier into the data frame under the condition that the data frame is received, wherein the specified identifier is used for indicating the state of the lost frame.
In the method for detecting a lost frame provided by the embodiment of the application, whether the lost frame exists or not can be directly determined through the clock counter, and compared with a traditional lost frame detection mode, the method uses fewer resources, so that the problem that the mode for detecting the lost frame in the related technology uses more resources can be solved. Meanwhile, after the lost frame is determined to be detected, the designated identifier for indicating the lost frame state is inserted into the data frame, and a receiver of the subsequent data frame can know that the data frame is in the lost frame state according to the designated identifier, so that the subsequent operation is facilitated. For example, in the case of detecting a lost frame, the transport channel of the target frame may be switched from the working path channel to the protection path channel, thereby ensuring that the transmitted target frame is not interrupted.
Fig. 5 is a block diagram illustrating a structure of an apparatus for detecting a lost frame according to the present application. Referring to fig. 5, the apparatus for detecting a lost frame includes: an acquisition module 510 and a processing module 520.
The obtaining module 510 is configured to obtain a target frame to be transmitted by a target interface of the multiple interfaces. A processing module 520, configured to determine whether a specified frame header flag exists in a frame header of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold. Therefore, whether the frame is lost or not is directly determined through the clock counter, compared with the traditional frame loss detection mode, the resource used is less, and the problem that the resource used in the mode for detecting the frame loss in the related technology is more can be solved.
Optionally, in an embodiment of the present application, the processing module 520 may be configured to insert a specific identifier into the data frame after determining that the lost frame is detected, where the specific identifier is used to indicate a lost frame status in a case that the data frame is received. Therefore, after the lost frame is determined to be detected, the designated identifier for indicating the lost frame state is inserted into the data frame, and a receiver of the subsequent data frame can know that the data frame is in the lost frame state according to the designated identifier, so that the subsequent operation is facilitated.
Optionally, in an embodiment of the present application, the processing module 520 is further configured to determine whether the header of the target frame is correct or not when the specified frame header mark exists in the header of the target frame, and add 1 to a value of a frame error counter when the header of the target frame is incorrect. And determining that the frame loss is detected under the condition that the value of the frame error counter reaches a preset value. Therefore, in the method for detecting the lost frame, under the condition that the head mark of the specified frame exists in the head of the target frame, the number of errors occurring in the head of the target frame is counted, and the lost frame is determined under the condition that the number of the errors occurring reaches a certain number of times. Therefore, the lost frame detection mode can be applied to the condition that the specified frame head mark exists in the frame head of the target frame, the detection range of the lost frame can be expanded, and the problem that the lost frame cannot be detected under the condition that the lost frame possibly occurs is solved.
Optionally, in an embodiment of the present application, the processing module 520 is further configured to determine whether the header of the target frame is correct or not when the specified frame header mark exists in the header of the target frame, set a value of the frame error counter to be 0 when the header of the target frame is correct, and determine that no missing frame is detected. Therefore, under the condition that the frame header of the target frame is correct, the value of the frame error counter is set to be 0, so that the timing can be restarted by utilizing the frame error counter conveniently under the condition that the frame loss occurs in the follow-up process, and the accuracy of the frame loss statistics is ensured.
Optionally, in an embodiment of the present application, the apparatus further includes: and the storage module is used for storing the time recorded by the clock counter every time the target frame is received. In the process of determining, by a clock counter, whether the time during which the target frame is not transmitted through the target port is greater than a first threshold, the processing module is specifically configured to: acquiring the current time through the clock counter; acquiring the appointed time when the target port receives the target frame last time; determining whether a difference between the current time and the specified time is greater than a first threshold. In this way, the time when the target port does not transmit the target frame can be conveniently obtained, and the time is compared with the first threshold value. Further, subsequent determination of whether to drop a frame based thereon may be facilitated.
FIG. 6 is a schematic diagram of a network device provided herein; the network device provided by the embodiment of the application can comprise: a processor 610 and a memory 620. Wherein the memory stores a program or instructions running on the processor, and the program or instructions when executed by the processor implement the steps of any one of the methods for detecting a lost frame provided by the embodiments of the present application.
The network device provided by the embodiment of the application acquires a target frame to be transmitted by a target interface in the plurality of interfaces; determining whether a specified frame header mark exists in a frame header of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for which the target frame is not transmitted through the target port is greater than a first threshold. Therefore, whether the frame is lost or not can be directly determined through the clock counter, and compared with the traditional frame loss detection mode, the method uses less resources, so that the problem that the mode for detecting the frame is more resources in the related technology can be solved.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing method for detecting a lost frame, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the foregoing method for detecting a lost frame, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing method for detecting a lost frame, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for detecting a lost frame, performed by a network device having a plurality of interfaces, the method comprising:
acquiring a target frame to be transmitted by a target interface of the plurality of interfaces;
determining whether a specified frame header mark exists in a frame header of the target frame;
determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame;
determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.
2. The method of claim 1, wherein after the determining detects a lost frame, the method further comprises:
under the condition that a data frame is received, a specified identifier is inserted into the data frame, and the specified identifier is used for indicating a frame loss state.
3. The method of claim 1, further comprising:
judging whether the header of the target frame is correct or not under the condition that the header of the specified frame exists in the header of the target frame;
adding 1 to the value of a frame error counter under the condition that the frame header of the target frame is wrong;
and determining that the frame loss is detected under the condition that the value of the frame error counter reaches a preset value.
4. The method of claim 3, further comprising:
and setting the value of the frame error counter to be 0 under the condition that the frame header of the target frame is correct, and determining that the frame is not lost.
5. The method of claim 1, further comprising: storing the time recorded by the clock counter each time the target frame is received;
the determining, by the clock counter, whether the time at which the target frame is not transmitted through the target port is greater than a first threshold value comprises:
acquiring the current time through the clock counter;
acquiring the appointed time when the target port receives the target frame last time;
determining whether a difference between the current time and the specified time is greater than a first threshold.
6. An apparatus for detecting a lost frame, the apparatus comprising:
an acquisition module for acquiring a target frame to be transmitted by a target interface among the plurality of interfaces;
the processing module is used for determining whether a specified frame head mark exists in the frame head of the target frame; determining, by a clock counter, whether a time during which the target frame is not transmitted through the target port is greater than a first threshold value, if the designated frame header marker is not present in a header of the target frame; determining that a lost frame is detected if it is determined that the time for not transmitting the target frame through the target port is greater than a first threshold.
7. The apparatus of claim 6, wherein the processing module is further configured to: after determining that the lost frame is detected, inserting a specified identifier into the data frame under the condition that the data frame is received, wherein the specified identifier is used for indicating the state of the lost frame.
8. The apparatus of claim 6, wherein the processing module is further configured to:
judging whether the header of the target frame is correct or not under the condition that the header of the specified frame exists in the header of the target frame;
adding 1 to the value of a frame error counter under the condition that the frame header of the target frame is wrong;
and determining that the frame loss is detected under the condition that the value of the frame error counter reaches a preset value.
9. The apparatus of claim 8, wherein the processing module is further configured to:
and setting the value of the frame error counter to be 0 under the condition that the frame header of the target frame is correct, and determining that the frame is not lost.
10. The apparatus of claim 6, further comprising: the storage module is used for storing the time recorded by the clock counter every time the target frame is received;
in the process of determining, by a clock counter, whether the time during which the target frame is not transmitted through the target port is greater than a first threshold, the processing module is specifically configured to:
acquiring the current time through the clock counter;
acquiring the appointed time when the target port receives the target frame last time;
determining whether a difference between the current time and the specified time is greater than a first threshold.
CN202111519503.6A 2021-12-13 2021-12-13 Method and device for detecting lost frame Pending CN114500329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111519503.6A CN114500329A (en) 2021-12-13 2021-12-13 Method and device for detecting lost frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111519503.6A CN114500329A (en) 2021-12-13 2021-12-13 Method and device for detecting lost frame

Publications (1)

Publication Number Publication Date
CN114500329A true CN114500329A (en) 2022-05-13

Family

ID=81492103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111519503.6A Pending CN114500329A (en) 2021-12-13 2021-12-13 Method and device for detecting lost frame

Country Status (1)

Country Link
CN (1) CN114500329A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001217767A (en) * 2000-01-28 2001-08-10 Matsushita Electric Ind Co Ltd Device and method for detecting out-of-step
CN1411198A (en) * 2001-09-25 2003-04-16 义隆电子股份有限公司 Method of detecting and restoring lost data in radio communication and its system
CN1964292A (en) * 2006-09-29 2007-05-16 Ut斯达康通讯有限公司 A method used to detect and feedback frame loss ratio of lub FP frame based on IP transmission
CN101217339A (en) * 2007-12-29 2008-07-09 华为技术有限公司 A method, device and base station for frame dropping detection
CN106209496A (en) * 2016-06-23 2016-12-07 珠海格力电器股份有限公司 A kind of communication abnormality detection device and method
CN112422253A (en) * 2020-10-27 2021-02-26 北京邮电大学 Real-time co-frequency simultaneous full duplex reliable transmission method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001217767A (en) * 2000-01-28 2001-08-10 Matsushita Electric Ind Co Ltd Device and method for detecting out-of-step
CN1411198A (en) * 2001-09-25 2003-04-16 义隆电子股份有限公司 Method of detecting and restoring lost data in radio communication and its system
CN1964292A (en) * 2006-09-29 2007-05-16 Ut斯达康通讯有限公司 A method used to detect and feedback frame loss ratio of lub FP frame based on IP transmission
CN101217339A (en) * 2007-12-29 2008-07-09 华为技术有限公司 A method, device and base station for frame dropping detection
CN106209496A (en) * 2016-06-23 2016-12-07 珠海格力电器股份有限公司 A kind of communication abnormality detection device and method
CN112422253A (en) * 2020-10-27 2021-02-26 北京邮电大学 Real-time co-frequency simultaneous full duplex reliable transmission method and device

Similar Documents

Publication Publication Date Title
CN109669899B (en) Method for adaptively adjusting serial port communication baud rate and serial port device
CN110932815B (en) Time synchronization method, device, network equipment and storage medium
CN109921915B (en) Method and device for testing wake-up function of real-time clock module and electronic equipment
EP3675398A1 (en) Check code processing method, electronic device, and storage medium
CN106897219B (en) Method and device for testing stability of mobile terminal system
CN108306967B (en) Data processing method and terminal
CN108052094A (en) A kind of extension card identification method, device and frequency converter
US20170280410A1 (en) Method, device and system for implementing information self-registration, and computer storage medium
CN109634822B (en) Function time consumption statistical method and device, storage medium and terminal equipment
CN109426826B (en) User behavior analysis method and device
CN112422369B (en) Method and device for determining offline time, storage medium and electronic device
CN114500329A (en) Method and device for detecting lost frame
CN111131262B (en) Vulnerability scanning method and device
CN109617905B (en) Multicast attack processing method, device and implementation device
CN111757371B (en) Statistical method of transmission delay, server and storage medium
CN114390114B (en) User data packet protocol port scanning method, system, terminal and storage medium
CN115811484A (en) Network detection method, device and storage medium
WO2016000324A1 (en) Method and apparatus for implementing time synchronization
Sharma et al. An empirical study of clock skew behavior in modern mobile and hand-held devices
CN104468569A (en) Integrity detection method and device of distributed data
CN111427818A (en) Method for identifying serial port communication baud rate and readable storage medium
CN105224411A (en) A kind of depleted method causing house dog to be restarted of CPU of avoiding
CN109299765A (en) More Internet of Things radio frequency identification equipment data capture methods, device and storage medium
CN117527641B (en) Packet loss observation method, device and equipment for data message and storage medium
CN110909289B (en) Data processing method and 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