Do you have any idea what is going wrong?
[ My protocol "x" is based on UDP (the only difference so far is a
protocol number),
I didn't touch anything else yet, so "SetDestinationPort" method
should work ]
Thanks,
--
Norman
Le Sun, 7 Dec 2008 11:23:49 -0800 (PST),
Norman <baz.n...@yahoo.com> a écrit :
> btw
> What do you exactly mean by SocketFactory (method nr 2)?
> Is it possible to create a sort of PF_PACKET?
You need to make use of PacketSocketFactory class.
Attached is simple example that shows the use of PF_PACKET like messages
in a wifi environment.
You can also find it in examples/wifi-packet-socket.cc from
http://code.nsnam.org/salumu/ns-3-mih (./waf --run wifi-packet-socket).
Hope it will help you start over more complex examples.
Regards,
--
Providence SALUMU M.
Doctorant, Département Logiciels-Réseaux
TELECOM SudParis
9 rue Charles Fourier, 91011 Evry Cedex
Tel: +33 1 60 76 44 65
Mob: +33 6 84 54 94 85
Fax: +33 1 60 76 47 11
http://www-lor.int-evry.fr/
"If you can't be strong, be clever, and make peace with someone who is
strong. But it's always better to be strong yourself! Always!" -- B.O.
LowLow.
I should point out that the latest version of ns-3 also allows you to
create ip raw sockets (as opposed to packet raw sockets):
Ptr<Socket> socket = Socket::CreateSocket ("ns3::Ipv4RawSocketFactory");
These should behave just the same as a normal linux-style raw socket.
That is, you can use them to receive ipv4 traffic and send ipv4 traffic
and the ip stack will use arp if needed. The exact raw socket logic is
located in src/internet-stack/ipv4-raw-socket-impl.cc
best regards,
Mathieu
> I should point out that the latest version of ns-3 also allows you to
> create ip raw sockets (as opposed to packet raw sockets):
>
> Ptr<Socket> socket = Socket::CreateSocket
> ("ns3::Ipv4RawSocketFactory");
Thank you Mathieu for point out this new one, it is much easier indeed.
--
Providence SALUMU M.
Doctorant, Département Logiciels-Réseaux
TELECOM SudParis
"If you can't be strong, be clever, and make peace with someone who is