buglwIP - A Lightweight TCP/IP stack - Bugs: bug #47270, [lwip-1.4.1 + ptp1588] - Multicast...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47270: [lwip-1.4.1 + ptp1588] - Multicast addresses for ptp domains

Submitted by:  Evripidis Karseras <evripidis>
Submitted on:  Fri 26 Feb 2016 01:06:38 AM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.4.1

(Jump to the original submission Jump to the original submission)

Fri 04 Mar 2016 08:58:44 PM UTC, comment #7:

Hopefully fixed by accepting all ipv4 multicast packets (at IP level) when LWIP_IGMP is disabled.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 27 Feb 2016 08:33:37 PM UTC, comment #6:

Hello Jan,

I am new to the lwip stack but not new in general. The MAC filter was set to accept all frames. I had to alter the lwip port from the manufacturer.

Despite not being a profinet oriented application it is very constrained in many aspects. I just cannot justify including IGMP functionality on top of everything else just to be able to use ptp.

Evripidis Karseras <evripidis>
Sat 27 Feb 2016 08:11:24 PM UTC, comment #5:

There are situations where you don't need to use igmp to receive multicast. E.g. for profinet networks, you simply know all the switches. Thus no need to include the igmp code.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 27 Feb 2016 07:31:49 PM UTC, comment #4:

I have been using pre lwip-1.4.1 and IEEE1588 for years and there was no problem. Now I have checked the source of my ip.c and upstream 1.4.1 ip.c and there are the same.

What do you mean with this? "But PTP does not used IGMP flags so even by enabling IGMP, the PTP packets never get through."

If you need to use any protocol in IPv4 multicast mode, you must join correct multicast group using IGMP. For PTP using E2E delay mechanism, it is just 224.0.1.129.

Check also hardware MAC filter configuration on your MCU. If it is set to "perfect" it will pass only unicast messages.

Jan Breuer <jan_breuer>
Sat 27 Feb 2016 01:23:34 PM UTC, comment #3:

I had a look at the code in ip.c again.

The list is iterated from the input netif (inp) (line 407) and the iteration breaks (line 424) on the first netif to pass the if statement checks.

The functionality I wanted is accomplished with fixing it like I said before. If we can resolve this fairly quickly for everyone as you say it would be great. I am very new at lwip so excuse any mistakes in what I mention.

Evripidis Karseras <evripidis>
Fri 26 Feb 2016 06:25:37 PM UTC, comment #2:

This is true.

I guess the evaluation board with only one netif, this is the reason it is working fine with my little fix.

Evripidis Karseras <evripidis>
Fri 26 Feb 2016 09:46:52 AM UTC, comment #1:

Your bug report is correct, but the fix is wrong as it accepts multicast packets on the first netif in the list instead of accepting in on the input netif.

I think there is a bug, too, in accepting broadcasts on any netif instead of only accepting them on the input netif.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 26 Feb 2016 01:06:38 AM UTC, original submission:

There is an issue in the following file:

lwip-1.4.1\src\core\ipv4\ip.c file (line 412)

if ( ip_addr_cmp(&current_iphdr_dest, &(netif->ip_addr))
|| ip_addr_isbroadcast(&current_iphdr_dest, netif)
)

There is no provision for multicast addresses needed for PTP1588. There is
another if statement before the above to account for IGMP and that is where
the multicast check is done. But PTP does not used IGMP flags so even by
enabling IGMP, the PTP packets never get through.

This has been tested on a port for a T.I device and after the following
modification PTPD would work fine:

if ( ip_addr_cmp(&current_iphdr_dest, &(netif->ip_addr))
|| ip_addr_isbroadcast(&current_iphdr_dest, netif)
#if LWIP_PTPD
|| ip_addr_ismulticast(&current_iphdr_dest)
#endif /* LWIP_PTPD */
)

Basically there is a clause added to make sure multicast is handled in case
PTPD is enabled.

Evripidis Karseras

Evripidis Karseras <evripidis>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jan_breuer (Posted a comment)
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by evripidis (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Mar 2016 08:58:44 PM UTCgoldsimonStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri 26 Feb 2016 09:46:52 AM UTCgoldsimonStatusNone=>In Progress
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1