Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1380)

Issue 121680043: MLDv2 final code review

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by KrishnaTeja
Modified:
9 years, 8 months ago
Reviewers:
Tommaso Pecorella
Visibility:
Public.

Description

MLDv2 implementation in |ns3| ----------------------------- This chapter describes MLDv2 implementation in |ns3|. Developed by Krishna Teja . Model Description ***************** The source code for MLDv2 model lives in the directory ``src/internet/model``. The implementation of MLDv2 protocol is contained in the following files: .. sourcecode:: text src/internet/model/mldv2.{cc,h} src/internet/model/mldv2-router-table.{cc,h} src/internet/model/mldv2-router-entry.{cc,h} src/internet/model/icmpv6-header.{cc,h} Enabling MLDv2 protocol *********************** By default MLDv2 protocol is disabled on an interface as this protocol generates periodic queries To enable it one can create and aggregate MLDv2 object manually. As an example: :: Ptr<Mldv2> mldv2 = CreateObject<Mldv2> (); node->AggregateObject (mldv2); MLDv2 protocol can also be enabled using InternetStackHelper.As an example: :: n.Create (2); InternetStackHelper internetv6; internetv6.SetMldv2 (true); internetv6.Install (n); MLDV2 Interactions ****************** Sockets request to join multicast groups using pubic function:: Ipv6JoinGroup (Ipv6Address address, Ipv6MulticastFilterMode filterMode, std::vector<Ipv6Address> sourceAddresses) This function is used as join, leave a multicast group or modify source filters of socket. For users who intend not to use filters can use helper function which in-turn use the above method function:: Ipv6JoinGroup (Ipv6Address address); Similarly for leaving group users can use function:: Ipv6LeaveGroup (); Socket class notifies Mldv2 class about the joins and leaves. Mldv2 process these requests and sends messages to different nodes using Icmpv6L4Protocol object. Icmpv6L4Protocol objects receive these ICMP packets and send them to MLDv2 class for handling them. MLDV2 Implementation ******************** * class :cpp:class:`Mldv2`: This class implements Mldv2 protocol and handles MLDV2 interactions. * class :cpp:class:`Mldv2RouterEntry`: This class helps in updating source timers, changing filter modes of the entry. * class :cpp:class:`Mldv2RouterTable`: This class helps in adding, deleting Mldv2 entries and also maintain filter timers. Attributes ========== The attributes that the Mldv2 class holds include the following: * QueryInterval: The time gap between two consecutive general queries. The default value is 125 seconds. * LastListenerQueryInterval: The total time the router should wait for a report, after the querier has sent the first query.The default value is 1 second. * Robustness: Protocol robustness variable. The default value is 1. As of now robustness variable is ignored. * MaximumResponseDelay: The the maximum time allowed before sending a responding Report. As of now Maximum Response Code value is ignored. Examples ======== * Example: mldv2-example.cc located in src/internet/examples ** Run the file: $ ./waf --run mldv2-example.cc ** Expected output from the previous commands: mldv2-0-1.pcap and mldv2.tr are produced Validation ========== The MLDv2 model is tested using Mldv2ProtocolTestSuite class defined in ``src/internet/test/mldv2-test.cc``. The suite includes 3 tests: * Test 1: The first test checks the operators of Mldv2 class. * Test 2: The second test checks the proper joining and leaving of Multicast groups without filter options. * Test 3: The third test checks the proper joining and leaving of Multicast groups with filter options. The test suite can be run using the following commands: $ ./waf configure --enable-examples --enable-tests $ ./waf build $ ./test.py mldv2-test Todo ==== * Robustness variable is not considered as of now. So there is no tuning for the expected packet loss on the link. This will be completed in the near time. * Maximum response delay is not considered as on now. So as of now there are immediate reply to queries. This will be completed in the near time. Limitations *********** * MLDv2 is spreading the nodes multicast groups join/leave events but MLDv2 alone cannot update routing tables. This will handled in due time by developing PIM-SM protocol. * Querier election is not handled as of now when there are multiple routers.This will handled in due time. * Packet does not contain Router Alert Hop-By-Hop Option . The API to add Hop-By-Hop Options header of the IPv6 packet is not yet defined.

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+3273 lines, -55 lines) Patch
M doc/models/Makefile View 1 chunk +1 line, -0 lines 0 comments Download
A examples/ipv6/mldv2-example.cc View 1 chunk +148 lines, -0 lines 0 comments Download
M examples/ipv6/wscript View 1 chunk +3 lines, -0 lines 0 comments Download
A src/internet/doc/mldv2.rst View 1 chunk +122 lines, -0 lines 0 comments Download
M src/internet/helper/internet-stack-helper.h View 2 chunks +13 lines, -0 lines 0 comments Download
M src/internet/helper/internet-stack-helper.cc View 6 chunks +15 lines, -1 line 0 comments Download
M src/internet/model/icmpv6-header.h View 1 chunk +241 lines, -0 lines 1 comment Download
M src/internet/model/icmpv6-header.cc View 5 chunks +302 lines, -4 lines 8 comments Download
M src/internet/model/icmpv6-l4-protocol.cc View 7 chunks +18 lines, -3 lines 0 comments Download
M src/internet/model/ipv6-list-routing.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/internet/model/ipv6-raw-socket-impl.h View 3 chunks +8 lines, -6 lines 0 comments Download
M src/internet/model/ipv6-raw-socket-impl.cc View 8 chunks +43 lines, -16 lines 0 comments Download
M src/internet/model/ipv6-static-routing.cc View 1 chunk +1 line, -2 lines 0 comments Download
A src/internet/model/mldv2.h View 1 chunk +268 lines, -0 lines 0 comments Download
A src/internet/model/mldv2.cc View 1 chunk +872 lines, -0 lines 0 comments Download
A src/internet/model/mldv2-router-entry.h View 1 chunk +144 lines, -0 lines 0 comments Download
A src/internet/model/mldv2-router-entry.cc View 1 chunk +245 lines, -0 lines 0 comments Download
A src/internet/model/mldv2-router-table.h View 1 chunk +140 lines, -0 lines 0 comments Download
A src/internet/model/mldv2-router-table.cc View 1 chunk +147 lines, -0 lines 0 comments Download
M src/internet/model/udp-socket-impl.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/internet/model/udp-socket-impl.cc View 10 chunks +38 lines, -16 lines 0 comments Download
A src/internet/test/mldv2-test.cc View 1 chunk +418 lines, -0 lines 0 comments Download
M src/internet/wscript View 3 chunks +7 lines, -0 lines 0 comments Download
M src/network/model/socket.h View 6 chunks +41 lines, -2 lines 1 comment Download
M src/network/model/socket.cc View 5 chunks +35 lines, -4 lines 0 comments Download

Messages

Total messages: 1
Tommaso Pecorella
9 years, 8 months ago (2014-08-15 18:24:57 UTC) #1
https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
File src/internet/model/icmpv6-header.cc (right):

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2036: size=size+m_multicastRecords.size
()*20;
Mind to be a bit simpler ?
uint32_t size=8 + m_multicastRecords.size ()*20;

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2041: size=size;
well, this is superfluous

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2093: i.ReadU8 ();
according to the standard, you must discard eventual Aux data. Still, they MAY
be there.
Either you throw an error if the field is non-zero, or you read (and discard)
them.

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2161: return size;
As for the other Serialize...
uint32_t size = 8 + 20 + 16 * m_sourceAddresses.size ();

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2211: SetFlagS ((byte) & (1 << 3));
it should be ((byte >> 3) & 0x1)

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2238: uint8_t
Icmpv6Mldv2Query::GetQueryIntervalCode () const
Not standard compliant

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2259:
m_robustnessVariable=robustnessVariable;
Enforce that the variable is 3-bit wide. I.e., reject any value grater than 7.
   [...]    If the querier's
   [Robustness Variable] exceeds 7, the maximum value of the QRV field,
   the QRV is set to zero.

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.cc:2274: uint16_t
Icmpv6Mldv2Query::GetMaximumResponseCode () const
Not standard compliant

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
File src/internet/model/icmpv6-header.h (right):

https://codereview.appspot.com/121680043/diff/1/src/internet/model/icmpv6-hea...
src/internet/model/icmpv6-header.h:1793: enum Record_Type
RecordType

https://codereview.appspot.com/121680043/diff/1/src/network/model/socket.h
File src/network/model/socket.h (right):

https://codereview.appspot.com/121680043/diff/1/src/network/model/socket.h#ne...
src/network/model/socket.h:951: Ipv6Address m_ipv6MulticastGroupAddress;
Initialize it in the socket's constructor. Set to Any().
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b