Create examples using UDP faces.
Creation of examples using UDP faces. The first step can be to port back the related simple example from ndnSIM 1.0:
Updated by Steven Collison about 6 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
- Estimated time set to 4.00 h
ndn-udp-simple used IpFacesHelper which used IpFaceStack. Neither of these modules seem to be working. Should I try to port both of them to make the example work? It looks like a lot of work to get both of them working.
It looks like the old IpFaceStack did a lot of the socket communication on behalf of the Tcp/Udp faces. Ex: IpFaceStack registers a receive callback with with ns3 socket. Right now I'm registering the receive callback from within the UdpFace. Should I change my current UdpFace implementation to conform to this? Or should I not follow what IpFaceStack does?
Would it be a better idea to try to hack the example without using IpFaceStack?
Updated by Alex Afanasyev about 6 years ago
You need to make it work in one way or another :)
If you don't want to follow the way it was done before, propose your design and we can comment on that. You has to have an entity that manages Udp/Tcp faces (= listens for incoming connections for TCP, processes incoming UDP packets from new remote addresses). IpFaceStack is one, but not the only option for that. NFD codebase has different design principle that you can follow (this would be UdpChannel and TcpChannel with UdpFactory and TcpFactory to create the channels).
Updated by Steven Collison almost 6 years ago
I've spent some time adapting the IpFaceStack and the ndn-simple-udp example. I've got it to successfully compile and run, though I'm not sure about the correctness.
A Couple questions:
Isn't this call to bind unnecessary since m_udpserver is already receiving all udp packets? https://github.com/NDN-Routing/ndnSIM/blob/master-v1/plugins/ip-faces/ndn-ip-face-stack.cc#L209
It looks like the SetUp() method is gone, so I just removed the call. Is there a replacement method I need to call? https://github.com/NDN-Routing/ndnSIM/blob/master-v1/plugins/ip-faces/ndn-ip-face-stack.cc#L217
Should ndn-ip-faces-helper be in the helper folder? Or should I put it in model/ip-faces?