Project

General

Profile

Bug #4761

"Operation not permitted" error if UDP multicast is enabled

Added by Ju Pan 9 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
jni
Start date:
11/02/2018
Due date:
% Done:

100%

Estimated time:
10.00 h

Description

After enabling UDP multicast in nfd-wrapper.cpp, I got following error:

10-23 13:57:01.498 3927-3976/net.named_data.nfd.service.NfdService A/nfd.NfdWrapper: Cannot bind multicast rx socket to wlan0: Operation not permitted

SO_BINDTODEVICE need root privilege, but Android doesn't allow application in user space to enter root.

History

#1 Updated by Junxiao Shi 9 months ago

  • Project changed from NFD to NFD-android
  • Subject changed from NFD-Android's NFD daemon cannot start if enable multicast to NFD daemon cannot start if enable multicast
  • Category changed from Faces to jni
  • Start date deleted (10/23/2018)

#2 Updated by Junxiao Shi 9 months ago

  • Subject changed from NFD daemon cannot start if enable multicast to NFD daemon cannot start if enable UDP multicast
  • Description updated (diff)

Android doesn't allow application in user space to enter root

Root your device, yo!

#3 Updated by Alex Afanasyev 9 months ago

Junxiao, please avoid such comments. You're in a public space, so please be professional.

#4 Updated by Davide Pesavento 9 months ago

  • Subject changed from NFD daemon cannot start if enable UDP multicast to NFD daemon cannot start if UDP multicast is enabled

#5 Updated by Davide Pesavento 9 months ago

  • Subject changed from NFD daemon cannot start if UDP multicast is enabled to "Operation not permitted" error if UDP multicast is enabled

#6 Updated by Ju Pan 9 months ago

  • Assignee set to Ju Pan
  • Start date set to 11/02/2018
  • Estimated time set to 10.00 h

#7 Updated by Ju Pan 8 months ago

I've read some documents and discussion online, it's been said that "Modern smart phones are equipped with multiple network interfaces such as Wi-Fi, cellular radio, Bluetooth, NFC, and others. Each of these interfaces could potentially be used to connect to the web. However, mobile platforms such as Android and iOS allow only one interface to be operational at any given time."

According to this, bindToDevice maybe not necessary for Android. So, I simply commented bindToDevice function out to test, and NFD-android now can automatically create udp v4 and v6 multicast faces when boot up. But I can't create a route using that v4 multicast face since NFD-android only support creating route by URI (on laptop we can create route by face id), but NFD does not allow creating udp multicast faces.

So, if I am on the correct track, next I may modify the NFD-android to support creating route by face id. Any comments? Thx.

#8 Updated by Davide Pesavento 8 months ago

Ju Pan wrote:

I've read some documents and discussion online, it's been said that "Modern smart phones are equipped with multiple network interfaces such as Wi-Fi, cellular radio, Bluetooth, NFC, and others. Each of these interfaces could potentially be used to connect to the web. However, mobile platforms such as Android and iOS allow only one interface to be operational at any given time."

Well... what does "operational" mean? I think it simply means that the IP routing table on the device is setup in such a way that all outgoing traffic goes over the "best" interface at any given time (where "best" usually means WiFi is preferred to cellular). However the problem we have is with incoming traffic, not outgoing.

In any case, this discussion is moot because in virtually all cases we have exactly one interface where using a multicast face makes sense, and that is the (only) WiFi interface.

According to this, bindToDevice maybe not necessary for Android. So, I simply commented bindToDevice function out to test, and NFD-android now can automatically create udp v4 and v6 multicast faces when boot up. But I can't create a route using that v4 multicast face since NFD-android only support creating route by URI (on laptop we can create route by face id), but NFD does not allow creating udp multicast faces.

We've known for a while that this was a potential workaround. Please do submit a patch.

So, if I am on the correct track, next I may modify the NFD-android to support creating route by face id. Any comments? Thx.

Yes, that's a known limitation, see #3997 #3998 #4632.

#9 Updated by Davide Pesavento 8 months ago

  • Status changed from New to Code review

#10 Updated by Ju Pan 8 months ago

  • % Done changed from 0 to 80

#11 Updated by Ju Pan 8 months ago

  • Status changed from Code review to Closed
  • % Done changed from 80 to 100

#12 Updated by Alex Afanasyev 8 months ago

  • Status changed from Closed to In Progress

I wouldn't close is yet. This needs to have a corresponding update in NFD-android that actually enables multicast faces.

#13 Updated by Ju Pan 8 months ago

  • % Done changed from 100 to 80

#14 Updated by Davide Pesavento 8 months ago

  • Status changed from In Progress to Code review

#15 Updated by Davide Pesavento 5 months ago

  • Status changed from Code review to Closed
  • % Done changed from 80 to 100

All done now.

Also available in: Atom PDF