Bug 1688 - Routers should advertise themselves from the link-local address
Routers should advertise themselves from the link-local address
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
ns-3-dev
All All
: P5 normal
Assigned To: Tommaso Pecorella
:
: 1696 (view as bug list)
Depends on: 1697
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-21 23:06 UTC by shiguowang
Modified: 2013-06-20 04:09 UTC (History)
3 users (show)

See Also:


Attachments
Modify route r1's routing table, now the next-hop address is link-local. (786 bytes, patch)
2013-05-21 23:09 UTC, shiguowang
Details | Diff
patch (3.69 KB, patch)
2013-06-16 05:34 UTC, Tommaso Pecorella
Details | Diff
new patch, cleaned (3.11 KB, patch)
2013-06-16 05:38 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description shiguowang 2013-05-21 23:06:15 UTC
This means the routing table should have link-local address as next hop.
you can reference http://keepingitclassless.net/2013/03/ipv6-next-hop-best-practices/ this article's name is "IPv6 Next-Hop Best Practices".
Comment 1 shiguowang 2013-05-21 23:09:53 UTC
Created attachment 1601 [details]
Modify route r1's routing table, now the next-hop address is link-local.
Comment 2 Tommaso Pecorella 2013-06-15 05:14:06 UTC
*** Bug 1696 has been marked as a duplicate of this bug. ***
Comment 3 Tommaso Pecorella 2013-06-15 05:21:55 UTC
For a discussion on this bug. see Bug 1646
Comment 4 Tommaso Pecorella 2013-06-16 05:34:08 UTC
Created attachment 1611 [details]
patch
Comment 5 Tommaso Pecorella 2013-06-16 05:38:14 UTC
Created attachment 1612 [details]
new patch, cleaned
Comment 6 Tommaso Pecorella 2013-06-19 03:27:38 UTC
fixed in changeset 9848:800877664177
Comment 7 Hajime Tazaki 2013-06-19 22:45:56 UTC
I think the following assertion is too much, isn't it ?

src/internet/model/ipv6-static-routing.cc

    4.13  void Ipv6StaticRouting::AddNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse, uint32_t metric)
    4.14  {
    4.15    NS_LOG_FUNCTION (this << network << networkPrefix << nextHop << interface << prefixToUse << metric);
    4.16 +  NS_ASSERT_MSG(nextHop.IsLinkLocal(), "Ipv6StaticRouting::AddNetworkRouteTo - Next hop must be link-local");


I guess, the requirement described in the RFC(4861, Section 8) is only about routers, not necessary for hosts.

# since I have a code to configure a host.
  routing->SetDefaultRoute (Ipv6Address ("2001:1:2:6::2"), 1, Ipv6Address ("::"), 0);
Comment 8 Tommaso Pecorella 2013-06-20 04:09:26 UTC
(In reply to comment #7)
> I think the following assertion is too much, isn't it ?
> 
> src/internet/model/ipv6-static-routing.cc
> 
>     4.13  void Ipv6StaticRouting::AddNetworkRouteTo (Ipv6Address network,
> Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address
> prefixToUse, uint32_t metric)
>     4.14  {
>     4.15    NS_LOG_FUNCTION (this << network << networkPrefix << nextHop <<
> interface << prefixToUse << metric);
>     4.16 +  NS_ASSERT_MSG(nextHop.IsLinkLocal(),
> "Ipv6StaticRouting::AddNetworkRouteTo - Next hop must be link-local");
> 
> 
> I guess, the requirement described in the RFC(4861, Section 8) is only about
> routers, not necessary for hosts.
> 
> # since I have a code to configure a host.
>   routing->SetDefaultRoute (Ipv6Address ("2001:1:2:6::2"), 1, Ipv6Address
> ("::"), 0);

According to the RFC, a router must advertise itself from the link-local address, and this is consistent, as the hosts should be able to reach it from the link local network.

If an host can't reach the default router from the link-local address, it means only one thing: that the router isn't in their LL network and there's another router in between, so that router can't be the default one.

Moreover, a router could (and should) discard packets that should be routed and are sent to its global address (it's a risk, they could be from loops or forged by an attacker).

I know using link-local addresses can be a pain, but even hosts should use that kind of address.
I'm going to revamp the helpers to set up the routers, including radvd. This should help a bit.

Cheers,
T.