CN102013940A - Method and device for controlling length of random message - Google Patents
Method and device for controlling length of random message Download PDFInfo
- Publication number
- CN102013940A CN102013940A CN2010100026713A CN201010002671A CN102013940A CN 102013940 A CN102013940 A CN 102013940A CN 2010100026713 A CN2010100026713 A CN 2010100026713A CN 201010002671 A CN201010002671 A CN 201010002671A CN 102013940 A CN102013940 A CN 102013940A
- Authority
- CN
- China
- Prior art keywords
- length
- message
- sequence
- random
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method for controlling the length of a random message, which comprises the following steps of: setting the minimum length Lmin and the maximum length Lmax of a message to be sent; generating a random sequence m in the manner that an M sequence generates a random code; controlling the value ranges of the length Lm of the random sequence m and hash mask length to be between 0-Lmax and Lmin through logic between 0-Lmax and Lmin, and maintaining the current m value; if not between 0-Lmax and Lmin, an M sequence generator continues to generate next sequence till the generated m meets the requirement of the length range; and during the process of message sending, firstly loading a length value L=Lmin+Lm. The invention also provides a device based on the method, which comprises a message length controller, the M sequence generator, a length range controller and a length loading device. By the invention, the problem of a random length message is solved, and the length of the message is ensured to be in a set range.
Description
Technical field
The present invention relates to network communication field, relate in particular to a kind of control method and the device of message length at random.
Background technology
In the network test process, for the requirement of testing, need to send the data message of random-length, and the control of message length need be determined by random value, simultaneously because network message needs certain length restriction, such as 64 to 1518, so when producing random-length, need to guarantee that its random value is within the scope of regulation.
Summary of the invention
The invention discloses a kind of in network test, method and device that the length of random-length message of simulation is controlled.
For achieving the above object, the technical solution used in the present invention is as follows:
A kind of control is the method for message length at random, comprising:
The minimum length L of the message that needs transmission is set
Min, maximum length L
MaxStep;
The mode that adopts the M sequence to produce random code produces the step of a random sequence m;
Length L m=(L﹠amp by logic control random sequence m; MASK
L) and mask-length MASK
LSpan be the step of 0~Lmax-Lmin;
If the length L m of random sequence m in 0~Lmax-Lmin scope, then keeps current m value; If not in this scope, then the M sequence generator continues to produce next sequence, satisfies the length range requirement up to the m that produces.
When sending message, logic loads length value L=L earlier
MinThe step of+Lm;
Optimize, do not produce a m value in the time and can satisfy area requirement sending a message, then by getting m﹠amp; MASK
LValue reach and produce the sequential value meet the demands.
A kind of control is the device of message length at random, comprising:
The message length control device is used to be provided with the minimum length L of the message that needs send
Min, maximum length L
Max
The M sequence generating device is used to produce a random sequence m;
The length range control device is used to judge the length L m=(L﹠amp by the m of sequence immediately of M sequence generating device generation; MASK
L) and mask-length MASK
LWhether at 0~L
Max-L
MinIn the scope;
The length charger is used for loading length value L=L when sending message
Min+ L
m
Beneficial effect of the present invention:
By this design, guaranteed that effectively message length is within the scope of setting.Through experiment showed, that message length becomes evenly to distribute in the Lmax scope at Lmin.
Description of drawings
Fig. 1 is a kind of control of the present invention schematic flow sheet of the method for message length at random;
Fig. 2 is a kind of control of the present invention principle of device schematic diagram of message length at random.
Embodiment
Establishing the minimum length that needs to send referring to accompanying drawing 1 is Lmin, maximum length is Lmax, MASK is the mask of Lmax-Lmin, first is not to be 1 entirely after 0 the value to the computational methods of MASKL for position from high to low, binary system such as Lmax-Lmin is 000001001001000, and then MASKL is 000001111111111.The mode that hardware logic adopts the M sequence to produce random code produces a random sequence m, by the length L m=(L﹠amp of logic control random sequence m; MASK
L) with the value scope of MASKL be 0~Lmax-Lmin, when beginning to send message, logic loads length value L=Lmin+ (m﹠amp earlier; MASKL), the L minimum value is Lmin like this, and maximum is Lmax, thereby guarantees that transmission length is controlled within the scope of user's setting.
Referring to accompanying drawing 2, the every clock CLK of M sequence produces a sequential value m, transferring to the length range controller then judges, if m in 0 ~ Lmax-Lmin scope, then keeps current m value, if not in this scope, then the M sequence generator continues to produce sequence, satisfy the length range requirement up to the m that produces, if also do not produce a m value in the time and can satisfy area requirement sending a message, then by getting m﹠amp; The value of MASKL reaches and produces the sequential value that meets the demands.
Claims (3)
1. control the method for message length at random for one kind, it is characterized in that comprising:
The minimum length L of the message that needs transmission is set
Min, maximum length L
MaxStep;
The mode that adopts the M sequence to produce random code produces the step of a random sequence m;
Length L m=(L﹠amp by logic control random sequence m; MASK
L) and mask-length MASK
LValue value scope be the step of 0~Lmax-Lmin;
If the length L m of random sequence m in 0~Lmax-Lmin scope, then keeps current m value; If not in this scope, then the M sequence generator continues to produce next sequence, satisfies the length range requirement up to the m that produces.
When sending message, logic loads length value L=L earlier
MinThe step of+Lm;
2. the described control of claim 1 method of message length at random is characterized in that: do not produce a m value in the time and can satisfy area requirement sending a message, then by getting m﹠amp; MASK
LValue reach and produce the sequential value meet the demands.
3. control the device of message length at random for one kind, comprise
The message length control device is used to be provided with the minimum length L of the message that needs send
Min, maximum length L
Max:
The M sequence generating device is used to produce a random sequence m;
The length range control device is used to judge the length L m=(L﹠amp by the m of sequence immediately of M sequence generating device generation; MASK
L) and mask-length MASK
LWhether at 0~L
Max-L
MinIn the scope;
The length charger is used for loading length value L=L when sending message
Min+ L
m
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010100026713A CN102013940A (en) | 2010-01-21 | 2010-01-21 | Method and device for controlling length of random message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010100026713A CN102013940A (en) | 2010-01-21 | 2010-01-21 | Method and device for controlling length of random message |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102013940A true CN102013940A (en) | 2011-04-13 |
Family
ID=43843975
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010100026713A Pending CN102013940A (en) | 2010-01-21 | 2010-01-21 | Method and device for controlling length of random message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102013940A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104580005A (en) * | 2015-01-13 | 2015-04-29 | 天津市德力电子仪器有限公司 | Method for sending random length message according to flow model accurately |
CN104714207A (en) * | 2014-12-10 | 2015-06-17 | 中国电子科技集团公司第二十研究所 | TACAN beacon simulator ranging response probability implementation method |
CN106385342A (en) * | 2016-08-31 | 2017-02-08 | 北京信而泰科技股份有限公司 | Network frame random length generation method |
CN112134757A (en) * | 2020-09-21 | 2020-12-25 | 北京信而泰科技股份有限公司 | Message generation method and device |
-
2010
- 2010-01-21 CN CN2010100026713A patent/CN102013940A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104714207A (en) * | 2014-12-10 | 2015-06-17 | 中国电子科技集团公司第二十研究所 | TACAN beacon simulator ranging response probability implementation method |
CN104714207B (en) * | 2014-12-10 | 2017-04-12 | 中国电子科技集团公司第二十研究所 | Tacan beacon simulator ranging response probability implementation method |
CN104580005A (en) * | 2015-01-13 | 2015-04-29 | 天津市德力电子仪器有限公司 | Method for sending random length message according to flow model accurately |
CN106385342A (en) * | 2016-08-31 | 2017-02-08 | 北京信而泰科技股份有限公司 | Network frame random length generation method |
CN112134757A (en) * | 2020-09-21 | 2020-12-25 | 北京信而泰科技股份有限公司 | Message generation method and device |
CN112134757B (en) * | 2020-09-21 | 2022-08-19 | 北京信而泰科技股份有限公司 | Message generation method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Luo et al. | Optimal save-then-transmit protocol for energy harvesting wireless transmitters | |
CN109413721B (en) | Configuration and detection method of wake-up signal detection time, network equipment and terminal | |
US8687533B2 (en) | Energy reservation in power limited networks | |
EP2701435A1 (en) | Parameter configuration method, base station, and user equipment | |
EP1994649A4 (en) | Control of field device on low power wireless networks | |
EP2966913A1 (en) | Wake-up control method, device and terminal equipment | |
CN103686876B (en) | The method and a kind of electronic equipment of a kind of information processing | |
US9413183B2 (en) | Quick charging system, control device, method of controlling amount of the stored electrical power, and program | |
CN102013940A (en) | Method and device for controlling length of random message | |
WO2013051882A3 (en) | Apparatus and method for preventing command conflicts in a smart grid network | |
US10075920B2 (en) | Method and apparatus for controlling traffic in electronic device | |
US20130086144A1 (en) | Adaptive period network session reservation | |
CN104269585A (en) | Charging method and mobile terminal | |
CN103066632B (en) | Charging control method | |
WO2015188293A1 (en) | Primary frequency modulation control method and apparatus for dynamic adjustment based on characteristic of valve flow | |
JPWO2016031755A1 (en) | Power generation control system, control device, power generation control method and program | |
WO2016033874A1 (en) | Wireless charging processing method and apparatus, and wireless charger | |
CN108039717B (en) | Capacity configuration method and device for converter station in multi-terminal flexible direct-current power grid | |
CN103839394B (en) | The control method of controlled switch and controlled switch | |
CN107046309A (en) | A kind of charging method and device for automatically adjusting charging current | |
CN103731910B (en) | Timing reminding method, terminal and server | |
EP3495913A1 (en) | Power supply control method and device for communication network | |
CN113922411A (en) | Method and device for determining distributed photovoltaic absorption capacity | |
GB2475057B (en) | Method and apparatus for communication traffic control | |
Yan et al. | Distributed frame size selection for a Q learning based slotted ALOHA protocol |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20110413 |
|
RJ01 | Rejection of invention patent application after publication |