Project

General

Profile

Actions

Bug #4761

closed

"Operation not permitted" error if UDP multicast is enabled

Added by Ju Pan over 5 years ago. Updated about 5 years 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.

Actions #1

Updated by Junxiao Shi over 5 years 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)
Actions #2

Updated by Junxiao Shi over 5 years 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!

Actions #3

Updated by Alex Afanasyev over 5 years ago

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

Actions #4

Updated by Davide Pesavento over 5 years ago

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

Updated by Davide Pesavento over 5 years ago

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

Updated by Ju Pan over 5 years ago

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

Updated by Ju Pan over 5 years 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.

Actions #8

Updated by Davide Pesavento over 5 years 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.

Actions #9

Updated by Davide Pesavento over 5 years ago

  • Status changed from New to Code review
Actions #10

Updated by Ju Pan over 5 years ago

  • % Done changed from 0 to 80
Actions #11

Updated by Ju Pan over 5 years ago

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

Updated by Alex Afanasyev over 5 years 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.

Actions #13

Updated by Ju Pan over 5 years ago

  • % Done changed from 100 to 80
Actions #14

Updated by Davide Pesavento over 5 years ago

  • Status changed from In Progress to Code review
Actions #15

Updated by Davide Pesavento about 5 years ago

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

All done now.

Actions

Also available in: Atom PDF