[Ns-developers] Spectrum Framework: generating waveforms after reading a packet
suresh.lalith at gmail.com
Sat Jan 7 08:19:12 PST 2012
On Sat, Jan 7, 2012 at 5:10 PM, Giuseppe Piro <g.piro at poliba.it> wrote:
> Hi all,I'm writing a new module in which the PHY layer, based on the
> spectrum framework, is able to generate a waveform for each bit that should
> be transmitted.
> In details, once the PHY layer has received the packet from upper layers,
> it reads the packet "bit-per-bit", thus creating, for each of them, a
> proper SpectrumSignalParameters object that will be sent to the channel.
> Unfortunately, I don't know how reading, bit-per-bit, the packet.
You can convert the packet to a byte array (if I recall correctly, it
was something like Packet::CopyData()), then iterate over the byte
array, and for each iteration (each byte, basically), use a bitmask to
extract an individual bit and generate a waveform for it.
> Then, when a PHY entity will receives a sequence of waveforms, it have to
> re-build the packet. How ?
At the receiver end, you'll need to do the reverse of the above. Get a
group of 8 bits, turn it into a byte, and keep repeating till you have
the whole set of bytes that make up the packet. When done, use
Create<Packet>(byte_array, len) to create a packet out of those bytes.
> Please, can anyone help me to address this task ?
> Thanks a lot
> Giuseppe Piro
More information about the Ns-developers