[Ns-developers] IPv6 IPsec extension

Lalith Suresh suresh.lalith at gmail.com
Wed Mar 16 09:54:59 PDT 2011


Hello,

On Wed, Mar 16, 2011 at 2:56 PM, Bernd Hirschler
<bernd.hirschler at gmail.com> wrote:
> Hello ns3 developers!
>
> For a projec i am implementing the IPsec extensions for IPv6.
> I made myself familiar with the IPv6 code and started implementing the
> headers for AH and ESP.
> To test my code i added the following code to the ping6 application (into
> the send function in ping6.cc):
> Ipv6ExtensionAHHeader AHHeader;
> AHHeader.SetNextHeader(Ipv6Header::IPV6_ICMPV6);
> AHHeader.SetLength(AHHeader.GetLength());
> AHHeader.SetReserved(0);
> AHHeader.SetSPI(1);
> AHHeader.SetSequenceNumber(2);
> AHHeader.SetTest((char *)"aaaaaaaaaaaa", (uint8_t) 13);
> p->AddHeader (AHHeader);
> NS_LOG_INFO ("Add AH Header " << AHHeader.GetTest());
> m_socket->SetAttribute ("Protocol", UintegerValue
> (Ipv6Header::IPV6_EXT_AUTHENTIFICATION));
>
> The simulation starts successfully but after the packet is generated and
> sent it stops:
> Create nodes.
> Create channels.
> Assign IPv6 Addresses.
> Create Applications.
> Ping6Application:Ping6()
> Ping6Application:SetLocal(0x1eab080,
> 0000:0000:0000:0000:0000:0000:0000:0000)
> Ping6Application:SetRemote(0x1eab080,
> ff02:0000:0000:0000:0000:0000:0000:0001)
> Run Simulation.
> Ping6Application:StartApplication()
> Ping6Application:ScheduleTransmit(0x1eab080, 0ns)
> Ping6Application:Send()
> Add AH Header aaaaaaaaaaaa
> Sent 106 bytes to ff02:0000:0000:0000:0000:0000:0000:0001
> assert failed. cond="interface", msg="Try to send on link-local multicast
> address, and no interface index is given!",
> file=../src/routing/static-routing/model/ipv6-static-routing.cc, line=228
> terminate called without an active exception
> Command
> ['/home/maniac/work/simulations/ns-allinone-3.10/ns-3.10/build/debug/examples/ipv6/ping6']
> terminated with signal SIGIOT. Run it under a debugger to get more
> information (./waf --run <program> --command-template="gdb --args %s
> <args>").
>
> I tried to find out where things go wrong but can not pinpoint the location
> of the error. I checked m_ifIndex because it looked like this could be the
> mistake but it is set to 1 and that should be fine . Also the pcap files
> which are generated look good, wireshark interprets the packet correct and
> shows me the fields, but only one message is sent there is no reply, but the
> request is correct.
>
> Can someone give me a hint where/how to pinpoint this error and supply ns3
> with a working IPsec implementation.
>
> Within the project I would implement IPsec AH and ESP together with the
> necessary calculations (authentication and encryption) and supply a fully
> functional IPsec implementation.
>

It's hard to tell just from this, but have you tried NS_LOG?



-- 
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in



More information about the Ns-developers mailing list