|
|
Created:
11 years, 7 months ago by mjf.alenazi Modified:
7 years, 4 months ago Reviewers:
Konstantinos Katsaros, Tommaso Pecorella, Peter Barnes, Tom Henderson, barnes26, tomh, barimahappiah, jpgs CC:
ns-3-reviews_googlegroups.com Visibility:
Public. |
DescriptionThis is the first issue created to review the code that adds MANETs routing protocol Epidemic to ns-3 based on the paper titled 'Epidemic Routing for Partially-Connected Ad Hoc Networks'.
This issue is based on ns-3.23.
The second issue is based on ns-3.27, which can be located at:
https://codereview.appspot.com/323290043/
Patch Set 1 #
Total comments: 28
Patch Set 2 : Fixed multiple issues based on inline comments from Peter Barnes #
Total comments: 32
Patch Set 3 : Adding comments, test cases and fixing more issues fore Epidemic routing #
Total comments: 180
Patch Set 4 : Fixing code styles and doxygen docs #
Total comments: 112
Patch Set 5 : Fixing summary vector. Seperating epidmic tag in seprate files and other issues #
Total comments: 90
Patch Set 6 : Fixing code based on comments. Changed globalPacketID from 64bit to 32bit to match original paper. #
Total comments: 115
Patch Set 7 : Fixing doxygen docs and code style #
Total comments: 103
Patch Set 8 : Fixing more doxygen comments and adding epidemic tag enum types #
Total comments: 245
Patch Set 9 : Fixing logging functions #
Total comments: 49
Patch Set 10 : Adding a function to not communicate with recently contacted hosts. Fixing more comments. #
Total comments: 37
Patch Set 11 : Fixing doxygen issues #
Total comments: 234
Patch Set 12 : Fixing doxygen #
Total comments: 90
MessagesTotal messages: 45
Link to the paper: http://issg.cs.duke.edu/epidemic/epidemic.pdf
Sign in to reply to this message.
In addition to the inline comments, this module needs a Models chapter and tests (what's here is just the templates) https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic... src/epidemic/examples/epidemic-example.cc:22: Some comments outlining the example model would be really helpful here. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.cc:51: if (m_queue.size () >= m_maxLen) Why not Purge() before checking m_queue.size? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.cc:70: std::vector<uint64_t> sm; This will be much faster if you create with the known size, GetSize() https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.cc:83: std::vector<uint64_t> sm; Reserve the known maximum size, GetSize() https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.cc:104: for (std::vector<QueueEntry>::iterator i = m_queue.begin (); i != m_queue.end (); ++i) Why is this a loop? It executes 0 or 1 times, depending on m_queue.begin() != m_queue.end https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.cc:134: bool PacketQueue::IsPresent (uint64_t packetID) Implement this in terms of Find() Is this function even used? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet-queue.h:182: std::vector<QueueEntry> m_queue; Is a vector the best choice here? You treat it like a LRU queue, adding new entries at the back, and expiring entries from the front. Expiring from the front is expensive in a vector. std::deque might be a better choice. The other access pattern you have is in Find, where you search for a packetId. That suggests a map<packetID, QueueEntry> might be the best. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet.cc:183: uint64_t sm_length = i.ReadNtohU64 (); Call m_summary_vector.reserve (sm_length) before the loop https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet.h:66: void SetInstanceTypeId (MessageType type); This sets the message type. The name associates it with GetInstanceTypeId, which is totally different. Suggest renaming this method to SetMessageType https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet.h:85: bool m_valid; Rather than increasing the size of this class, you can add a EPIDEMIC_TYPE_INVALID, then use that to determine if you deserialize correctly. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-pa... src/epidemic/model/epidemic-packet.h:204: uint32_t m_floodCount; // Count to keep track of number of traveled hops Is this the same as the hop count in the paper? If you have to change the name, please document the correspondence. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:60: const uint32_t RoutingProtocol::EPIDEMIC_PORT = 269; This if from RFC 5498, right? Please document that. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:148: int32_t m_oif; More descriptive variable name, please. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:183: } Is this implementation difficult? If not, please provide it. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:246: header.SetSource (header.GetSource ()); Isn't this a noop? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:247: header.SetTtl (header.GetTtl () + 1); Why are you incrementing? To avoid it getting decremented to zero and the packet dropped? A comment would be helpful. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:384: bool RoutingProtocol::RouteInput (Ptr<const Packet> p,const Ipv4Header &header,Ptr<const NetDevice> idev,UnicastForwardCallback ucb,MulticastForwardCallback mcb,LocalDeliverCallback lcb,ErrorCallback ecb) Need some line breaks. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:387: if (p->GetSize () < 8 ) What is this magic number? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:405: NS_LOG_DEBUG ("No route to forward broadcast. Drop packet " << p->GetUid ()); Shouldn't the message be "TTL expired"? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:470: //Reset the counter if it reaches the max value 2^32 -1 m_dataPacketCounter is uint32_t, so it will roll over automatically. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:476: uint64_t global_packet_ID = header.GetSource ().Get (); Unnecessary. https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:483: a = (uint32_t)((global_packet_ID & 0xFFFFFFFF00000000) >> 32); Isn't this just (uint32_t)pkt_id? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:484: b = (uint32_t)(global_packet_ID & 0xFFFFFFFF); Isn't this just m_dataPacketCounter? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:521: // Exist the function to not add the packet to the queue since the flood count limit is reached "Exit" https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:579: Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> (); Unused? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.cc:668: QueueEntry newEntry = m_queue.Find (*i); You're traversing the queue twice, once in IsPresent(), then again in Find(). Instead, just call Find, then check for a non-empty QueueEntry. (Or better, instead of returning QueueEntry explicitly, which requires a copy, return a Ptr<QueueEntry>, and check for non-null.) https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.h:26: * Work supported by King Saud University and the ITTC at The University of Kansas. Do we usually put funding attribution in the code? Tom? https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... src/epidemic/model/epidemic-routing-protocol.h:64: static const uint32_t EPIDEMIC_PORT; This const is public in the header, but only given a value in the .cc. Doesn't this mean it's unusable by anyone including this header? even though it's public? I think this should either be private, or given a value here.
Sign in to reply to this message.
Thank you very much for your comments. I will try to fix them all as soon as I can (possibly within two weeks). On Wed, Oct 2, 2013 at 8:05 PM, <pdbj@mac.com> wrote: > In addition to the inline comments, this module needs a Models chapter > and tests (what's here is just the templates) > > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/examples/epidemic-**example.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic-example.cc> > File src/epidemic/examples/**epidemic-example.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/examples/epidemic-**example.cc#newcode22<https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic-example.cc#newcode22> > src/epidemic/examples/**epidemic-example.cc:22: > Some comments outlining the example model would be really helpful here. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc> > File src/epidemic/model/epidemic-**packet-queue.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode51<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode51> > src/epidemic/model/epidemic-**packet-queue.cc:51: if (m_queue.size () >= > m_maxLen) > Why not Purge() before checking m_queue.size? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode70<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode70> > src/epidemic/model/epidemic-**packet-queue.cc:70: std::vector<uint64_t> > sm; > This will be much faster if you create with the known size, GetSize() > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode83<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode83> > src/epidemic/model/epidemic-**packet-queue.cc:83: std::vector<uint64_t> > sm; > Reserve the known maximum size, GetSize() > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode104<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode104> > src/epidemic/model/epidemic-**packet-queue.cc:104: for > (std::vector<QueueEntry>::**iterator i = m_queue.begin (); i != > m_queue.end (); ++i) > Why is this a loop? It executes 0 or 1 times, depending on > m_queue.begin() != m_queue.end > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode134<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode134> > src/epidemic/model/epidemic-**packet-queue.cc:134: bool > PacketQueue::IsPresent (uint64_t packetID) > Implement this in terms of Find() > Is this function even used? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.h> > File src/epidemic/model/epidemic-**packet-queue.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.h#newcode182<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.h#newcode182> > src/epidemic/model/epidemic-**packet-queue.h:182: std::vector<QueueEntry> > m_queue; > Is a vector the best choice here? You treat it like a LRU queue, adding > new entries at the back, and expiring entries from the front. Expiring > from the front is expensive in a vector. std::deque might be a better > choice. > > The other access pattern you have is in Find, where you search for a > packetId. That suggests a map<packetID, QueueEntry> might be the best. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.cc> > File src/epidemic/model/epidemic-**packet.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.cc#newcode183<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.cc#newcode183> > src/epidemic/model/epidemic-**packet.cc:183: uint64_t sm_length = > i.ReadNtohU64 (); > Call m_summary_vector.reserve (sm_length) before the loop > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h> > File src/epidemic/model/epidemic-**packet.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode66<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode66> > src/epidemic/model/epidemic-**packet.h:66: void SetInstanceTypeId > (MessageType type); > This sets the message type. The name associates it with > GetInstanceTypeId, which is totally different. Suggest renaming this > method to SetMessageType > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode85<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode85> > src/epidemic/model/epidemic-**packet.h:85: bool m_valid; > Rather than increasing the size of this class, you can add a > EPIDEMIC_TYPE_INVALID, then use that to determine if you deserialize > correctly. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode204<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode204> > src/epidemic/model/epidemic-**packet.h:204: uint32_t m_floodCount; // > Count to keep track of number of traveled hops > Is this the same as the hop count in the paper? If you have to change > the name, please document the correspondence. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc> > File src/epidemic/model/epidemic-**routing-protocol.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode60<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode60> > src/epidemic/model/epidemic-**routing-protocol.cc:60: const uint32_t > RoutingProtocol::EPIDEMIC_PORT = 269; > This if from RFC 5498, right? Please document that. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode148<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode148> > src/epidemic/model/epidemic-**routing-protocol.cc:148: int32_t m_oif; > More descriptive variable name, please. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode183<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode183> > src/epidemic/model/epidemic-**routing-protocol.cc:183: } > Is this implementation difficult? If not, please provide it. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode246<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode246> > src/epidemic/model/epidemic-**routing-protocol.cc:246: header.SetSource > (header.GetSource ()); > Isn't this a noop? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode247<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode247> > src/epidemic/model/epidemic-**routing-protocol.cc:247: header.SetTtl > (header.GetTtl () + 1); > Why are you incrementing? To avoid it getting decremented to zero and > the packet dropped? A comment would be helpful. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode384<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode384> > src/epidemic/model/epidemic-**routing-protocol.cc:384: bool > RoutingProtocol::RouteInput (Ptr<const Packet> p,const Ipv4Header > &header,Ptr<const NetDevice> idev,UnicastForwardCallback > ucb,MulticastForwardCallback mcb,LocalDeliverCallback lcb,ErrorCallback > ecb) > Need some line breaks. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode387<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode387> > src/epidemic/model/epidemic-**routing-protocol.cc:387: if (p->GetSize () < > 8 ) > What is this magic number? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode405<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode405> > src/epidemic/model/epidemic-**routing-protocol.cc:405: NS_LOG_DEBUG ("No > route to forward broadcast. Drop packet " << p->GetUid ()); > Shouldn't the message be "TTL expired"? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode470<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode470> > src/epidemic/model/epidemic-**routing-protocol.cc:470: //Reset the counter > if it reaches the max value 2^32 -1 > m_dataPacketCounter is uint32_t, so it will roll over automatically. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode476<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode476> > src/epidemic/model/epidemic-**routing-protocol.cc:476: uint64_t > global_packet_ID = header.GetSource ().Get (); > Unnecessary. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode483<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode483> > src/epidemic/model/epidemic-**routing-protocol.cc:483: a = > (uint32_t)((global_packet_ID & 0xFFFFFFFF00000000) >> 32); > Isn't this just (uint32_t)pkt_id? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode484<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode484> > src/epidemic/model/epidemic-**routing-protocol.cc:484: b = > (uint32_t)(global_packet_ID & 0xFFFFFFFF); > Isn't this just m_dataPacketCounter? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode521<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode521> > src/epidemic/model/epidemic-**routing-protocol.cc:521: // Exist the > function to not add the packet to the queue since the flood count limit > is reached > "Exit" > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode579<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode579> > src/epidemic/model/epidemic-**routing-protocol.cc:579: Ptr<WifiNetDevice> > wifi = dev->GetObject<WifiNetDevice> (); > Unused? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode668<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode668> > src/epidemic/model/epidemic-**routing-protocol.cc:668: QueueEntry newEntry > = m_queue.Find (*i); > You're traversing the queue twice, once in IsPresent(), then again in > Find(). Instead, just call Find, then check for a non-empty QueueEntry. > (Or better, instead of returning QueueEntry explicitly, which requires > a copy, return a Ptr<QueueEntry>, and check for non-null.) > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h> > File src/epidemic/model/epidemic-**routing-protocol.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h#newcode26<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h#newcode26> > src/epidemic/model/epidemic-**routing-protocol.h:26: * Work supported by > King Saud University and the ITTC at The University of Kansas. > Do we usually put funding attribution in the code? Tom? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h#newcode64<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h#newcode64> > src/epidemic/model/epidemic-**routing-protocol.h:64: static const uint32_t > EPIDEMIC_PORT; > This const is public in the header, but only given a value in the .cc. > Doesn't this mean it's unusable by anyone including this header? even > though it's public? I think this should either be private, or given a > value here. > > https://codereview.appspot.**com/13831049/<https://codereview.appspot.com/138... > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
On 3 Oct 2013, at 16:28, Mohammed Alenazi wrote: > Thank you very much for your comments. > I will try to fix them all as soon as I can (possibly within two weeks). > > https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... > src/epidemic/model/epidemic-routing-protocol.h:26: * Work supported by > King Saud University and the ITTC at The University of Kansas. > Do we usually put funding attribution in the code? Tom? This is a *requirement* for our contributing code. Without this we would have to withdraw the submission. Cheers, James --------------------------------------------------------------------- James P.G. Sterbenz jpgs@{ittc|eecs}.ku.edu jpgs@comp.lancs.ac.uk www.ittc.ku.edu/~jpgs 154 Nichols ITTC|EECS InfoLab21 Lancaster U +1 508 944 3067 The University of Kansas jpgs@tik.ee.ethz.ch jpgs@{acm|ieee|comsoc|computer|m.ieice}.org jpgsterbenz@gmail.com gplus.to/jpgs www.facebook.com/jpgsterbenz google|skype:jpgsterbenz
Sign in to reply to this message.
On 10/04/2013 09:41 AM, James P.G. Sterbenz wrote: > > On 3 Oct 2013, at 16:28, Mohammed Alenazi wrote: > >> Thank you very much for your comments. >> I will try to fix them all as soon as I can (possibly within two weeks). > >> >> https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-ro... >> src/epidemic/model/epidemic-routing-protocol.h:26: * Work supported by >> King Saud University and the ITTC at The University of Kansas. >> Do we usually put funding attribution in the code? Tom? > > This is a *requirement* for our contributing code. Without this we would have to withdraw the submission. Sorry for the late reply. James and I have discussed this issue earlier this year. In this specific case, I am OK with keeping it as is, similar to the DSR and DSDV modules. In general, I would like the project to adopt some guidelines that avoid accumulating authors and attributions in the core modules of ns-3. For separate modules outside the core (e.g. epidemic, DSDV, DSR), I don't care as strongly. In IETF terminology, perhaps a SHOULD NOT have lengthy attributions in contributed modules, but MUST NOT when patching core modules. Probably also, if patching someone else's copyrighted code, that person should have the last word about header changes. This probably means amending this section of the coding style: http://www.nsnam.org/developers/contributing-code/coding-style/#file-layout-a... and discussing on the ns-developers mailing list to do so. I'll post a note there. - Tom
Sign in to reply to this message.
On Wed, Oct 2, 2013 at 8:05 PM, <pdbj@mac.com> wrote: > In addition to the inline comments, this module needs a Models chapter > and tests (what's here is just the templates) > > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/examples/epidemic-**example.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic-example.cc> > File src/epidemic/examples/**epidemic-example.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/examples/epidemic-**example.cc#newcode22<https://codereview.appspot.com/13831049/diff/1/src/epidemic/examples/epidemic-example.cc#newcode22> > src/epidemic/examples/**epidemic-example.cc:22: > Some comments outlining the example model would be really helpful here. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc> > File src/epidemic/model/epidemic-**packet-queue.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode51<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode51> > src/epidemic/model/epidemic-**packet-queue.cc:51: if (m_queue.size () >= > m_maxLen) > Why not Purge() before checking m_queue.size? > > Fixed > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode70<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode70> > src/epidemic/model/epidemic-**packet-queue.cc:70: std::vector<uint64_t> > sm; > This will be much faster if you create with the known size, GetSize() > > Fixed > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode83<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode83> > src/epidemic/model/epidemic-**packet-queue.cc:83: std::vector<uint64_t> > sm; > Reserve the known maximum size, GetSize() > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode104<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode104> > src/epidemic/model/epidemic-**packet-queue.cc:104: for > (std::vector<QueueEntry>::**iterator i = m_queue.begin (); i != > m_queue.end (); ++i) > Why is this a loop? It executes 0 or 1 times, depending on > m_queue.begin() != m_queue.end > > Fixed > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.cc#newcode134<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.cc#newcode134> > src/epidemic/model/epidemic-**packet-queue.cc:134: bool > PacketQueue::IsPresent (uint64_t packetID) > Implement this in terms of Find() > Is this function even used? > This is removed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.h> > File src/epidemic/model/epidemic-**packet-queue.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet-queue.h#newcode182<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.h#newcode182> > src/epidemic/model/epidemic-**packet-queue.h:182: std::vector<QueueEntry> > m_queue; > Is a vector the best choice here? You treat it like a LRU queue, adding > new entries at the back, and expiring entries from the front. Expiring > from the front is expensive in a vector. std::deque might be a better > choice. > I am not an expert in C++ but I need to search the queue sometime and I need a vector because I know it works for searching. I have not tried or worked with LRU before > > The other access pattern you have is in Find, where you search for a > packetId. That suggests a map<packetID, QueueEntry> might be the best. > I do know know how to approach this . > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.cc> > File src/epidemic/model/epidemic-**packet.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.cc#newcode183<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.cc#newcode183> > src/epidemic/model/epidemic-**packet.cc:183: uint64_t sm_length = > i.ReadNtohU64 (); > Call m_summary_vector.reserve (sm_length) before the loop > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h> > File src/epidemic/model/epidemic-**packet.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode66<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode66> > src/epidemic/model/epidemic-**packet.h:66: void SetInstanceTypeId > (MessageType type); > This sets the message type. The name associates it with > GetInstanceTypeId, which is totally different. Suggest renaming this > method to SetMessageType > I copied it from AODV implementation > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode85<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode85> > src/epidemic/model/epidemic-**packet.h:85: bool m_valid; > Rather than increasing the size of this class, you can add a > EPIDEMIC_TYPE_INVALID, then use that to determine if you deserialize > correctly. > I followed AODV implementation. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**packet.h#newcode204<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet.h#newcode204> > src/epidemic/model/epidemic-**packet.h:204: uint32_t m_floodCount; // > Count to keep track of number of traveled hops > Is this the same as the hop count in the paper? If you have to change > the name, please document the correspondence. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc> > File src/epidemic/model/epidemic-**routing-protocol.cc (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode60<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode60> > src/epidemic/model/epidemic-**routing-protocol.cc:60: const uint32_t > RoutingProtocol::EPIDEMIC_PORT = 269; > This if from RFC 5498, right? Please document that. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode148<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode148> > src/epidemic/model/epidemic-**routing-protocol.cc:148: int32_t m_oif; > More descriptive variable name, please. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode183<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode183> > src/epidemic/model/epidemic-**routing-protocol.cc:183: } > Is this implementation difficult? If not, please provide it. > No routing table for Epidemic > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode246<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode246> > src/epidemic/model/epidemic-**routing-protocol.cc:246: header.SetSource > (header.GetSource ()); > Isn't this a noop? > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode247<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode247> > src/epidemic/model/epidemic-**routing-protocol.cc:247: header.SetTtl > (header.GetTtl () + 1); > Why are you incrementing? To avoid it getting decremented to zero and > the packet dropped? A comment would be helpful. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode384<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode384> > src/epidemic/model/epidemic-**routing-protocol.cc:384: bool > RoutingProtocol::RouteInput (Ptr<const Packet> p,const Ipv4Header > &header,Ptr<const NetDevice> idev,UnicastForwardCallback > ucb,MulticastForwardCallback mcb,LocalDeliverCallback lcb,ErrorCallback > ecb) > Need some line breaks. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode387<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode387> > src/epidemic/model/epidemic-**routing-protocol.cc:387: if (p->GetSize () < > 8 ) > What is this magic number? > :) I had it to avoid ICMP packets. Now it is removed. Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode405<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode405> > src/epidemic/model/epidemic-**routing-protocol.cc:405: NS_LOG_DEBUG ("No > route to forward broadcast. Drop packet " << p->GetUid ()); > Shouldn't the message be "TTL expired"? > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode470<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode470> > src/epidemic/model/epidemic-**routing-protocol.cc:470: //Reset the counter > if it reaches the max value 2^32 -1 > m_dataPacketCounter is uint32_t, so it will roll over automatically. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode476<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode476> > src/epidemic/model/epidemic-**routing-protocol.cc:476: uint64_t > global_packet_ID = header.GetSource ().Get (); > Unnecessary. > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode483<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode483> > src/epidemic/model/epidemic-**routing-protocol.cc:483: a = > (uint32_t)((global_packet_ID & 0xFFFFFFFF00000000) >> 32); > Isn't this just (uint32_t)pkt_id? > Yes. This is just to check that the concatenating and splitting work. It is commented anyway. > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode484<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode484> > src/epidemic/model/epidemic-**routing-protocol.cc:484: b = > (uint32_t)(global_packet_ID & 0xFFFFFFFF); > Isn't this just m_dataPacketCounter? > Yes for the same reason above > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode521<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode521> > src/epidemic/model/epidemic-**routing-protocol.cc:521: // Exist the > function to not add the packet to the queue since the flood count limit > is reached > "Exit" > fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode579<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode579> > src/epidemic/model/epidemic-**routing-protocol.cc:579: Ptr<WifiNetDevice> > wifi = dev->GetObject<WifiNetDevice> (); > Unused? > fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.cc#newcode668<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.cc#newcode668> > src/epidemic/model/epidemic-**routing-protocol.cc:668: QueueEntry newEntry > = m_queue.Find (*i); > You're traversing the queue twice, once in IsPresent(), then again in > Find(). Instead, just call Find, then check for a non-empty QueueEntry. > (Or better, instead of returning QueueEntry explicitly, which requires > a copy, return a Ptr<QueueEntry>, and check for non-null.) > Fixed > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h> > File src/epidemic/model/epidemic-**routing-protocol.h (right): > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h#newcode26<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h#newcode26> > src/epidemic/model/epidemic-**routing-protocol.h:26: * Work supported by > King Saud University and the ITTC at The University of Kansas. > Do we usually put funding attribution in the code? Tom? > > https://codereview.appspot.**com/13831049/diff/1/src/** > epidemic/model/epidemic-**routing-protocol.h#newcode64<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-routing-protocol.h#newcode64> > src/epidemic/model/epidemic-**routing-protocol.h:64: static const uint32_t > EPIDEMIC_PORT; > This const is public in the header, but only given a value in the .cc. > Doesn't this mean it's unusable by anyone including this header? even > though it's public? I think this should either be private, or given a > value here. > Fixed > > https://codereview.appspot.**com/13831049/<https://codereview.appspot.com/138... > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
Still need docs and tests. You should really rethink the queue and summary vector implementations. I've made some comments in the code on the issues and possible solutions. https://codereview.appspot.com/13831049/diff/17001/scratch/epidemic-example.cc File scratch/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/17001/scratch/epidemic-example.c... scratch/epidemic-example.cc:1: #include "ns3/core-module.h" This file is duplicative of src/epidemic/examples/epidemic-example.cc. Patches shouldn't include files in scratch/ https://codereview.appspot.com/13831049/diff/17001/src/epidemic/doc/epidemic.rst File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:1: Example Module Documentation Need module documentation. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/epid... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:17: Please explain the model used in this example, and the expected output: /** This example creates a 10-node wireless network ... */ https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:43: // LogComponentEnable("EpidemicRoutingProtocol", LOG_LEVEL_ALL); Please remove extraneous code, unless it illustrates an alternative process, in which case it needs an explanatory comment. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:122: // More extraneous code. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/wscript File src/epidemic/examples/wscript (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/examples/wscr... src/epidemic/examples/wscript:4: obj = bld.create_ns3_program('epidemic-manet', ['epidemic']) Should this be 'epidemic-example'? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/helper/epidem... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.h:15: EpidemicHelper (); Need minimal doxygen: /** Constructor */ https://codereview.appspot.com/13831049/diff/17001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.h:16: ~EpidemicHelper (); Need minimal doxygen: /** Destructor */ https://codereview.appspot.com/13831049/diff/17001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.h:19: * \returns pointer to clone of this EpidemicHelper Reverse these two lines, so the function has a brief description. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:55: m_queue.erase (m_queue.begin ()); Since erase is part of dropping, (and always called after Drop, just include erase in the body of Drop. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:71: std::vector<uint64_t> sm (m_queue.size ()); Purge first? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:84: std::vector<uint64_t> current_node_sum_vec = GetSummaryVector (); Reverse these two lines, so Purge is called, but only once, before allocating sm. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:88: if (!(std::find (list.begin (), list.end (), *i) != list.end ())) Isn't this just std::find() == list.end ()? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:154: m_queue.end ()); Put the erase in the body of Drop. It's particularly bad here since you're traversing the queue twice, once explicitly to call Drop(), then again to erase(). https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:161: return; Perhaps NS_LOG_INFO ("dropping " << en... << ", reason: " << reason); https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:43: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; Please give at least minimal doxygen for all functions, typdefs, enums, ... https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:62: { ns-3 coding standard discourages inline functions, unless you can show a significant performance issue. Suggest you move these bodies to a .cc file, such as epidemic-packet-queue.cc. In fact, can you just forward declare the QueueEntry class here, and put the entire class declaration in epidemic-packet-queue.cc? (Looks like with a few more &'s that would work, and reduce the exposed implementation. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:50: * 1. Beacon Packet: it is used to advertise the presence of a node in the network. Please use smaller indent, and wrap long lines, so this comment is legible. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:63: TypeHeader (MessageType t = EPIDEMIC_TYPE_BEACON); Doxygen needed everywhere. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:74: { Please move all inline bodies to epidemic-packet.cc https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:102: EpidemicSummaryVectorHeader (std::vector<uint64_t> sv = std::vector<uint64_t> ()); This design can be greatly improved. As is, you're forced into copying vectors multiple times. Instead, just inherit from std::vector, then have PacketQueue::GetSummaryVector/FindDisjointPackets assemble the EpidemicSummaryVectorHeader directly. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:208: Ptr<Socket> socket = j->first; Move this into the conditional https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:243: void RoutingProtocol::SendPacketFromQueue (Ipv4Address dst,QueueEntry queueEntry) Missing ' ' after ','. Probably should run all the code through the style checker. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:434: int32_t iif = m_ipv4->GetInterfaceForDevice (idev); Isnt' this a loop invariant? So it can be done before the loop? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:470: I can't understand this function below here. Please fix the indentation and line lengths, remove dead code, as a start Please describe the overall logic as you go, so I have a clue when each block fires and what it's supposed to do. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:668: QueueEntry newEntry = m_queue.Find (*i); Wait, we've already walked my m_queue and the other side's summary vector to find the list of disjoint packets, now we have to walk the queue again?!? Much better to have FindDisjointPackets return a list of iterators into the queue, then we don't have to do another Find here. https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:713: header_summary.SetSummaryVector (my_vec); Aren't these two lines redundant with the header_summary initialization above? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:87: uint32_t m_floodCount; //Number of times a packet is resent m_hopCount? https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:111: * dest: destination address \param dest destination address https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:112: * firstNode: check the anti-entropy session in the Epidemic paper \param firstNode ... https://codereview.appspot.com/13831049/diff/17001/src/epidemic/test/epidemic... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/17001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:14: class EpidemicTestCase1 : public TestCase Need to implement test cases. https://codereview.appspot.com/13831049/diff/17001/upload.py File upload.py (right): https://codereview.appspot.com/13831049/diff/17001/upload.py#newcode1 upload.py:1: #!/usr/bin/env python This file doesn't belong in the patch.
Sign in to reply to this message.
On 2013/10/14 19:48:46, mjf.alenazi wrote: > > https://codereview.appspot.**com/13831049/diff/1/src/** > > > epidemic/model/epidemic-**packet-queue.h#newcode182<https://codereview.appspot.com/13831049/diff/1/src/epidemic/model/epidemic-packet-queue.h#newcode182> > > src/epidemic/model/epidemic-**packet-queue.h:182: std::vector<QueueEntry> > > m_queue; > > Is a vector the best choice here? You treat it like a LRU queue, adding > > new entries at the back, and expiring entries from the front. Expiring > > from the front is expensive in a vector. std::deque might be a better > > choice. > > I am not an expert in C++ but I need to search the queue sometime and I > need a vector because I know it works for searching. I have not tried or > worked with LRU before You *are* working with LRU (least recently used) ;) You can search a dequeu just like a vector. That's the beauty of STL containers. > > The other access pattern you have is in Find, where you search for a > > packetId. That suggests a map<packetID, QueueEntry> might be the best. > > I do know know how to approach this . Take a look at std::map http://www.cplusplus.com/reference/map/map/ PacketQueue would have std::map<packetID, QueueEntry> m_map; In outline the key functions become (code not compiled or tested): bool PacketQueue::Enqueue (QueueEntry & entry) { // Add or update the entry m_map[GetPacketID ()] = entry; Purge (true); // Drop oldest entry if we're over the limit } QueueEntry PacketQueue::Find (uint64_t packetID) { std::map<packetID, QueueEntry>::iterator entry = m_map.find (packetID); if (entry != m_map.end ()) { return *entry; } else { return QueueEntry (); } } struct IsEarlier { bool operator() (QueueEntry const & e1, QueueEntry const & e2) const { return (e1.GetExpireTime () < e2.GetExpireTime ()); } }; void PacketQueue::Purge (bool oldestOnly /* = false */) { if (oldestOnly && m_map.size () > m_maxLen) { Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier), "Drop the most aged packet"); } else { for (std::vector<QueueEntry>::iterator i = m_queue.begin (); i != m_queue.end (); ++i) { if (i->GetExpireTime () < Seconds (0)) { Drop (*i, "Drop outdated packet "); } } } } void PacketQueue::Drop (QueueEntry en, std::string reason) { m_map.erase (en.GetPacketID ()); } The map approach will give logarithmic search time for all accesses (summary vector, expiring queue entries), compared to the current approach, which is linear in all accesses (even expiring the oldest entry, since it forces a copy of the entire vector).
Sign in to reply to this message.
Patch 2 doesn't build for me: Waf: Entering directory `epidemic/build' Waf: Leaving directory `epidemic/build' source not found: 'test/dsr-epidemic-suite.cc' in bld(features=['cxx', 'cxxshlib', 'ns3module', 'ns3testlib'], ns3_dir_location='src/epidemic', pcfilegen=bld(features='ns3pcfile', idx=4, meths=[], prec=defaultdict(<type 'list'>, {}), _name='', source='', module='ns3-epidemic-test', mappings={}, path=epidemic/src/epidemic, target='') in epidemic/src/epidemic, use=['ns3-epidemic'], mappings={}, uselib='', meths=['_add_test_code', 'apply_bundle', 'process_rule', 'process_source', 'apply_link', 'apply_implib', 'process_use', 'propagate_uselib_vars', 'apply_incpaths_ns3testlib', 'apply_incpaths', 'apply_vnum', 'set_macosx_deployment_target'], prec=defaultdict(<type 'list'>, {}), source=['test/dsr-epidemic-suite.cc'], test=True, install_path='${LIBDIR}', module_deps=['epidemic'], dependencies=['epidemic'], path=epidemic/src/epidemic, vnum=None, posted=True, is_static=False, target='../../ns3-dev-epidemic-test-debug', idx=3, _name='ns3-epidemic-test', is_ns3_module_test_library=True, module_name='ns3-epidemic') in epidemic/src/epidemic
Sign in to reply to this message.
Thank you for the comments. I will work on fixing the code once I get a chance. The code builds for me with no errors. On Thu, Oct 17, 2013 at 6:08 PM, <pdbj@mac.com> wrote: > Patch 2 doesn't build for me: > > Waf: Entering directory `epidemic/build' > Waf: Leaving directory `epidemic/build' > source not found: 'test/dsr-epidemic-suite.cc' in bld(features=['cxx', > 'cxxshlib', 'ns3module', 'ns3testlib'], ns3_dir_location='src/**epidemic', > pcfilegen=bld(features='**ns3pcfile', idx=4, meths=[], > prec=defaultdict(<type 'list'>, {}), _name='', source='', > module='ns3-epidemic-test', mappings={}, path=epidemic/src/epidemic, > target='') in epidemic/src/epidemic, use=['ns3-epidemic'], mappings={}, > uselib='', meths=['_add_test_code', 'apply_bundle', 'process_rule', > 'process_source', 'apply_link', 'apply_implib', 'process_use', > 'propagate_uselib_vars', 'apply_incpaths_ns3testlib', 'apply_incpaths', > 'apply_vnum', 'set_macosx_deployment_target'**], prec=defaultdict(<type > 'list'>, {}), source=['test/dsr-epidemic-**suite.cc'], test=True, > install_path='${LIBDIR}', module_deps=['epidemic'], > dependencies=['epidemic'], path=epidemic/src/epidemic, vnum=None, > posted=True, is_static=False, > target='../../ns3-dev-**epidemic-test-debug', idx=3, > _name='ns3-epidemic-test', is_ns3_module_test_library=**True, > module_name='ns3-epidemic') in epidemic/src/epidemic > > > https://codereview.appspot.**com/13831049/<https://codereview.appspot.com/138... > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
On Thursday, October 17, 2013 8:43:37 PM UTC-7, Mohammed Alenazi wrote: > > The code builds for me with no errors. > To get this to build I have to: 1. Edit src/epidemic/wscript to rename 'test/dsr-epidemic-suite.cc' to ' test/epidemic-test-suite.cc' 2. Remove '#include "ns3/epidemic-.h"' from test/epidemic-test-suite.cc
Sign in to reply to this message.
I will fix these in my end On Mon, Oct 21, 2013 at 2:42 PM, Peter Barnes <barnes26@llnl.gov> wrote: > > > On Thursday, October 17, 2013 8:43:37 PM UTC-7, Mohammed Alenazi wrote: >> >> The code builds for me with no errors. >> > > To get this to build I have to: > > > 1. Edit src/epidemic/wscript to rename 'test/dsr-epidemic-suite.cc' to > 'test/epidemic-test-suite.cc' > 2. Remove '#include "ns3/epidemic-.h"' from test/epidemic-test-suite.cc > > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
I am in a process of changing the vector with the a map as suggested. I am mostly done with it but i have an error that I could not fix in the in this function void PacketQueue::Purge (bool oldestOnly /* = false */) { if (oldestOnly && m_map.size () > m_maxLen) { Drop(std::min_element(m_map.begin(), m_map.end(),IsEarlier),"Drop the most aged packet"); } else { for (std::map<uint64_t, QueueEntry>::iterator i = m_map.begin (); i != m_map.end (); ++i) { if (i->second.GetExpireTime () < Seconds (0)) { Drop (i->second, "Drop outdated packet "); } } } } The error message is malenazi@malenazi-DX4822:~/workspace/epidemic_routing/ns-3.17$ ./waf --run scratch/epidemic-example Waf: Entering directory `/home/malenazi/workspace/epidemic_routing/ns-3.17/build' [1135/1490] cxx: src/epidemic/model/epidemic-packet-queue.cc -> build/src/epidemic/model/epidemic-packet-queue.cc.1.o ../src/epidemic/model/epidemic-packet-queue.cc: In member function ‘void ns3::epidemic::PacketQueue::Purge(bool)’: ../src/epidemic/model/epidemic-packet-queue.cc:70:67: error: expected primary-expression before ‘)’ token Waf: Leaving directory `/home/malenazi/workspace/epidemic_routing/ns-3.17/build' Build failed -> task in 'ns3-epidemic' failed (exit status 1): {task 53617168: cxx epidemic-packet-queue.cc -> epidemic-packet-queue.cc.1.o} ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-Isrc/epidemic', '-I../src/epidemic', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '../src/epidemic/model/epidemic-packet-queue.cc', '-c', '-o', 'src/epidemic/model/epidemic-packet-queue.cc.1.o'] If I comment the first drop statement, it works but without dropping. On Mon, Oct 21, 2013 at 9:58 PM, Mohammed Alenazi <mjf.alenazi@gmail.com>wrote: > I will fix these in my end > > > On Mon, Oct 21, 2013 at 2:42 PM, Peter Barnes <barnes26@llnl.gov> wrote: > >> >> >> On Thursday, October 17, 2013 8:43:37 PM UTC-7, Mohammed Alenazi wrote: >>> >>> The code builds for me with no errors. >>> >> >> To get this to build I have to: >> >> >> 1. Edit src/epidemic/wscript to rename 'test/dsr-epidemic-suite.cc' >> to 'test/epidemic-test-suite.cc' >> 2. Remove '#include "ns3/epidemic-.h"' from >> test/epidemic-test-suite.cc >> >> > > > -- > Mohammed Alenazi > Graduate Research Assistant > Information and Telecommunications Technology Center > University of Kansas > malenazi@ittc.ku.edu > http://www.ittc.ku.edu/~malenazi > +1 785 979 5358 > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
On 2013/10/22 06:12:59, mjf.alenazi wrote: > I am in a process of changing the vector with the a map as suggested. I am > mostly done with it but i have an error that I could not fix in the in this > function > void PacketQueue::Purge (bool oldestOnly /* = false */) > { > if (oldestOnly && m_map.size () > m_maxLen) > { > Drop(std::min_element(m_map.begin(), m_map.end(),IsEarlier),"Drop > the most aged packet"); > } > else > { > > for (std::map<uint64_t, QueueEntry>::iterator i = m_map.begin (); > i != m_map.end (); ++i) > { > if (i->second.GetExpireTime () < Seconds (0)) > { > Drop (i->second, "Drop outdated packet "); > } > } > } > } > > > If I comment the first drop statement, it works but without dropping. Ahh, compiler error messages are legendary for their helpfulness. After some poking, I got this to compile: struct IsEarlier { bool operator () (const QueueMap::value_type & e1, const QueueMap::value_type & e2) const { return e1.second.expireTime < e2.second.expireTime; } }; void Drop (QueueMap::const_iterator en, std::string reason) { m_map.erase (en->second.id); } void Purge (bool oldestOnly = false) { if (oldestOnly && m_map.size () > m_maxLen) { Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier () ), "Drop the oldest packet"); } else { for (QueueMap::iterator i = m_map.begin (); i != m_map.end (); ++i) { if (i->second.expireTime < 0) { Drop (i, "Drop expired packet"); } } } } Note that IsEarlier and Drop both have new signatures, basically because map iterators return std::pairs. HTH, Peter
Sign in to reply to this message.
I fixed almost all the issues (details are are below). Before I upload, I run the style checker. However, there is one issue. In line src/epidemic/model/epidemic- packet-queue.cc:158 This statement is commented. Could you please uncomment it and tell me what is the issue so i can fix it? //Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier()),"Drop the oldest packet"); On Thu, Oct 17, 2013 at 5:09 PM, <pdbj@mac.com> wrote: > Still need docs and tests. > > You should really rethink the queue and summary vector implementations. > I've made some comments in the code on the issues and possible > solutions. > > > https://codereview.appspot.com/13831049/diff/17001/ > scratch/epidemic-example.cc > File scratch/epidemic-example.cc (right): > > https://codereview.appspot.com/13831049/diff/17001/ > scratch/epidemic-example.cc#newcode1 > scratch/epidemic-example.cc:1: #include "ns3/core-module.h" > This file is duplicative of src/epidemic/examples/epidemic-example.cc. > Patches shouldn't include files in scratch/ > fixed > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/doc/epidemic.rst > File src/epidemic/doc/epidemic.rst (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/doc/epidemic.rst#newcode1 > src/epidemic/doc/epidemic.rst:1: Example Module Documentation > Need module documentation. > Added basic file > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/epidemic-example.cc > File src/epidemic/examples/epidemic-example.cc (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/epidemic-example.cc#newcode17 > src/epidemic/examples/epidemic-example.cc:17: > Please explain the model used in this example, and the expected output: > > /** > This example creates a 10-node wireless network ... > > */ > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/epidemic-example.cc#newcode43 > src/epidemic/examples/epidemic-example.cc:43: > // LogComponentEnable("EpidemicRoutingProtocol", LOG_LEVEL_ALL); > Please remove extraneous code, unless it illustrates an alternative > process, in which case it needs an explanatory comment. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/epidemic-example.cc#newcode122 > src/epidemic/examples/epidemic-example.cc:122: // > More extraneous code. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/wscript > File src/epidemic/examples/wscript (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/examples/wscript#newcode4 > src/epidemic/examples/wscript:4: obj = > bld.create_ns3_program('epidemic-manet', ['epidemic']) > Should this be 'epidemic-example'? > > Yes. Fixed. > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/helper/epidemic-helper.h > File src/epidemic/helper/epidemic-helper.h (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/helper/epidemic-helper.h#newcode15 > src/epidemic/helper/epidemic-helper.h:15: EpidemicHelper (); > Need minimal doxygen: /** Constructor */ > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/helper/epidemic-helper.h#newcode16 > src/epidemic/helper/epidemic-helper.h:16: ~EpidemicHelper (); > Need minimal doxygen: /** Destructor */ > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/helper/epidemic-helper.h#newcode19 > src/epidemic/helper/epidemic-helper.h:19: * \returns pointer to clone of > this EpidemicHelper > Reverse these two lines, so the function has a brief description. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc > File src/epidemic/model/epidemic-packet-queue.cc (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode55 > src/epidemic/model/epidemic-packet-queue.cc:55: m_queue.erase > (m_queue.begin ()); > Since erase is part of dropping, (and always called after Drop, just > include erase in the body of Drop. > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode71 > src/epidemic/model/epidemic-packet-queue.cc:71: std::vector<uint64_t> sm > (m_queue.size ()); > Purge first? > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode84 > src/epidemic/model/epidemic-packet-queue.cc:84: std::vector<uint64_t> > current_node_sum_vec = GetSummaryVector (); > Reverse these two lines, so Purge is called, but only once, before > allocating sm. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode88 > src/epidemic/model/epidemic-packet-queue.cc:88: if (!(std::find > (list.begin (), list.end (), *i) != list.end ())) > Isn't this just std::find() == list.end ()? > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode154 > src/epidemic/model/epidemic-packet-queue.cc:154: m_queue.end ()); > Put the erase in the body of Drop. It's particularly bad here since > you're traversing the queue twice, once explicitly to call Drop(), then > again to erase(). > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.cc#newcode161 > src/epidemic/model/epidemic-packet-queue.cc:161: return; > Perhaps NS_LOG_INFO ("dropping " << en... << ", reason: " << reason); > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.h > File src/epidemic/model/epidemic-packet-queue.h (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.h#newcode43 > src/epidemic/model/epidemic-packet-queue.h:43: typedef > Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; > Please give at least minimal doxygen for all functions, typdefs, enums, > ... > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet-queue.h#newcode62 > src/epidemic/model/epidemic-packet-queue.h:62: { > ns-3 coding standard discourages inline functions, unless you can show a > significant performance issue. Suggest you move these bodies to a .cc > file, such as epidemic-packet-queue.cc. In fact, can you just forward > declare the QueueEntry class here, and put the entire class declaration > in epidemic-packet-queue.cc? (Looks like with a few more &'s that would > work, and reduce the exposed implementation. > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet.h > File src/epidemic/model/epidemic-packet.h (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet.h#newcode50 > src/epidemic/model/epidemic-packet.h:50: * 1. Beacon Packet: it is > used to advertise the presence of a node in the network. > Please use smaller indent, and wrap long lines, so this comment is > legible. > > fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet.h#newcode63 > src/epidemic/model/epidemic-packet.h:63: TypeHeader (MessageType t = > EPIDEMIC_TYPE_BEACON); > Doxygen needed everywhere. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet.h#newcode74 > src/epidemic/model/epidemic-packet.h:74: { > Please move all inline bodies to epidemic-packet.cc > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-packet.h#newcode102 > src/epidemic/model/epidemic-packet.h:102: EpidemicSummaryVectorHeader > (std::vector<uint64_t> sv = std::vector<uint64_t> ()); > This design can be greatly improved. As is, you're forced into copying > vectors multiple times. Instead, just inherit from std::vector, then > have PacketQueue::GetSummaryVector/FindDisjointPackets assemble the > EpidemicSummaryVectorHeader directly. > > Any suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc > File src/epidemic/model/epidemic-routing-protocol.cc (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode208 > src/epidemic/model/epidemic-routing-protocol.cc:208: Ptr<Socket> socket > = j->first; > Move this into the conditional > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode243 > src/epidemic/model/epidemic-routing-protocol.cc:243: void > RoutingProtocol::SendPacketFromQueue (Ipv4Address dst,QueueEntry > queueEntry) > Missing ' ' after ','. Probably should run all the code through the > style checker. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode434 > src/epidemic/model/epidemic-routing-protocol.cc:434: int32_t iif = > m_ipv4->GetInterfaceForDevice (idev); > Isnt' this a loop invariant? So it can be done before the loop? > > no it depends on i > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode470 > src/epidemic/model/epidemic-routing-protocol.cc:470: > I can't understand this function below here. Please fix the indentation > and line lengths, remove dead code, as a start Please describe the > overall logic as you go, so I have a clue when each block fires and what > it's supposed to do. > > Small reorganization > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode668 > > src/epidemic/model/epidemic-routing-protocol.cc:668: QueueEntry newEntry > = m_queue.Find (*i); > Wait, we've already walked my m_queue and the other side's summary > vector to find the list of disjoint packets, now we have to walk the > queue again?!? Much better to have FindDisjointPackets return a list of > iterators into the queue, then we don't have to do another Find here. > > The packet queue has been rewritten based on your outline and suggestions > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.cc#newcode713 > src/epidemic/model/epidemic-routing-protocol.cc:713: > header_summary.SetSummaryVector (my_vec); > Aren't these two lines redundant with the header_summary initialization > above? > > Yes. Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.h > File src/epidemic/model/epidemic-routing-protocol.h (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.h#newcode87 > src/epidemic/model/epidemic-routing-protocol.h:87: uint32_t > m_floodCount; //Number of times a packet is resent > m_hopCount? > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.h#newcode111 > src/epidemic/model/epidemic-routing-protocol.h:111: * dest: destination > address > \param dest destination address > > fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/model/epidemic-routing-protocol.h#newcode112 > src/epidemic/model/epidemic-routing-protocol.h:112: * firstNode: check > the anti-entropy session in the Epidemic paper > \param firstNode ... > > Fixed > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/test/epidemic-test-suite.cc > File src/epidemic/test/epidemic-test-suite.cc (right): > > https://codereview.appspot.com/13831049/diff/17001/src/ > epidemic/test/epidemic-test-suite.cc#newcode14 > src/epidemic/test/epidemic-test-suite.cc:14: class EpidemicTestCase1 : > public TestCase > Need to implement test cases. > > Fixed > https://codereview.appspot.com/13831049/diff/17001/upload.py > File upload.py (right): > > https://codereview.appspot.com/13831049/diff/17001/upload.py#newcode1 > upload.py:1: #!/usr/bin/env python > This file doesn't belong in the patch. > > Fixed > https://codereview.appspot.com/13831049/ > -- Mohammed Alenazi Graduate Research Assistant Information and Telecommunications Technology Center University of Kansas malenazi@ittc.ku.edu http://www.ittc.ku.edu/~malenazi +1 785 979 5358
Sign in to reply to this message.
I'm traveling so I won't be able to try this until Tues at the earliest. Just on a hunch you might try &IsEarlier Peter On 2013/11/08 20:57:09, mjf.alenazi wrote: > However, there is one issue. In line src/epidemic/model/epidemic- > packet-queue.cc:158 > > This statement is commented. Could you please uncomment it and tell me what > is the issue so i can fix it? > //Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier()),"Drop > the oldest packet");
Sign in to reply to this message.
The main issues that need to be resolved before merging to ns-3-dev are: - use of random variables needs to be refactored (see comments in the code) - non-trivial unit tests should be added (in particular, the PacketQueue and the RoutingProtocol) - the operation should be validated against the published results In particular, I recommend trying to reproduce Table 1 of the paper. The epidemic-example.cc seems to be a step towards this (e.g. it reproduces the grid size used in the paper) but it only sends a few packets for a fixed scenario. I recommend trying to write an example (perhaps named 'epidemic-benchmark.cc') that, through parameter choices that correspond to Table 1, allows user to see that the behavior approximates what is shown in Table 1. It may be that some additions need to be made to the model to support this (e.g. how can latency and hops traversed be provided as output data?). I can help with these items after the ns-3.19 release. There are also many small issues in the review that need to be addressed. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.rst File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:1: Epidemic Routing Please add at the top of this file: .. include:: replace.txt .. highlight:: cpp https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:5: for use in multi-hop wireless ad hoc networks of mobile nodes. Please say more about the use case (i.e. it is not for dense MANETs but for cases in which connectivity is intermittent or sparse). Clarify also that it is for IPv4 only. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:24: epidemic.Set ("BeaconInterval", UintegerValue (1)); What are these statements included for? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:37: | | can be forwarded through | | Can you explain somewhere how HopCount interacts with the IP TTL? Is IP TTL regenerated each hop? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:43: | | since generated at the source | | If an intermediate node is basing this on the source time, is a network-wide synchronization assumed? Please clarify. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:47: +------------------------- +------------------------------------+-------------+ Please clarify that beaconing is randomized and that this is the mean interval. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:62: Clarify, does Install() have to be called before or after the Internet stack is added? I would suggest that you clarify that the epidemic.Set() statements are needed only if the user wants to modify the default values; otherwise, they can be excluded. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:68: The example can be found in ``src/epidemic/examples/epidemic-example.cc``: Please say a bit more about this example; what does it do and what options does it provide to the user? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:77: * Unit tests have been written to verify the internals of Epidemic. This can be found in ``src/epidemic/test/epidemic-test-suite.cc``. These tests verify whether the methods inside DSR module which deal with packet buffer, headers work correctly. Inside DSR module? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" Is config-store-module.h needed? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:14: #include "ns3/olsr-module.h" are all of these headers needed? Strip out unneeded headers. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:16: #include <time.h> I don't see usage of cmath or time.h below. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:21: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. Why selected to be Grid? There is no intermittent connectivity with Grid. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:38: These could all be made command-line configurable if you used the CommandLine feature (see second.cc in the tutorial). https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:52: SeedManager::SetSeed (7); Why is seed set to 7 and not the default? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:78: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); Perhaps add a comment on the initial distribution of these nodes as part of the documentation of this example. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:89: ); Perhaps add a comment on the mobility model of this example as part of the documentation. Do these values come from the epidemic paper? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:104: wifiPhy.SetChannel (wifiChannel.Create ()); Perhaps add a comment to the documentation of this example that the RangePropagationLoss model is used, and explain the implications on the distance threshold. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:119: epidemic.Set ("BeaconInterval", TimeValue (Seconds (1))); The top two Set()s are changing from the defaults. Why? Is it going to matter for this example. The bottom two Set()s just restate the default values. Why? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:120: The top two Set() statements change from default values. Does this matter for this example (why)? The bottom two Set() statements just restate the default values; why? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:142: uint32_t sink_num = 9; Should this be hardcoded to nine (if user changes nWifis)? Can you document the application behavior above? (e.g. "The example runs for 100 seconds, and data is sent from time 10 to 15 seconds, with the extra time in the example allocated to allow the epidemic routing to eventually deliver the packets.") https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscript File src/epidemic/examples/wscript (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscr... src/epidemic/examples/wscript:4: obj = bld.create_ns3_program(''epidemic-example', ['epidemic']) Change ''epidemic-example' to 'epidemic-example' https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscr... src/epidemic/examples/wscript:5: obj.source = ''epidemic-example.cc' Change ''epidemic-example.cc' to 'epidemic-example.cc' https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.cc:32: #include "ns3/names.h" where are node-list.h, ipv4-list-routing.h, and names.h needed? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:35: #include "ns3/log.h" Logging needs to be added (LOG_COMPONENT_DEFINE, and logging statements) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:158: // Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier()),"Drop the oldest packet"); this needs to be fixed; suggest to replace IsEarlier() with something simpler, if possible, or look at a different STL construct for this. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:46: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; what do these callbacks do? They don't seem to be used anywhere. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:51: ErrorCallback ecb = ErrorCallback (), Time exp = Simulator::Now () + Seconds (10),uint64_t packetID = 0) Please document the 10 seconds parameter choice somewhere; is this a value that will affect performance much (and should be exposed)? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:109: PacketQueue (uint64_t maxLen, Time routeToQueueTimeout) document parameters; what is "routeToQueueTimeout"? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:114: /// Push entry in queue, if there is no entry with the same packet and destination address in queue. what is the behavior if there is already an entry with same destination address? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:128: QueueEntry Find (uint64_t packetID); missing doxygen https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:155: static bool IsEqual (QueueEntry en, const uint64_t m_packetID) this method doesn't seem to be used anywhere https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.cc:34: namespace epidemic { logging is missing in this file (both the log component define and the NS_LOG_FUNCTION() calls). See e.g. src/internet/model/ipv4-header.h for example. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:199: static inline std::ostream & operator<< (std::ostream& os, const EpidemicSummaryVectorHeader & packet) Why is this static and inline? See e.g. Mac48Address where operator<< is std::ostream& operator<< (std::ostream& os, const Mac48Address & address); https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:302: static inline std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet) same comment as above. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:35: #include "ns3/random-variable.h" random-variable.h is deprecated; you need to use random-variable-stream.h You will also need to implement AssignStreams() for all of your random variable usage. http://www.nsnam.org/docs/release/3.18/manual/html/random-variables.html#sett... https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:37: #include "ns3/trace-source-accessor.h" you have no trace sources. Adding trace sources might be a good idea, but if not, remove this inclusion. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:39: #include "ns3/wifi-net-device.h" why does the routing protocol depend on wifi-net-device.h? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:73: .AddAttribute ("QueueEntryExpireTime","Time in seconds after which a packet in the queue will expire.", Time after enqueuing on the local node, or time after which it was originally sent? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:77: .AddAttribute ("BeaconInterval","Time in seconds after which a beacon packet is broadcast.", Mean time, or exact time? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:86: // define this class in a public header move the class declaration to a header, as you suggest. And then doxygenate it. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:195: m_BeaconTimer.Schedule (m_beaconInterval + MilliSeconds (UniformVariable ().GetInteger (0,100))); This will need to be reworked a bit to use UniformRandomVariable and to expose its parameterization to users. Otherwise, users will run into difficulty in reproducing results. I can help you with this at a later date. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:236: socket->SendTo (p, 0, InetSocketAddress (destination, EPIDEMIC_PORT)); these kind of Send events ought to be logged. In general, try to log (NS_LOG_DEBUG or NS_LOG_LOGIC) around the main control flow of your protocol so that users can debug more easily later. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:250: * IP TTL dropping mechanism is avoided by incrementing TTL. Why not just generate a fresh IP header with whatever local TTL is defined? It seems to me that it might be more error-prone to be adding to IP TTL. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:280: packet->AddPacketTag (tempTag); Is the tag ever removed? Perhaps add a comment here about where you expect the packet to be removed. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:282: m_BeaconTimer.Schedule (m_beaconInterval + MilliSeconds (UniformVariable ().GetInteger (0,100))); similar comment here about beacon use of RandomVariable https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:287: { How is this different that Ipv4::GetInterfaceForAddress()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:307: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) it may be more robust to check the type of the device (is LoopbackNetDevice) rather than use the IP address (which might be different, perhaps?) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:316: bool RoutingProtocol::IsMyOwnAddress (Ipv4Address src) how is this different from Ipv4::IsDestinationAddress()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:354: p->PeekPacketTag (tag); similar comment here-- where is this tag later removed? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:490: //ADD EPIDEMIC HEADER this kind of comment might be better to add as a debug log statement. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:515: // Exit the function to not add the packet to the queue since the flood count limit is reached code like this would benefit from logging statements https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:610: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); state this restriction in the documentation (class doxygen, and the .rst file). https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:661: Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),&RoutingProtocol::SendPacketFromQueue,this,dest, newEntry); this is another usage of UniformVariable that must be changed to expose this parameter. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:709: Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),&RoutingProtocol::SendPacket,this, packet_summary, addr); another instance of jitter that should be refactored https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:718: NS_LOG_FUNCTION (this << socket); NS_LOG_FUNCTION should be the first statement https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:117: uint32_t find_output_device_for_address ( Ipv4Address dst); This method naming should be changed to CamelCase https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:119: uint32_t find_loopback_device (); This method naming should be changed to CamelCase https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ Missing GPL header https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:10: #include "ns3/mesh-helper.h" Mesh helper? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:64: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); These tests are trivial; what about trying to check around boundary conditions? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:134: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "trivial"); These tests are all trivial. There should be test cases for e.g. trying to dequeue from an empty queue, trying to enqueue to a full queue, trying to add duplicate packets, etc. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:148: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); There is no test case for routing protocol operation; how could RoutingProtocol be unit tested? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/wscript File src/epidemic/wscript (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/wscript#newco... src/epidemic/wscript:25: ] add also: if (bld.env['ENABLE_EXAMPLES']): bld.recurse('examples') eventually, we'll add python bindings as well.
Sign in to reply to this message.
A few comments from patch-2 are still unaddressed; I've brought them forward. Much doxygen is missing. I'm sending you privately a patch addressing a few doc building bugs, and a fix for the problematic Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.h:34: * \defgroup epidemic Routing \defgroup epidemic Epidemic Routing https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.h:39: */ This whole comment block should be in a source file, not src/epidemic/doc/. Perhaps src/epidemic/model/epidemic-routing-protocol.h, after line 49. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:27: NS_LOG_COMPONENT_DEFINE ("EpidemicScript"); Perhaps "EpidemicExample" https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.h:60: * This method will be called by ns3::InternetStackHelper::Install This kind of documentation is not useful. Doxygen already shows me who calls this function. Instead tell me what does this function actually *does* https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:175: { Perhaps NS_LOG_INFO ("dropping " << en... << ", reason: " << reason); https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:178: This is hard to review, since you've moved these functions from the bottom of the file. I can't see what's changed within the functions. Please move these to their former position so diffs work. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:183: std::vector<uint64_t> sm (m_map.size ()); Purge first? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:195: std::vector<uint64_t> current_node_sum_vec = GetSummaryVector (); Reverse these two lines, so Purge is called, but only once, before allocating sm. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:198: if (!(std::find (list.begin (), list.end (), *i) != list.end ())) Isn't this just std::find() == list.end ()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:43: class QueueEntry Can you just forward declare the QueueEntry class here, and put the entire class declaration in epidemic-packet-queue.cc? (Looks like with a few more &'s that would work, and reduce the exposed implementation.) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:67: //\{ This just groups these functions under a heading "Fields", which isn't very useful, and doesn't qualify as useful documentation. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:110: : m_maxLen (maxLen), No inline, please. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:140: { No inline, please. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:156: { No inline, please. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.cc:46: TypeId TypeHeader::GetTypeId () I prefer return type on a separate line than the function name, as in the previous patch. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:48: /** This doxygen block should be merged with the one following. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:50: * \brief Three types: \brief Epidemic routing packet type header. Epidemic routing packets come in three types: https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:167: class EpidemicSummaryVectorHeader : public Header This design can be greatly improved. As is, you're forced into copying vectors multiple times. Instead, just inherit from std::vector, then have PacketQueue::GetSummaryVector/FindDisjointPackets assemble the EpidemicSummaryVectorHeader directly. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:200: { No inline please. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:65: * \ingroup epidemic This belongs in the class block, not on the port. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:69: http://tools.ietf.org/html/rfc5498 Just do: Based on \RFC{5498} (and omit explicit link; the doxygen alias will add it for you) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:73: /// Transport Port for MANET routing protocols ports Combine with previous block (this block is probably redundant.) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:80: //\{ // Inherited methods: (You don't need to document these; doxygen will copy from the parent class.) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:94: //\{ Unnecessary. These will already appear in a separate "Private Attributes" section. What's worse, you don't have a closing //\}, so even the private methods are listed under "Protocol Parameters" https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:107: private: Redundant. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:128: * \param dest: destination address \param dest destination address (No colon ':') https://codereview.appspot.com/13831049/diff/85001/src/epidemic/wscript File src/epidemic/wscript (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/wscript#newco... src/epidemic/wscript:25: ] Why are you disabling examples and bindings?
Sign in to reply to this message.
I have uploaded a new patch fixing the issues presented. However, there is a runtime error happening when I run the epidemic-benchmark.cc file in the examples folder. I tried to fix it but I could not find the source of that error. Could any of you guys try to find the source of that error so I can fix it. I tried to used gdb but it was not that helpful. Tom, For the additional test cases, could you please point me to an example in the current ns3 ditro so I can follow to add new test cases. Thank you https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.h:34: * \defgroup epidemic Routing Is it two epidemic words or is that a typo? On 2013/12/10 00:02:33, Peter Barnes wrote: > \defgroup epidemic Epidemic Routing https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.h:39: */ I was trying to follow DSR model? On 2013/12/10 00:02:33, Peter Barnes wrote: > This whole comment block should be in a source file, not src/epidemic/doc/. > Perhaps src/epidemic/model/epidemic-routing-protocol.h, after line 49. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.rst File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:1: Epidemic Routing On 2013/12/08 22:24:26, Tom Henderson wrote: > Please add at the top of this file: > > .. include:: replace.txt > .. highlight:: cpp Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:5: for use in multi-hop wireless ad hoc networks of mobile nodes. On 2013/12/08 22:24:26, Tom Henderson wrote: > Please say more about the use case (i.e. it is not for dense MANETs but for > cases in which connectivity is intermittent or sparse). > > Clarify also that it is for IPv4 only. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:24: epidemic.Set ("BeaconInterval", UintegerValue (1)); On 2013/12/08 22:24:26, Tom Henderson wrote: > > What are these statements included for? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:37: | | can be forwarded through | | This does not depend on the TTL. I try to increment the TTL in each node so the packet does not drop because of the TTL. On 2013/12/08 22:24:26, Tom Henderson wrote: > Can you explain somewhere how HopCount interacts with the IP TTL? Is IP TTL > regenerated each hop? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:43: | | since generated at the source | | Yes On 2013/12/08 22:24:26, Tom Henderson wrote: > If an intermediate node is basing this on the source time, is a network-wide > synchronization assumed? Please clarify. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:47: +------------------------- +------------------------------------+-------------+ On 2013/12/08 22:24:26, Tom Henderson wrote: > Please clarify that beaconing is randomized and that this is the mean interval. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:62: On 2013/12/08 22:24:26, Tom Henderson wrote: > > Clarify, does Install() have to be called before or after the Internet stack is > added? > > I would suggest that you clarify that the epidemic.Set() statements are needed > only if the user wants to modify the default values; otherwise, they can be > excluded. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:68: The example can be found in ``src/epidemic/examples/epidemic-example.cc``: I explained these in the example itself. On 2013/12/08 22:24:26, Tom Henderson wrote: > Please say a bit more about this example; what does it do and what options does > it provide to the user? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/doc/epidemic.... src/epidemic/doc/epidemic.rst:77: * Unit tests have been written to verify the internals of Epidemic. This can be found in ``src/epidemic/test/epidemic-test-suite.cc``. These tests verify whether the methods inside DSR module which deal with packet buffer, headers work correctly. On 2013/12/08 22:24:26, Tom Henderson wrote: > Inside DSR module? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > Is config-store-module.h needed? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:14: #include "ns3/olsr-module.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > are all of these headers needed? Strip out unneeded headers. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:16: #include <time.h> On 2013/12/08 22:24:26, Tom Henderson wrote: > I don't see usage of cmath or time.h below. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:21: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. The user can use either Grid or RandomWaypoint. Grid is a simple verification example. On 2013/12/08 22:24:26, Tom Henderson wrote: > Why selected to be Grid? There is no intermittent connectivity with Grid. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:27: NS_LOG_COMPONENT_DEFINE ("EpidemicScript"); On 2013/12/10 00:02:33, Peter Barnes wrote: > Perhaps "EpidemicExample" Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:38: On 2013/12/08 22:24:26, Tom Henderson wrote: > These could all be made command-line configurable if you used the CommandLine > feature (see second.cc in the tutorial). Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:52: SeedManager::SetSeed (7); On 2013/12/08 22:24:26, Tom Henderson wrote: > Why is seed set to 7 and not the default? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:78: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); On 2013/12/08 22:24:26, Tom Henderson wrote: > Perhaps add a comment on the initial distribution of these nodes as part of the > documentation of this example. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:89: ); On 2013/12/08 22:24:26, Tom Henderson wrote: > Perhaps add a comment on the mobility model of this example as part of the > documentation. Do these values come from the epidemic paper? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:89: ); Yes On 2013/12/08 22:24:26, Tom Henderson wrote: > Perhaps add a comment on the mobility model of this example as part of the > documentation. Do these values come from the epidemic paper? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/epid... src/epidemic/examples/epidemic-example.cc:142: uint32_t sink_num = 9; On 2013/12/08 22:24:26, Tom Henderson wrote: > Should this be hardcoded to nine (if user changes nWifis)? > > Can you document the application behavior above? (e.g. "The example runs for > 100 seconds, and data is sent from time 10 to 15 seconds, with the extra time in > the example allocated to allow the epidemic routing to eventually deliver the > packets.") Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscript File src/epidemic/examples/wscript (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscr... src/epidemic/examples/wscript:4: obj = bld.create_ns3_program(''epidemic-example', ['epidemic']) On 2013/12/08 22:24:26, Tom Henderson wrote: > Change ''epidemic-example' to 'epidemic-example' Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/examples/wscr... src/epidemic/examples/wscript:5: obj.source = ''epidemic-example.cc' On 2013/12/08 22:24:26, Tom Henderson wrote: > Change ''epidemic-example.cc' to 'epidemic-example.cc' Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.cc:32: #include "ns3/names.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > where are node-list.h, ipv4-list-routing.h, and names.h needed? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/helper/epidem... src/epidemic/helper/epidemic-helper.h:60: * This method will be called by ns3::InternetStackHelper::Install On 2013/12/10 00:02:33, Peter Barnes wrote: > This kind of documentation is not useful. Doxygen already shows me who calls > this function. Instead tell me what does this function actually *does* Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:35: #include "ns3/log.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > Logging needs to be added (LOG_COMPONENT_DEFINE, and logging statements) Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:158: // Drop (std::min_element (m_map.begin (), m_map.end (), IsEarlier()),"Drop the oldest packet"); On 2013/12/08 22:24:26, Tom Henderson wrote: > this needs to be fixed; suggest to replace IsEarlier() with something simpler, > if possible, or look at a different STL construct for this. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:175: { On 2013/12/10 00:02:33, Peter Barnes wrote: > Perhaps NS_LOG_INFO ("dropping " << en... << ", reason: " << reason); Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:178: On 2013/12/10 00:02:33, Peter Barnes wrote: > This is hard to review, since you've moved these functions from the bottom of > the file. I can't see what's changed within the functions. Please move these > to their former position so diffs work. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:183: std::vector<uint64_t> sm (m_map.size ()); On 2013/12/10 00:02:33, Peter Barnes wrote: > Purge first? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:195: std::vector<uint64_t> current_node_sum_vec = GetSummaryVector (); On 2013/12/10 00:02:33, Peter Barnes wrote: > Reverse these two lines, so Purge is called, but only once, before allocating > sm. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:195: std::vector<uint64_t> current_node_sum_vec = GetSummaryVector (); On 2013/12/10 00:02:33, Peter Barnes wrote: > Reverse these two lines, so Purge is called, but only once, before allocating > sm. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:198: if (!(std::find (list.begin (), list.end (), *i) != list.end ())) On 2013/12/10 00:02:33, Peter Barnes wrote: > Isn't this just std::find() == list.end ()? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.cc:198: if (!(std::find (list.begin (), list.end (), *i) != list.end ())) In member function ‘std::vector<long long unsigned int, std::allocator<long long unsigned int> > ns3::epidemic::PacketQueue::FindDisjointPackets(std::vector<long long unsigned int, std::allocator<long long unsigned int> >)’: ../src/epidemic/model/epidemic-packet-queue.cc:212: error: no matching function for call to ‘find()’ On 2013/12/10 00:02:33, Peter Barnes wrote: > Isn't this just std::find() == list.end ()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:43: class QueueEntry I thought you want the implementation in the .cc files and the definitions in the .h files https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... On 2013/12/10 00:02:33, Peter Barnes wrote: > Can you just forward declare the QueueEntry class here, and put the entire class > declaration in epidemic-packet-queue.cc? (Looks like with a few more &'s that > would work, and reduce the exposed implementation.) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:46: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; They are used in the QueueEntry constructer. On 2013/12/08 22:24:26, Tom Henderson wrote: > what do these callbacks do? They don't seem to be used anywhere. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:51: ErrorCallback ecb = ErrorCallback (), Time exp = Simulator::Now () + Seconds (10),uint64_t packetID = 0) On 2013/12/08 22:24:26, Tom Henderson wrote: > Please document the 10 seconds parameter choice somewhere; is this a value that > will affect performance much (and should be exposed)? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:67: //\{ I have been trying to follow the AODV docs. On 2013/12/10 00:02:33, Peter Barnes wrote: > This just groups these functions under a heading "Fields", which isn't very > useful, and doesn't qualify as useful documentation. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:109: PacketQueue (uint64_t maxLen, Time routeToQueueTimeout) On 2013/12/08 22:24:26, Tom Henderson wrote: > document parameters; what is "routeToQueueTimeout"? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:110: : m_maxLen (maxLen), On 2013/12/10 00:02:33, Peter Barnes wrote: > No inline, please. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:114: /// Push entry in queue, if there is no entry with the same packet and destination address in queue. On 2013/12/08 22:24:26, Tom Henderson wrote: > what is the behavior if there is already an entry with same destination address? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:128: QueueEntry Find (uint64_t packetID); On 2013/12/08 22:24:26, Tom Henderson wrote: > missing doxygen Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:140: { On 2013/12/10 00:02:33, Peter Barnes wrote: > No inline, please. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:155: static bool IsEqual (QueueEntry en, const uint64_t m_packetID) On 2013/12/08 22:24:26, Tom Henderson wrote: > this method doesn't seem to be used anywhere Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet-queue.h:156: { On 2013/12/10 00:02:33, Peter Barnes wrote: > No inline, please. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.cc:34: namespace epidemic { On 2013/12/08 22:24:26, Tom Henderson wrote: > > logging is missing in this file (both the log component define and the > NS_LOG_FUNCTION() calls). > > See e.g. src/internet/model/ipv4-header.h for example. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.cc:46: TypeId TypeHeader::GetTypeId () I did not understand what you mean here? On 2013/12/10 00:02:33, Peter Barnes wrote: > I prefer return type on a separate line than the function name, as in the > previous patch. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:48: /** On 2013/12/10 00:02:33, Peter Barnes wrote: > This doxygen block should be merged with the one following. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:50: * \brief Three types: On 2013/12/10 00:02:33, Peter Barnes wrote: > \brief Epidemic routing packet type header. > > Epidemic routing packets come in three types: Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:167: class EpidemicSummaryVectorHeader : public Header Could you please help me with this and send it as a patch? On 2013/12/10 00:02:33, Peter Barnes wrote: > This design can be greatly improved. As is, you're forced into copying vectors > multiple times. Instead, just inherit from std::vector, then have > PacketQueue::GetSummaryVector/FindDisjointPackets assemble the > EpidemicSummaryVectorHeader directly. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:199: static inline std::ostream & operator<< (std::ostream& os, const EpidemicSummaryVectorHeader & packet) Followed the AODV example. On 2013/12/08 22:24:26, Tom Henderson wrote: > Why is this static and inline? See e.g. Mac48Address where operator<< is > > std::ostream& operator<< (std::ostream& os, const Mac48Address & address); https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:200: { Should I remove the function? On 2013/12/10 00:02:33, Peter Barnes wrote: > No inline please. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-packet.h:302: static inline std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet) I followed the AODV example. Should I remove the function. On 2013/12/08 22:24:26, Tom Henderson wrote: > same comment as above. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:35: #include "ns3/random-variable.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > random-variable.h is deprecated; you need to use random-variable-stream.h > > You will also need to implement AssignStreams() for all of your random variable > usage. > http://www.nsnam.org/docs/release/3.18/manual/html/random-variables.html#sett... Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:37: #include "ns3/trace-source-accessor.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > you have no trace sources. Adding trace sources might be a good idea, but if > not, remove this inclusion. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:39: #include "ns3/wifi-net-device.h" On 2013/12/08 22:24:26, Tom Henderson wrote: > why does the routing protocol depend on wifi-net-device.h? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:73: .AddAttribute ("QueueEntryExpireTime","Time in seconds after which a packet in the queue will expire.", Time after enqueuing on the local node or the packet originated both are the same. On 2013/12/08 22:24:26, Tom Henderson wrote: > Time after enqueuing on the local node, or time after which it was originally > sent? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:77: .AddAttribute ("BeaconInterval","Time in seconds after which a beacon packet is broadcast.", Time specified in seconds + some milliseconds to avoid collisions. On 2013/12/08 22:24:26, Tom Henderson wrote: > Mean time, or exact time? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:86: // define this class in a public header On 2013/12/08 22:24:26, Tom Henderson wrote: > move the class declaration to a header, as you suggest. And then doxygenate it. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:195: m_BeaconTimer.Schedule (m_beaconInterval + MilliSeconds (UniformVariable ().GetInteger (0,100))); On 2013/12/08 22:24:26, Tom Henderson wrote: > This will need to be reworked a bit to use UniformRandomVariable and to expose > its parameterization to users. Otherwise, users will run into difficulty in > reproducing results. > > I can help you with this at a later date. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:236: socket->SendTo (p, 0, InetSocketAddress (destination, EPIDEMIC_PORT)); On 2013/12/08 22:24:26, Tom Henderson wrote: > these kind of Send events ought to be logged. In general, try to log > (NS_LOG_DEBUG or NS_LOG_LOGIC) around the main control flow of your protocol so > that users can debug more easily later. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:250: * IP TTL dropping mechanism is avoided by incrementing TTL. I am using the header associated with the packet. On 2013/12/08 22:24:26, Tom Henderson wrote: > Why not just generate a fresh IP header with whatever local TTL is defined? It > seems to me that it might be more error-prone to be adding to IP TTL. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:280: packet->AddPacketTag (tempTag); Yes, before the packet is delivered On 2013/12/08 22:24:26, Tom Henderson wrote: > Is the tag ever removed? Perhaps add a comment here about where you expect the > packet to be removed. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:282: m_BeaconTimer.Schedule (m_beaconInterval + MilliSeconds (UniformVariable ().GetInteger (0,100))); On 2013/12/08 22:24:26, Tom Henderson wrote: > similar comment here about beacon use of RandomVariable Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:287: { My function is trying to match the correct subnet address not just the actual address. On 2013/12/08 22:24:26, Tom Henderson wrote: > How is this different that Ipv4::GetInterfaceForAddress()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:307: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) Can you help me with this one? On 2013/12/08 22:24:26, Tom Henderson wrote: > it may be more robust to check the type of the device (is LoopbackNetDevice) > rather than use the IP address (which might be different, perhaps?) https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:316: bool RoutingProtocol::IsMyOwnAddress (Ipv4Address src) I tried pv4::IsDestinationAddress() but it did not work. If you can fix it and send me how to do it. On 2013/12/08 22:24:26, Tom Henderson wrote: > how is this different from Ipv4::IsDestinationAddress()? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:354: p->PeekPacketTag (tag); On 2013/12/08 22:24:26, Tom Henderson wrote: > similar comment here-- where is this tag later removed? Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:490: //ADD EPIDEMIC HEADER On 2013/12/08 22:24:26, Tom Henderson wrote: > this kind of comment might be better to add as a debug log statement. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:515: // Exit the function to not add the packet to the queue since the flood count limit is reached On 2013/12/08 22:24:26, Tom Henderson wrote: > code like this would benefit from logging statements Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:610: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); On 2013/12/08 22:24:26, Tom Henderson wrote: > state this restriction in the documentation (class doxygen, and the .rst file). Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:610: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); On 2013/12/08 22:24:26, Tom Henderson wrote: > state this restriction in the documentation (class doxygen, and the .rst file). Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:661: Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),&RoutingProtocol::SendPacketFromQueue,this,dest, newEntry); On 2013/12/08 22:24:26, Tom Henderson wrote: > this is another usage of UniformVariable that must be changed to expose this > parameter. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:709: Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),&RoutingProtocol::SendPacket,this, packet_summary, addr); On 2013/12/08 22:24:26, Tom Henderson wrote: > another instance of jitter that should be refactored Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:718: NS_LOG_FUNCTION (this << socket); On 2013/12/08 22:24:26, Tom Henderson wrote: > NS_LOG_FUNCTION should be the first statement Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.cc:718: NS_LOG_FUNCTION (this << socket); On 2013/12/08 22:24:26, Tom Henderson wrote: > NS_LOG_FUNCTION should be the first statement Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:69: http://tools.ietf.org/html/rfc5498 On 2013/12/10 00:02:33, Peter Barnes wrote: > Just do: > > Based on \RFC{5498} > > (and omit explicit link; the doxygen alias will add it for you) Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:73: /// Transport Port for MANET routing protocols ports On 2013/12/10 00:02:33, Peter Barnes wrote: > Combine with previous block (this block is probably redundant.) Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:73: /// Transport Port for MANET routing protocols ports On 2013/12/10 00:02:33, Peter Barnes wrote: > Combine with previous block (this block is probably redundant.) Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:80: //\{ On 2013/12/10 00:02:33, Peter Barnes wrote: > // Inherited methods: > > (You don't need to document these; doxygen will copy from the parent class.) Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:94: //\{ I have not worked with Doxygen before. On 2013/12/10 00:02:33, Peter Barnes wrote: > Unnecessary. These will already appear in a separate "Private Attributes" > section. > > What's worse, you don't have a closing //\}, so even the private methods are > listed under "Protocol Parameters" https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:107: private: On 2013/12/10 00:02:33, Peter Barnes wrote: > Redundant. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:117: uint32_t find_output_device_for_address ( Ipv4Address dst); On 2013/12/08 22:24:26, Tom Henderson wrote: > This method naming should be changed to CamelCase Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:119: uint32_t find_loopback_device (); On 2013/12/08 22:24:26, Tom Henderson wrote: > This method naming should be changed to CamelCase Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/model/epidemi... src/epidemic/model/epidemic-routing-protocol.h:128: * \param dest: destination address On 2013/12/10 00:02:33, Peter Barnes wrote: > \param dest destination address > > (No colon ':') Done.
Sign in to reply to this message.
A few general comments: * Many of Tom's comments on patch3 have not been addressed, even cases where you have replied "Done" * epidemic-benchmark runs without error for me. What error are you getting? * Patch for EpidemicSummaryVectorHeader sent separately https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:34: * \defgroup epidemic Epidemic Routing The first is the sphinx module name, a single token. The remainder is the module title, which is what shows up in the toc. On 2013/12/30 23:11:11, mjf.alenazi wrote: > Is it two epidemic words or is that a typo? > On 2013/12/10 00:02:33, Peter Barnes wrote: > > \defgroup epidemic Epidemic Routing https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:39: */ Since it's so simple, it would be better IMO to include this in epidemic-routing-protocol.h as suggested, instead of in a new directory and new file. )For more complicated multi-page documentation */doc/* would be appropriate.) On 2013/12/30 23:11:11, mjf.alenazi wrote: > I was trying to follow DSR model? > On 2013/12/10 00:02:33, Peter Barnes wrote: > > This whole comment block should be in a source file, not src/epidemic/doc/. > > Perhaps src/epidemic/model/epidemic-routing-protocol.h, after line 49. > https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:14: `the ResiliNets research group <http://www.ittc.ku.edu/resilinets>`_ the `ResiliNets... https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:40: epidemic.Set ("BeaconInterval", UintegerValue (1)); I think Tom is suggesting that you delete this code sample; all the parameters are better documented in the table which follows. Besides, this same block appears later in the doc, so it's redundant here. On 2013/12/30 23:11:11, mjf.alenazi wrote: > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > > What are these statements included for? > > Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:47: | HopCount | Maximum number of hops a packet | 64 | Please put this explanation in the docs. On 2013/12/30 23:11:11, mjf.alenazi wrote: > This does not depend on the TTL. I try to increment the TTL in each node so the > packet does not drop because of the TTL. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Can you explain somewhere how HopCount interacts with the IP TTL? Is IP TTL > > regenerated each hop? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:55: | | network-wide is synchronization | | … at the source. Network … (Punctuate sentences.) https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:60: | | added to avoid collision | | What is the random distribution? Is this configurable? How much randomness is introduced? Is this configurable? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:68: in your simulation script. For instance::: Only 2 ':' http://sphinx-doc.org/rest.html#source-code https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:71: epidemic.Set ("HopCount", UintegerValue (64)); Suggest using non-default values for clarity. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:75: mainNodes.Install (epidemic, adhocNodes); (Bump: Tom's first Q not addressed) On 2013/12/08 22:24:26, Tom Henderson wrote: > Clarify, does Install() have to be called before or after the Internet stack is > added? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:77: The epidemic.Set() statements are needed ``epidemic.Set ()`` https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:84: The example can be found in ``src/epidemic/examples/epidemic-example.cc`` It's helpful to say a bit here, so the reader knows what they might find there. On 2013/12/30 23:11:11, mjf.alenazi wrote: > I explained these in the example itself. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Please say a bit more about this example; what does it do and what options > > does it provide to the user? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:96: ********** *********** (Underline has to be same length as section title text) https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:17: the default is set to 50 m. What is the expected output? How does it compare to the paper? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:48: cmd.AddValue ("nodeSpeed", "Node speed in RandomWayPoint model, Default:20", nodeSpeed); CommandLine will print the default value automatically in the message generated by '--help'; no need to put the default in the help string. (In fact, putting the default in the help string is undesirable: the default has to be updated in two place. Notice that you already have this problem with nodeSpeed: the default is 10, but your string says 20.) https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:57: cmd.Parse (argc,argv); Need space ' ' after comma ',' Please fix this in all files. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:65: * */ */ is sufficient. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" Well, is it? Why? On 2013/12/30 23:11:11, mjf.alenazi wrote: > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Is config-store-module.h needed? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/wsc... File src/epidemic/examples/wscript (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/wsc... src/epidemic/examples/wscript:6: obj = bld.create_ns3_program('epidemic-benchmark', ['epidemic']) obj.source = 'epidemic-benchmark.cc' https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:36: Need include guards in all .h files. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:40: * \ingroup aodv \ingroup epidemic https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** * Add an epidemic::RoutingProtocol object to to a node. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:41: namespace epidemic { I would prefer "namespace Epidemic" as more in line with ns-3 naming guidelines. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:177: if (i->second.GetExpireTime () < Seconds (0)) Shouldn't this be GetExpireTime () < Now ()? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:43: class QueueEntry Yes, for exposed API. Purely internal classes used in a single .cc file can/should be declared and defined in the .cc file. On 2013/12/30 23:11:11, mjf.alenazi wrote: > I thought you want the implementation in the .cc files and the definitions in > the .h files > https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... > > > On 2013/12/10 00:02:33, Peter Barnes wrote: > > Can you just forward declare the QueueEntry class here, and put the entire > class > > declaration in epidemic-packet-queue.cc? (Looks like with a few more &'s that > > would work, and reduce the exposed implementation.) > https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; Then shouldn't they be private? On 2013/12/30 23:11:11, mjf.alenazi wrote: > They are used in the QueueEntry constructer. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > what do these callbacks do? They don't seem to be used anywhere. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:66: //\{ I'd prefer you didn't do this grouping, but won't insist. These functions still need doxygen. On 2013/12/30 23:11:11, mjf.alenazi wrote: > I have been trying to follow the AODV docs. AODV is not always a good reference… > On 2013/12/10 00:02:33, Peter Barnes wrote: > > This just groups these functions under a heading "Fields", which isn't very > > useful, and doesn't qualify as useful documentation. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:108: PacketQueue (uint64_t maxLen, Time queueTimeout) Not done. On 2013/12/30 23:11:11, mjf.alenazi wrote: > On 2013/12/08 22:24:26, Tom Henderson wrote: > > document parameters; what is "routeToQueueTimeout"? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:49: TypeId TypeHeader::GetTypeId () TypeId TypeHeader::GetTypeId () on all function definitions. On 2013/12/30 23:11:11, mjf.alenazi wrote: > I did not understand what you mean here? > On 2013/12/10 00:02:33, Peter Barnes wrote: > > I prefer return type on a separate line than the function name, as in the > > previous patch. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:41: EPIDEMIC_TYPE_BEACON = 1, //!< EPIDEMIC_TYPE_BEACON 1. Not helpful to just repeat the symbol name. What does the symbol *mean*? This would be easier if the enum was part of the epidemic::TypeHeader class: EPIDEMIC_TYPE_BEACON = 1, //!< Beacon packet to advertise node presence. (Sorry, should have said this earlier.) 2. Is the value specified in the paper? If it is, then specify it here as you did "=1" to ensure interoperability. If it's not in the paper, then let it get auto-assigned: EPIDEMIC_TYPE_BEACON, EPIDEMIC_TYPE_REPLY, EPIDEMIC_TYPE_REPLY_BACK } https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:42: EPIDEMIC_TYPE_REPLY = 2, //!< EPIDEMIC_TYPE_REPLY //!< Reply to a beacon, with the packet Id summary vector. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:43: EPIDEMIC_TYPE_REPLY_BACK = 3, //!< EPIDEMIC_TYPE_REPLY_BACK //!< Response to a Reply packet, with the list of disjoint packets. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:50: * \brief Epidemic routing packets come in three types:: See previous comment on this line. Your edit now includes the long description in the brief summary. (Also, single ':') https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:68: * \brief Epidemic types A single \brief, please, at the beginning of the comment. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:70: class TypeHeader : public Header Seems like TypeHeader and EpidemicHeader could/should be combined into one header. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:94: void SetInstanceTypeId (MessageType type); SetMessageType () https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:114: * \return info about this packet No return https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:119: MessageType Get () const; GetMessageType () https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:127: /// flag What defines "valid"? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:168: class EpidemicSummaryVectorHeader : public Header Since this is already in namespace ns3::epidemic, please rename this SummaryVectorHeader (without the redundant "Epidemic"). Even better would be something like PacketListHeader, which is more descriptive of its function. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:201: static inline std::ostream & operator<< (std::ostream& os, const EpidemicSummaryVectorHeader & packet) static std::ostream & operator<< (…) Move the implementation to epidemic-packet.cc On 2013/12/30 23:11:11, mjf.alenazi wrote: > Followed the AODV example. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Why is this static and inline? See e.g. Mac48Address where operator<< is > > > > std::ostream& operator<< (std::ostream& os, const Mac48Address & address); https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:243: class EpidemicHeader : public Header Seems like TypeHeader and EpidemicHeader could/should be combined into one header. Since this is already in namespace ns3::epidemic, could you rename this just class Header : public ns3::Header https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:71: .AddAttribute ("QueueEntryExpireTime","Time in seconds after which a packet in the queue will expire.", They shouldn't be: they should differ by at least the channel propagation delay. So which is it? On 2013/12/30 23:11:11, mjf.alenazi wrote: > Time after enqueuing on the local node or the packet originated both are the > same. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Time after enqueuing on the local node, or time after which it was originally > > sent? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:75: .AddAttribute ("BeaconInterval","Time in seconds after which a beacon packet is broadcast.", Please clarify: according to the code, this is the minimum time between beacons (up to 100 ms uniformly random gets added) On 2013/12/30 23:11:11, mjf.alenazi wrote: > Time specified in seconds + some milliseconds to avoid collisions. > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Mean time, or exact time? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:127: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); I'm not sure this is what you want. If I understand correctly, each Start, and each SendBeacon, gets an *independent* UniformRandomVariable. The starting point for each depends on the initialization order of *all* other random variables, which makes the behavior of a single node unreproducible if anything in the model changes (such as the number of nodes). I think the r.v object should be part of the router (not a new one created each time you need a r.v), and should be accessible via attribute, in order to deterministically set the stream number, at least. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:287: * Control packets generated at this node, are tagged with EpedemicTag. EpidemicTag https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:300: if ( tag.GetEpidemicTag () != -1) -1 is the magic default tag value. This should be an enum constant in EpidemicTag, or a function test IsDefault(), or even better, IsData(). https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:303: * if the packet is not tagged, it means a data packet This is a misuse of Tags. Tags are not present in real network packets; don't use Tags to implement protocols. If you need this information, you have to encode it into the protocol itself, typically in the protocol header. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:376: EpidemicHeader epidemicHeader; This is unused (but gcc doesn't warn?!?) https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:68: /// Transport Port for MANET routing protocols ports "ports, based on \RFC{5498}" https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:74: Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr); // Inherited methods: https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:109: uint32_t findOutputDeviceForAddress ( Ipv4Address dst); CamelCase: Find... https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:135: /// Tag used by epidemic implementation \ingroup epidemic https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:136: class EpidemicTag : public Tag NO. Tom was suggesting moving the *declaration* to a header, such as epidemic-tag.h. The *definitions* should go to a .cc file, such as epidemic-tag.cc. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:141: EpidemicTag (int32_t o = -1) : Tag (), Default value should be an enum, or you should have a IsDefault() checking function, so user code doesn't get littered with "== -1" magic numbers. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:187: void Deserialize (TagBuffer i) IIRC, DeSerialize should return the number of bytes consumed.
Sign in to reply to this message.
I have run the style-check.py before submitting the code using this command find . -type f -name "*.cc" -o -name "*.h" | xargs -I '{}' ../../utils/check-style.py -f '{}' -i $1 -l 3 For the error I mentioned earlier in src/epidemic/examples/epidemic-benchmark.cc I forget to say that the error would appear if the queue length is large for example 2000. I think the error appear because of the summary vector packet length header becomes larger than allowed length i.e 2^16. I am just speculating. Could someone please confirm that. If it's confirmed, what would be a good solution for that? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:14: `the ResiliNets research group <http://www.ittc.ku.edu/resilinets>`_ On 2014/01/07 23:57:09, Peter Barnes wrote: > the `ResiliNets... Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:40: epidemic.Set ("BeaconInterval", UintegerValue (1)); On 2014/01/07 23:57:09, Peter Barnes wrote: > I think Tom is suggesting that you delete this code sample; all the parameters > are better documented in the table which follows. Besides, this same block > appears later in the doc, so it's redundant here. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > > > > What are these statements included for? > > > > Done. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:47: | HopCount | Maximum number of hops a packet | 64 | where exactly? On 2014/01/07 23:57:09, Peter Barnes wrote: > Please put this explanation in the docs. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > This does not depend on the TTL. I try to increment the TTL in each node so > the > > packet does not drop because of the TTL. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Can you explain somewhere how HopCount interacts with the IP TTL? Is IP TTL > > > regenerated each hop? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:55: | | network-wide is synchronization | | On 2014/01/07 23:57:09, Peter Barnes wrote: > … at the source. Network … > (Punctuate sentences.) Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:60: | | added to avoid collision | | On 2014/01/07 23:57:09, Peter Barnes wrote: > What is the random distribution? Is this configurable? > How much randomness is introduced? Is this configurable? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:68: in your simulation script. For instance::: On 2014/01/07 23:57:09, Peter Barnes wrote: > Only 2 ':' > http://sphinx-doc.org/rest.html#source-code Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:71: epidemic.Set ("HopCount", UintegerValue (64)); On 2014/01/07 23:57:09, Peter Barnes wrote: > Suggest using non-default values for clarity. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:75: mainNodes.Install (epidemic, adhocNodes); I really do not know. On 2014/01/07 23:57:09, Peter Barnes wrote: > (Bump: Tom's first Q not addressed) > On 2013/12/08 22:24:26, Tom Henderson wrote: > > Clarify, does Install() have to be called before or after the Internet stack > is > > added? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:77: The epidemic.Set() statements are needed On 2014/01/07 23:57:09, Peter Barnes wrote: > ``epidemic.Set ()`` Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:84: The example can be found in ``src/epidemic/examples/epidemic-example.cc`` On 2014/01/07 23:57:09, Peter Barnes wrote: > It's helpful to say a bit here, so the reader knows what they might find there. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > I explained these in the example itself. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Please say a bit more about this example; what does it do and what options > > > does it provide to the user? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:96: ********** On 2014/01/07 23:57:09, Peter Barnes wrote: > *********** > (Underline has to be same length as section title text) Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:17: the default is set to 50 m. There are several scenarios. The results are in the paper. I have not started comparing them in details. I will once I fix large epidemic queue length problem. It throws an error because I suspect that the the header size of the summary vector packet exceeds 2^16. On 2014/01/07 23:57:09, Peter Barnes wrote: > What is the expected output? How does it compare to the paper? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:48: cmd.AddValue ("nodeSpeed", "Node speed in RandomWayPoint model, Default:20", nodeSpeed); On 2014/01/07 23:57:09, Peter Barnes wrote: > CommandLine will print the default value automatically in the message generated > by '--help'; no need to put the default in the help string. (In fact, putting > the default in the help string is undesirable: the default has to be updated in > two place. Notice that you already have this problem with nodeSpeed: the > default is 10, but your string says 20.) Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:57: cmd.Parse (argc,argv); On 2014/01/07 23:57:09, Peter Barnes wrote: > Need space ' ' after comma ',' Please fix this in all files. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:65: * */ On 2014/01/07 23:57:09, Peter Barnes wrote: > */ is sufficient. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" On 2014/01/07 23:57:09, Peter Barnes wrote: > Well, is it? Why? > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Is config-store-module.h needed? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/wsc... File src/epidemic/examples/wscript (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/examples/wsc... src/epidemic/examples/wscript:6: On 2014/01/07 23:57:09, Peter Barnes wrote: > obj = bld.create_ns3_program('epidemic-benchmark', ['epidemic']) > obj.source = 'epidemic-benchmark.cc' Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:40: * \ingroup aodv On 2014/01/07 23:57:09, Peter Barnes wrote: > \ingroup epidemic Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:40: * \ingroup aodv On 2014/01/07 23:57:09, Peter Barnes wrote: > \ingroup epidemic Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** On 2014/01/07 23:57:09, Peter Barnes wrote: > * Add an epidemic::RoutingProtocol object to to a node. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:41: namespace epidemic { On 2014/01/07 23:57:09, Peter Barnes wrote: > I would prefer "namespace Epidemic" as more in line with ns-3 naming guidelines. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:177: if (i->second.GetExpireTime () < Seconds (0)) On 2014/01/07 23:57:09, Peter Barnes wrote: > Shouldn't this be GetExpireTime () < Now ()? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:43: class QueueEntry I tried to move the QueueEntry class definition and implementation to epidemic-packet-queue.cc but it generated many errors that I could not solve. Then I did undo. If you can help me with that, I would appreciate it. On 2014/01/07 23:57:09, Peter Barnes wrote: > Yes, for exposed API. Purely internal classes used in a single .cc file > can/should be declared and defined in the .cc file. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > I thought you want the implementation in the .cc files and the definitions in > > the .h files > > > https://codereview.appspot.com/13831049/diff/17001/src/epidemic/model/epidemi... > > > > > > On 2013/12/10 00:02:33, Peter Barnes wrote: > > > Can you just forward declare the QueueEntry class here, and put the entire > > class > > > declaration in epidemic-packet-queue.cc? (Looks like with a few more &'s > that > > > would work, and reduce the exposed implementation.) > > > https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; What do you mean by private? On 2014/01/07 23:57:09, Peter Barnes wrote: > Then shouldn't they be private? > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > They are used in the QueueEntry constructer. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > what do these callbacks do? They don't seem to be used anywhere. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:108: PacketQueue (uint64_t maxLen, Time queueTimeout) On 2014/01/07 23:57:09, Peter Barnes wrote: > Not done. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > document parameters; what is "routeToQueueTimeout"? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:49: TypeId TypeHeader::GetTypeId () On 2014/01/07 23:57:09, Peter Barnes wrote: > TypeId > TypeHeader::GetTypeId () > > on all function definitions. > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > I did not understand what you mean here? > > On 2013/12/10 00:02:33, Peter Barnes wrote: > > > I prefer return type on a separate line than the function name, as in the > > > previous patch. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:41: EPIDEMIC_TYPE_BEACON = 1, //!< EPIDEMIC_TYPE_BEACON It is not assigned in the paper. On 2014/01/07 23:57:09, Peter Barnes wrote: > 1. Not helpful to just repeat the symbol name. What does the symbol *mean*? > This would be easier if the enum was part of the epidemic::TypeHeader class: > > EPIDEMIC_TYPE_BEACON = 1, //!< Beacon packet to advertise node presence. > (Sorry, should have said this earlier.) > > 2. Is the value specified in the paper? If it is, then specify it here as you > did "=1" to ensure interoperability. If it's not in the paper, then let it get > auto-assigned: > EPIDEMIC_TYPE_BEACON, > EPIDEMIC_TYPE_REPLY, > EPIDEMIC_TYPE_REPLY_BACK > } https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:41: EPIDEMIC_TYPE_BEACON = 1, //!< EPIDEMIC_TYPE_BEACON On 2014/01/07 23:57:09, Peter Barnes wrote: > 1. Not helpful to just repeat the symbol name. What does the symbol *mean*? > This would be easier if the enum was part of the epidemic::TypeHeader class: > > EPIDEMIC_TYPE_BEACON = 1, //!< Beacon packet to advertise node presence. > (Sorry, should have said this earlier.) > > 2. Is the value specified in the paper? If it is, then specify it here as you > did "=1" to ensure interoperability. If it's not in the paper, then let it get > auto-assigned: > EPIDEMIC_TYPE_BEACON, > EPIDEMIC_TYPE_REPLY, > EPIDEMIC_TYPE_REPLY_BACK > } Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:42: EPIDEMIC_TYPE_REPLY = 2, //!< EPIDEMIC_TYPE_REPLY On 2014/01/07 23:57:09, Peter Barnes wrote: > //!< Reply to a beacon, with the packet Id summary vector. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:43: EPIDEMIC_TYPE_REPLY_BACK = 3, //!< EPIDEMIC_TYPE_REPLY_BACK On 2014/01/07 23:57:09, Peter Barnes wrote: > //!< Response to a Reply packet, with the list of disjoint packets. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:43: EPIDEMIC_TYPE_REPLY_BACK = 3, //!< EPIDEMIC_TYPE_REPLY_BACK On 2014/01/07 23:57:09, Peter Barnes wrote: > //!< Response to a Reply packet, with the list of disjoint packets. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:50: * \brief Epidemic routing packets come in three types:: On 2014/01/07 23:57:09, Peter Barnes wrote: > See previous comment on this line. Your edit now includes the long description > in the brief summary. > > (Also, single ':') Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:68: * \brief Epidemic types On 2014/01/07 23:57:09, Peter Barnes wrote: > A single \brief, please, at the beginning of the comment. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:70: class TypeHeader : public Header No, Type header is for identifying which header is used in the summary vector exchange. Epidemic header is used in the data packets On 2014/01/07 23:57:09, Peter Barnes wrote: > Seems like TypeHeader and EpidemicHeader could/should be combined into one > header. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:94: void SetInstanceTypeId (MessageType type); On 2014/01/07 23:57:09, Peter Barnes wrote: > SetMessageType () Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:114: * \return info about this packet On 2014/01/07 23:57:09, Peter Barnes wrote: > No return Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:119: MessageType Get () const; On 2014/01/07 23:57:09, Peter Barnes wrote: > GetMessageType () Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:119: MessageType Get () const; On 2014/01/07 23:57:09, Peter Barnes wrote: > GetMessageType () Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:127: /// flag In the TypeHeader::Deserialize fucntions On 2014/01/07 23:57:09, Peter Barnes wrote: > What defines "valid"? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:168: class EpidemicSummaryVectorHeader : public Header On 2014/01/07 23:57:09, Peter Barnes wrote: > Since this is already in namespace ns3::epidemic, please rename this > SummaryVectorHeader (without the redundant "Epidemic"). Even better would be > something like PacketListHeader, which is more descriptive of its function. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:201: static inline std::ostream & operator<< (std::ostream& os, const EpidemicSummaryVectorHeader & packet) On 2014/01/07 23:57:09, Peter Barnes wrote: > static std::ostream & operator<< (…) > > Move the implementation to epidemic-packet.cc > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > Followed the AODV example. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Why is this static and inline? See e.g. Mac48Address where operator<< is > > > > > > std::ostream& operator<< (std::ostream& os, const Mac48Address & address); Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:243: class EpidemicHeader : public Header No, Type header is for identifying which header is used in the summary vector exchange. Epidemic header is used in the data packets On 2014/01/07 23:57:09, Peter Barnes wrote: > Seems like TypeHeader and EpidemicHeader could/should be combined into one > header. > > Since this is already in namespace ns3::epidemic, could you rename this just > class Header : public ns3::Header https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:71: .AddAttribute ("QueueEntryExpireTime","Time in seconds after which a packet in the queue will expire.", On 2014/01/07 23:57:09, Peter Barnes wrote: > They shouldn't be: they should differ by at least the channel propagation > delay. So which is it? > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > Time after enqueuing on the local node or the packet originated both are the > > same. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Time after enqueuing on the local node, or time after which it was > originally > > > sent? Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:75: .AddAttribute ("BeaconInterval","Time in seconds after which a beacon packet is broadcast.", I have added a new parameter to configure this time. On 2014/01/07 23:57:09, Peter Barnes wrote: > Please clarify: according to the code, this is the minimum time between beacons > (up to 100 ms uniformly random gets added) > On 2013/12/30 23:11:11, mjf.alenazi wrote: > > Time specified in seconds + some milliseconds to avoid collisions. > > On 2013/12/08 22:24:26, Tom Henderson wrote: > > > Mean time, or exact time? https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:127: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); I really do not understand the new stream uniform random variable. Could you please fix it so it is unreproducible. On 2014/01/07 23:57:09, Peter Barnes wrote: > I'm not sure this is what you want. If I understand correctly, each Start, and > each SendBeacon, gets an *independent* UniformRandomVariable. The starting point > for each depends on the initialization order of *all* other random variables, > which makes the behavior of a single node unreproducible if anything in the > model changes (such as the number of nodes). I think the r.v object should be > part of the router (not a new one created each time you need a r.v), and should > be accessible via attribute, in order to deterministically set the stream > number, at least. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:287: * Control packets generated at this node, are tagged with EpedemicTag. On 2014/01/07 23:57:09, Peter Barnes wrote: > EpidemicTag Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:300: if ( tag.GetEpidemicTag () != -1) Are IsDefault() and IsData() standard functions or should I implement them myself. On 2014/01/07 23:57:09, Peter Barnes wrote: > -1 is the magic default tag value. This should be an enum constant in > EpidemicTag, or a function test IsDefault(), or even better, IsData(). https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:303: * if the packet is not tagged, it means a data packet I am just trying to see if the packet is generated at the source. In the routeoutput function, the source is always not defined. If there is another way, please let me know. I even filed this as a bug but Tom it's OK https://www.nsnam.org/bugzilla/show_bug.cgi?id=1480 On 2014/01/07 23:57:09, Peter Barnes wrote: > This is a misuse of Tags. Tags are not present in real network packets; don't > use Tags to implement protocols. If you need this information, you have to > encode it into the protocol itself, typically in the protocol header. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:376: EpidemicHeader epidemicHeader; On 2014/01/07 23:57:09, Peter Barnes wrote: > This is unused (but gcc doesn't warn?!?) Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:68: /// Transport Port for MANET routing protocols ports On 2014/01/07 23:57:09, Peter Barnes wrote: > "ports, based on \RFC{5498}" Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:74: Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr); On 2014/01/07 23:57:09, Peter Barnes wrote: > // Inherited methods: Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:109: uint32_t findOutputDeviceForAddress ( Ipv4Address dst); On 2014/01/07 23:57:09, Peter Barnes wrote: > CamelCase: Find... Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:135: /// Tag used by epidemic implementation On 2014/01/07 23:57:09, Peter Barnes wrote: > \ingroup epidemic Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:141: EpidemicTag (int32_t o = -1) : Tag (), On 2014/01/07 23:57:09, Peter Barnes wrote: > Default value should be an enum, or you should have a IsDefault() checking > function, so user code doesn't get littered with "== -1" magic numbers. Done. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:187: void Deserialize (TagBuffer i) It is inherited from tag.h and this is how it's defined On 2014/01/07 23:57:09, Peter Barnes wrote: > IIRC, DeSerialize should return the number of bytes consumed. https://codereview.appspot.com/13831049/diff/105001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:187: void Deserialize (TagBuffer i) On 2014/01/07 23:57:09, Peter Barnes wrote: > IIRC, DeSerialize should return the number of bytes consumed. Done.
Sign in to reply to this message.
Overall making great progress. Still missing lots of doxygen, and a number of earlier comments are not addressed. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:8: designed specifically for use in multi-hop wireless ad hoc networks (See patch-3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:22: for Partially-Connected Ad Hoc Networks.'[1] Footnote: "…Networks.'[#Vahdat]]_" Then below: .. [#Vahdat] ... https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:24: In the original paper, the implementation was on top of top of Duplicated text "top of" https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:35: Epidemic routing supports these options::: Single `:' https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:43: | | can be forwarded through | | (See patch-3 comment): Can you explain *here* how HopCount interacts with the IP TTL? Is IP TTL regenerated each hop? https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:50: | | Network-wide is synchronization | | Delete "is" https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:68: in your simulation script. For instance:: "…instance (assuming ``mainNodes`` is a ``NodeContainer``):: https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:73: This will run the epidemic routing using the default values. To use different parameter values End line with `::' https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:79: mainNodes.Install (epidemic, adhocNodes); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:88: The example can be found in ``src/epidemic/examples/epidemic-example.cc`` Put this sentence first: One example can be found in ``src/epidemic/examples/epidemic-example.cc`` This example creates … Same for next paragraph. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:13: for Partially-Connected Ad Hoc Networks.'. We have 50 nodes in an area of 1500 m x 300 m. "…Networks.' We have…" This will use the first sentence as the brief description. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:21: NS_LOG_COMPONENT_DEFINE ("EpidemicBenchmark"); You define a log component, but you never use it. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:45: CommandLine cmd; Consider adding a usage message: cmd.Usage (…) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:16: #include <time.h> (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:21: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:37: bool app_logging = true; (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:52: SeedManager::SetSeed (7); (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:78: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:89: ); (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:104: wifiPhy.SetChannel (wifiChannel.Create ()); (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:119: epidemic.Set ("BeaconInterval", TimeValue (Seconds (1))); (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:142: uint32_t sink_num = 9; (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: #include "ns3/names.h" (See comment on patch 3) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:60: * \param add an epidemic::RoutingProtocol object to to a node. Patch 3 version was correct: "\param node Add an …" https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); Still need (at least) function logging. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:43: class QueueEntry (See patch-3 comment) Public API should be declared in .h. Private implementation classes used in only one .cc can be declared there directly, just as you did for EpidemicSummaryVectorHeader https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:66: //\{ (See patch-3 comment) Please don't group these functions. Document them as normal. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:111: * \return info about this packet Constructors don't have return values. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:141: /// Type define PacketIdMap I can see that the next line defines a type, so that's not helpful documentation. What is the type used for? Something like "Type to connect a global Packet id to a QueueEntry." https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:143: /// Type define PacketIdMapPair Ditto. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:222: (See patch-3) Restore operator << for each class, but not static and not inline. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); (See patch-3 comment) ping Tom for help. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:232: EpidemicTag tempTag (1); This constant should be in an enum. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:233: packet->AddPacketTag (tempTag); (See patch-3 comment) Document when tag will be removed. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:235: Simulator::Schedule (MilliSeconds (uv->GetValue ()),&RoutingProtocol::BroadcastPacket,this, packet); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:241: RoutingProtocol::FindOutputDeviceForAddress (Ipv4Address dst) (See patch-3 comment) Perhaps rename to reflect the semantics? FindSubnetDeviceForAddress? https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:263: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:272: bool (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:315: p->PeekPacketTag (tag); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:589: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); (See patch-3 comment) Still needed in doxygen. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:646: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:697: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:91: //\{ (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:103: //\}, (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:40: class EpidemicTag : public Tag Document what this tag is used for. As far as i can tell, this tag is used solely to mark beacon packets, which are required by the protocol. This seems redundant with the EPIDEMIC_TYPE_BEACON value in TypeHeader. In addition, since tags don't appear on real packets, they should only be used as a simulation convenience, not for required functions of the protocol. You should encode the beacon in the protocol packet itself. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:45: EpidemicTag (int32_t o = -1) : Tag (), This constant (-1) should be an enum. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:99: NS_TEST_EXPECT_MSG_EQ (q.GetMaxQueueLen (), 64, "trivial"); Labeling every test as "trivial" is no help when one fails; which one was it? Give each test a descriptive string, as you did above. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "trivial"); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); (See patch-3 comment) What about reproducing results from the paper?
Sign in to reply to this message.
Hi I have one suggestion for this patch. Since one of the key metrics when comparing routing protocols is the overhead, I would like to see a trace source for any control message e.g. Beacons, Reply, Reply_Back. I guess that the most obvious location to trigger this trace would be in RoutingProtocol::BroadcastPacket (Ptr<Packet> p) and in RoutingProtocol::SendPacket (Ptr<Packet> p). I do not think you need different traces for the diffent types, since you can get the header information. Regards, K.
Sign in to reply to this message.
I have just submitted patch 6. I've run the check-style.py before submitting. I have changed the global packet ID size from 64bit to 32bit to match the paper. Basically, I selected the most left first 16 bit as a host ID. Before, the whole IPv4 address was the host ID. Also, I have tried to fix all the stuff that I could fix. For the tests, I initially tried to DSR and I could not find the documentation to generate more tests. For the epidemic tag, please read my reasoning in the corresponding question below. If you have a solution, please let me know. Thank you https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:8: designed specifically for use in multi-hop wireless ad hoc networks On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:22: for Partially-Connected Ad Hoc Networks.'[1] On 2014/03/10 22:36:53, Peter Barnes wrote: > Footnote: "…Networks.'[#Vahdat]]_" > > Then below: > .. [#Vahdat] ... Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:24: In the original paper, the implementation was on top of top of On 2014/03/10 22:36:53, Peter Barnes wrote: > Duplicated text "top of" Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:35: Epidemic routing supports these options::: On 2014/03/10 22:36:53, Peter Barnes wrote: > Single `:' Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:43: | | can be forwarded through | | On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment): Can you explain *here* how HopCount interacts with the > IP TTL? Is IP TTL regenerated each hop? Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:50: | | Network-wide is synchronization | | On 2014/03/10 22:36:53, Peter Barnes wrote: > Delete "is" Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:68: in your simulation script. For instance:: On 2014/03/10 22:36:53, Peter Barnes wrote: > "…instance (assuming ``mainNodes`` is a ``NodeContainer``):: Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:73: This will run the epidemic routing using the default values. To use different parameter values On 2014/03/10 22:36:53, Peter Barnes wrote: > End line with `::' Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:79: mainNodes.Install (epidemic, adhocNodes); On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:88: The example can be found in ``src/epidemic/examples/epidemic-example.cc`` On 2014/03/10 22:36:53, Peter Barnes wrote: > Put this sentence first: > One example can be found in ``src/epidemic/examples/epidemic-example.cc`` This > example creates … > > Same for next paragraph. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:13: for Partially-Connected Ad Hoc Networks.'. We have 50 nodes in an area of 1500 m x 300 m. I did not understand On 2014/03/10 22:36:53, Peter Barnes wrote: > "…Networks.' > > We have…" > > This will use the first sentence as the brief description. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:21: NS_LOG_COMPONENT_DEFINE ("EpidemicBenchmark"); On 2014/03/10 22:36:53, Peter Barnes wrote: > You define a log component, but you never use it. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:45: CommandLine cmd; On 2014/03/10 22:36:53, Peter Barnes wrote: > Consider adding a usage message: cmd.Usage (…) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:16: #include <time.h> On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:21: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. This is just a simple scenario to test the protocol. I give two options here. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:37: bool app_logging = true; Yes but it can be changed from the script. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:52: SeedManager::SetSeed (7); No reason. This can be any number but I wanted to have the same results while testing. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:78: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:89: ); These are from the paper. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:104: wifiPhy.SetChannel (wifiChannel.Create ()); On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:119: epidemic.Set ("BeaconInterval", TimeValue (Seconds (1))); It does not matter but I was experimenting with other parameters and I thought I would just keep it for the user as well. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:142: uint32_t sink_num = 9; The user can change it from the script. Again, this is just a simple example to show that epidemic forwarding works. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: #include "ns3/names.h" On 2014/03/10 22:36:53, Peter Barnes wrote: > (See comment on patch 3) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:60: * \param add an epidemic::RoutingProtocol object to to a node. On 2014/03/10 22:36:53, Peter Barnes wrote: > Patch 3 version was correct: > "\param node Add an …" Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); On 2014/03/10 22:36:53, Peter Barnes wrote: > Still need (at least) function logging. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:66: //\{ On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) > Please don't group these functions. Document them as normal. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:111: * \return info about this packet On 2014/03/10 22:36:53, Peter Barnes wrote: > Constructors don't have return values. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:143: /// Type define PacketIdMapPair I have not written these lines of code. Could you please propose a documentation. On 2014/03/10 22:36:53, Peter Barnes wrote: > Ditto. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:222: Can you elaborate here? I still did not understand. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3) > Restore operator << for each class, but not static and not inline. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) ping Tom for help. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:91: //\{ On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:103: //\}, On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:40: class EpidemicTag : public Tag I am using tags to tag control packets so I know that they are control packets before I remove the header. I do not know how to distinguish between packets. Another problem is that the source address in the route output function is not set. I have asked a question before here https://www.nsnam.org/bugzilla/show_bug.cgi?id=1480 On 2014/03/10 22:36:53, Peter Barnes wrote: > Document what this tag is used for. > > As far as i can tell, this tag is used solely to mark beacon packets, which are > required by the protocol. This seems redundant with the EPIDEMIC_TYPE_BEACON > value in TypeHeader. > > In addition, since tags don't appear on real packets, they should only be used > as a simulation convenience, not for required functions of the protocol. You > should encode the beacon in the protocol packet itself. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:45: EpidemicTag (int32_t o = -1) : Tag (), Could you please suggest a solution to this? Thank you On 2014/03/10 22:36:53, Peter Barnes wrote: > This constant (-1) should be an enum. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); To be honest, I do not know how this works. I was following some examples such as DSR. This is what I found. If you can suggest similar examples, that would be great. On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:99: NS_TEST_EXPECT_MSG_EQ (q.GetMaxQueueLen (), 64, "trivial"); On 2014/03/10 22:36:53, Peter Barnes wrote: > Labeling every test as "trivial" is no help when one fails; which one was it? > Give each test a descriptive string, as you did above. Done. https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "trivial"); Can you suggest specific examples? On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/125001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); I will write a paper about the implementation and compare the results. I am planning to do it for the upcoming WNS315 On 2014/03/10 22:36:53, Peter Barnes wrote: > (See patch-3 comment) > What about reproducing results from the paper?
Sign in to reply to this message.
(Sorry I took so long to look at your latest.) Much good progress. Biggest remaining issues are: - Include guards needed in all headers. - Too many comments from patch-3 are unaddressed. The rest of my comments are inline. Peter https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:39: */ (See patch-3 comment.) Following existing code is fine, except when it's not. This is one of those cases. This comment block defines the doxygen module epidemic and describes the module as a whole. It has to go in a source code file to be read by doxygen. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:9: of mobile nodes. This routing protocol is designed for intermittent Please give one or two sentences explaining the protocol idea. (IIRC, store incoming packets; when two nodes come into contact exchange the packets they don't already have in common; expire packets when too old or too many hops.) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:14: the 'ResiliNets research group <http://www.ittc.ku.edu/resilinets>`_ `Resilinets Backtick, not apostrophe. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:22: for Partially-Connected Ad Hoc Networks.'[#Vahdat] [#Vahdat]_ Trailing underscore. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:28: is not implemented in ns-3, a beacon mechanism is added to the implementation. |ns3| https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:37: The parameters have the following meanings and default values: The preceding two sentences are redundant. Pick one. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:47: | | packet does not get dropped. | | (See patch-3 comment) Why not just use TTL? The HopCount serves the same function. (If it's because the paper uses a HopCount, then document that, or explain that you use TTL as the hop count, which would be more natural.) (Hours later:) I just found out why: TTL is 8-bit; HopCount is 32 bits, so you allow for a much higher limit. Please state that reason here. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:64: +-----------------------+-----------------------------------+---------------+ This would be a good place to explain the conditions under which a packet gets dropped (IIRC these are HopCount exceeded or older than QueueEntryExpireTime) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:77: This will run the epidemic routing using the default values. To use different parameter values:: Need a blank line between `::' and first line of code. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:93: example creates the scenarios presented the the paper titled 'Epidemic Routing "presented in the paper. [#Vahdat]_ We have" https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:111: Epidemic does not work with more then one address per each interface. Ignore added address "interface. Additional addresses are ignored." https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:13: for Partially-Connected Ad Hoc Networks'. We have 50 nodes in an area of 1500 m x 300 m. On 2014/05/28 21:57:41, mjf.alenazi wrote: > I did not understand > On 2014/03/10 22:36:53, Peter Barnes wrote: > > "…Networks.' > > > > We have…" > > > > This will use the first sentence as the brief description. Two changes: Networks.' (period before apostrophe) Blank line before next sentence. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:44: CommandLine cmd; (See patch-3 comment: reject w/ reason or edit the file) You haven't addressed this comment, so please don't say `Done'. If you are rejecting the comment, please say so and explain why. If you are accepting the comment, please actually make the change. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:47: cmd.AddValue ("nodeSpeed", "Node speed in RandomWayPoint model, Default:20", nodeSpeed); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:56: cmd.Parse (argc,argv); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:63: * Enabling OnOffApplication and PacketSink logging (See patch-3 comment) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:13: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. (See patch-3 comment: reject w/ reason or edit the file) Please at least document the reason. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:19: NS_LOG_COMPONENT_DEFINE ("EpidemicScript"); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:30: (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:44: // The seed is fixed to get the same results every run. For your testing? Better to make this command line settable. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:71: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:82: ); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:97: wifiPhy.SetChannel (wifiChannel.Create ()); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:112: epidemic.Set ("BeaconInterval", TimeValue (Seconds (1))); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:135: uint32_t sink_num = 9; (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:36: (See patch-4 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:60: * \param add an epidemic::RoutingProtocol object to to a node. \param node Add... https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; Is this necessary? Seems to obfuscate that this is just an ordinary callback, as used by every routing protocol. If it has to stay, it needs better documentation of under what conditions it will get called. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:49: typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback; Is this necessary? Seems to obfuscate that this is just an ordinary callback, as used by every routing protocol. If it has to stay, it needs better documentation of under what conditions it will get called. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:152: /// Type define PacketIdMapPair (See patch-5) Look at the comment on the variable created with this typedef. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:181: return 4 + (int32_t) m_packets.size () * 4; Use sizeof(). Future proof and portable, and documents what will be serialized. uint32_t size = sizeof(m_packets.size()) + (uint32_t) m_packets.size () * sizeof (uint32_t); https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:323: return 16; Use sizeof() for each component. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:40: enum MessageType Why isn't this in the TypeHeader class? If it's going to stay here, the enum needs doxygen, or the values don't generate any output. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:100: void SetInstanceType (MessageType type); (See patch-4 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:132: /// flag (See patch-3 comment: reject w/ reason or edit the file) Please don't make the reader search the code for where this gets set, just to figure out what defines valid. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:173: class EpidemicSummaryVectorHeader : public Header (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:184: ///\name Fields Are these all inherited functions from Header? Then you don't need to document them; doxygen will reuse the documentation from Header. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:215: std::vector<uint32_t> m_packets; Doxygen got lost https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:222: Please keep the printing functions operator<<, just make them ordinary (not static or inline). https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:266: class EpidemicHeader : public Header (See patch-3 comment: reject w/ reason or edit the file) Rename to Header (in namespace ns3::Epidemic already, so EpidemicHeader is redundant) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:272: EpidemicHeader (uint32_t pkt_ID = 0,uint32_t hopCount = 0, Time timeStamp = Seconds (0)); Document arguments https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:277: ///\name Header serialization/deserialization Ditto documentation comment on inherited functions. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:233: packet->AddPacketTag (tempTag); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:263: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) (See patch-3 comment) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:272: bool (See patch-3 comment) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:320: p->PeekPacketTag (tag); (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:654: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); No. This creates a new UniformRandomVariable each iteration, which can never be controlled by the user. Instead, make m_beaconRandomness a UniformRandomVariable, then just get the next value from that. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:705: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); Again, no. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:93: uint32_t m_HopCount; m_hopCount https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:100: /// Upper bond of the uniform distribution random time added to avoid collisions. Measured in milliseconds bound https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:106: /// A mat between opened sockets and IP addresses map https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:111: Timer m_BeaconTimer; m_beaconTimer https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:39: */ /** * \ingroup epidemic * Tag used to … */ https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:10: #include "ns3/mesh-helper.h" (See patch-3 comment.) Why do you need mesh-helper? https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); (See patch-3 comment.) See patch-3 comment on line 134 where Tom gave several good examples. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); (See patch-3 comment.) Tom gave several good examples. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); (See patch-3 comment.) Please make some more involved test cases with code reproducing results from the paper.
Sign in to reply to this message.
I have fixed inline comments. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:39: */ Again, I was trying to follow DSR style. I am not sure what you want me to do. On 2014/07/22 19:25:48, Peter Barnes wrote: > (See patch-3 comment.) > > Following existing code is fine, except when it's not. This is one of those > cases. > > This comment block defines the doxygen module epidemic and describes the module > as a whole. It has to go in a source code file to be read by doxygen. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:9: of mobile nodes. This routing protocol is designed for intermittent On 2014/07/22 19:25:49, Peter Barnes wrote: > Please give one or two sentences explaining the protocol idea. (IIRC, store > incoming packets; when two nodes come into contact exchange the packets they > don't already have in common; expire packets when too old or too many hops.) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:14: the 'ResiliNets research group <http://www.ittc.ku.edu/resilinets>`_ On 2014/07/22 19:25:49, Peter Barnes wrote: > `Resilinets > > Backtick, not apostrophe. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:22: for Partially-Connected Ad Hoc Networks.'[#Vahdat] On 2014/07/22 19:25:49, Peter Barnes wrote: > [#Vahdat]_ > > Trailing underscore. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:28: is not implemented in ns-3, a beacon mechanism is added to the implementation. On 2014/07/22 19:25:48, Peter Barnes wrote: > |ns3| Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:37: The parameters have the following meanings and default values: On 2014/07/22 19:25:49, Peter Barnes wrote: > The preceding two sentences are redundant. Pick one. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:47: | | packet does not get dropped. | | On 2014/07/22 19:25:48, Peter Barnes wrote: > (See patch-3 comment) > > Why not just use TTL? The HopCount serves the same function. (If it's because > the paper uses a HopCount, then document that, or explain that you use TTL as > the hop count, which would be more natural.) > > (Hours later:) I just found out why: TTL is 8-bit; HopCount is 32 bits, so you > allow for a much higher limit. Please state that reason here. Acknowledged. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:64: +-----------------------+-----------------------------------+---------------+ On 2014/07/22 19:25:48, Peter Barnes wrote: > This would be a good place to explain the conditions under which a packet gets > dropped (IIRC these are HopCount exceeded or older than QueueEntryExpireTime) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:77: This will run the epidemic routing using the default values. To use different parameter values:: On 2014/07/22 19:25:49, Peter Barnes wrote: > Need a blank line between `::' and first line of code. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:93: example creates the scenarios presented the the paper titled 'Epidemic Routing On 2014/07/22 19:25:49, Peter Barnes wrote: > "presented in the paper. [#Vahdat]_ We have" Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:111: Epidemic does not work with more then one address per each interface. Ignore added address On 2014/07/22 19:25:48, Peter Barnes wrote: > "interface. Additional addresses are ignored." Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:13: for Partially-Connected Ad Hoc Networks'. We have 50 nodes in an area of 1500 m x 300 m. On 2014/07/22 19:25:49, Peter Barnes wrote: > On 2014/05/28 21:57:41, mjf.alenazi wrote: > > I did not understand > > On 2014/03/10 22:36:53, Peter Barnes wrote: > > > "…Networks.' > > > > > > We have…" > > > > > > This will use the first sentence as the brief description. > > Two changes: > > Networks.' (period before apostrophe) > > Blank line before next sentence. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:44: CommandLine cmd; On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) > > You haven't addressed this comment, so please don't say `Done'. If you are > rejecting the comment, please say so and explain why. > > If you are accepting the comment, please actually make the change. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:47: cmd.AddValue ("nodeSpeed", "Node speed in RandomWayPoint model, Default:20", nodeSpeed); On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:56: cmd.Parse (argc,argv); On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:5: #include "ns3/config-store-module.h" On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:13: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. The user can use either Grid or RandomWaypoint. Grid is a simple verification example. On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) > > Please at least document the reason. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:19: NS_LOG_COMPONENT_DEFINE ("EpidemicScript"); On 2014/07/22 19:25:50, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:30: On 2014/07/22 19:25:50, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:44: // The seed is fixed to get the same results every run. On 2014/07/22 19:25:50, Peter Barnes wrote: > For your testing? Better to make this command line settable. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:71: "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=30]")); On 2014/07/22 19:25:50, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:82: ); On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:97: wifiPhy.SetChannel (wifiChannel.Create ()); Users can check the RangePropagationLoss model docs for more details or implications on the distance. threshold. On 2014/07/22 19:25:49, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:112: epidemic.Set ("BeaconInterval", TimeValue (Seconds (1))); Now they can be set using cmd On 2014/07/22 19:25:50, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:135: uint32_t sink_num = 9; Now they can be set using cmd On 2014/07/22 19:25:50, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:60: * \param add an epidemic::RoutingProtocol object to to a node. On 2014/07/22 19:25:50, Peter Barnes wrote: > \param node Add... Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; I am following AODV here. I tried to remove them and put Ipv4RoutingProtocol::UnicastForwardCallback instead but it did not work. Can you suggest better docs? On 2014/07/22 19:25:50, Peter Barnes wrote: > Is this necessary? Seems to obfuscate that this is just an ordinary callback, > as used by every routing protocol. > > If it has to stay, it needs better documentation of under what conditions it > will get called. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:181: return 4 + (int32_t) m_packets.size () * 4; On 2014/07/22 19:25:50, Peter Barnes wrote: > Use sizeof(). Future proof and portable, and documents what will be serialized. > > uint32_t size = sizeof(m_packets.size()) > + (uint32_t) m_packets.size () * sizeof (uint32_t); Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:323: return 16; On 2014/07/22 19:25:50, Peter Barnes wrote: > Use sizeof() for each component. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:40: enum MessageType I am just following AODV. On 2014/07/22 19:25:51, Peter Barnes wrote: > Why isn't this in the TypeHeader class? If it's going to stay here, the enum > needs doxygen, or the values don't generate any output. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:100: void SetInstanceType (MessageType type); GetMessageType() is already used. On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-4 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:132: /// flag On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) > > Please don't make the reader search the code for where this gets set, just to > figure out what defines valid. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:173: class EpidemicSummaryVectorHeader : public Header On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:184: ///\name Fields Yes, they are in inherited functions from Header. On 2014/07/22 19:25:50, Peter Barnes wrote: > Are these all inherited functions from Header? Then you don't need to document > them; doxygen will reuse the documentation from Header. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:215: std::vector<uint32_t> m_packets; On 2014/07/22 19:25:51, Peter Barnes wrote: > Doxygen got lost Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:222: On 2014/07/22 19:25:51, Peter Barnes wrote: > Please keep the printing functions operator<<, just make them ordinary (not > static or inline). Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:266: class EpidemicHeader : public Header On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) > > Rename to Header (in namespace ns3::Epidemic already, so EpidemicHeader is > redundant) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:272: EpidemicHeader (uint32_t pkt_ID = 0,uint32_t hopCount = 0, Time timeStamp = Seconds (0)); On 2014/07/22 19:25:51, Peter Barnes wrote: > Document arguments Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:233: packet->AddPacketTag (tempTag); On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:263: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) I tried but I could not get it to work. On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:272: bool I tried pv4::IsDestinationAddress() but it did not work. If you can fix it and send me how to do it. On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:320: p->PeekPacketTag (tag); This is just a packet tag peek. I an not adding a tag On 2014/07/22 19:25:51, Peter Barnes wrote: > (See patch-3 comment: reject w/ reason or edit the file) https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:654: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); On 2014/07/22 19:25:51, Peter Barnes wrote: > No. This creates a new UniformRandomVariable each iteration, which can never be > controlled by the user. > > Instead, make m_beaconRandomness a UniformRandomVariable, then just get the next > value from that. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:705: Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); On 2014/07/22 19:25:51, Peter Barnes wrote: > Again, no. Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:93: uint32_t m_HopCount; On 2014/07/22 19:25:51, Peter Barnes wrote: > m_hopCount Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:100: /// Upper bond of the uniform distribution random time added to avoid collisions. Measured in milliseconds On 2014/07/22 19:25:52, Peter Barnes wrote: > bound Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:106: /// A mat between opened sockets and IP addresses On 2014/07/22 19:25:52, Peter Barnes wrote: > map Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:111: Timer m_BeaconTimer; On 2014/07/22 19:25:52, Peter Barnes wrote: > m_beaconTimer Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:39: */ On 2014/07/22 19:25:52, Peter Barnes wrote: > /** > * \ingroup epidemic > * Tag used to … > */ Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); I could not find examples to follow in building the suggested cases. On 2014/07/22 19:25:52, Peter Barnes wrote: > (See patch-3 comment.) > > See patch-3 comment on line 134 where Tom gave several good examples. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); I could not find examples to follow in building the suggested cases. On 2014/07/22 19:25:52, Peter Barnes wrote: > (See patch-3 comment.) > > Tom gave several good examples. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); I had difficult time building test cases. If someone can help me with that, would appropriate it. On 2014/07/22 19:25:52, Peter Barnes wrote: > (See patch-3 comment.) > > Please make some more involved test cases with code reproducing results from the > paper.
Sign in to reply to this message.
Hi, I'll not comment every line, but I'd strongly suggest to improve the documentation. 1) src/epidemic/docs/epidemic.h move the file content to the start of src/epidemic/model/epidemic-routing-protocol.h 2) be consistent with the namespace capitalization. In the doxygen the result is this: RoutingProtocol (ns3::olsr) RoutingProtocol (ns3::dsdv) RoutingProtocol (ns3::aodv) RoutingProtocol (ns3::Epidemic) RoutingProtocol (ns3::epidemic) I am not sure if this may cause further issues, but I bet it can. 2a) I'm strongly against calling a class "RoutingProtocol", even if it's 'protected' by a namespace. However, this is more a personal opinion than a coded rule. 3) there are a couple of "caught" doxygen errors: src/epidemic/model/epidemic-packet.h:272: warning: parameters of member ns3::Epidemic::EpidemicHeader::EpidemicHeader are not (all) documented src/epidemic/model/epidemic-packet.h:184: warning: Member GetTypeId(void) (function) of class ns3::Epidemic::EpidemicSummaryVectorHeader is not documented. 4) there are a number of silently accepted doxygen errors... which are errors, nonetheless. E.g.: /// Send a packet to a given IP address void SendPacket (Ptr<Packet> p,InetSocketAddress addr); all the parameters are not documented. This is repeated for all the private functions. Please document them as well, docs are for the maintainers as well. 5) /// c-tor This translates to a "c-tor" note on the constructor. Do not document the constructors, doxygen does it by itself. 6) As a general rule, inspect the generated documentation and see if it is "ok". I'll try to do a more in-depth review in the next days.
Sign in to reply to this message.
- Include guards needed in all headers. - Too many comments from prior patches are unaddressed. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); On 2014/08/02 19:15:12, mjf.alenazi wrote: > I had difficult time building test cases. If someone can help me with that, > would appropriate it. Basically you duplicate the example code, and check that it produces the expected results. It may seem silly the first time, since the test is just for the results produced by the example, but it helps catch bugs introduced with later commits, since they may change the behavior in unintended ways. By hard-coding the expected result here in a test case, you help catch future bugs. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contract, disjoint "contact" https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:17: the 'ResiliNets research group <http://www.ittc.ku.edu/resilinets>'_ You went the wrong way. Sphinx needs back ticks ` not apostrophes ' https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:49: | | packet does not get dropped. | | (See patch-6 comment.) Still need to state the reason. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:87: epidemic.Set ("HopCount", UintegerValue (64)); (See comment patch-4) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:101: example creates the scenariospresented in the paper. [#Vahdat]_ We have 50 nodes in an area of 1500 m x 300 m. scenariospresented (missing space) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:19: the default is set to 50 m. (See comment patch-4) If you want to defer this, put in a todo: \todo Compare to results from the paper https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:46: CommandLine cmd; (See patch-5 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:12: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. (See patch-3 comment) If Grid is just for verification, then perhaps the default should be RandomWayPoint. In any case, explain *in the doxy comment* why the chosen default makes sense. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:15: */ Also see patch-3 comment on line 142. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:29: uint32_t seed = 7; (See patch-3 comment, line 52): Why make the default seed 7 explicitly? Actually, why have an explicit seed at all? The user can already set the seed, see https://www.nsnam.org/docs/release/3.20/manual/singlehtml/index.html#seeding-... https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:48: CommandLine cmd; Usage message. This could be another way to address comment patch-3 line 142 https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:138: wifiPhy.SetChannel (wifiChannel.Create ()); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:36: (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** (See comment patch-4) /** * Add an epidemic::RoutingProtocol object. * * \param node the node on which the routing protocol will run. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); (See patch-5 comment) Add NS_LOG_FUNCTION (…) to each function in this file, besides trivial Get and Set functions. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; (See patch-4 comment) (See patch-6 comment) When you say it didn't work, what didn't work? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:49: typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback; (See patch-6 comment) When you say it didn't work, what didn't work? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:152: /// Type define PacketIdMapPair (See patch-5 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:40: enum MessageType (See patch-6 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:100: void SetInstanceType (MessageType type); (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:125: /// Check that type if MessageType value is set correctly and not corrupted. ? Unclear https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:132: /// flag (See patch-6 comment) Document the valid conditions here; don't make me search the code. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:173: class EpidemicSummaryVectorHeader : public Header (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:273: * pkt_ID global packet ID \param pkt_ID global … Similar for all arguments https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:282: ///\name Header serialization/deserialization (See patch-6 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:80: .AddAttribute ("BeaconRandomness","Upper bond of the uniform distribution random time " "bound" https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: m_beaconRandomnessDistro = CreateObject<UniformRandomVariable> (); Add m_beaconRandomnessDistro->SetAttribute ("Max", DoubleValue (m_beaconMaxJitterMs)); https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:139: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness)); (With added line above): … m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue ()); https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:232: EpidemicTag tempTag (1); The magic value 1 should be an enum constant in class EpidemicTag. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:234: packet->AddPacketTag (tempTag); (See patch-3 comment) What do you mean by "before local delivery"? In what function? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:236: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness),&RoutingProtocol::BroadcastPacket,this, packet); (See comment line 139) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:237: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness)); (See comment line 139) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:264: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:273: bool (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:321: p->PeekPacketTag (tag); (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:331: if ( tag.GetEpidemicTag () != -1) (See patch-4 comment) The magic value 1 should be an enum constant in class EpidemicTag. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:334: * if the packet is not tagged, it means a data packet (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:472: //ADD EPIDEMIC HEADER (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:598: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); (See patch-3 comment) Where in the docs is this restriction? I can't find it. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:656: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness), (See comment line 139) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:706: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness), (See comment line 139) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:101: /// Upper bound of the uniform distribution random time added to avoid collisions. Measured in milliseconds Suggest m_beaconMaxJitterMs https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:113: /// unifrom random variable to be added to beacon intervals to avoid collisions "uniform" Suggest m_beaconJitter https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:39: */ Delete redundant comment block https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:46: class EpidemicTag : public Tag (See comment patch-5) You can't use Packet tags to implement a protocol. Use the EPIDEMIC_TYPE_BEACON value in TypeHeader as suggested. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:51: EpidemicTag (int32_t o = -1) : Tag (), (See patch-4 comment) when this was in epidemic-routing-protocol.cc The magic value -1 should be an enum constant in class EpidemicTag. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:10: #include "ns3/mesh-helper.h" (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); (See patch-3 comment.)
Sign in to reply to this message.
https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ On 2014/07/22 19:25:52, Peter Barnes wrote: > (See patch-3 comment.) Done. https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:10: #include "ns3/mesh-helper.h" I removed the mesh-helper On 2014/07/22 19:25:52, Peter Barnes wrote: > (See patch-3 comment.) > > Why do you need mesh-helper? https://codereview.appspot.com/13831049/diff/145001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); I understand the request but I do not know how to do it. If you can give me a simple example code to follow, that would be great. On 2014/09/12 20:33:47, Peter Barnes wrote: > On 2014/08/02 19:15:12, mjf.alenazi wrote: > > I had difficult time building test cases. If someone can help me with that, > > would appropriate it. > Basically you duplicate the example code, and check that it produces the > expected results. It may seem silly the first time, since the test is just for > the results produced by the example, but it helps catch bugs introduced with > later commits, since they may change the behavior in unintended ways. By > hard-coding the expected result here in a test case, you help catch future bugs. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contract, disjoint On 2014/09/12 20:33:47, Peter Barnes wrote: > "contact" Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:17: the 'ResiliNets research group <http://www.ittc.ku.edu/resilinets>'_ On 2014/09/12 20:33:47, Peter Barnes wrote: > You went the wrong way. Sphinx needs back ticks ` not apostrophes ' Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:49: | | packet does not get dropped. | | The reason is that Hop count is parameter is used in the original paper. On 2014/09/12 20:33:47, Peter Barnes wrote: > (See patch-6 comment.) Still need to state the reason. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:87: epidemic.Set ("HopCount", UintegerValue (64)); On 2014/09/12 20:33:47, Peter Barnes wrote: > (See comment patch-4) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:101: example creates the scenariospresented in the paper. [#Vahdat]_ We have 50 nodes in an area of 1500 m x 300 m. On 2014/09/12 20:33:47, Peter Barnes wrote: > scenariospresented (missing space) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:19: the default is set to 50 m. This scenario was moved to examples/epidemic-benchmark.cc I can not state the expected results here. They are shown in the original paper. On 2014/09/12 20:33:47, Peter Barnes wrote: > (See comment patch-4) > If you want to defer this, put in a todo: > > \todo Compare to results from the paper https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:46: CommandLine cmd; On 2014/09/12 20:33:47, Peter Barnes wrote: > (See patch-5 comment) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:12: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. I cannot think of a way to explain why I choose these default values. These values are not constants. They can be changed by the user. I had to put choose some values and I choose these. On 2014/09/12 20:33:47, Peter Barnes wrote: > (See patch-3 comment) > If Grid is just for verification, then perhaps the default should be > RandomWayPoint. > > In any case, explain *in the doxy comment* why the chosen default makes sense. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:15: */ On 2014/09/12 20:33:48, Peter Barnes wrote: > Also see patch-3 comment on line 142. Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:29: uint32_t seed = 7; On 2014/09/12 20:33:47, Peter Barnes wrote: > (See patch-3 comment, line 52): Why make the default seed 7 explicitly? > > Actually, why have an explicit seed at all? The user can already set the seed, > see > https://www.nsnam.org/docs/release/3.20/manual/singlehtml/index.html#seeding-... Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:29: uint32_t seed = 7; On 2014/09/12 20:33:47, Peter Barnes wrote: > (See patch-3 comment, line 52): Why make the default seed 7 explicitly? > > Actually, why have an explicit seed at all? The user can already set the seed, > see > https://www.nsnam.org/docs/release/3.20/manual/singlehtml/index.html#seeding-... Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:48: CommandLine cmd; On 2014/09/12 20:33:47, Peter Barnes wrote: > Usage message. This could be another way to address comment patch-3 line 142 Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:138: wifiPhy.SetChannel (wifiChannel.Create ()); I do not know the implications on the distance threshold. Could you please tell me what to write here? On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:36: They are included in this file line 29 &30. I have included guards in the other .h files On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** I did not understand what's required here. On 2014/09/12 20:33:48, Peter Barnes wrote: > (See comment patch-4) > /** > * Add an epidemic::RoutingProtocol object. > * > * \param node the node on which the routing protocol will run. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-5 comment) > Add NS_LOG_FUNCTION (…) to each function in this file, besides trivial Get and > Set functions. Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; When I remove the typedef, it does not recognize UnicastForwardCallback. I tried to use Ipv4RoutingProtocol::UnicastForwardCallback but it did not work either. On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-4 comment) > (See patch-6 comment) > When you say it didn't work, what didn't work? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:49: typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback; Same reason above On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-6 comment) > When you say it didn't work, what didn't work? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:152: /// Type define PacketIdMapPair I have not written these lines of code. Could you please propose a documentation. On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-5 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:40: enum MessageType On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-6 comment) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:100: void SetInstanceType (MessageType type); On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-4 comment) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:125: /// Check that type if MessageType value is set correctly and not corrupted. On 2014/09/12 20:33:48, Peter Barnes wrote: > ? Unclear Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:173: class EpidemicSummaryVectorHeader : public Header This name matches the paper function name. On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:273: * pkt_ID global packet ID On 2014/09/12 20:33:48, Peter Barnes wrote: > \param pkt_ID global … > Similar for all arguments Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:282: ///\name Header serialization/deserialization Should I remove the comments here? I do not understand. On 2014/09/12 20:33:48, Peter Barnes wrote: > (See patch-6 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:80: .AddAttribute ("BeaconRandomness","Upper bond of the uniform distribution random time " On 2014/09/12 20:33:49, Peter Barnes wrote: > "bound" Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: m_beaconRandomnessDistro = CreateObject<UniformRandomVariable> (); On 2014/09/12 20:33:49, Peter Barnes wrote: > Add > > m_beaconRandomnessDistro->SetAttribute ("Max", DoubleValue > (m_beaconMaxJitterMs)); Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:139: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness)); On 2014/09/12 20:33:49, Peter Barnes wrote: > (With added line above): > … m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue ()); Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:232: EpidemicTag tempTag (1); On 2014/09/12 20:33:49, Peter Barnes wrote: > The magic value 1 should be an enum constant in class EpidemicTag. Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:234: packet->AddPacketTag (tempTag); Before the data packet is sent to transport layer at the destination host. On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-3 comment) > What do you mean by "before local delivery"? In what function? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:236: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness),&RoutingProtocol::BroadcastPacket,this, packet); On 2014/09/12 20:33:49, Peter Barnes wrote: > (See comment line 139) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:237: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness)); On 2014/09/12 20:33:49, Peter Barnes wrote: > (See comment line 139) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:264: if (iface.GetLocal () == Ipv4Address ("127.0.0.1") ) I could not do it. Can you help me with this one? On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:273: bool I tried pv4::IsDestinationAddress() but it did not work. If you can fix it and send me how to do it. On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:321: p->PeekPacketTag (tag); Before the data packet is sent to transport layer at the destination host. On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-3 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:331: if ( tag.GetEpidemicTag () != -1) On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-4 comment) > The magic value 1 should be an enum constant in class EpidemicTag. Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:334: * if the packet is not tagged, it means a data packet I am just trying to see if the packet is generated at the source. In the routeoutput function, the source is always not defined. If there is another way, please let me know. I even filed this as a bug but Tom it's OK https://www.nsnam.org/bugzilla/show_bug.cgi?id=1480 On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-4 comment) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:472: //ADD EPIDEMIC HEADER On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:598: NS_LOG_LOGIC ("Epidemic does not work with more then one address per each interface. Ignore added address"); in LIMITATIONS in epidemic.rst On 2014/09/12 20:33:49, Peter Barnes wrote: > (See patch-3 comment) > Where in the docs is this restriction? I can't find it. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:656: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness), On 2014/09/12 20:33:49, Peter Barnes wrote: > (See comment line 139) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:706: Simulator::Schedule (MilliSeconds (m_beaconRandomnessDistro->GetValue () * m_beaconRandomness), On 2014/09/12 20:33:50, Peter Barnes wrote: > (See comment line 139) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:101: /// Upper bound of the uniform distribution random time added to avoid collisions. Measured in milliseconds On 2014/09/12 20:33:50, Peter Barnes wrote: > Suggest m_beaconMaxJitterMs Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:113: /// unifrom random variable to be added to beacon intervals to avoid collisions On 2014/09/12 20:33:50, Peter Barnes wrote: > "uniform" > Suggest m_beaconJitter Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:39: */ On 2014/09/12 20:33:50, Peter Barnes wrote: > Delete redundant comment block Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:46: class EpidemicTag : public Tag I could not distinguish between control packets and data packets in the route input function. If you can help me with that, I will remove this tag. On 2014/09/12 20:33:50, Peter Barnes wrote: > (See comment patch-5) > You can't use Packet tags to implement a protocol. Use the EPIDEMIC_TYPE_BEACON > value in TypeHeader as suggested. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:51: EpidemicTag (int32_t o = -1) : Tag (), On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-4 comment) when this was in epidemic-routing-protocol.cc > The magic value -1 should be an enum constant in class EpidemicTag. Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment.) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:10: #include "ns3/mesh-helper.h" On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment.) Done. https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:69: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); Again, I can not write more because I do not know how. I tried to follow other protocols tests. If you can help me with that, I will be happy to do it. On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:136: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); Again, I can not write more because I do not know how. I tried to follow other protocols tests. If you can help me with that, I will be happy to do it. On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment.) https://codereview.appspot.com/13831049/diff/165001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:151: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); Again, I can not write more because I do not know how. I tried to follow other protocols tests. If you can help me with that, I will be happy to do it. On 2014/09/12 20:33:50, Peter Barnes wrote: > (See patch-3 comment.)
Sign in to reply to this message.
1. Source formatting ------------------ Please remove multiple blank lines in the middle of functions. Please clean up indentation. Please ensure lines are much longer than 80 chars. 2. m_valid --------- @TomH: I don't understand the need for m_valid in class Epidemic::TypeHeader (epidemic-packet.h). m_type is an enum value, which is serialized and deserialized, so how can it be invalid? The corresponding predicate function IsValid isn't even implemented. I see AODV (which was the implementation model for epidemic) does the same thing (but it *does* implement IsValid, and calls it). It seems like the only way either Epidemic or AODV TypeHeaders can be invalid is if they are deserialized from a packet which didn't have the corresponding header, and the relevant data deserialized happened not to match a valid TypeHeader value. How can such a mistaken header extraction occur? 3. Use of PacketTags ------------------ You use a PacketTag (in epidemic-routing-protocol.cc) to communication protocol information. This smells like an abuse of PacketTags. I think you use this to distinguish Beacon and SummaryVector packets from data packets in RouteInput and RouteOutput. @TomH: isn't there a better way? https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/165001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback; The actual compiler error message would help. Please include that next time someone asks for more detail. Suggested resolution is in comment to patch 8. On 2014/09/18 00:34:25, mjf.alenazi wrote: > When I remove the typedef, it does not recognize UnicastForwardCallback. > I tried to use Ipv4RoutingProtocol::UnicastForwardCallback but it did not work > either. > On 2014/09/12 20:33:48, Peter Barnes wrote: > > (See patch-4 comment) > > (See patch-6 comment) > > When you say it didn't work, what didn't work? > https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:39: */ (See comment patch 3). https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contact, disjoint receiver's buffer. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:49: | | packet does not get dropped. | | Not done. Explanations in the code review comments are helpful only to the reviewers. Please add the explanations *to the documentation* so they are helpful to the users. In this case, I gave you the explanation to put in the documentation: HopCount serves a similar function to TTL, but the 8-bit range of TTL is too small, so we use a 32-bit field as in the paper. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:1: #include "ns3/core-module.h" Mode line and copyright. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:19: the default is set to 50 m. The expected results are shown in the paper. Add to this doxygen comment: \todo Compare to Vahdat paper Or reference future paper by Alenazi with results of this comparison. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:47: cmd.Usage ("Benchmark example shows epidemic routing scenario presented in the original paper.\n"); Please add a few sentences describing the model, as you did in epidemic.rst. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:60: Write to std::cout the values of command line options: std::cout << "Number of wifi nodes: " << nWifis << std::endl; etc. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:1: #include "ns3/core-module.h" Mode line and copyright. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:11: This example creates an N-node wireless network, which is set by default to 10 nodes. "The wireless channel is configured to use the RangePropagationLossModel, so packets will be received only when the communicating nodes are closer than the configured distance." https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:12: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. "…either RandomDiscPositionAllocator with SteadyStateRandomWaypointMobilityModel (the default) or GridPositionAllocator with ConstantPositionMobilityModel." For each case, describe the initial position distribution and mobility bounds https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:52: cmd.Usage ("Simple example shows basic epidemic routing scenario.\n"); Please expand this with the model description from the doxygen at the top of the file. Users should be able to learn what the model is, and what the command line arguments mean, from reading the Usage message. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:65: cmd.Parse (argc, argv); Validate command args. For example, source_num and sink_num should be less than nWifis. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:66: Write the values of all command line arguments to std::cout. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:123: "MaxY", DoubleValue (1500.0) You constrain the mobility to [0, 300] in x, [0, 1500] in y, but you center the initial positions around (300, 1500), i.e. a corner of the mobility box. In other words, 3/4 of the nodes will start outside the mobility box. Is this intentional? How about centering the initial positions at the center of the box (150, 750)? What did Vahdat do? Please document which of these values come from the paper. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: NS_LOG_COMPONENT_DEFINE ("EpidemicHelper"); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:35: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:39: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:44: { NS_LOG_FUNCTION (); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:49: { NS_LOG_FUNCTION (this << node); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:56: { NS_LOG_FUNCTION (this << name << value); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** Start this doxygen with: /** * Add an epidemic::RoutingProtocol object. * * \param node the node on which the routing protocol will run. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); Should be before any namespaces. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:47: typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback; Delete these two lines; they are already defined in epidemic-packet-queue.h https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:58: UnicastForwardCallback QueueEntry::UnicastForwardCallback https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:70: ErrorCallback QueueEntry::ErrorCallback https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:90: { NS_LOG_FUNCTION (this << p); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:102: { NS_LOG_FUNCTION (this << h); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:108: { NS_LOG_FUNCTION (this << exp); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:126: { NS_LOG_FUNCTION (this << id); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:139: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << entry); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:149: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << entry); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:170: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << len); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:177: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << packetId); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:199: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << oldestOnly); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:221: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << en->second.GetPacketId () << reason); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:222: NS_LOG_INFO ("dropping packet with ID: " << en->second.GetPacketID () << ", reason: " << reason); Delete this line. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:245: NS_LOG_FUNCTION (this ); NS_LOG_FUNCTION (this << list); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:37: #define EPIDEMIC_PACKET_QUEUE_H Include guard should appear before any includes. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:50: /// Redefine UnicastForwardCallback Please expand this doc to: "/// Class local synonym for ns3::Ipv4RoutingProtocol::UnicastForwardCallback" Please include the fully qualified name, as above; a forthcoming patch to document callback signatures will need it. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:52: /// Redefine ErrorCallback Ditto previous comment. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:156: /// Type define PacketIdMapPair /// Pair representing a global Packet Id and a QueueEntry https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:36: NS_LOG_COMPONENT_DEFINE ("EpidemicPacket"); This should be two lines earlier, outside of any namespaces. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:68: { NS_LOG_FUNCTION (this << type); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:92: case EPIDEMIC_TYPE_BEACON: (With MessageType local to class TypeHeader): case BEACON Same below https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:141: MessageType (With MessageType local to class TypeHeader): TypeHeader::MessageType https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:146: bool TypeHeader::IsMessageType (const MessageType type) const { return m_type == type; } https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:158: { NS_LOG_FUNCTION (this << size); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:163: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:229: os << " Summary_vector Size: " << m_packets.size (); Consider printing the contents of this header, i.e. the packet ids. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:234: { NS_LOG_FUNCTION (this << pkt_ID); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:261: { NS_LOG_FUNCTION (this << hopCount << timeStamp); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:270: { NS_LOG_FUNCTION (this << pktID); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:283: { NS_LOG_FUNCTION (this << floodCount); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:296: { NS_LOG_FUNCTION (this << timeStamp); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:36: #define EPIDEMIC_PACKET_H Include guard should go before any includes. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:42: enum MessageType This enum should be a public enum in class TypeHeader, below. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:44: EPIDEMIC_TYPE_BEACON, //!< Advertise the presence of a node (When moved to class TypeHeader) Remove "EPIDEMIC_TYPE_" prefix from these enum values, since they will always appear as TypeHeader::BEACON, etc. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:126: MessageType GetMessageType () const; Insert this function: /** * Check if this TypeHeader is of the indicated MessageType. * * \param type The expected message type * \return true if \p type matches the MessageType of this TypeHeader */ bool IsMessageType (const MessageType type) const; https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:127: /// Check that type if MessageType value is valid. "of" https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:134: /// flag (See patch-6 comment) Document the valid conditions here; don't make me search the code. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:142: * \ingroup summaryVectorHeader \ingroup epidemic https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:229: * \ingroup Header \ingroup epidemic https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:285: //\{ Delete the two previous comment lines. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:292: //\} Delete this comment line. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:55: NS_LOG_COMPONENT_DEFINE ("EpidemicRoutingProtocol"); This should be before any namespaces. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:100: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:104: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:109: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: m_beaconJitter = CreateObject<UniformRandomVariable> (); Add m_beaconRandomnessDistro->SetAttribute ("Max", DoubleValue (m_beaconMaxJitterMs)); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:139: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs)); (With added line above): … m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue ()); Actually, it looks like you add jitter both to scheduling the next SendBeacons, and in scheduling the resulting BroadcastPacket. I think you should be doing one, not both. @TomH: comments? https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:149: NS_LOG_FUNCTION (this << *p); NS_LOG_FUNCTION (this << p << addr); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:169: NS_LOG_FUNCTION (this); NS_LOG_FUNCTION (this << p); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:195: NS_LOG_FUNCTION (this << "Queue Sending Packet " << dst ); NS_LOG_FUNCTION (this << dst << queueEntry); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:224: NS_LOG_FUNCTION (this << "Broadcasting Beacons"); NS_LOG_FUNCTION (this); (You don't need to add the "Broadcasting.." string, since the NS_LOG_FUNCTION will already show the function name, "SendBeacons") https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:229: packet->AddHeader (header); The preceding four lines seem unnecessary. You don't need even read the EpidemicHeader when you receive the beacon packet in RecvEpidemic. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:230: TypeHeader tHeader (EPIDEMIC_TYPE_BEACON); (With MessageType local to class TypeHeader): TypeHeader::BEACON Same below https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:232: EpidemicTag tempTag (EPIDEMIC_TAG_TYPE_CONTROL); (With enum TagType in class EpidemicTag): tempTag (EpidemicTag::CONTROL) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:233: // Packet tag is added and will be removed before local delivery This is insufficient response to Tom's Q on patch 7: In what function is this tag removed? https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:236: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs),&RoutingProtocol::BroadcastPacket,this, packet); (See comments line 139) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:237: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs)); (See comments line 139) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:243: { NS_LOG_FUNCTION (this << dst); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:259: { NS_LOG_FUNCTION (this); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:275: { NS_LOG_FUNCTION (this << src); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:296: NS_LOG_FUNCTION (this << p << header << oif << sockerr); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:297: NS_LOG_FUNCTION (this << "Packet Size" << p->GetSize () << " Packet " << p->GetUid () NS_LOG_LOGIC ("Packet size" …) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:321: p->PeekPacketTag (tag); (See prior comments.) Add to the prior code comment when and where this tag is removed. Also, these lines should be moved to just before line 331 where the tag is examined. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:331: if ( tag.GetEpidemicTag () != EPIDEMIC_TAG_TYPE_NOT_SET) (With enum TagType in class EpidemicTag): if ( tag.IsTagType (EpidemicTag::NOT_SET) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:334: * if the packet is not tagged, it means a data packet The packet *is* tagged, so fix this comment. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:418: if (tag.GetEpidemicTag () == EPIDEMIC_TAG_TYPE_NOT_SET) (With enum TagType in class EpidemicTag): if ( tag.IsTagType (EpidemicTag::NOT_SET) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:432: // Remove the packet header for delivery What does this comment mean? The EpidemicHeader was already removed from local_copy. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:444: local_copy->RemoveAllPacketTags (); This will remove *all* tags, even those not used by EpidemicRouting. This should probably be RemovePacketTag() https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:455: This condition is called one the packet is originated locally and does not have an epidemic header I think you mean "This condition occurs when the packet is originated locally and does not have an Epidemic header." https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:476: new_epidemicHeader.SetHopCount (m_hopCount); Move the preceding 6 lines to after line 483 where new_epidemic gets used. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:520: NS_LOG_FUNCTION (this); NS_LOG_FUNCTION (this << ipv4); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:569: NS_LOG_FUNCTION (this << " interface " << i << " address " << address); NS_LOG_FUNCTION (this << i << address); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:609: NS_LOG_FUNCTION (this); NS_LOG_FUNCTION (this << i << address); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:642: NS_LOG_FUNCTION (this << " send to " << dest); NS_LOG_FUNCTION (this << dest); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:656: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs), (See comment line 139 on altering this line) BUT… why are you adding jitter here? Why the same range as beacons? Presumably the jitter between beacon broadcasts can be a significant fraction of the beacon interval. The beacon interval can be of order the time nodes are within range, given a mobility model. Here, you need to get the disjoint packets sent *before* the nodes go out of range, so you don't' want to delay them by the same amount as beacon jitter. If you really want jitter here, it should be separately controlled than the beacon jitter. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:686: NS_LOG_FUNCTION (this << " sent to " << dest); NS_LOG_FUNCTION (this << dest << firstNode); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:699: packet_summary->AddHeader (header_summary); Move this before the TypeHeader declaration. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:700: EpidemicTag tempTag (EPIDEMIC_TAG_TYPE_CONTROL); (With enum TagType in class EpidemicTag): tempTag (EpidemicTag::CONTROL) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:701: packet_summary->AddHeader (tHeader); Move this before the EpidemicTag declaration. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:706: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs), (See comment line 139 on altering this line) BUT… same questions as line 656. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:725: Ptr<Packet> packet_copy = packet->Copy (); Unused. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:726: if (tHeader.GetMessageType () == EPIDEMIC_TYPE_BEACON) (With MessageType local to class TypeHeader): if (tHeader.IsMessageType (TypeHeader::BEACON)) Same below https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:51: #define EPIDEMIC_ROUTING_PROTOCOL_H Include guard has to go before any includes. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:58: EpidemicTagType EpidemicTag::GetEpidemicTag () const EpidemicTag::TagType EpidemicTag::GetTagType https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:62: bool EpidemicTag::IsTagType (const TagType type) const { return m_tag == type; } https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:64: void EpidemicTag::SetEpidemicTag (EpidemicTagType tag) EpidemicTag::SetTagType (const TagType tag) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:90: case EPIDEMIC_TAG_TYPE_CONTROL: case CONTROL: https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:91: case EPIDEMIC_TAG_TYPE_NOT_SET: case NOT_SET: https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:93: m_tag = (EpidemicTagType) type; (TagType) https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:34: #define EPIDEMIC_TAG_H Include guard should be before any includes. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:47: enum EpidemicTagType This should be a public member of class EpidemicTag, below, in which case it can be named simply enum TagType https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:49: EPIDEMIC_TAG_TYPE_CONTROL, //!< Tagged as control message "EPIDEMIC_TAG_TYPE_" prefix can be dropped, since these will always appear as EpidemicTag::CONTROL, etc. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:61: EpidemicTag (EpidemicTagType o = EPIDEMIC_TAG_TYPE_NOT_SET) : Tag (), (With enum TagType in class EpidemicTag): TagType o = NOT_SET https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:72: EpidemicTagType GetEpidemicTag () const; (With enum TagType in class EpidemicTag): TagType GetTagType https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:73: /** * Check if this EpidemicTag is of the indicated TagType. * * \param type The expected TagType * \return true if \p type matches the TagType of this EpidemicTag. */ bool IsTagType (const TagType type) const; with docs similar to https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:75: void SetEpidemicTag (EpidemicTagType tag); (With enum TagType in class EpidemicTag): SetTagType (const TagType tag); https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: EpidemicTagType m_tag; (With enum TagType in class EpidemicTag): TagType https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:93: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); (See patch 3 comment) Tom gave suggestions. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:160: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); (See patch 3 comment) Tom gave suggestions. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:175: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); (See patch 3 comment) Tom gave suggestions. I gave suggestions.
Sign in to reply to this message.
I have uploaded patch9. For the epidemic routing protocol operation test case, I know the testing scenario but I do not know how to implement it. I've looked at DSDV, AODV, DSR, and others. The scenario is similar to the epidemic example with a linear topology. There are 10 nodes and they are 100 m apart. Their transmission range is 120 m with one sender and one receiver. How can I build this scenario as a unit test and how can I check these conditions: 1. If the packet has been received at the receiver end. 2. Number of packets in each node's epidemic buffer. Thank you https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:64: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); Done. On 2013/12/08 22:24:26, Tom Henderson wrote: > These tests are trivial; what about trying to check around boundary conditions? https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:134: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "trivial"); On 2013/12/08 22:24:26, Tom Henderson wrote: > These tests are all trivial. There should be test cases for e.g. trying to > dequeue from an empty queue, trying to enqueue to a full queue, trying to add > duplicate packets, etc. Done. https://codereview.appspot.com/13831049/diff/85001/src/epidemic/test/epidemic... src/epidemic/test/epidemic-test-suite.cc:148: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); I do know know how to do this. On 2013/12/08 22:24:26, Tom Henderson wrote: > There is no test case for routing protocol operation; how could RoutingProtocol > be unit tested? https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:39: */ On 2014/09/23 22:54:25, Peter Barnes wrote: > (See comment patch 3). Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contact, disjoint Packets are actually stored in the sender's buffer. On 2014/09/23 22:54:25, Peter Barnes wrote: > receiver's buffer. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:49: | | packet does not get dropped. | | On 2014/09/23 22:54:25, Peter Barnes wrote: > Not done. > > Explanations in the code review comments are helpful only to the reviewers. > Please add the explanations *to the documentation* so they are helpful to the > users. > > In this case, I gave you the explanation to put in the documentation: HopCount > serves a similar function to TTL, but the 8-bit range of TTL is too small, so we > use a 32-bit field as in the paper. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:1: #include "ns3/core-module.h" On 2014/09/23 22:54:25, Peter Barnes wrote: > Mode line and copyright. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:19: the default is set to 50 m. The expected results are shown in the paper. On 2014/09/23 22:54:25, Peter Barnes wrote: > Add to this doxygen comment: > > \todo Compare to Vahdat paper > Or reference future paper by Alenazi with results of this comparison. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:47: cmd.Usage ("Benchmark example shows epidemic routing scenario presented in the original paper.\n"); On 2014/09/23 22:54:25, Peter Barnes wrote: > Please add a few sentences describing the model, as you did in epidemic.rst. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:60: On 2014/09/23 22:54:25, Peter Barnes wrote: > Write to std::cout the values of command line options: > > std::cout << "Number of wifi nodes: " << nWifis << std::endl; > > etc. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:1: #include "ns3/core-module.h" On 2014/09/23 22:54:26, Peter Barnes wrote: > Mode line and copyright. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:11: This example creates an N-node wireless network, which is set by default to 10 nodes. Is there a perfect range model. I would like to use it. On 2014/09/23 22:54:25, Peter Barnes wrote: > "The wireless channel is configured to use the RangePropagationLossModel, so > packets will be received only when the communicating nodes are closer than the > configured distance." https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:12: The mobility model can be either static Grid or Randomwaypoint, which by default is selected to be Grid. On 2014/09/23 22:54:25, Peter Barnes wrote: > "…either > RandomDiscPositionAllocator with SteadyStateRandomWaypointMobilityModel (the > default) > or > GridPositionAllocator with ConstantPositionMobilityModel." > > For each case, describe the initial position distribution and mobility bounds Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:52: cmd.Usage ("Simple example shows basic epidemic routing scenario.\n"); On 2014/09/23 22:54:26, Peter Barnes wrote: > Please expand this with the model description from the doxygen at the top of the > file. Users should be able to learn what the model is, and what the command > line arguments mean, from reading the Usage message. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:65: cmd.Parse (argc, argv); On 2014/09/23 22:54:25, Peter Barnes wrote: > Validate command args. For example, source_num and sink_num should be less than > nWifis. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:66: On 2014/09/23 22:54:26, Peter Barnes wrote: > Write the values of all command line arguments to std::cout. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:123: "MaxY", DoubleValue (1500.0) The paper says "Each node picks a random spot in the rectangle and moves there with a speed uniformly distributed between 0-20 m/s". I really do not know how to do that in ns-3. Could you please help me with that? On 2014/09/23 22:54:25, Peter Barnes wrote: > You constrain the mobility to [0, 300] in x, [0, 1500] in y, but you center the > initial positions around (300, 1500), i.e. a corner of the mobility box. In > other words, 3/4 of the nodes will start outside the mobility box. Is this > intentional? How about centering the initial positions at the center of the box > (150, 750)? What did Vahdat do? > > Please document which of these values come from the paper. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_COMPONENT_DEFINE ("EpidemicHelper"); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:35: { On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:39: { On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:44: { On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:49: { On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << node); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:56: { Generated an error. So I removed the value from the log. ../src/epidemic/helper/epidemic-helper.cc: In member function ‘void ns3::EpidemicHelper::Set(std::string, const ns3::AttributeValue&)’: ../src/epidemic/helper/epidemic-helper.cc:61: error: cannot allocate an object of abstract type ‘ns3::AttributeValue’ On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << name << value); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:59: /** On 2014/09/23 22:54:26, Peter Barnes wrote: > Start this doxygen with: > > /** > * Add an epidemic::RoutingProtocol object. > * > * \param node the node on which the routing protocol will run. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:43: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); On 2014/09/23 22:54:26, Peter Barnes wrote: > Should be before any namespaces. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:47: typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback; On 2014/09/23 22:54:26, Peter Barnes wrote: > Delete these two lines; they are already defined in epidemic-packet-queue.h Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:58: UnicastForwardCallback On 2014/09/23 22:54:26, Peter Barnes wrote: > QueueEntry::UnicastForwardCallback Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:70: ErrorCallback On 2014/09/23 22:54:26, Peter Barnes wrote: > QueueEntry::ErrorCallback Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:90: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << p); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:102: { On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << h); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:108: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << exp); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:126: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << id); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:139: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << entry); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:149: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << entry); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:170: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << len); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:177: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << packetId); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:199: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << oldestOnly); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:221: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:26, Peter Barnes wrote: > NS_LOG_FUNCTION (this << en->second.GetPacketId () << reason); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:222: NS_LOG_INFO ("dropping packet with ID: " << en->second.GetPacketID () << ", reason: " << reason); On 2014/09/23 22:54:26, Peter Barnes wrote: > Delete this line. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:245: NS_LOG_FUNCTION (this ); On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << list); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:37: #define EPIDEMIC_PACKET_QUEUE_H On 2014/09/23 22:54:27, Peter Barnes wrote: > Include guard should appear before any includes. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:50: /// Redefine UnicastForwardCallback On 2014/09/23 22:54:27, Peter Barnes wrote: > Please expand this doc to: > "/// Class local synonym for ns3::Ipv4RoutingProtocol::UnicastForwardCallback" > > Please include the fully qualified name, as above; a forthcoming patch to > document callback signatures will need it. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:52: /// Redefine ErrorCallback On 2014/09/23 22:54:27, Peter Barnes wrote: > Ditto previous comment. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:156: /// Type define PacketIdMapPair On 2014/09/23 22:54:27, Peter Barnes wrote: > /// Pair representing a global Packet Id and a QueueEntry Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:36: NS_LOG_COMPONENT_DEFINE ("EpidemicPacket"); On 2014/09/23 22:54:28, Peter Barnes wrote: > This should be two lines earlier, outside of any namespaces. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:68: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << type); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:92: case EPIDEMIC_TYPE_BEACON: On 2014/09/23 22:54:27, Peter Barnes wrote: > (With MessageType local to class TypeHeader): > case BEACON > > Same below Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:141: MessageType On 2014/09/23 22:54:28, Peter Barnes wrote: > (With MessageType local to class TypeHeader): > TypeHeader::MessageType Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:146: On 2014/09/23 22:54:27, Peter Barnes wrote: > bool > TypeHeader::IsMessageType (const MessageType type) const > { > return m_type == type; > } Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:158: { On 2014/09/23 22:54:28, Peter Barnes wrote: > NS_LOG_FUNCTION (this << size); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:163: { On 2014/09/23 22:54:28, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:229: os << " Summary_vector Size: " << m_packets.size (); On 2014/09/23 22:54:28, Peter Barnes wrote: > Consider printing the contents of this header, i.e. the packet ids. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:234: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << pkt_ID); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:261: { On 2014/09/23 22:54:27, Peter Barnes wrote: > NS_LOG_FUNCTION (this << hopCount << timeStamp); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:270: { On 2014/09/23 22:54:28, Peter Barnes wrote: > NS_LOG_FUNCTION (this << pktID); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:283: { On 2014/09/23 22:54:28, Peter Barnes wrote: > NS_LOG_FUNCTION (this << floodCount); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:36: #define EPIDEMIC_PACKET_H On 2014/09/23 22:54:28, Peter Barnes wrote: > Include guard should go before any includes. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:42: enum MessageType On 2014/09/23 22:54:28, Peter Barnes wrote: > This enum should be a public enum in class TypeHeader, below. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:44: EPIDEMIC_TYPE_BEACON, //!< Advertise the presence of a node On 2014/09/23 22:54:28, Peter Barnes wrote: > (When moved to class TypeHeader) > Remove "EPIDEMIC_TYPE_" prefix from these enum values, since they will always > appear as TypeHeader::BEACON, etc. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:126: MessageType GetMessageType () const; On 2014/09/23 22:54:28, Peter Barnes wrote: > Insert this function: > /** > * Check if this TypeHeader is of the indicated MessageType. > * > * \param type The expected message type > * \return true if \p type matches the MessageType of this TypeHeader > */ > bool IsMessageType (const MessageType type) const; Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:127: /// Check that type if MessageType value is valid. On 2014/09/23 22:54:28, Peter Barnes wrote: > "of" Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:134: /// flag On 2014/09/23 22:54:28, Peter Barnes wrote: > (See patch-6 comment) > Document the valid conditions here; don't make me search the code. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:142: * \ingroup summaryVectorHeader On 2014/09/23 22:54:28, Peter Barnes wrote: > \ingroup epidemic Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:229: * \ingroup Header On 2014/09/23 22:54:28, Peter Barnes wrote: > \ingroup epidemic Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:285: //\{ On 2014/09/23 22:54:28, Peter Barnes wrote: > Delete the two previous comment lines. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:292: //\} On 2014/09/23 22:54:28, Peter Barnes wrote: > Delete this comment line. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:55: NS_LOG_COMPONENT_DEFINE ("EpidemicRoutingProtocol"); On 2014/09/23 22:54:29, Peter Barnes wrote: > This should be before any namespaces. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:100: { On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:104: { On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:109: { On 2014/09/23 22:54:31, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:138: m_beaconJitter = CreateObject<UniformRandomVariable> (); On 2014/09/23 22:54:30, Peter Barnes wrote: > Add > > m_beaconRandomnessDistro->SetAttribute ("Max", DoubleValue > (m_beaconMaxJitterMs)); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:139: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs)); On 2014/09/23 22:54:29, Peter Barnes wrote: > (With added line above): > … m_beaconInterval + MilliSeconds (m_beaconRandomnessDistro->GetValue ()); > > Actually, it looks like you add jitter both to scheduling the next SendBeacons, > and in scheduling the resulting BroadcastPacket. I think you should be doing > one, not both. > > @TomH: comments? Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:149: NS_LOG_FUNCTION (this << *p); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << p << addr); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:169: NS_LOG_FUNCTION (this); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << p); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:195: NS_LOG_FUNCTION (this << "Queue Sending Packet " << dst ); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << dst << queueEntry); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:224: NS_LOG_FUNCTION (this << "Broadcasting Beacons"); On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this); > > (You don't need to add the "Broadcasting.." string, since the NS_LOG_FUNCTION > will already show the function name, "SendBeacons") Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:229: packet->AddHeader (header); Here I tag the packet as a control packet so it does not get buffered in the RoutingProtocol::RouteOutput function. On 2014/09/23 22:54:30, Peter Barnes wrote: > The preceding four lines seem unnecessary. You don't need even read the > EpidemicHeader when you receive the beacon packet in RecvEpidemic. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:230: TypeHeader tHeader (EPIDEMIC_TYPE_BEACON); On 2014/09/23 22:54:31, Peter Barnes wrote: > (With MessageType local to class TypeHeader): > TypeHeader::BEACON > > Same below Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:232: EpidemicTag tempTag (EPIDEMIC_TAG_TYPE_CONTROL); On 2014/09/23 22:54:29, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > tempTag (EpidemicTag::CONTROL) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:233: // Packet tag is added and will be removed before local delivery On 2014/09/23 22:54:31, Peter Barnes wrote: > This is insufficient response to Tom's Q on patch 7: > In what function is this tag removed? Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:236: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs),&RoutingProtocol::BroadcastPacket,this, packet); On 2014/09/23 22:54:30, Peter Barnes wrote: > (See comments line 139) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:237: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs)); On 2014/09/23 22:54:30, Peter Barnes wrote: > (See comments line 139) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:243: { On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this << dst); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:259: { On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:275: { On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this << src); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:296: On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << p << header << oif << sockerr); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:297: NS_LOG_FUNCTION (this << "Packet Size" << p->GetSize () << " Packet " << p->GetUid () On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_LOGIC ("Packet size" …) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:321: p->PeekPacketTag (tag); On 2014/09/23 22:54:30, Peter Barnes wrote: > (See prior comments.) > Add to the prior code comment when and where this tag is removed. > > Also, these lines should be moved to just before line 331 where the tag is > examined. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:331: if ( tag.GetEpidemicTag () != EPIDEMIC_TAG_TYPE_NOT_SET) On 2014/09/23 22:54:29, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > if ( tag.IsTagType (EpidemicTag::NOT_SET) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:334: * if the packet is not tagged, it means a data packet I have re-written the comment here. I see that there is a problem, which I can not figure out how to solve. Basically, when an outgoing packet is a control packet, it should be sent to the destination address (either unicast or broadcast). When the outgoing packet is data packet, it should be looped back to the sender so the route input function can buffer it. However, now it is actually working with exact opposite logic. I have checked the functions:FindOutputDeviceForAddress and FindLoopbackDevice and they seem to be working fine. I am not sure if I am using the Ipv4Route object correctly. On 2014/09/23 22:54:31, Peter Barnes wrote: > The packet *is* tagged, so fix this comment. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:418: if (tag.GetEpidemicTag () == EPIDEMIC_TAG_TYPE_NOT_SET) On 2014/09/23 22:54:29, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > if ( tag.IsTagType (EpidemicTag::NOT_SET) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:432: // Remove the packet header for delivery On 2014/09/23 22:54:29, Peter Barnes wrote: > What does this comment mean? The EpidemicHeader was already removed from > local_copy. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:444: local_copy->RemoveAllPacketTags (); On 2014/09/23 22:54:29, Peter Barnes wrote: > This will remove *all* tags, even those not used by EpidemicRouting. This > should probably be RemovePacketTag() Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:455: This condition is called one the packet is originated locally and does not have an epidemic header On 2014/09/23 22:54:29, Peter Barnes wrote: > I think you mean > "This condition occurs when the packet is originated locally and does not have > an Epidemic header." Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:476: new_epidemicHeader.SetHopCount (m_hopCount); On 2014/09/23 22:54:30, Peter Barnes wrote: > Move the preceding 6 lines to after line 483 where new_epidemic gets used. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:520: NS_LOG_FUNCTION (this); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << ipv4); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:569: NS_LOG_FUNCTION (this << " interface " << i << " address " << address); On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this << i << address); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:609: NS_LOG_FUNCTION (this); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << i << address); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:642: NS_LOG_FUNCTION (this << " send to " << dest); On 2014/09/23 22:54:29, Peter Barnes wrote: > NS_LOG_FUNCTION (this << dest); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:656: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs), I tried using Simulator::Schedule (Simulator::Now()... but it did not work. The jitter is in milliseconds so I think it's OK since epidemic is not designed for high speed nodes. On 2014/09/23 22:54:30, Peter Barnes wrote: > (See comment line 139 on altering this line) > > BUT… why are you adding jitter here? Why the same range as beacons? > > Presumably the jitter between beacon broadcasts can be a significant fraction of > the beacon interval. The beacon interval can be of order the time nodes are > within range, given a mobility model. Here, you need to get the disjoint packets > sent *before* the nodes go out of range, so you don't' want to delay them by the > same amount as beacon jitter. If you really want jitter here, it should be > separately controlled than the beacon jitter. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:686: NS_LOG_FUNCTION (this << " sent to " << dest); On 2014/09/23 22:54:30, Peter Barnes wrote: > NS_LOG_FUNCTION (this << dest << firstNode); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:699: packet_summary->AddHeader (header_summary); On 2014/09/23 22:54:31, Peter Barnes wrote: > Move this before the TypeHeader declaration. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:700: EpidemicTag tempTag (EPIDEMIC_TAG_TYPE_CONTROL); On 2014/09/23 22:54:29, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > tempTag (EpidemicTag::CONTROL) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:701: packet_summary->AddHeader (tHeader); On 2014/09/23 22:54:30, Peter Barnes wrote: > Move this before the EpidemicTag declaration. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:706: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue () * m_beaconMaxJitterMs), On 2014/09/23 22:54:30, Peter Barnes wrote: > (See comment line 139 on altering this line) > > BUT… same questions as line 656. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:725: Ptr<Packet> packet_copy = packet->Copy (); On 2014/09/23 22:54:31, Peter Barnes wrote: > Unused. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:726: if (tHeader.GetMessageType () == EPIDEMIC_TYPE_BEACON) On 2014/09/23 22:54:30, Peter Barnes wrote: > (With MessageType local to class TypeHeader): > if (tHeader.IsMessageType (TypeHeader::BEACON)) > > Same below Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:51: #define EPIDEMIC_ROUTING_PROTOCOL_H On 2014/09/23 22:54:31, Peter Barnes wrote: > Include guard has to go before any includes. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:58: EpidemicTagType EpidemicTag::GetEpidemicTag () const On 2014/09/23 22:54:31, Peter Barnes wrote: > EpidemicTag::TagType EpidemicTag::GetTagType Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:62: On 2014/09/23 22:54:31, Peter Barnes wrote: > bool > EpidemicTag::IsTagType (const TagType type) const > { > return m_tag == type; > } Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:64: void EpidemicTag::SetEpidemicTag (EpidemicTagType tag) On 2014/09/23 22:54:31, Peter Barnes wrote: > EpidemicTag::SetTagType (const TagType tag) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:90: case EPIDEMIC_TAG_TYPE_CONTROL: On 2014/09/23 22:54:31, Peter Barnes wrote: > case CONTROL: Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:91: case EPIDEMIC_TAG_TYPE_NOT_SET: On 2014/09/23 22:54:31, Peter Barnes wrote: > case NOT_SET: Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:93: m_tag = (EpidemicTagType) type; On 2014/09/23 22:54:31, Peter Barnes wrote: > (TagType) Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:34: #define EPIDEMIC_TAG_H On 2014/09/23 22:54:32, Peter Barnes wrote: > Include guard should be before any includes. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:47: enum EpidemicTagType On 2014/09/23 22:54:32, Peter Barnes wrote: > This should be a public member of class EpidemicTag, below, in which case it can > be named simply > enum TagType Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:49: EPIDEMIC_TAG_TYPE_CONTROL, //!< Tagged as control message On 2014/09/23 22:54:31, Peter Barnes wrote: > "EPIDEMIC_TAG_TYPE_" prefix can be dropped, since these will always appear as > EpidemicTag::CONTROL, etc. Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:61: EpidemicTag (EpidemicTagType o = EPIDEMIC_TAG_TYPE_NOT_SET) : Tag (), On 2014/09/23 22:54:31, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > TagType o = NOT_SET Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:72: EpidemicTagType GetEpidemicTag () const; On 2014/09/23 22:54:32, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > TagType GetTagType Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:73: On 2014/09/23 22:54:31, Peter Barnes wrote: > /** > * Check if this EpidemicTag is of the indicated TagType. > * > * \param type The expected TagType > * \return true if \p type matches the TagType of this EpidemicTag. > */ > bool IsTagType (const TagType type) const; > > with docs similar to Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:75: void SetEpidemicTag (EpidemicTagType tag); On 2014/09/23 22:54:31, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > SetTagType (const TagType tag); Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: EpidemicTagType m_tag; On 2014/09/23 22:54:31, Peter Barnes wrote: > (With enum TagType in class EpidemicTag): > TagType Done. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... File src/epidemic/test/epidemic-test-suite.cc (right): https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:93: NS_TEST_ASSERT_MSG_EQ (header2.GetHopCount (),10,"Checking hop count"); I did add the boundary checking tests. On 2014/09/23 22:54:32, Peter Barnes wrote: > (See patch 3 comment) > Tom gave suggestions. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:160: NS_TEST_EXPECT_MSG_EQ (q.Dequeue (e4), false, "Checking the dequeue function with empty queue"); I added the tests for checking empty buffer. On 2014/09/23 22:54:32, Peter Barnes wrote: > (See patch 3 comment) > Tom gave suggestions. https://codereview.appspot.com/13831049/diff/185001/src/epidemic/test/epidemi... src/epidemic/test/epidemic-test-suite.cc:175: AddTestCase (new EpidemicRqueueTest, TestCase::QUICK); I do know know how to do this. On 2014/09/23 22:54:32, Peter Barnes wrote: > (See patch 3 comment) > Tom gave suggestions. I gave suggestions.
Sign in to reply to this message.
This is much farther along. Good work. Aside from trivial comments in line: 1. Jitter in epidemic-routing-protocol.cc needs to be revisited. You are using the same jitter for two different purposes, without documenting it. You are making assumptions about reasonable time scales, also not documented. 2. Use of PacketTag to communicate protocol information. We have to resolve this. 3. Tests. You have a proposed test scenario. Start by making an example program which builds and runs that scenario, and prints out the information you want to validate. From there it will be straightforward to turn in to a test case. @Tom: can you help us with 1) and 2)? Peter https://codereview.appspot.com/13831049/diff/205001/.hgignore File .hgignore (left): https://codereview.appspot.com/13831049/diff/205001/.hgignore#oldcode1 .hgignore:1: \.rej$ Why is this file deleted? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contact, disjoint *incoming* packets can't be stored on the sender: the sender doesn't get incoming packets. Perhaps you need to define or clarify the terms. On 2014/11/25 19:51:51, mjf.alenazi wrote: > Packets are actually stored in the sender's buffer. > On 2014/09/23 22:54:25, Peter Barnes wrote: > > receiver's buffer. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:31: is not implemented in |ns-3|, a beacon mechanism is added to the implementation. |ns3| (I know, this is an odd convention) https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:72: Packets, stored in buffers, are dropped if they exceed HopCount, they are older than QueueEntryExpireTime, Please reflow so all lines are less than 80 characters wide. Do this on *all* files, even source code and headers. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:73: or the holding buffer exceed QueueLength. Delete all whitespace at the beginning of continuation lines. (White space at the beginning of a line becomes indentation in the Sphinx output.) https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:96: ******** This section needs cleanup. Right now it is one paragraph, with many redundant phrases. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:125: [#Vahdat] Amin Vahdat and David Becker, "Epidemic Routing for Partially-Connected This should be: .. rubric Footnotes .. [#Vahdat] Amin Vahdat and David Becker, "Epidemic Routing for Partially-Connected Ad Hoc Networks," Duke University, Technical Report CS-200006, http://issg.cs.duke.edu/epidemic/epidemic.pdf https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:77: cmd.Usage ("Benchmark example shows epidemic routing scenario presented in the original paper." paper. " (Need two spaces after periods. Please fix this throughout this usage message, and in epidemic-example.cc) https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:118: std::cout << "Source number can not excced number of nodes" << std::endl; Errors should be reported to std::cerr << … and followed with std::cerr << cmd; exit (-1); to print the usage message (which should state the restriction) and exit. Alternatively, you could fix the error automatically, by setting source_num = nWifis, for example. In this case, you should state the error (to std::cout) and how you are fixing it: std::cout << "Source number can not excced number of nodes" << std::endl; std::cout << "Setting source number to number of nodes." << std::endl; This should occur *before* the summary of command line parameters, so the summary shows what is actually being used. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:123: std::cout << "Sink number can not excced number of nodes" << std::endl; See previous comment. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:179: "MaxY", DoubleValue (1500.0) (See comment on patch 8) You'll have to read the tutorial and models docs on mobility. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: NS_LOG_COMPONENT_DEFINE ("EpidemicHelper"); Since your last patch, we've moved all NS_LOG_COMPONENT_DEFINE *inside* namespace ns3… See bug 1551: https://www.nsnam.org/bugzilla/show_bug.cgi?id=1551 https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:61: * \param the node on which the routing protocol will run. \param node The node as you had before. (The first word after \param ("node") is the parameter name as it appears in the code; the remainder of the line is the documentation.) https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:136: /// Check if MessageType of value is valid. Check that this is a valid MessageType. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:143: /// true if the message serialized correctly;otherwise it is set to false. /// Valid flag: \c true if the message deserialized correctly. otherwise \c false. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:195: static TypeId GetTypeId (void); /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:293: static TypeId GetTypeId (void); /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:143: m_beaconJitter->SetAttribute ("Max", DoubleValue (m_beaconMaxJitterMs)); (patch 8 comment:) It looks like you add jitter both to scheduling the next SendBeacons, and in scheduling the resulting BroadcastPacket. I think you should be doing one, not both. @TomH: comments? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:143: m_beaconJitter->SetAttribute ("Max", DoubleValue (m_beaconMaxJitterMs)); (patch 8 comment:) It looks like you add jitter both to scheduling the next SendBeacons, and in scheduling the resulting BroadcastPacket. I think you should be doing one, not both. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:234: packet->AddHeader (header); (See patch 8 comment) Why do need the EpidemicHeader? It would seem that TypeHeader would be sufficient? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:237: EpidemicTag tempTag (EpidemicTag::CONTROL); Why do you use a packet tag to convey protocol information? Unless I'm missing something, this is an abuse of tags. @Tom: can you comment? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:242: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()),&RoutingProtocol::BroadcastPacket,this, packet); (patch 8 comment:) See comment line 143. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:338: * if the packet is not control, it means a data packet (See patch 8 discussion) @Tom: can you comment? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:572: NS_LOG_FUNCTION (this << " interface " << i << " address " << address); NS_LOG_FUNCTION (this << i << address); https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:659: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), (See patch 8 discussion) So you assume that many beacons are exchanged in the time nodes are in range? This is a pretty important assumption, and should be stated in the .rst docs in section called "Limitations" or "Assumptions", and again in the docs for m_beaconJitter, explaining how it's used and where. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:710: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), (See patch 8 discussion) Same comment as line 659 and previous.
Sign in to reply to this message.
I have fixed the pointed issues. I have added a function to avoid re-initiating packets exchange with recently contacted hosts. Also, I have made sure that lines do not exceed 80 chars in each line. https://codereview.appspot.com/13831049/diff/205001/.hgignore File .hgignore (left): https://codereview.appspot.com/13831049/diff/205001/.hgignore#oldcode1 .hgignore:1: \.rej$ After moving to another computer, this file appeared as modified in "hg status". I tried to ignore it so it does not affect others. On 2014/12/17 00:15:46, Peter Barnes wrote: > Why is this file deleted? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:11: the sender's buffer. When two nodes come into contact, disjoint On 2014/12/17 00:15:46, Peter Barnes wrote: > *incoming* packets can't be stored on the sender: the sender doesn't get > incoming packets. Perhaps you need to define or clarify the terms. > On 2014/11/25 19:51:51, mjf.alenazi wrote: > > Packets are actually stored in the sender's buffer. > > On 2014/09/23 22:54:25, Peter Barnes wrote: > > > receiver's buffer. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:31: is not implemented in |ns-3|, a beacon mechanism is added to the implementation. On 2014/12/17 00:15:46, Peter Barnes wrote: > |ns3| > (I know, this is an odd convention) Acknowledged. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:72: Packets, stored in buffers, are dropped if they exceed HopCount, they are older than QueueEntryExpireTime, On 2014/12/17 00:15:46, Peter Barnes wrote: > Please reflow so all lines are less than 80 characters wide. > > Do this on *all* files, even source code and headers. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:73: or the holding buffer exceed QueueLength. On 2014/12/17 00:15:46, Peter Barnes wrote: > Delete all whitespace at the beginning of continuation lines. (White space at > the beginning of a line becomes indentation in the Sphinx output.) Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:96: ******** On 2014/12/17 00:15:46, Peter Barnes wrote: > This section needs cleanup. Right now it is one paragraph, with many redundant > phrases. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:125: [#Vahdat] Amin Vahdat and David Becker, "Epidemic Routing for Partially-Connected On 2014/12/17 00:15:46, Peter Barnes wrote: > This should be: > > .. rubric Footnotes > > .. [#Vahdat] Amin Vahdat and David Becker, "Epidemic Routing for > Partially-Connected Ad Hoc Networks," Duke University, Technical > Report CS-200006, http://issg.cs.duke.edu/epidemic/epidemic.pdf Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:77: cmd.Usage ("Benchmark example shows epidemic routing scenario presented in the original paper." On 2014/12/17 00:15:46, Peter Barnes wrote: > paper. " > > (Need two spaces after periods. Please fix this throughout this usage message, > and in epidemic-example.cc) Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:118: std::cout << "Source number can not excced number of nodes" << std::endl; On 2014/12/17 00:15:46, Peter Barnes wrote: > Errors should be reported to > > std::cerr << … > > and followed with > > std::cerr << cmd; > exit (-1); > > to print the usage message (which should state the restriction) and exit. > > Alternatively, you could fix the error automatically, by setting > > source_num = nWifis, > > for example. In this case, you should state the error (to std::cout) and how > you are fixing it: > > std::cout << "Source number can not excced number of nodes" << std::endl; > std::cout << "Setting source number to number of nodes." << std::endl; > > This should occur *before* the summary of command line parameters, so the > summary shows what is actually being used. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:123: std::cout << "Sink number can not excced number of nodes" << std::endl; On 2014/12/17 00:15:46, Peter Barnes wrote: > See previous comment. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:179: "MaxY", DoubleValue (1500.0) On 2014/12/17 00:15:46, Peter Barnes wrote: > (See comment on patch 8) > > You'll have to read the tutorial and models docs on mobility. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: NS_LOG_COMPONENT_DEFINE ("EpidemicHelper"); On 2014/12/17 00:15:46, Peter Barnes wrote: > Since your last patch, we've moved all NS_LOG_COMPONENT_DEFINE *inside* > namespace ns3… > > See bug 1551: > https://www.nsnam.org/bugzilla/show_bug.cgi?id=1551 Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:61: * \param the node on which the routing protocol will run. On 2014/12/17 00:15:46, Peter Barnes wrote: > \param node The node > > as you had before. (The first word after \param ("node") is the parameter name > as it appears in the code; the remainder of the line is the documentation.) Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:136: /// Check if MessageType of value is valid. On 2014/12/17 00:15:46, Peter Barnes wrote: > Check that this is a valid MessageType. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:143: /// true if the message serialized correctly;otherwise it is set to false. On 2014/12/17 00:15:46, Peter Barnes wrote: > /// Valid flag: \c true if the message deserialized correctly. otherwise \c > false. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:195: static TypeId GetTypeId (void); On 2014/12/17 00:15:46, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:293: static TypeId GetTypeId (void); On 2014/12/17 00:15:46, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:143: m_beaconJitter->SetAttribute ("Max", DoubleValue (m_beaconMaxJitterMs)); On 2014/12/17 00:15:47, Peter Barnes wrote: > (patch 8 comment:) > It looks like you add jitter both to scheduling the next SendBeacons, > and in scheduling the resulting BroadcastPacket. I think you should be doing > one, not both. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:234: packet->AddHeader (header); I tried to do it but I could not. In the route output function packet, I do not see anything about the outgoing packet to distinguish between control packets and data packets. I would be happy to change it if someone can help be in this issue. On 2014/12/17 00:15:47, Peter Barnes wrote: > (See patch 8 comment) > Why do need the EpidemicHeader? It would seem that TypeHeader would be > sufficient? https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:242: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()),&RoutingProtocol::BroadcastPacket,this, packet); On 2014/12/17 00:15:47, Peter Barnes wrote: > (patch 8 comment:) > See comment line 143. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:572: NS_LOG_FUNCTION (this << " interface " << i << " address " << address); On 2014/12/17 00:15:46, Peter Barnes wrote: > NS_LOG_FUNCTION (this << i << address); Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:659: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), On 2014/12/17 00:15:46, Peter Barnes wrote: > (See patch 8 discussion) > So you assume that many beacons are exchanged in the time nodes are in range? > This is a pretty important assumption, and should be stated in the .rst docs in > section called "Limitations" or "Assumptions", and again in the docs for > m_beaconJitter, explaining how it's used and where. Done. https://codereview.appspot.com/13831049/diff/205001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:710: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), On 2014/12/17 00:15:47, Peter Barnes wrote: > (See patch 8 discussion) > Same comment as line 659 and previous. Done.
Sign in to reply to this message.
Missing Doxygen: src/epidemic/model/epidemic-packet-queue.h:131: warning: parameters of member ns3::Epidemic::PacketQueue::Enqueue are not (all) documented src/epidemic/model/epidemic-packet-queue.h:131: warning: return type of member ns3::Epidemic::PacketQueue::Enqueue is not documented src/epidemic/model/epidemic-packet-queue.h:147: warning: parameters of member ns3::Epidemic::PacketQueue::Find are not (all) documented src/epidemic/model/epidemic-packet-queue.h:147: warning: return type of member ns3::Epidemic::PacketQueue::Find is not documented src/epidemic/model/epidemic-packet-queue.h:152: warning: parameters of member ns3::Epidemic::PacketQueue::FindDisjointPackets are not (all) documented src/epidemic/model/epidemic-packet-queue.h:152: warning: return type of member ns3::Epidemic::PacketQueue::FindDisjointPackets is not documented src/epidemic/model/epidemic-packet.h:201: warning: Member GetTypeId(void) (function) of class ns3::Epidemic::EpidemicSummaryVectorHeader is not documented. src/epidemic/model/epidemic-packet.h:305: warning: Member GetTypeId(void) (function) of class ns3::Epidemic::EpidemicHeader is not documented. src/epidemic/model/epidemic-routing-protocol.h:150: warning: parameters of member ns3::Epidemic::RoutingProtocol::SendDisjointPackets are not (all) documented Make sure every function has documented every argument and the return value. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ This file should be deleted, as requested previously. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:12: packets are exchanged. Packets are dropped if they expire or buffers Now I see why you're saying sender's buffer. I think what's missing is that disjoint packets are exchanged, *even for packets not destined for the other node*. Anytime two nodes come into contact, they exchange disjoint packets. In this way packets spread virally until they reach the destination node. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:31: is not implemented in |ns-3|, a beacon mechanism is added to the implementation. Not fixed: change |ns-3| to |ns3| https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:45: | | HopCount serves a similar | | Not fixed, see patch 9 comment. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:125: be found in ``src/epidemic/test/epidemic-test-suite.cc``. These tests verify These lines must have the same indent as "Unit tests…" since they are part of the same bullet paragraph. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:131: Epidemic does not work with more then one address per each interface. Additional than (spelling) https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:141: .. rubric Footnotes Sorry, I left off the colons: .. rubric:: Footnotes https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:39: /** /** * \file * https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:132: std::cerr << "Source number can not exceed number of nodes" << std::endl; Not finished, read patch-9 comment. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:138: std::cerr << "Sink number can not exceed number of nodes" << std::endl; Same as previous. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: namespace ns3 { Blank line before. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:56: agent = m_agentFactory.Create<Epidemic::RoutingProtocol> (); Ptr<Epidemic::RoutingProtocol> agent = m_agentFactory.Create<Epidemic::RoutingProtocol> (); (Something has to be indented, to show this is a continuation line) https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:339: .AddConstructor<EpidemicHeader> (); static TypeId tid = TypeId ("ns3::epidemic::TypeHeader") .SetParent<Header> () .AddConstructor<TypeHeader> (); (Each .Function begins a new continuation line) https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:95: * \brief Get the type identificator. /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:139: /// Check if MessageType of value is valid. Not done, see patch-9 comment. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:155: m_beaconTimer.Schedule (m_beaconInterval); Add jitter here: m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue ())); https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:164: if (m_hostContactTime.find (hostID) == m_hostContactTime.end ()) if (hostID_pair == ... https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:291: m_beaconTimer.Schedule (m_beaconInterval); You schedule m_beaconTimer rigidly at m_beaconInterval, but you don't actually send the beacon at those times. Instead you schedule the beacon send for m_beaconJitter ms later. This is confusing and inefficient (two events instead of one). Instead, add the jitter directly to m_beaconTimer, and in this function just send the packet: BroadcastPacket (packet); m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds (m_beaconJitter->GetValue ())); https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:799: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), Why are you adding jitter to sending the summary vector? Don't they already take turns? Why is the beacon jitter the right amount? How is this dual use of beacon jitter documented?
Sign in to reply to this message.
I fixed the pointed issues. Also, I tried to fix all the doxygen issues in the report you included in the last review. Thank you https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic.h File src/epidemic/doc/epidemic.h (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.h:1: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ On 2014/12/19 20:38:40, Peter Barnes wrote: > This file should be deleted, as requested previously. Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:12: packets are exchanged. Packets are dropped if they expire or buffers On 2014/12/19 20:38:41, Peter Barnes wrote: > Now I see why you're saying sender's buffer. I think what's missing is that > disjoint packets are exchanged, *even for packets not destined for the other > node*. Anytime two nodes come into contact, they exchange disjoint packets. In > this way packets spread virally until they reach the destination node. Acknowledged. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:31: is not implemented in |ns-3|, a beacon mechanism is added to the implementation. On 2014/12/19 20:38:41, Peter Barnes wrote: > Not fixed: change |ns-3| to |ns3| Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:45: | | HopCount serves a similar | | I am sorry but I did not find the issue. On 2014/12/19 20:38:41, Peter Barnes wrote: > Not fixed, see patch 9 comment. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:131: Epidemic does not work with more then one address per each interface. Additional On 2014/12/19 20:38:40, Peter Barnes wrote: > than (spelling) Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:141: .. rubric Footnotes On 2014/12/19 20:38:41, Peter Barnes wrote: > Sorry, I left off the colons: > > .. rubric:: Footnotes Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:39: /** On 2014/12/19 20:38:41, Peter Barnes wrote: > /** > * \file > * Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:132: std::cerr << "Source number can not exceed number of nodes" << std::endl; On 2014/12/19 20:38:41, Peter Barnes wrote: > Not finished, read patch-9 comment. Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:138: std::cerr << "Sink number can not exceed number of nodes" << std::endl; On 2014/12/19 20:38:41, Peter Barnes wrote: > Same as previous. Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: namespace ns3 { On 2014/12/19 20:38:41, Peter Barnes wrote: > Blank line before. Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:56: agent = m_agentFactory.Create<Epidemic::RoutingProtocol> (); On 2014/12/19 20:38:41, Peter Barnes wrote: > Ptr<Epidemic::RoutingProtocol> agent = > m_agentFactory.Create<Epidemic::RoutingProtocol> (); > > (Something has to be indented, to show this is a continuation line) Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:339: .AddConstructor<EpidemicHeader> (); On 2014/12/19 20:38:41, Peter Barnes wrote: > static TypeId tid = TypeId ("ns3::epidemic::TypeHeader") > .SetParent<Header> () > .AddConstructor<TypeHeader> (); > > (Each .Function begins a new continuation line) Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:95: * \brief Get the type identificator. On 2014/12/19 20:38:41, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:139: /// Check if MessageType of value is valid. On 2014/12/19 20:38:41, Peter Barnes wrote: > Not done, see patch-9 comment. Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:155: m_beaconTimer.Schedule (m_beaconInterval); On 2014/12/19 20:38:41, Peter Barnes wrote: > Add jitter here: > > m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds > (m_beaconJitter->GetValue ())); Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:164: if (m_hostContactTime.find (hostID) == m_hostContactTime.end ()) On 2014/12/19 20:38:41, Peter Barnes wrote: > if (hostID_pair == ... Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:291: m_beaconTimer.Schedule (m_beaconInterval); On 2014/12/19 20:38:41, Peter Barnes wrote: > You schedule m_beaconTimer rigidly at m_beaconInterval, but you don't actually > send the beacon at those times. Instead you schedule the beacon send for > m_beaconJitter ms later. This is confusing and inefficient (two events instead > of one). > > Instead, add the jitter directly to m_beaconTimer, and in this function just > send the packet: > > BroadcastPacket (packet); > m_beaconTimer.Schedule (m_beaconInterval + MilliSeconds > (m_beaconJitter->GetValue ())); Done. https://codereview.appspot.com/13831049/diff/225001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:799: Simulator::Schedule (MilliSeconds (m_beaconJitter->GetValue ()), On 2014/12/19 20:38:41, Peter Barnes wrote: > Why are you adding jitter to sending the summary vector? Don't they already > take turns? Why is the beacon jitter the right amount? How is this dual use of > beacon jitter documented? Done.
Sign in to reply to this message.
In addition to the line by line comments, I've asked TomH to help us with: - Use of PacketTag to propagate protocol information between layers See my comments of 2014-12-17, 2014-09-23, and around src/epidemic/model/epidemic-routing-protocol.cc:237 src/epidemic/model/epidemic-routing-protocol.cc:321 I think this is abuse of PacketTags. I think (but I'm not sure) that the tag is redundant with Epidemic::TypeHeader. I can't even tell if the tag is added and removed on the same node before the packet goes out. Assuming it's redundant with Epidemic::TypeHeader, it would make more sense to me just to add the header, then check for the header to decide which kind of packet it is, but maybe there's a reason this doesn't work? - Turning an example into a useful test scenario https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:10: or sparse networks. Basically, sender's transport packets are stored in "… networks. Packets are held in the source nodes' buffer until the source node comes into communication range with another node. The packets are transmitted to the new node, which becomes a transit node for those packets. Transit nodes hold all packets received until they come into range with other nodes, at which point they each send the other any packets the other doesn't already have. The name "epidemic" is drawn from the way packets spread virally by communication contact between nodes. At the source and all transit nodes, packets are eventually dropped when the expire or the epidemic routing buffer becomes full, in which case the oldest packets are dropped. It is not useful…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:45: | | HopCount serves a similar | | Sphinx tables can't have tabs; replace all of these tabs with spaces so the pipe '|' characters line up. (This was raised in patch 8 comments) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:125: be found in ``src/epidemic/test/epidemic-test-suite.cc``. These tests verify These lines have to have the same indent as "Unit …" in the line above. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:39: using namespace ns3; Blank line before. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:41: /** /** \file \ingroup epidemic https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:37: using namespace ns3; Blank line before. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:40: * \file If the body of this comment doesn't use leading `*', then don't use them on these first two lines either. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:121: std::cerr << "Source number can not exceed number of nodes" << std::endl; (from patch-9 comment:) Add std::cerr << cmd; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:127: std::cerr << "Sink number can not exceed number of nodes" << std::endl; (from patch-9 comment:) Add std::cerr << cmd; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: #include "ns3/epidemic-routing-protocol.h" /** * \file * \ingroup epidemic * ns3::EpidemicHelper implementation. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: namespace ns3 { Blank line before. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:44: m_agentFactory.SetTypeId ("ns3::epidemic::RoutingProtocol"); "ns3::Epidemic::…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:37: /** * \file * \ingroup epidemic * ns3::EpidemicHelper declaration. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:51: /** Copy () and Create () are inherited, so don't repeat the docs from the base class, just do: // Inherited EpidemicHelper* Copy (void) const; virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:66: /** * Set attributes by name. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:70: * This method controls the attributes of ns3::epidemic::RoutingProtocol "ns3::Epidemic::…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:75: /** the factory to create Epidemic routing object */ /** The ... https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:41: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); Should be after namespace ns3 { https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:45: Constructor initializer lists: QueueEntry::QueueEntry (void) : m_packet (0), m_header (), m_ucb (), m_ecb (), m_expire (Simulator::Now ()), m_packetID (0) { } QueueEntry::QueueEntry (Ptr<const Packet> pa, Ipv4Header const & h, UnicastForwardCallback ucb, ErrorCallback ecb, Time exp /* = Simulator::Now () */, uint32_t packetID /* = 0 */) : m_packet (pa), m_header (h), m_ucb (ucb), m_ecb (ecb), m_expire (exp), m_packetID (packetID) { } https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:41: namespace ns3 { Before namespace ns3 {: /** * \file * \ingroup epidemic * ns3::Epidemic::QueueEntry and ns3::Epidemic::PacketQueue declarations. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:55: /// c-tor 1. Yuck on defaults for all arguments. Your code either gives no args or the first four, so do this: QueueEntry (void); QueueEntry (Ptr<const Packet> pa, Ipv4Header const & h, UnicastForwardCallback ucb, ErrorCallback ecb, Time exp = Simulator::Now (), uint32_t packetID = 0); See matching comment in the .cc file for the initializers. 2. In any case, document the arguments. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:65: m_packetID (packetID) See the .cc file for these initializers; no inlines. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:70: bool operator== (QueueEntry const & o) const; Document argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:71: /// Return the UnicastForwardCallback associated with the queued packet /// \returns The ... https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:74: void SetUnicastForwardCallback (UnicastForwardCallback ucb); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:76: ErrorCallback GetErrorCallback () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:78: void SetErrorCallback (ErrorCallback ecb); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:80: Ptr<const Packet> GetPacket () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:82: void SetPacket (Ptr<const Packet> p); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:84: Ipv4Header GetIpv4Header () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:86: void SetIpv4Header (Ipv4Header h); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:88: void SetExpireTime (Time exp); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:90: Time GetExpireTime () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:92: uint32_t GetPacketID () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:94: void SetPacketID (uint32_t id); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:128: : m_maxLen (maxLen) These initializers should really be in the .cc file; no inlines. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:138: bool Dequeue (QueueEntry & entry); Document the argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:140: uint32_t GetSize (); Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:142: uint32_t GetMaxQueueLen () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:144: void SetMaxQueueLen (uint32_t len); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:146: Time GetQueueTimeout () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:158: QueueEntry Find (uint32_t packetID); Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:160: EpidemicSummaryVectorHeader GetSummaryVector (); Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:166: EpidemicSummaryVectorHeader FindDisjointPackets (EpidemicSummaryVectorHeader list); Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:182: void Purge (bool oldestOnly /* = false */); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:184: void Drop (PacketIdMap::iterator en, std::string reason); Document the argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:35: NS_LOG_COMPONENT_DEFINE ("EpidemicPacket"); Should be after namespace ns3 { https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:36: namespace ns3 { Before namespace ns3 {: /** * \file * \ingroup epidemic * ns3::Epidemic::TypeHeader, ns3::Epidemic::EpidemicSummaryVectorHeader * and ns3::Epidemic::EpidemicHeader implementations. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:58: TypeId ("ns3::epidemic::TypeHeader").SetParent<Header> ().AddConstructor< "ns3::Epidemic::…" [Capitalize Epidemic] .SetParent… [Each .Function on a separate line] .AddConstructor… https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:180: TypeId ("ns3::epidemic::EpidemicSummaryVectorHeader").SetParent< "ns3::Epidemic::…" .SetParent… .AddConstructor... https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:278: EpidemicHeader::EpidemicHeader (uint32_t pkt_ID, uint32_t hopCount, Remove this constructor; it's not needed. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:338: TypeId ("ns3::epidemic::EpidemicHeader") "ns3::Epidemic::…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:41: /** * \file * \ingroup epidemic * ns3::Epidemic::TypeHeader, ns3::Epidemic::EpidemicSummaryVectorHeader * and ns3::Epidemic::EpidemicHeader declarations. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:67: 0 Align this table under \verbatim as for EpidemicSummaryVectorHeader: \verbatim 0 1 2… +-+-... https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:88: */ * \param t Header message type. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:103: TypeId GetInstanceTypeId () const; Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:107: void SetMessageType (MessageType type); Document argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:112: uint32_t GetSerializedSize () const; Put all inherited together, without repeating the docs from the base class: // Inherited TypeId GetInstanceTypeId () const; uint32_t GetSerializedSize () const; void Serialize (Buffer::Iterator start) const; uint32_t Deserialize (Buffer::Iterator start); void Print (std::ostream &os) const; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:130: /// Return type /// \returns The message type. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:133: * Check that this is a valid MessageType. * Check that this is a message of the expected type. Also document the arguments and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:140: bool IsValid () const; Document the return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:142: bool operator== (TypeHeader const & o) const; Document the argument and return type. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:153: /** * \ingroup epidemic * \brief Output streamer for TypeHeader. * * \param os The stream. * \param h The TypeHeader. * \returns The stream. */ std::ostream & operator<< (std::ostream & os, TypeHeader const & h); (Or did you mean to keep this private in epidemic-packet.cc?) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:157: * \ingroup epidemic Uniform indentation https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:190: class EpidemicSummaryVectorHeader : public Header Since this is already in namespace Epidemic, I suggest renaming this class to SummaryVectorHeader. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:204: static TypeId GetTypeId (void); /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:209: virtual TypeId GetInstanceTypeId (void) const; Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:210: virtual uint32_t GetSerializedSize () const; // Inherited https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:238: * \return A vector to store packet IDs. * A vector … (It's not a function, so has no return value.) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:247: /** * \ingroup epidemic * \brief Output streamer for EpidemicSummaryVectorHeader. * * \param os The stream. * \param packet The EpidemicSummaryVectorHeader. * \returns The stream. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:280: * 0 1 2 3 This needs \verbatim, \endverbatim: \verbatim 0 1 2… +-+-... https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:293: class EpidemicHeader : public Header Since this is already in namespace Epidemic, I suggest renaming this class to Header. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:302: EpidemicHeader (uint32_t pkt_ID = 0,uint32_t hopCount = 0, This constructor is never called with arguments, and these are the default values for the member variables, so just let the compiler supply the default constructor. Delete this one. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:309: * \brief return TypeID. * \brief Get the registered TypeId for this class. * \return The object TypeId. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:316: virtual TypeId GetInstanceTypeId (void) const; This is inherited, so don't duplicate the base class docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:360: }; /** * \ingroup epidemic * \brief Output streamer for EpidemicHeader. * * \param os The stream. * \param packet The EpidemicHeader. * \returns The stream. */ std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet); (Or did you mean to keep this private in epidemic-packet.cc?) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:50: NS_LOG_COMPONENT_DEFINE ("EpidemicRoutingProtocol"); Should be after namespace ns3 { https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:52: using namespace std; Before using: /** * \file * \ingroup epidemic * ns3::Epidemic::RoutingProtocol implementation. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:62: static TypeId tid = TypeId ("ns3::epidemic::RoutingProtocol") "ns3::Epidemic::…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:734: miliseconds apart The algorithm following this comment schedules each disjoint packet send 1 ms apart. Why insert this delay instead of just queuing all the packets for transmission now, and letting the socket handle it? Why is 1 ms the right number, independent of the packet sizes, channel bit rate, etc? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:76: * Transport Port for MANET routing protocols ports These two lines are left over; they are duplicated from EPIDEMIC_PORT, below. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:83: static TypeId GetTypeId (void); /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:89: virtual ~RoutingProtocol (); /** Dummy destructor, see DoDispose. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:90: virtual void DoDispose (); /** Destructor implementation */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:147: void Start (); /// Invoked by SetIpv4() https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:149: void RecvEpidemic (Ptr<Socket> socket); Document argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:157: EpidemicSummaryVectorHeader packet_SMV,Ipv4Address dest); Space after `,' https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:161: uint32_t FindOutputDeviceForAddress ( Ipv4Address dst); Document argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:163: uint32_t FindLoopbackDevice (); Document return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:165: void SendPacket (Ptr<Packet> p,InetSocketAddress addr); Document arguments. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:167: bool IsMyOwnAddress (Ipv4Address src); Document argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:169: void BroadcastPacket (Ptr<Packet> p); Document argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:174: * True send a summary vector with reply header \c true https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:175: * False send a summary vector with reply back header \c false https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:179: Ptr<Socket> FindSocketWithInterfaceAddress ( Document argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:182: void SendPacketFromQueue (Ipv4Address dst,QueueEntry queueEntry); Document arguments. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:184: bool IsHostContactedRecently (Ipv4Address hostID); Document argument and return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:44: static TypeId tid = TypeId ("ns3::epidemic::EpidemicTag").SetParent<Tag> () "ns3::Epidemic::…" https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:50: class EpidemicTag : public Tag Since this is already in namespace Epidemic, I suggest renaming this class to ControlTag. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:58: NOT_SET, //!< Tag is not set Align comments https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:68: static TypeId GetTypeId (); /** * Get the registered TypeId for this class. * \return The object TypeId. */ https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:70: TypeId GetInstanceTypeId () const; Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:73: TagType GetTagType () const; Document return value. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:86: void SetTagType (const TagType tag); Document argument. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: uint32_t GetSerializedSize () const; Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:92: void Serialize (TagBuffer i) const; Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:94: void Deserialize (TagBuffer i); Inherited, no docs here. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:96: void Print (std::ostream &os) const; Inherited, no docs here.
Sign in to reply to this message.
Just a few comments. I didn't check all the code, these are the ones from a quick overview. More soon (if necessary, of course). Beside the specific content, a general one: why not to do it for v6 ? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:113: The total messages are 45 * 44 = 1980 messages. The buffer size is 2000 If the buffer is 2000, then it is not infinite. Rephrase please. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:135: the time nodes are in range. Explain better. I.e., is this a limitation on the node movement ? It is a hard or soft limitation ? What happens if the criterion is not met ? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:708: Ipv4Address::GetAny (), EPIDEMIC_PORT)); Missing the call to socket->BindToNetDevice (l3->GetNetDevice (i)); https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:818: if (tHeader.GetMessageType () == TypeHeader::BEACON) Either use a switch-case (llvm finds "missing" cases), or add a final "else" statement (I know that there are only 3 message types, but it's safer to have a default catch). https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:79: class RoutingProtocol : public Ipv4RoutingProtocol I know it's normal for IPv4 routing protocols, but I still find it very annoying: the classes are all named "RoutingProtocol" and they are "just" in different namespaces. Is it possible to name it "EpidemicRoutingProtocol" ? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/wscript File src/epidemic/wscript (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/wscript#newc... src/epidemic/wscript:4: module = bld.create_ns3_module('epidemic', ['internet', 'wifi', 'mesh', 'applications']) Move 'wifi', 'mesh', 'applications' dependency into the examples wscript. The module shouldn't depend on unnecessary modules. Its examples may have separate dependencies. Moreover, limit the dependencies to the ones effectively used by the single example.
Sign in to reply to this message.
Hello Tomasso, On Feb 8, 2015, at 1:29 AM, tommypec@gmail.com wrote: > https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... > src/epidemic/doc/epidemic.rst:113: The total messages are 45 * 44 = 1980 > messages. The buffer size is 2000 > If the buffer is 2000, then it is not infinite. Rephrase please. Agreed. I suggested this wording to indicate that no packets are dropped in this example. Mohammed pointed out that this is the example from the original paper, so we agreed to keep it as is. IIRC this is configurable (or we should make it so). > https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... > src/epidemic/doc/epidemic.rst:135: the time nodes are in range. > Explain better. I.e., is this a limitation on the node movement ? It is > a hard or soft limitation ? What happens if the criterion is not met ? Agreed this should be clearer. > https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... > src/epidemic/model/epidemic-routing-protocol.h:79: class RoutingProtocol > : public Ipv4RoutingProtocol > I know it's normal for IPv4 routing protocols, but I still find it very > annoying: the classes are all named "RoutingProtocol" and they are > "just" in different namespaces. > Is it possible to name it "EpidemicRoutingProtocol" ? IIRC it was named this way originally, but I pushed to rename it since it's already in the namespace. It seemed kind of silly to force a user to write "Epidemic::EpidemicRoutingProtocol"; isn't that what namespaces are for? On the other hand I know you're allergic to namespaces. :) If this is just stylistic we could a) add an item to the style guide, or b) leave this as an implementer's choice. If there are bigger issues than just style, I'd like to understand them. Peter _______________________________________________________________________ Dr. Peter D. Barnes, Jr. Physics Division Lawrence Livermore National Laboratory Physical and Life Sciences 7000 East Avenue, L-50 email: pdbarnes@llnl.gov P. O. Box 808 Voice: (925) 422-3384 Livermore, California 94550 Fax: (925) 423-3371
Sign in to reply to this message.
Sorry for the delay. I have been busy with my dissertation. I have fixed the code based on the latest comments. Thank you all https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... File src/epidemic/doc/epidemic.rst (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:10: or sparse networks. Basically, sender's transport packets are stored in On 2015/02/03 01:25:44, Peter Barnes wrote: > "… networks. Packets are held in the source nodes' buffer until the source node > comes into communication range with another node. The packets are transmitted > to the new node, which becomes a transit node for those packets. Transit nodes > hold all packets received until they come into range with other nodes, at which > point they each send the other any packets the other doesn't already have. The > name "epidemic" is drawn from the way packets spread virally by communication > contact between nodes. At the source and all transit nodes, packets are > eventually dropped when the expire or the epidemic routing buffer becomes full, > in which case the oldest packets are dropped. It is not useful…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:45: | | HopCount serves a similar | | On 2015/02/03 01:25:44, Peter Barnes wrote: > Sphinx tables can't have tabs; replace all of these tabs with spaces so the pipe > '|' characters line up. (This was raised in patch 8 comments) Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:113: The total messages are 45 * 44 = 1980 messages. The buffer size is 2000 On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > If the buffer is 2000, then it is not infinite. Rephrase please. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:125: be found in ``src/epidemic/test/epidemic-test-suite.cc``. These tests verify On 2015/02/03 01:25:44, Peter Barnes wrote: > These lines have to have the same indent as "Unit …" in the line above. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/doc/epidemic... src/epidemic/doc/epidemic.rst:135: the time nodes are in range. On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > Explain better. I.e., is this a limitation on the node movement ? It is a hard > or soft limitation ? What happens if the criterion is not met ? Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-benchmark.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:39: using namespace ns3; On 2015/02/03 01:25:44, Peter Barnes wrote: > Blank line before. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:39: using namespace ns3; On 2015/02/03 01:25:44, Peter Barnes wrote: > Blank line before. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-benchmark.cc:41: /** On 2015/02/03 01:25:44, Peter Barnes wrote: > /** > \file > \ingroup epidemic > Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:37: using namespace ns3; On 2015/02/03 01:25:44, Peter Barnes wrote: > Blank line before. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:40: * \file On 2015/02/03 01:25:44, Peter Barnes wrote: > If the body of this comment doesn't use leading `*', then don't use them on > these first two lines either. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:121: std::cerr << "Source number can not exceed number of nodes" << std::endl; On 2015/02/03 01:25:44, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:121: std::cerr << "Source number can not exceed number of nodes" << std::endl; caused an error Build failed -> task in 'epidemic-example' failed (exit status 1): {task 47912848: cxx epidemic-example.cc -> epidemic-example.cc.6.o} .. On 2015/02/03 01:25:44, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:127: std::cerr << "Sink number can not exceed number of nodes" << std::endl; On 2015/02/03 01:25:44, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:127: std::cerr << "Sink number can not exceed number of nodes" << std::endl; caused same error above On 2015/02/03 01:25:44, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:31: #include "ns3/epidemic-routing-protocol.h" On 2015/02/03 01:25:44, Peter Barnes wrote: > /** > * \file > * \ingroup epidemic > * ns3::EpidemicHelper implementation. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:32: namespace ns3 { On 2015/02/03 01:25:44, Peter Barnes wrote: > Blank line before. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.cc:44: m_agentFactory.SetTypeId ("ns3::epidemic::RoutingProtocol"); On 2015/02/03 01:25:44, Peter Barnes wrote: > "ns3::Epidemic::…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:37: On 2015/02/03 01:25:44, Peter Barnes wrote: > /** > * \file > * \ingroup epidemic > * ns3::EpidemicHelper declaration. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:51: /** On 2015/02/03 01:25:44, Peter Barnes wrote: > Copy () and Create () are inherited, so don't repeat the docs from the base > class, just do: > > // Inherited > EpidemicHelper* Copy (void) const; > virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const; Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:66: /** On 2015/02/03 01:25:44, Peter Barnes wrote: > * Set attributes by name. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:70: * This method controls the attributes of ns3::epidemic::RoutingProtocol That caused an error On 2015/02/03 01:25:44, Peter Barnes wrote: > "ns3::Epidemic::…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:75: /** the factory to create Epidemic routing object */ On 2015/02/03 01:25:44, Peter Barnes wrote: > /** The ... Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:41: NS_LOG_COMPONENT_DEFINE ("EpidemicPacketQueue"); On 2015/02/03 01:25:44, Peter Barnes wrote: > Should be after namespace ns3 { Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:45: On 2015/02/03 01:25:45, Peter Barnes wrote: > Constructor initializer lists: > > QueueEntry::QueueEntry (void) > : m_packet (0), > m_header (), > m_ucb (), > m_ecb (), > m_expire (Simulator::Now ()), > m_packetID (0) > { > } > > QueueEntry::QueueEntry (Ptr<const Packet> pa, > Ipv4Header const & h, > UnicastForwardCallback ucb, > ErrorCallback ecb, > Time exp /* = Simulator::Now () */, > uint32_t packetID /* = 0 */) > : m_packet (pa), > m_header (h), > m_ucb (ucb), > m_ecb (ecb), > m_expire (exp), > m_packetID (packetID) > { > } > Acknowledged. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:41: namespace ns3 { On 2015/02/03 01:25:45, Peter Barnes wrote: > Before namespace ns3 {: > > /** > * \file > * \ingroup epidemic > * ns3::Epidemic::QueueEntry and ns3::Epidemic::PacketQueue declarations. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:41: namespace ns3 { On 2015/02/03 01:25:45, Peter Barnes wrote: > Before namespace ns3 {: > > /** > * \file > * \ingroup epidemic > * ns3::Epidemic::QueueEntry and ns3::Epidemic::PacketQueue declarations. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:55: /// c-tor I tried both. None of them worked. On 2015/02/03 01:25:45, Peter Barnes wrote: > 1. Yuck on defaults for all arguments. Your code either gives no args or the > first four, so do this: > > QueueEntry (void); > > QueueEntry (Ptr<const Packet> pa, > Ipv4Header const & h, > UnicastForwardCallback ucb, > ErrorCallback ecb, > Time exp = Simulator::Now (), > uint32_t packetID = 0); > > See matching comment in the .cc file for the initializers. > > 2. In any case, document the arguments. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:65: m_packetID (packetID) On 2015/02/03 01:25:45, Peter Barnes wrote: > See the .cc file for these initializers; no inlines. Acknowledged. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:70: bool operator== (QueueEntry const & o) const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:71: /// Return the UnicastForwardCallback associated with the queued packet On 2015/02/03 01:25:45, Peter Barnes wrote: > /// \returns The ... Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:74: void SetUnicastForwardCallback (UnicastForwardCallback ucb); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:76: ErrorCallback GetErrorCallback () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:78: void SetErrorCallback (ErrorCallback ecb); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:80: Ptr<const Packet> GetPacket () const; On 2015/02/03 01:25:46, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:82: void SetPacket (Ptr<const Packet> p); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:84: Ipv4Header GetIpv4Header () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:86: void SetIpv4Header (Ipv4Header h); On 2015/02/03 01:25:46, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:88: void SetExpireTime (Time exp); On 2015/02/03 01:25:46, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:90: Time GetExpireTime () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:92: uint32_t GetPacketID () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:94: void SetPacketID (uint32_t id); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:94: void SetPacketID (uint32_t id); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:128: : m_maxLen (maxLen) On 2015/02/03 01:25:45, Peter Barnes wrote: > These initializers should really be in the .cc file; no inlines. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:138: bool Dequeue (QueueEntry & entry); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:140: uint32_t GetSize (); On 2015/02/03 01:25:46, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:142: uint32_t GetMaxQueueLen () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:144: void SetMaxQueueLen (uint32_t len); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:144: void SetMaxQueueLen (uint32_t len); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:146: Time GetQueueTimeout () const; On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:158: QueueEntry Find (uint32_t packetID); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:160: EpidemicSummaryVectorHeader GetSummaryVector (); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:166: EpidemicSummaryVectorHeader FindDisjointPackets (EpidemicSummaryVectorHeader list); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:182: void Purge (bool oldestOnly /* = false */); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:184: void Drop (PacketIdMap::iterator en, std::string reason); On 2015/02/03 01:25:45, Peter Barnes wrote: > Document the argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:35: NS_LOG_COMPONENT_DEFINE ("EpidemicPacket"); On 2015/02/03 01:25:46, Peter Barnes wrote: > Should be after namespace ns3 { Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:36: namespace ns3 { On 2015/02/03 01:25:46, Peter Barnes wrote: > Before namespace ns3 {: > > /** > * \file > * \ingroup epidemic > * ns3::Epidemic::TypeHeader, ns3::Epidemic::EpidemicSummaryVectorHeader > * and ns3::Epidemic::EpidemicHeader implementations. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:58: TypeId ("ns3::epidemic::TypeHeader").SetParent<Header> ().AddConstructor< On 2015/02/03 01:25:46, Peter Barnes wrote: > "ns3::Epidemic::…" [Capitalize Epidemic] > .SetParent… [Each .Function on a separate line] > .AddConstructor… Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:180: TypeId ("ns3::epidemic::EpidemicSummaryVectorHeader").SetParent< On 2015/02/03 01:25:46, Peter Barnes wrote: > "ns3::Epidemic::…" > .SetParent… > .AddConstructor... Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:278: EpidemicHeader::EpidemicHeader (uint32_t pkt_ID, uint32_t hopCount, On 2015/02/03 01:25:46, Peter Barnes wrote: > Remove this constructor; it's not needed. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:338: TypeId ("ns3::epidemic::EpidemicHeader") On 2015/02/03 01:25:46, Peter Barnes wrote: > "ns3::Epidemic::…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:41: On 2015/02/03 01:25:46, Peter Barnes wrote: > /** > * \file > * \ingroup epidemic > * ns3::Epidemic::TypeHeader, ns3::Epidemic::EpidemicSummaryVectorHeader > * and ns3::Epidemic::EpidemicHeader declarations. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:67: 0 On 2015/02/03 01:25:46, Peter Barnes wrote: > Align this table under \verbatim as for EpidemicSummaryVectorHeader: > > \verbatim > 0 1 2… > +-+-... Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:88: */ On 2015/02/03 01:25:47, Peter Barnes wrote: > * \param t Header message type. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:103: TypeId GetInstanceTypeId () const; On 2015/02/03 01:25:47, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:107: void SetMessageType (MessageType type); On 2015/02/03 01:25:46, Peter Barnes wrote: > Document argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:112: uint32_t GetSerializedSize () const; On 2015/02/03 01:25:46, Peter Barnes wrote: > Put all inherited together, without repeating the docs from the base class: > > // Inherited > TypeId GetInstanceTypeId () const; > uint32_t GetSerializedSize () const; > void Serialize (Buffer::Iterator start) const; > uint32_t Deserialize (Buffer::Iterator start); > void Print (std::ostream &os) const; > Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:130: /// Return type On 2015/02/03 01:25:47, Peter Barnes wrote: > /// \returns The message type. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:133: * Check that this is a valid MessageType. On 2015/02/03 01:25:46, Peter Barnes wrote: > * Check that this is a message of the expected type. > > Also document the arguments and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:140: bool IsValid () const; On 2015/02/03 01:25:47, Peter Barnes wrote: > Document the return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:142: bool operator== (TypeHeader const & o) const; On 2015/02/03 01:25:46, Peter Barnes wrote: > Document the argument and return type. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:153: it's in .cc file On 2015/02/03 01:25:46, Peter Barnes wrote: > /** > * \ingroup epidemic > * \brief Output streamer for TypeHeader. > * > * \param os The stream. > * \param h The TypeHeader. > * \returns The stream. > */ > std::ostream & operator<< (std::ostream & os, TypeHeader const & h); > > (Or did you mean to keep this private in epidemic-packet.cc?) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:157: * \ingroup epidemic On 2015/02/03 01:25:47, Peter Barnes wrote: > Uniform indentation Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:190: class EpidemicSummaryVectorHeader : public Header On 2015/02/03 01:25:46, Peter Barnes wrote: > Since this is already in namespace Epidemic, I suggest renaming this class to > SummaryVectorHeader. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:204: static TypeId GetTypeId (void); On 2015/02/03 01:25:46, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:209: virtual TypeId GetInstanceTypeId (void) const; On 2015/02/03 01:25:46, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:210: virtual uint32_t GetSerializedSize () const; On 2015/02/03 01:25:46, Peter Barnes wrote: > // Inherited Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:238: * \return A vector to store packet IDs. On 2015/02/03 01:25:46, Peter Barnes wrote: > * A vector … > > (It's not a function, so has no return value.) Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:247: On 2015/02/03 01:25:47, Peter Barnes wrote: > /** > * \ingroup epidemic > * \brief Output streamer for EpidemicSummaryVectorHeader. > * > * \param os The stream. > * \param packet The EpidemicSummaryVectorHeader. > * \returns The stream. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:280: * 0 1 2 3 On 2015/02/03 01:25:47, Peter Barnes wrote: > This needs \verbatim, \endverbatim: > > \verbatim > 0 1 2… > +-+-... Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:293: class EpidemicHeader : public Header Header could be confused with ns3::Header. On 2015/02/03 01:25:46, Peter Barnes wrote: > Since this is already in namespace Epidemic, I suggest renaming this class to > Header. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:302: EpidemicHeader (uint32_t pkt_ID = 0,uint32_t hopCount = 0, Caused errors. On 2015/02/03 01:25:47, Peter Barnes wrote: > This constructor is never called with arguments, and these are the default > values for the member variables, so just let the compiler supply the default > constructor. Delete this one. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:309: * \brief return TypeID. On 2015/02/03 01:25:46, Peter Barnes wrote: > * \brief Get the registered TypeId for this class. > * \return The object TypeId. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:316: virtual TypeId GetInstanceTypeId (void) const; On 2015/02/03 01:25:47, Peter Barnes wrote: > This is inherited, so don't duplicate the base class docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:360: }; it's in .cc file. On 2015/02/03 01:25:47, Peter Barnes wrote: > > /** > * \ingroup epidemic > * \brief Output streamer for EpidemicHeader. > * > * \param os The stream. > * \param packet The EpidemicHeader. > * \returns The stream. > */ > std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet); > > (Or did you mean to keep this private in epidemic-packet.cc?) https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:50: NS_LOG_COMPONENT_DEFINE ("EpidemicRoutingProtocol"); On 2015/02/03 01:25:47, Peter Barnes wrote: > Should be after namespace ns3 { Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:52: using namespace std; On 2015/02/03 01:25:47, Peter Barnes wrote: > Before using: > > /** > * \file > * \ingroup epidemic > * ns3::Epidemic::RoutingProtocol implementation. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:62: static TypeId tid = TypeId ("ns3::epidemic::RoutingProtocol") On 2015/02/03 01:25:47, Peter Barnes wrote: > "ns3::Epidemic::…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:708: Ipv4Address::GetAny (), EPIDEMIC_PORT)); On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > Missing the call to socket->BindToNetDevice (l3->GetNetDevice (i)); Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:734: miliseconds apart I do know how to queue all packets for transmission now. On 2015/02/03 01:25:47, Peter Barnes wrote: > The algorithm following this comment schedules each disjoint packet send 1 ms > apart. Why insert this delay instead of just queuing all the packets for > transmission now, and letting the socket handle it? Why is 1 ms the right > number, independent of the packet sizes, channel bit rate, etc? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:818: if (tHeader.GetMessageType () == TypeHeader::BEACON) On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > Either use a switch-case (llvm finds "missing" cases), or add a final "else" > statement (I know that there are only 3 message types, but it's safer to have a > default catch). Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:76: * Transport Port for MANET routing protocols ports On 2015/02/03 01:25:48, Peter Barnes wrote: > These two lines are left over; they are duplicated from EPIDEMIC_PORT, below. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:79: class RoutingProtocol : public Ipv4RoutingProtocol I could not rename it. There are many errors. On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > I know it's normal for IPv4 routing protocols, but I still find it very > annoying: the classes are all named "RoutingProtocol" and they are "just" in > different namespaces. > Is it possible to name it "EpidemicRoutingProtocol" ? https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:83: static TypeId GetTypeId (void); On 2015/02/03 01:25:47, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:89: virtual ~RoutingProtocol (); On 2015/02/03 01:25:48, Peter Barnes wrote: > /** Dummy destructor, see DoDispose. */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:90: virtual void DoDispose (); On 2015/02/03 01:25:48, Peter Barnes wrote: > /** Destructor implementation */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:147: void Start (); On 2015/02/03 01:25:47, Peter Barnes wrote: > /// Invoked by SetIpv4() Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:149: void RecvEpidemic (Ptr<Socket> socket); On 2015/02/03 01:25:48, Peter Barnes wrote: > Document argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:157: EpidemicSummaryVectorHeader packet_SMV,Ipv4Address dest); On 2015/02/03 01:25:47, Peter Barnes wrote: > Space after `,' Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:161: uint32_t FindOutputDeviceForAddress ( Ipv4Address dst); On 2015/02/03 01:25:48, Peter Barnes wrote: > Document argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:163: uint32_t FindLoopbackDevice (); On 2015/02/03 01:25:47, Peter Barnes wrote: > Document return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:165: void SendPacket (Ptr<Packet> p,InetSocketAddress addr); On 2015/02/03 01:25:47, Peter Barnes wrote: > Document arguments. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:167: bool IsMyOwnAddress (Ipv4Address src); On 2015/02/03 01:25:48, Peter Barnes wrote: > Document argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:169: void BroadcastPacket (Ptr<Packet> p); On 2015/02/03 01:25:47, Peter Barnes wrote: > Document argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:174: * True send a summary vector with reply header On 2015/02/03 01:25:47, Peter Barnes wrote: > \c true Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:175: * False send a summary vector with reply back header On 2015/02/03 01:25:48, Peter Barnes wrote: > \c false Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:179: Ptr<Socket> FindSocketWithInterfaceAddress ( On 2015/02/03 01:25:47, Peter Barnes wrote: > Document argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:182: void SendPacketFromQueue (Ipv4Address dst,QueueEntry queueEntry); On 2015/02/03 01:25:47, Peter Barnes wrote: > Document arguments. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:184: bool IsHostContactedRecently (Ipv4Address hostID); On 2015/02/03 01:25:47, Peter Barnes wrote: > Document argument and return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:44: static TypeId tid = TypeId ("ns3::epidemic::EpidemicTag").SetParent<Tag> () On 2015/02/03 01:25:48, Peter Barnes wrote: > "ns3::Epidemic::…" Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:50: class EpidemicTag : public Tag On 2015/02/03 01:25:48, Peter Barnes wrote: > Since this is already in namespace Epidemic, I suggest renaming this class to > ControlTag. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:58: NOT_SET, //!< Tag is not set On 2015/02/03 01:25:48, Peter Barnes wrote: > Align comments Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:68: static TypeId GetTypeId (); On 2015/02/03 01:25:48, Peter Barnes wrote: > /** > * Get the registered TypeId for this class. > * \return The object TypeId. > */ Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:70: TypeId GetInstanceTypeId () const; On 2015/02/03 01:25:48, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:73: TagType GetTagType () const; On 2015/02/03 01:25:48, Peter Barnes wrote: > Document return value. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:86: void SetTagType (const TagType tag); On 2015/02/03 01:25:48, Peter Barnes wrote: > Document argument. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: uint32_t GetSerializedSize () const; On 2015/02/03 01:25:48, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:92: void Serialize (TagBuffer i) const; On 2015/02/03 01:25:48, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:94: void Deserialize (TagBuffer i); On 2015/02/03 01:25:48, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:96: void Print (std::ostream &os) const; On 2015/02/03 01:25:48, Peter Barnes wrote: > Inherited, no docs here. Done. https://codereview.appspot.com/13831049/diff/245001/src/epidemic/wscript File src/epidemic/wscript (right): https://codereview.appspot.com/13831049/diff/245001/src/epidemic/wscript#newc... src/epidemic/wscript:4: module = bld.create_ns3_module('epidemic', ['internet', 'wifi', 'mesh', 'applications']) On 2015/02/08 09:29:28, Tommaso Pecorella wrote: > Move 'wifi', 'mesh', 'applications' dependency into the examples wscript. The > module shouldn't depend on unnecessary modules. Its examples may have separate > dependencies. > Moreover, limit the dependencies to the ones effectively used by the single > example. Done.
Sign in to reply to this message.
Mostly minor; all easy to fix. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:122: std::cerr << "Source number can not exceed number of nodes" << std::endl; (from patch-9 comment:) Add std::cerr << cmd; Rebase onto a newer ns-3, anything after r10654 c23778df1349 https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:128: std::cerr << "Sink number can not exceed number of nodes" << std::endl; (from patch-9 comment:) Add std::cerr << cmd; Rebase onto a newer ns-3, anything after r10654 c23778df1349 https://codereview.appspot.com/13831049/diff/265001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:61: // Inherited Unnecessary, since you said this two lines earlier. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:50: */ This block should be before "namespace ns3" https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:55: See the .h for steps 1. and 2. 3. Insert the constructor implementations here: QueueEntry::QueueEntry (void) : m_packet (0), m_header (Ipv4Header ()), m_ucb (UnicastForwardCallback ()), m_ecb (ErrorCallback ()), m_expire (Simulator::Now ()), m_packetID (0) { } QueueEntry::QueueEntry (Ptr<const Packet> pa, Ipv4Header const & h, UnicastForwardCallback ucb, ErrorCallback ecb, Time exp /* = Simulator::Now () */, uint32_t packetID /* = 0 */) : m_packet (pa), m_header (h), m_ucb (ucb), m_ecb (ecb), m_expire (exp), m_packetID (packetID) { } https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: */ This block should really be before "namespace ns3" https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:72: m_packetID (packetID) 1. Replace lines 63-74 with: QueueEntry (void); QueueEntry (Ptr<const Packet> pa, Ipv4Header const & h, UnicastForwardCallback ucb, ErrorCallback ecb, Time exp = Simulator::Now (), uint32_t packetID = 0); 2. Document these arguments: * \param pa … etc 3. See matching comment in epidemic-packet-queue.cc https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:77: bool operator== (QueueEntry const & o) const; Explicitly document argument: * \param o ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:81: void SetUnicastForwardCallback (UnicastForwardCallback ucb); Explicitly document argument: * \param ucb ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:85: void SetErrorCallback (ErrorCallback ecb); Explicitly document argument: * \param ecb ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:89: void SetPacket (Ptr<const Packet> p); Explicitly document argument: * \param p ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:93: void SetIpv4Header (Ipv4Header h); Explicitly document argument: * \param h ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:95: void SetExpireTime (Time exp); Explicitly document argument: * \param exp ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:101: void SetPacketID (uint32_t id); Explicitly document argument: * \param id ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:135: { No inlines means no {} here in the header file. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:140: * \param entry contains a packet Document return value https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:145: bool Dequeue (QueueEntry & entry); Explicitly document argument: * \param entry ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:151: void SetMaxQueueLen (uint32_t len); Explicitly document argument: * \param len ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:192: void Purge (bool oldestOnly /* = false */); Explicitly document argument: * \param oldestOnly ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:194: void Drop (PacketIdMap::iterator en, std::string reason); Explicitly document argument: * \param en … * \param reason ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:70: TypeHeader> (); Merge with previous line, so template argument is easy to see. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:78: * \endverbatim No '*' before \endverbatiim. (The '*' gets included in the verbatim section.) https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:121: * Check that this is a valid MessageType. "Check that this is a message of the expected type." https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:130: bool operator== (TypeHeader const & o) const; Explicitly document the arguments: * \param o … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:141: Yes, that's the point. If it's only in the .cc file, it can only be used there. It would be more useful if the signature was in this header, so people can print the header. On 2015/04/26 22:56:08, mjf.alenazi wrote: > it's in .cc file > On 2015/02/03 01:25:46, Peter Barnes wrote: > > /** > > * \ingroup epidemic > > * \brief Output streamer for TypeHeader. > > * > > * \param os The stream. > > * \param h The TypeHeader. > > * \returns The stream. > > */ > > std::ostream & operator<< (std::ostream & os, TypeHeader const & h); > > > > (Or did you mean to keep this private in epidemic-packet.cc?) > https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:171: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // Inherited-+-+-+-+-+-+-+-+-+-+-+-+-+ Whoops. Remove extraneous insertion. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:189: * \brief return TypeID. * \return The object TypeId. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:255: * The format of a global packet ID is a concatenation of 16 bit sender IP It's 32 bits in the diagram below. Which value is correct? https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:287: class EpidemicHeader : public Header This is only a problem if there is "using namespace ns3::Epidemic". Sggest renaming this class to Header On 2015/04/26 22:56:08, mjf.alenazi wrote: > Header could be confused with ns3::Header. > On 2015/02/03 01:25:46, Peter Barnes wrote: >> Since this is already in namespace Epidemic, I suggest renaming this class to >> Header. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:344: }; It's not useful in the .cc file without a public declaration here. On 2015/04/26 22:56:07, mjf.alenazi wrote: > it's in .cc file. > On 2015/02/03 01:25:47, Peter Barnes wrote: > > > > /** > > * \ingroup epidemic > > * \brief Output streamer for EpidemicHeader. > > * > > * \param os The stream. > > * \param packet The EpidemicHeader. > > * \returns The stream. > > */ > > std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet); > > > > (Or did you mean to keep this private in epidemic-packet.cc?) https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:717: Ipv4Address::GetAny (), EPIDEMIC_PORT)); Either do what Tommaso asked or explain why it's not needed. Every other use of socket->Bind has: socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), EPIDEMIC_PORT)); socket->BindToNetDevice (l3->GetNetDevice (i)); socket->SetAllowBroadcast (true); Why is this one different? https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:756: Simulator::Schedule (MilliSeconds (incrementalTimeSlot++), Just change this line to Simulator::Schedule (Time(0), and delete incrementalTimeSlot everywhere. On 2015/04/26 22:56:08, mjf.alenazi wrote: > I do know how to queue all packets for transmission now. > On 2015/02/03 01:25:47, Peter Barnes wrote: > > The algorithm following this comment schedules each disjoint packet send 1 ms > > apart. Why insert this delay instead of just queuing all the packets for > > transmission now, and letting the socket handle it? Why is 1 ms the right > > number, independent of the packet sizes, channel bit rate, etc? https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:77: class RoutingProtocol : public Ipv4RoutingProtocol @Tommaso: I encouraged relying on the Epidemic namespace instead of (redundantly) calling everything ns3::Epidemic::EpidemicFoo. The difference is two `:', and is more readable IMO. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:152: /// Captures incomming Epidemic packet via /p socket "incoming" https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:153: void RecvEpidemic (Ptr<Socket> socket); Explicitly document arguments: * \param socket … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:165: uint32_t FindOutputDeviceForAddress ( Ipv4Address dst); Explicitly document arguments: * \param dst … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:169: void SendPacket (Ptr<Packet> p,InetSocketAddress addr); Explicitly document arguments: * \param p … * \param addr … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:171: bool IsMyOwnAddress (Ipv4Address src); Explicitly document arguments: * \param src … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:173: void BroadcastPacket (Ptr<Packet> p); Explicitly document arguments: * \param p … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:183: Ptr<Socket> FindSocketWithInterfaceAddress ( Explicitly document arguments: * \param iface ... https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:186: void SendPacketFromQueue (Ipv4Address dst,QueueEntry queueEntry); Explicitly document arguments: * \param dst … * \param queueEntry … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:188: bool IsHostContactedRecently (Ipv4Address hostID); Explicitly document arguments: * \param hostId … https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:44: static TypeId tid = TypeId ("ns3::Epidemic::ControlTag").SetParent<Tag> () .SetParent<Tag> () is duplicated https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: void SetTagType (const TagType tag); Explicitly document arguments: * \param tag …
Sign in to reply to this message.
Hello everyone, I am resuming my epidemic code review. I have fixed all indicted issues except changing the classes' names from EpidemicHeader to Header. I tried to do it but I got many errors that I could not solve. Hopefully, I can fix that in the next patch set with the help of the reviewers. Best regards, Mohammed https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... File src/epidemic/examples/epidemic-example.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:122: std::cerr << "Source number can not exceed number of nodes" << std::endl; On 2015/04/28 23:42:31, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; > > Rebase onto a newer ns-3, anything after r10654 c23778df1349 Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/examples/epi... src/epidemic/examples/epidemic-example.cc:128: std::cerr << "Sink number can not exceed number of nodes" << std::endl; On 2015/04/28 23:42:31, Peter Barnes wrote: > (from patch-9 comment:) > Add > std::cerr << cmd; > > Rebase onto a newer ns-3, anything after r10654 c23778df1349 Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/helper/epide... File src/epidemic/helper/epidemic-helper.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/helper/epide... src/epidemic/helper/epidemic-helper.h:61: // Inherited On 2015/04/28 23:42:31, Peter Barnes wrote: > Unnecessary, since you said this two lines earlier. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:50: */ On 2015/04/28 23:42:32, Peter Barnes wrote: > This block should be before "namespace ns3" Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.cc:55: On 2015/04/28 23:42:32, Peter Barnes wrote: > See the .h for steps 1. and 2. > > 3. Insert the constructor implementations here: > > QueueEntry::QueueEntry (void) > : m_packet (0), > m_header (Ipv4Header ()), > m_ucb (UnicastForwardCallback ()), > m_ecb (ErrorCallback ()), > m_expire (Simulator::Now ()), > m_packetID (0) > { > } > > QueueEntry::QueueEntry (Ptr<const Packet> pa, > Ipv4Header const & h, > UnicastForwardCallback ucb, > ErrorCallback ecb, > Time exp /* = Simulator::Now () */, > uint32_t packetID /* = 0 */) > : m_packet (pa), > m_header (h), > m_ucb (ucb), > m_ecb (ecb), > m_expire (exp), > m_packetID (packetID) > { > } > Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet-queue.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:47: */ On 2015/04/28 23:42:32, Peter Barnes wrote: > This block should really be before "namespace ns3" Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:72: m_packetID (packetID) On 2015/04/28 23:42:32, Peter Barnes wrote: > 1. Replace lines 63-74 with: > > QueueEntry (void); > QueueEntry (Ptr<const Packet> pa, > Ipv4Header const & h, > UnicastForwardCallback ucb, > ErrorCallback ecb, > Time exp = Simulator::Now (), > uint32_t packetID = 0); > > 2. Document these arguments: > * \param pa … etc > > 3. See matching comment in epidemic-packet-queue.cc Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:77: bool operator== (QueueEntry const & o) const; On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param o ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:81: void SetUnicastForwardCallback (UnicastForwardCallback ucb); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param ucb ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:85: void SetErrorCallback (ErrorCallback ecb); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param ecb ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:89: void SetPacket (Ptr<const Packet> p); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param p ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:93: void SetIpv4Header (Ipv4Header h); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param h ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:95: void SetExpireTime (Time exp); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param exp ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:101: void SetPacketID (uint32_t id); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param id ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:135: { On 2015/04/28 23:42:32, Peter Barnes wrote: > No inlines means no {} here in the header file. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:140: * \param entry contains a packet On 2015/04/28 23:42:32, Peter Barnes wrote: > Document return value Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:145: bool Dequeue (QueueEntry & entry); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param entry ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:151: void SetMaxQueueLen (uint32_t len); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param len ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:151: void SetMaxQueueLen (uint32_t len); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param len ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:192: void Purge (bool oldestOnly /* = false */); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param oldestOnly ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet-queue.h:194: void Drop (PacketIdMap::iterator en, std::string reason); On 2015/04/28 23:42:32, Peter Barnes wrote: > Explicitly document argument: > * \param en … > * \param reason ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.cc:70: TypeHeader> (); On 2015/04/28 23:42:33, Peter Barnes wrote: > Merge with previous line, so template argument is easy to see. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-packet.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:78: * \endverbatim On 2015/04/28 23:42:33, Peter Barnes wrote: > No '*' before \endverbatiim. (The '*' gets included in the verbatim section.) Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:121: * Check that this is a valid MessageType. On 2015/04/28 23:42:33, Peter Barnes wrote: > "Check that this is a message of the expected type." Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:121: * Check that this is a valid MessageType. On 2015/04/28 23:42:33, Peter Barnes wrote: > "Check that this is a message of the expected type." Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:130: bool operator== (TypeHeader const & o) const; On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document the arguments: > * \param o … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:141: On 2015/04/28 23:42:33, Peter Barnes wrote: > Yes, that's the point. If it's only in the .cc file, it can only be used there. > It would be more useful if the signature was in this header, so people can > print the header. > > On 2015/04/26 22:56:08, mjf.alenazi wrote: > > it's in .cc file > > On 2015/02/03 01:25:46, Peter Barnes wrote: > > > /** > > > * \ingroup epidemic > > > * \brief Output streamer for TypeHeader. > > > * > > > * \param os The stream. > > > * \param h The TypeHeader. > > > * \returns The stream. > > > */ > > > std::ostream & operator<< (std::ostream & os, TypeHeader const & h); > > > > > > (Or did you mean to keep this private in epidemic-packet.cc?) > > Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:171: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // Inherited-+-+-+-+-+-+-+-+-+-+-+-+-+ On 2015/04/28 23:42:33, Peter Barnes wrote: > Whoops. Remove extraneous insertion. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:189: * \brief return TypeID. On 2015/04/28 23:42:33, Peter Barnes wrote: > * \return The object TypeId. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:189: * \brief return TypeID. On 2015/04/28 23:42:33, Peter Barnes wrote: > * \return The object TypeId. Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:255: * The format of a global packet ID is a concatenation of 16 bit sender IP On 2015/04/28 23:42:33, Peter Barnes wrote: > It's 32 bits in the diagram below. Which value is correct? Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:287: class EpidemicHeader : public Header On 2015/04/28 23:42:33, Peter Barnes wrote: > This is only a problem if there is "using namespace ns3::Epidemic". > > Sggest renaming this class to Header > > On 2015/04/26 22:56:08, mjf.alenazi wrote: > > Header could be confused with ns3::Header. > > On 2015/02/03 01:25:46, Peter Barnes wrote: > >> Since this is already in namespace Epidemic, I suggest renaming this class to > >> Header. Acknowledged. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-packet.h:344: }; On 2015/04/28 23:42:33, Peter Barnes wrote: > It's not useful in the .cc file without a public declaration here. > > On 2015/04/26 22:56:07, mjf.alenazi wrote: > > it's in .cc file. > > On 2015/02/03 01:25:47, Peter Barnes wrote: > > > > > > /** > > > * \ingroup epidemic > > > * \brief Output streamer for EpidemicHeader. > > > * > > > * \param os The stream. > > > * \param packet The EpidemicHeader. > > > * \returns The stream. > > > */ > > > std::ostream & operator<< (std::ostream& os, const EpidemicHeader & packet); > > > > > > (Or did you mean to keep this private in epidemic-packet.cc?) Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:717: Ipv4Address::GetAny (), EPIDEMIC_PORT)); On 2015/04/28 23:42:33, Peter Barnes wrote: > Either do what Tommaso asked or explain why it's not needed. > > Every other use of socket->Bind has: > > socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), EPIDEMIC_PORT)); > socket->BindToNetDevice (l3->GetNetDevice (i)); > socket->SetAllowBroadcast (true); > > Why is this one different? Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:717: Ipv4Address::GetAny (), EPIDEMIC_PORT)); On 2015/04/28 23:42:33, Peter Barnes wrote: > Either do what Tommaso asked or explain why it's not needed. > > Every other use of socket->Bind has: > > socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), EPIDEMIC_PORT)); > socket->BindToNetDevice (l3->GetNetDevice (i)); > socket->SetAllowBroadcast (true); > > Why is this one different? Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.cc:756: Simulator::Schedule (MilliSeconds (incrementalTimeSlot++), On 2015/04/28 23:42:33, Peter Barnes wrote: > Just change this line to > Simulator::Schedule (Time(0), > > and delete incrementalTimeSlot everywhere. > On 2015/04/26 22:56:08, mjf.alenazi wrote: > > I do know how to queue all packets for transmission now. > > On 2015/02/03 01:25:47, Peter Barnes wrote: > > > The algorithm following this comment schedules each disjoint packet send 1 > ms > > > apart. Why insert this delay instead of just queuing all the packets for > > > transmission now, and letting the socket handle it? Why is 1 ms the right > > > number, independent of the packet sizes, channel bit rate, etc? Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-routing-protocol.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:77: class RoutingProtocol : public Ipv4RoutingProtocol On 2015/04/28 23:42:33, Peter Barnes wrote: > @Tommaso: I encouraged relying on the Epidemic namespace instead of > (redundantly) calling everything ns3::Epidemic::EpidemicFoo. The difference is > two `:', and is more readable IMO. Acknowledged. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:152: /// Captures incomming Epidemic packet via /p socket On 2015/04/28 23:42:33, Peter Barnes wrote: > "incoming" Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:153: void RecvEpidemic (Ptr<Socket> socket); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param socket … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:171: bool IsMyOwnAddress (Ipv4Address src); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param src … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:173: void BroadcastPacket (Ptr<Packet> p); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param p … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:183: Ptr<Socket> FindSocketWithInterfaceAddress ( On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param iface ... Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:186: void SendPacketFromQueue (Ipv4Address dst,QueueEntry queueEntry); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param dst … > * \param queueEntry … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-routing-protocol.h:188: bool IsHostContactedRecently (Ipv4Address hostID); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param hostId … Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.cc (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.cc:44: static TypeId tid = TypeId ("ns3::Epidemic::ControlTag").SetParent<Tag> () On 2015/04/28 23:42:33, Peter Barnes wrote: > .SetParent<Tag> () is duplicated Done. https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... File src/epidemic/model/epidemic-tag.h (right): https://codereview.appspot.com/13831049/diff/265001/src/epidemic/model/epidem... src/epidemic/model/epidemic-tag.h:89: void SetTagType (const TagType tag); On 2015/04/28 23:42:33, Peter Barnes wrote: > Explicitly document arguments: > * \param tag … Done.
Sign in to reply to this message.
This code review has migrated to https://codereview.appspot.com/323290043/ in order to accommodate the port to ns-3.27.
Sign in to reply to this message.
> On 14 Jul 2017, at 21:40, tomh.org@gmail.com wrote: > > This code review has migrated to > https://codereview.appspot.com/323290043/ in order to accommodate the > port to ns-3.27. > > https://codereview.appspot.com/13831049/ Thanks. Has progress been made on the renaming, Mohammed? Thanks, James ----------------------------------------------------------------------mb-- James P.G. Sterbenz 司徒傑莫 송재윤 +1 508 944 3067 www.ittc.ku.edu/~jpgs jpgs@{ittc|eecs}.ku.edu 154 Nichols ITTC EECS – The University of Kansas jpgs@comp.lancs.ac.uk. Comp & Comms and InfoLab21 – Lancaster University jpgs@comp.polyu.edu.hk Computing – The Hong Kong Polytechnic University jpgs@tik.ee.ethz.ch jpgs@{acm|ieee|comsoc|computer|m.ieice}.org jpgs@sterbenz.org skype:jpgsterbenz jpgsterbenz@gmail.com jpgs!scc!lancs!janet!geant!moskvax!ihnp4!internet2!gpn!kanren!ku!ittc!jpgs
Sign in to reply to this message.
On 2017/07/14 14:37:06, jpgs_ittc.ku.edu wrote: > > On 14 Jul 2017, at 21:40, mailto:tomh.org@gmail.com wrote: > > > > This code review has migrated to > > https://codereview.appspot.com/323290043/ in order to accommodate the > > port to ns-3.27. > > > > https://codereview.appspot.com/13831049/ > > Thanks. > > Has progress been made on the renaming, Mohammed? > > Thanks, > James > > ----------------------------------------------------------------------mb-- > James P.G. Sterbenz 司徒傑莫 송재윤 +1 508 944 3067 http://www.ittc.ku.edu/~jpgs > mailto:jpgs@{ittc|eecs}.ku.edu 154 Nichols ITTC EECS – The University of Kansas > mailto:jpgs@comp.lancs.ac.uk. Comp & Comms and InfoLab21 – Lancaster University > mailto:jpgs@comp.polyu.edu.hk Computing – The Hong Kong Polytechnic University > mailto:jpgs@tik.ee.ethz.ch mailto:jpgs@{acm|ieee|comsoc|computer|m.ieice}.org > mailto:jpgs@sterbenz.org skype:jpgsterbenz mailto:jpgsterbenz@gmail.com > jpgs!scc!lancs!janet!geant!moskvax!ihnp4!internet2!gpn!kanren!ku!ittc!jpgs > No James, it is still outstanding. Hopefully, we can fix it in the next patch. This code review has migrated to https://codereview.appspot.com/323290043/ in order to accommodate the port to ns-3.27.
Sign in to reply to this message.
Hi, I am working on a project but I would want to how the percentage of messages delivered and message delivery latency were done. I am new to ns3 and I would appreciate any help. Thank you very much.
Sign in to reply to this message.
|