0

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

1 Answers1

0

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.

Sahel Vafa
  • 26
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 09 '22 at 09:26
  • Thanks for the answer! Do you also know how to implement mobile nodes in cooja? – Extrafantastik Feb 16 '22 at 21:38