Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aodvv2: add routes to FIB #2985

Merged
merged 2 commits into from
Jul 15, 2015
Merged

Conversation

Lotterleben
Copy link
Member

This PR introduces the FIB to AODVv2. All routes which are found will be added to the FIB, and the FIB now initiates route discoveries.
What's still missing is that routes aren't updated when they are used. This will be introduced after #2815 has been merged.
The tests are pretty rudimentary, but I thought I'd include them anyway for clarity. if you want to, I can remove them.


fib_register_rp((uint8_t*) &aodvv2_prefix, aodvv2_prefix_len);

//fib_register_rp((uint8_t*) &aodvv2_prefix, aodvv2_prefix_len);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove

@BytesGalore
Copy link
Member

nice one 👍 will test

@Lotterleben
Copy link
Member Author

Addressed comments and rebased to current master

*
* @}
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add:

#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif

and header guards

@BytesGalore
Copy link
Member

please add an empty assets folder to the RIOT/tests/aodvv2 directory.
Else buffering RREQ/RREP messages produce an access violation.


/* make sure sender_thread is done */
sleep(2);
aodv_test_writer_write_more_recent_rrep();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This writer is called but doesn't seem to store ./assets/more_recent_rrep, resulting in an access violation in aodv_test_update_fib_regular_rreq() when trying to load the missing file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, this works on my machine too. I'd suggest this is because the call to aodv_init() that comes after it overwrites the callback too quickly; I'll add another sleep(2), can you test if it works for you too then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested works :)

@Lotterleben
Copy link
Member Author

@BytesGalore doesn't git forbid you from adding empty directories? I guess It'd make more sense to write proper code to prevent that error ^^

@Lotterleben
Copy link
Member Author

Also, judging by your header comments I'm assuming the tests stay in?

@BytesGalore
Copy link
Member

@Lotterleben don't know how git handles empty directories, but another possibility is to create the directory by the Makefile when calling make :)

@OlegHahm
Copy link
Member

@BytesGalore doesn't git forbid you from adding empty directories?

Git just cannot store directory information, only files can be stored. A common workaround is to put an (empty) .gitignore into the directory.

@BytesGalore
Copy link
Member

@Lotterleben I would vote to store the RREPs/RREQs in a global buffer instead of writing them to files. Currently this test is only applicable on native.
Using a buffer would make this test independent from the board.

@Lotterleben
Copy link
Member Author

The idea behind storing them in files was that they could be tracked too and any differences in the message format caused by unvoluntary changes could be detected, but I guess that was a little bit too enthusiastic of an approach...

@BytesGalore
Copy link
Member

Then I propose to provide an optional feature in the tests to store the RREP/RREQ in files only when native is used :)

@OlegHahm OlegHahm added this to the Release 2015.06 milestone May 19, 2015
@Lotterleben
Copy link
Member Author

Currently, this PR as well as #2985 are modifying ip.c to get anything working with the routing protocols which are still on the network stack... I really wouldn't proposed my changes to be merged, but I think ít would make sense to introduce an ifdef-based workaround to ip.c so that the fib can be used and tested even before all routing protocols have been moved to the network stack when it's ready... What do you think @OlegHahm @BytesGalore?

@BytesGalore
Copy link
Member

I think you meant #2765 :)
+1 to do something to keep the current network stack operable until all routing protocols are migrated to the FIB/the nameless network stack.

@Lotterleben
Copy link
Member Author

Ssoooo tests are updated and everything is squashed :)

{
int i; /* make clang stfu */
i = netaddr_from_string(&aodvv2_test_origaddr, "::10");
i = netaddr_from_string(&aodvv2_test_sender_oa, "::11");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok travis seems to be a bit picky here:
tests/aodvv2/main.c:76: performance (redundantAssignment): Variable 'i' is reassigned a value before the old one has been used. ...
I think you can calm travis when using += from this line on :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make i volatile

@Lotterleben
Copy link
Member Author

Squashed and rebased again

@Lotterleben
Copy link
Member Author

(Can I add the ready for CI build flag and see what travis says?)

@BytesGalore BytesGalore added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 16, 2015
@BytesGalore
Copy link
Member

lets rock :)

static void aodvv2_init_testdata(void)
{
volatile int i; /* make clang stfu */
i = netaddr_from_string(&aodvv2_test_origaddr, "::10");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, volatile doesn't seem to calm travis

tests/aodvv2/main.c:70: performance (redundantAssignment): Variable 'i' is reassigned a value before the old one has been used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigh... += it is, then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about checking if the conversion worked accordingly with a return value isof 0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean just to make sure? That makes sense...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose this:

static int aodvv2_init_testdata(void)
{
    if( netaddr_from_string(&aodvv2_test_origaddr, "::10") == -1 ) {
        return -1;
    }

    if( netaddr_from_string(&aodvv2_test_sender_oa, "::11") == -1 ) {
        return -1;
    }

    if( netaddr_from_string(&aodvv2_test_sender_ta, "::12") == -1 ) {
        return -1;
    }

    if( netaddr_from_string(&aodvv2_test_targaddr, "::13") == -1 ) {
        return -1;
    }
    return 0;
}

@Lotterleben Lotterleben force-pushed the aodvv2_fib branch 2 times, most recently from 3d5fb7d to 72baaca Compare June 16, 2015 10:00
@Lotterleben
Copy link
Member Author

Oha... seems like the test exceeds the memory of a lot of boards... I'll have to investigate that. :S

@Lotterleben
Copy link
Member Author

Seems like my very ambitious values for AODVV2_RREQ_BUF (128) and AODVV2_MAX_ROUTING_ENTRIES (255 !!! What the hell) are the main offenders. I'm wondering if I should just blacklist smaller boards for now, or open a PR trimming down those sizes, or wait for us to figure out a doable solution for setting these variables at compile time (see #3022)...

@BytesGalore
Copy link
Member

+1 for blacklisting the test.
maybe we could provide a slim version in the future that suits the constraints of the smaller guys.

@BytesGalore
Copy link
Member

(I mean blacklisting the boards not the test ;) )

@Lotterleben
Copy link
Member Author

I've whitelisted only native for now...

@Lotterleben
Copy link
Member Author

rebased to current master

int main(void)
{
aodvv2_init_testdata();
aodvv2_setup_node();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I propose to change this to:

    if( aodvv2_init_testdata() != 0 ) {
        return -1;
    }

    if( aodvv2_setup_node() != 0 ) {
        return -1;
    }

@Lotterleben
Copy link
Member Author

Addressed comments and rebased onto current master

@BytesGalore
Copy link
Member

I guess you can squash and we see if the dynamic duo (travis and strider) get happy :)

@BytesGalore
Copy link
Member

nice, the duo is happy and so am I -> ACK

@BytesGalore
Copy link
Member

and GO

BytesGalore pushed a commit that referenced this pull request Jul 15, 2015
@BytesGalore BytesGalore merged commit 5b0d63f into RIOT-OS:master Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants