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

Categories

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...