Adding a packet tag

1,315 views
Skip to first unread message

Ken

unread,
Mar 26, 2012, 10:54:22 AM3/26/12
to ns-3-users
Hello everyone,

I am designing a topology where node A is sending udp packets to node
B. Now, i want to add packet tags to the packets being sent. Can
anyone tell me where (in which function) i can do this?

Thanks in advance

Ken

sahukari ganesh

unread,
Mar 27, 2012, 4:12:01 AM3/27/12
to ns-3-users
In the application, when you creating the packet the which you want to
send

Ptr<Packet> packet = Create<Packet> (m_packetSize);

add the tag like below

p->AddPacketTag (tag);

Please go through the example "/ns-3-dev/src/network/examples/main-
packet-tag.cc" for how to add a tag to a packet.

and go through the example "/ns-3-dev/examples/tutorial/fifth.cc" for
how to make a custom application.

--
Ganesh
Reply all
Reply to author
Forward
0 new messages