--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.
void
RoutingProtocol::SendHello ()
{
NS_LOG_FUNCTION (this);
/* Broadcast a RREP with TTL = 1 with the RREP message fields set as follows:
* Destination IP Address The node's IP address.
* Destination Sequence Number The node's latest sequence number.
* Hop Count 0
* Lifetime AllowedHelloLoss * HelloInterval
*/
….
// If RREP is Hello message
if (dst == rrepHeader.GetOrigin ())
{
ProcessHello (rrepHeader, receiver);
return;
}
I do not think that it is difficult to add more fields in the header. You only need to be careful in the Serialize and Deserialize methods and to calculate the size of the header properly. A guideline on how to create your own header (or update an existing) can be found here http://www.nsnam.org/support/faq/miscellaneous/#adding-data-to-an-existing-packet
On Wednesday, 29 January 2014 at 17:28, PATEL RAJANKUMAR wrote:
tks sir for your valuable suggestions.But sir i want to modify the AODV hello packet i.e. suppose, i wantto add two more header fields of Hello packet say: random number andload of node. After that i will simulate the aodv and to use/displaythe new added field for those nodes who will be received the modifiedhello packet.Regards,Rajan Patel
The code you mention, belongs to the AODV module and implements theNeighbor class used in AODV. This class can be seen as an entry to the listof neighbors.It is not possible to use part of the code as it is, only to simulate theneighbor discovery.Some basic steps you have to do to implement a neighbor discovery mechanismare:- You define your own class (like AODV) or simply a struct (like OLSR) toidentify a Neighbor and its properties (e.g. IP address).- Have a list/vector of that class/struct to store them, this will be yourneighbor list.- Send/Receive HELLO messages and update the list containing the propertiesyou want to store. These messages are broadcast, so no routing is actuallyneeded. Therefore, you can implement the neighbor discovery mechanism evenas an application. Create a UDP socket and send HELLO messages, whilstlistening to that socket you can receive HELLO messages from others andupdate your neighbor list.On Wednesday, January 29, 2014 9:40:23 AM UTC, PATEL RAJANKUMAR wrote:
sir you just read content of mail, it clearly mention that the nodediscovery of neighbor nodes using hello packet is available in src. i gonethrough that but not able to know that how to use the code. so have anyexample so that i can simulate and able to find neighbor nodes.On Wed, Jan 29, 2014 at 2:02 PM, Tommaso Pecorella
email to ns-3-users+...@googlegroups.com <javascript:>.
To post to this group, send email to
ns-3-...@googlegroups.com<javascript:>
.Visit this group at http://groups.google.com/group/ns-3-users.For more options, visit https://groups.google.com/groups/opt_out.
--You received this message because you are subscribed to the Google Groups"ns-3-users" group.To unsubscribe from this group and stop receiving emails from it, send anemail to ns-3-users+...@googlegroups.com.To post to this group, send email to ns-3-...@googlegroups.com.Visit this group at http://groups.google.com/group/ns-3-users.For more options, visit https://groups.google.com/groups/opt_out.
Ptr<Socket> socket;
Ipv4InterfaceAddress iface;
Ipv4Address destination;
Ptr<Packet> packet;
Изменить
uint16_t i;
for (uint16_t j = 0; j<ClusterHeadsCount; j++)
{
i = ClusterHeads[j];
iface = Ipv4InterfaceAddress(AllInterfaces.GetAddress(i,0),"255.255.255.0");
destination = iface.GetBroadcast();
ns3::PacketMetadata::Enable();
packet = Create<Packet> (16);
socket = Socket::CreateSocket (AllNodes.Get(i),//GetObject<Node> (),
UdpSocketFactory::GetTypeId ());
socket->BindToNetDevice (AllDevices.Get(i));
socket->SetAllowBroadcast (true);
SendTo(socket,packet,destination);
}