views:

370

answers:

4

Hi,

I am looking for PRBS Pattern Generating C/C++ API, So that i can insert it in Payload of UDP.

If anybody know the procedure for generating PRBS pattern it would be greatfull.

A: 

Wikipedia does

dsm
An answer that consists solely of a link is generally considered bad practice. Stack Overflow aims to become the repository of answers for all questions, so if you link, copy some relevant quotes from the link and maybe elaborate.
Chris Lutz
A comment that consists solely of ill-thought criticism is generally considered bad practice. Stack Overflow aims to become the repository of answers for all questions, so if you criticise a response, please make sure you read the question and answer in order to determine whether your criticism is appropriate.
dsm
and yes, that does mean that a lone link is a perfectly acceptable answer for this question.
dsm
A: 

please try to check if the src code from http://www.walterg.uklinux.net/prbs.htm can help.

Jin

Jin
An answer that consists solely of a link is generally considered bad practice, particularly if it comes from a user with 1 reputation since that looks suspiciously like spam to a lot of users. Stack Overflow aims to become the repository of answers for all questions, so if you link, copy some relevant quotes from the link and maybe elaborate.
Chris Lutz
A: 

PRBS patterns for networking is often done using Linear Feedback Shift Registers. Perhaps simulating one of these in software would suffice for you.

krousey
+1  A: 

I'm unsure if there's a library which can match your purpose. I can give you some pointers on the implementation though:

The basis of your implementation will be a LFSR. You can implement one in two ways:

  • The Fibonacci implementation consists of a simple shift register in which a modulo-2 sum of the binary-weighted taps is fed back to the input (remember that mod-2 sum is equivalent to addition without carry, which is in turn equivalent with XOR).
  • The Galois implementation consists of a shift register, the content of which is modified at every step by a binary-weighted value of the output stage, again using modulo-2 math. The order of the Galois weights is opposite that of the Fibonacci weights. The Galois form is generally faster due to the reduced amount of logic in the feedback loop.

For more information on how taps are specified and what sequences you can obtain you can start here. Note that your implementation choices above can have the same cycle length and sequence of output bits for an appropriate choice of initial states (seeds).

That's your basic requirement right there. LFSRs have output streams that are very uniformly distributed and sufficiently long periods. I'd suggest not to use it for cryptographic purposes, as it's extremely weak - being a linear system. There are workarounds, but nothing substantial except the shrinking generator (which I find extremely cool).

Links to implementations have already been given, so good luck!

Michael Foukarakis