can we send the data packet

38 views
Skip to first unread message

mpaul

unread,
Sep 21, 2011, 2:21:44 PM9/21/11
to ns-3-users
Hi all,

Can we send packet actually containing the data,
for example, sending " x= 12.5 y=46.56" and receiving the same data
at the other end.

thanks

Manjinder

Nicholas Loulloudes

unread,
Oct 3, 2011, 4:08:34 PM10/3/11
to ns-3-...@googlegroups.com
Hi, 

I am also wondering about this. Anyone with suggestions?

Rafael R. Aschoff

unread,
Oct 3, 2011, 4:13:15 PM10/3/11
to ns-3-...@googlegroups.com
I think the most fast and easy way to do it is to use the Packet constructor which receives a buffer and its size.
ns3::Packet::Packet (uint8_t const * buffer, uint32_t size )


 
On Mon, Oct 3, 2011 at 9:08 PM, Nicholas Loulloudes <loullo...@gmail.com> wrote:
Hi, 

I am also wondering about this. Anyone with suggestions?

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/4jdPCFOXMlQJ.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--
Rafael Roque Aschoff

Ph.D. Candidate

School of Informatics

 

City University London

Phone: +44 (0)20 7040 3252

http://www.city.ac.uk/informatics


Alessandro Russo

unread,
Oct 4, 2011, 3:17:34 AM10/4/11
to ns-3-...@googlegroups.com
Have a look at routing protocols, how packets are built and sent.
Then, write the specification of your packet and serialize-deserialize methods and you are done.
 Alessandro  R.

Nicholas Loulloudes

unread,
Oct 4, 2011, 9:52:24 AM10/4/11
to ns-3-...@googlegroups.com
HI, 

But how would i serialize a double?? The serialize-deserialize methods only deal with integers.

Best,
Nicholas.

Alessandro Russo

unread,
Oct 4, 2011, 10:43:03 AM10/4/11
to ns-3-...@googlegroups.com
these might be useful

better: IEEE 754-2008 "[...] interchange formats: encodings (bit strings) that may be used to exchange floating-point data in an efficient and compact form [...]"
http://en.wikipedia.org/wiki/IEEE_floating-point_standard
http://en.wikipedia.org/wiki/Double_precision

easier:
http://en.wikipedia.org/wiki/Significand

so one double field is represented by  a few integer fields that can be used to compute the original double value without loosing precision.

cheers
 Alessandro  R.


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/QEuPnQpRwQsJ.

Nicholas Loulloudes

unread,
Oct 4, 2011, 5:18:41 PM10/4/11
to ns-3-...@googlegroups.com
Great.

Thanks for the tip.!
Reply all
Reply to author
Forward
0 new messages