Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.9k views
in Technique[技术] by (71.8m points)

udp - broadcast in wireless network ns3

I have a scenario where wireless nodes send packets to a server (the server is also a wireless node) and this server broadcasts a packet to all nodes. I added the following code in the handleRead void in udp-server.cc Ptr<Packet> p = Create<Packet> (1024); TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); Ptr<Socket> socket1 = Socket::CreateSocket (GetNode (), tid); socket1->SetAllowBroadcast (true); Ipv4Address address=Ipv4Address("10.1.3.255"); socket1->Connect (InetSocketAddress (address, port)); socket1->Send(p); The server receives the packets from senders. But, packets are not sent by the server. I want to know if it is possible to enable broadcast in ns3 in wifi scenarios or if it is possible to enable multicast.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...