组播都是udp报文发送,发送用的地方在选路
ns3有组播的例子,加默认路由,静态组播路由,这几个例子我没看懂。FIXME
这几个例子与我想要的区别是,我要针对quagga加增内容,改造,而不能像ns3的组播路由那样自由发挥FIXME
现状:采用dce直接路由组播的结果是:
assert failed. cond="oif", msg="Try to send on link-local multicast address, and no interface index is given!", file=../model/ipv4-dce-routing.cc, line=409
terminate called without an active exception
需要变更成组播顺利发送
另一个想法:如果直接使用linux栈(日本人做的那个ns-next-sim协议栈),可能是一切工作正常的。那个栈的劣势是和ns3其他部分有些脱离。FIXME
回来处理那个assert
Breakpoint 4, ns3::Ipv4DceRouting::LookupStatic (this=0x6c1d40, dest=..., oif=...) at ../model/ipv4-dce-routing.cc:409
409 NS_ASSERT_MSG (oif, "Try to send on link-local multicast address, and no interface index is given!");
(gdb) bt
#0 ns3::Ipv4DceRouting::LookupStatic (this=0x6c1d40, dest=..., oif=...) at ../model/ipv4-dce-routing.cc:409
#1 0x00007ffff7ac912b in ns3::Ipv4DceRouting::RouteOutput (this=0x6c1d40, p=..., header=..., oif=..., sockerr=@0x7fffffffcfec: 32767) at ../model/ipv4-dce-routing.cc:664
#2 0x00007ffff6d1170a in ns3::UdpSocketImpl::DoSendTo (this=0x7fffdc006200, p=..., dest=..., port=646) at ../src/internet/model/udp-socket-impl.cc:621
#3 0x00007ffff6d140ca in ns3::UdpSocketImpl::SendTo (this=0x7fffdc006200, p=..., flags=64, address=...) at ../src/internet/model/udp-socket-impl.cc:807
#4 0x00007ffff7a44df4 in ns3::UnixDatagramSocketFd::MainSendTo (this=0x7fffdc007ed0, r=0x7ffff0a29e6c, p=..., f=64, ad=...) at ../model/unix-datagram-socket-fd.cc:510
#5 0x00007ffff7a45787 in ns3::EventImpl* ns3::MakeEvent
#6 0x00007ffff733b5e7 in ns3::EventImpl::Invoke (this=0x7fffdc024bf0) at ../src/core/model/event-impl.cc:51
#7 0x00007ffff7a8a5ba in ns3::TaskManager::Schedule (this=0x67dc00) at ../model/task-manager.cc:441
#8 0x00007ffff7a8c5ad in ns3::EventImpl* ns3::MakeEvent
#9 0x00007ffff733b5e7 in ns3::EventImpl::Invoke (this=0x64f120) at ../src/core/model/event-impl.cc:51
#10 0x00007ffff73402ac in ns3::DefaultSimulatorImpl::ProcessOneEvent (this=0x6b1870) at ../src/core/model/default-simulator-impl.cc:147
#11 0x00007ffff7340638 in ns3::DefaultSimulatorImpl::Run (this=0x6b1870) at ../src/core/model/default-simulator-impl.cc:200
#12 0x00007ffff733c378 in ns3::Simulator::Run () at ../src/core/model/simulator.cc:204
#13 0x000000000040cd90 in main (argc=1, argv=0x7fffffffdc08) at ../myscripts/ns-3-dce-quagga/example/dce-quagga-mpls.cc:219
(gdb)
发送是由ldp hello触发的,
查看
#2 0x00007ffff6d1170a in ns3::UdpSocketImpl::DoSendTo (this=0x7fffdc006200, p=..., dest=..., port=646) at ../src/internet/model/udp-socket-impl.cc:621
发现m_boundnetdevice是0,表示并没有发生过bind操作。
查这篇文章,看到client和server都是有bind的。
http://www.cnblogs.com/hnrainll/archive/2011/11/07/2238671.html
查quagga,发现hello有绑定的
mpls_socket_bind
mpls_socket_udp_sendto
如此找bind,linux kernel的处理代码是inet_bind,对于组播来说,这个绑定也许真没用FIXME
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~