contikicontiki-ngrpl

Dropping only UDP packets in RPL


1)I am trying to drop only UDP packets in RPL in Contigi-ng OS.
I modified the code in/contiki/core/net/tcpip.c as:

...
    static void
    packet_input(void)
    {
    #if DEST_PORT_IS_MAL_DROP
    if ((UIP_IP_BUF->proto == UIP_PROTO_UDP) && 
    (uip_ntohs(UIP_UDP_BUF->destport)==UDP_MALICIOUS_PORT)){
    uip_len=0;}
    #endif
    #if UIP_CONF_IP_FORWARD
    if(uip_len > 0){
...

This drops all packets whose destport = UDP_MALICIOUS_PORT and do not know how to drop only UDP packets and allow control messages.

Thanks in advance


Solution

  • You should change uip6.c in the "os/net/ipv6/uip6.c" path. please see this paper :A Reference Implementation for RPL Attacks Using Contiki-NG and COOJA. This is good reference for implementing attacks in Contiki-ng.