Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE announce candidates from down interfaces #57

Closed
nshopik opened this issue Jul 30, 2015 · 4 comments
Closed

ICE announce candidates from down interfaces #57

nshopik opened this issue Jul 30, 2015 · 4 comments

Comments

@nshopik
Copy link

nshopik commented Jul 30, 2015

I've noticed that baresip ICE is announcing its candidates from interfaces which are in down state. When call established its trying using these SRC IP addresses from down interfaces (or at least that what logging says, as tcpdump doesn't confirm it).

This doesn't affect much call, but probably slowdown audio path selecting from remoteside

Tested on Ubuntu 15.04

@alfredh
Copy link
Collaborator

alfredh commented Aug 1, 2015

thanks for reporting, can you re-test and include the following:

  • output from /sbin/ifconfig
  • enable "ice_debug yes" in ~/.baresip/config and full log

maybe there is something wrong with net_if_apply()..

@nshopik
Copy link
Author

nshopik commented Aug 1, 2015

Below log output and ip addr and ifconfig output, notice that eth1 in down state.

baresip v0.4.13 Copyright (C) 2010 - 2015 Alfred E. Heggestad et al.
Local network address: IPv4=eth0:192.168.0.23
aucodec: PCMU/8000/1
aucodec: PCMA/8000/1
aufilt: vumeter
dl: mod: /usr/local/lib/baresip/modules/alsa.so (/usr/local/lib/baresip/modules/alsa.so: cannot open shared object file: No such file or directory)
module alsa.so: No such file or directory
medianat: stun
medianat: turn
medianat: ice
999@example.org: Using medianat `ice'
Populated 1 account
Populated 4 contacts
Populated 2 audio codecs
Populated 1 audio filter
Populated 0 video codecs
Populated 0 video filters
baresip is ready.
999@example.org: {0/TCP/v4} 200 OK () [1 binding]
All 1 useragent registered successfully! (394 ms)
>                               50
call: connecting to 'sip:50@example.org;transport=tcp'..
ice: audio: Default local candidates: 128.72.212.224:33478 / 128.72.212.224:33479
call: SIP Progress: 100 Trying (/)
call: SIP Progress: 180 Ringing (/)
{      audio.1} Set default remote candidate: srflx:128.72.212.224:58846
{      audio.2} Set default remote candidate: srflx:128.72.212.224:58847
chklist: audio: pruned candidate pairs: 12
{      audio.1}  host <--->  host  FSM:      Frozen ===> Waiting
{      audio.1}  host <--->  host  FSM:      Frozen ===> Waiting
{      audio.1}  host <--->  host  FSM:      Frozen ===> Waiting
{      audio.1}  host <--->  host  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> srflx  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> srflx  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> srflx  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> srflx  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> relay  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> relay  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> relay  FSM:      Frozen ===> Waiting
{      audio.1}  host <---> relay  FSM:      Frozen ===> Waiting
{      audio. } starting connectivity checks with 24 candidate pairs
audio: Set audio decoder: PCMA 8000Hz 1ch
audio: Set audio encoder: PCMA 8000Hz 1ch
audio tx pipeline:         src ---> vumeter ---> PCMA
audio rx pipeline:        play <--- vumeter <--- PCMA
999@example.org: Call established: sip:50@example.org;transport=tcp
{      audio.1}  host <--->  host  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> host:192.168.0.19:58846 (InProgress)
{      audio.1} Rx Binding Request from 192.168.0.19:58846 via Socket (candpair=InProgress)
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- host:192.168.0.19:58846 '0 OK'
{      audio.1} New local candidate for mapped 192.168.0.23:33478
{      audio.1}  host <--->  host  FSM:  InProgress ===> Succeeded
{      audio.1}  host <--->  host  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> host:192.168.0.19:58846 (InProgress)
{      audio.1} Rx Binding Request from 192.168.0.19:58846 via Socket (candpair=InProgress)
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- host:192.168.0.19:58846 '0 OK'
{      audio.1}  host <--->  host  FSM:  InProgress ===> Succeeded
{      audio.1}  host <--->  host  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> host:10.184.253.53:58846 (InProgress)
{      audio.2}  host <--->  host  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> host:192.168.0.19:58847 (InProgress)  [Trigged]
{      audio.2} Rx Binding Request from 192.168.0.19:58847 via Socket (candpair=InProgress)
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- host:192.168.0.19:58847 '0 OK'
{      audio.2} New local candidate for mapped 192.168.0.23:33479
{      audio.2}  host <--->  host  FSM:  InProgress ===> Succeeded
{      audio.1}  host <--->  host  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> host:10.184.253.53:58846 (InProgress)
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- host:10.184.253.53:58846 '0 ' (Connection timed out)
{      audio.1}  host <--->  host  FSM:  InProgress ===> Failed
{      audio.1}  host <---> srflx  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> srflx:128.72.212.224:58846 (InProgress)
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- host:10.184.253.53:58846 '0 ' (Connection timed out)
{      audio.1}  host <--->  host  FSM:  InProgress ===> Failed
{      audio.1}  host <---> srflx  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> srflx:128.72.212.224:58846 (InProgress)
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- srflx:128.72.212.224:58846 '0 ' (Connection timed out)
{      audio.1}  host <---> srflx  FSM:  InProgress ===> Failed
{      audio.1}  host <---> srflx  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> srflx:83.149.9.138:8931 (InProgress)
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- srflx:128.72.212.224:58846 '0 ' (Connection timed out)
{      audio.1}  host <---> srflx  FSM:  InProgress ===> Failed
{      audio.1}  host <---> srflx  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> srflx:83.149.9.138:8931 (InProgress)
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- srflx:83.149.9.138:8931 '0 OK'               ]
{      audio.1} New local candidate for mapped 128.72.212.224:33478
{      audio.1}  host <---> srflx  FSM:  InProgress ===> Succeeded
{      audio.1}  host <---> relay  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> relay:95.215.44.62:65434 (InProgress)
{      audio.1} Rx Binding Request from 83.149.9.138:8931 via Socket (candpair=InProgress)       ]
{      audio.1} Rx Binding Request from 83.149.9.138:8931 via Socket (candpair=InProgress)       ]
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- srflx:83.149.9.138:8931 '0 OK'              ]
{      audio.1} New local candidate for mapped 128.72.212.224:33478
{      audio.1}  host <---> srflx  FSM:  InProgress ===> Succeeded
{      audio.1}  host <---> relay  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> relay:95.215.44.62:65434 (InProgress)
{      audio.1} Rx Binding Request from 83.149.9.138:8931 via Socket (candpair=Succeeded)        ]
{      audio.1} Rx Binding Request from 83.149.9.138:8931 via Socket (candpair=Succeeded)        ]
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- relay:95.215.44.62:65434 '0 ' (Connection timed out)
{      audio.1}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.1}  host <---> relay  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth1:host:10.10.10.10:33478 ---> relay:95.215.44.62:53813 (InProgress)
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- relay:95.215.44.62:65434 '0 ' (Connection timed out)
{      audio.1}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.1}  host <---> relay  FSM:     Waiting ===> InProgress
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> relay:95.215.44.62:53813 (InProgress)
{      audio.1} Rx eth1:host:10.10.10.10:33478 <--- relay:95.215.44.62:53813 '0 ' (Connection timed out)
{      audio.1}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.2}  host <--->  host  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> host:192.168.0.19:58847 (InProgress)
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- host:192.168.0.19:58847 '0 OK'              ]
{      audio.2}  host <--->  host  FSM:  InProgress ===> Succeeded
{      audio.2}  host <--->  host  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> host:10.184.253.53:58847 (InProgress)
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- relay:95.215.44.62:53813 '0 ' (Connection timed out)
{      audio.1}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.2}  host <--->  host  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> host:10.184.253.53:58847 (InProgress)
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- host:10.184.253.53:58847 '0 ' (Connection timed out)
{      audio.2}  host <--->  host  FSM:  InProgress ===> Failed
{      audio.2}  host <---> srflx  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> srflx:128.72.212.224:58847 (InProgress)
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- host:10.184.253.53:58847 '0 ' (Connection timed out)
{      audio.2}  host <--->  host  FSM:  InProgress ===> Failed
{      audio.2}  host <---> srflx  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> srflx:128.72.212.224:58847 (InProgress)
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- srflx:128.72.212.224:58847 '0 ' (Connection timed out)
{      audio.2}  host <---> srflx  FSM:  InProgress ===> Failed
{      audio.2}  host <---> srflx  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> srflx:83.149.9.138:5067 (InProgress)
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- srflx:128.72.212.224:58847 '0 ' (Connection timed out)
{      audio.2}  host <---> srflx  FSM:  InProgress ===> Failed
{      audio.2}  host <---> srflx  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> srflx:83.149.9.138:5067 (InProgress)
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- srflx:83.149.9.138:5067 '0 OK'               ]
{      audio.2} New local candidate for mapped 128.72.212.224:33479
{      audio.2}  host <---> srflx  FSM:  InProgress ===> Succeeded
{      audio.2}  host <---> relay  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> relay:95.215.44.62:55533 (InProgress)
{      audio.2} Rx Binding Request from 83.149.9.138:5067 via Socket (candpair=InProgress)       ]
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- srflx:83.149.9.138:5067 '0 OK'              ]
{      audio.2} New local candidate for mapped 128.72.212.224:33479
{      audio.2}  host <---> srflx  FSM:  InProgress ===> Succeeded
{      audio.2}  host <---> relay  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> relay:95.215.44.62:55533 (InProgress)
{      audio.2} Rx Binding Request from 83.149.9.138:5067 via Socket (candpair=Succeeded)        ]
{      audio.2} Rx Binding Request from 83.149.9.138:5067 via Socket (candpair=Succeeded)        ]
{      audio.2} Rx Binding Request from 83.149.9.138:5067 via Socket (candpair=Succeeded)        ]
{      audio.2} Rx Binding Request from 83.149.9.138:5067 via Socket (candpair=Succeeded)        ]
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- relay:95.215.44.62:55533 '0 ' (Connection timed out)
{      audio.2}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.2}  host <---> relay  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth1:host:10.10.10.10:33479 ---> relay:95.215.44.62:50188 (InProgress)
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- relay:95.215.44.62:55533 '0 ' (Connection timed out)
{      audio.2}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.2}  host <---> relay  FSM:      Frozen ===> InProgress
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> relay:95.215.44.62:50188 (InProgress)
{      audio.2} Rx eth1:host:10.10.10.10:33479 <--- relay:95.215.44.62:50188 '0 ' (Connection timed out)
{      audio.2}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- relay:95.215.44.62:50188 '0 ' (Connection timed out)
{      audio.2}  host <---> relay  FSM:  InProgress ===> Failed
{      audio.1} Tx eth0:host:192.168.0.23:33478 ---> host:192.168.0.19:58846 (Succeeded) [USE] [Trigged]
{      audio.2} Tx eth0:host:192.168.0.23:33479 ---> host:192.168.0.19:58847 (Succeeded) [USE] [Trigged]
ice: audio: connectivity check is complete (update=1)
ice: audio: sending Re-INVITE with updated default candidates
call: medianat established -- sending Re-INVITE
{      audio.1} Rx eth0:host:192.168.0.23:33478 <--- host:192.168.0.19:58846 '0 OK'              ]
{      audio.2} Rx eth0:host:192.168.0.23:33479 <--- host:192.168.0.19:58847 '0 OK'
{      audio.1} Set default remote candidate: host:192.168.0.19:58846           [                ]
{      audio.2} Set default remote candidate: host:192.168.0.19:58847
call: terminate call '042f2c6e5eca638a' with sip:50@example.org;transport=tcp      [                ]
sip:999@example.org: Call with sip:50@example.org;transport=tcp terminated (duration: 1 min 10 secs)
Quit
Stopping 1 useragent..
shopik@shopik-virtual-machine:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:bb:4d:0c brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.23/24 brd 192.168.0.255 scope global dynamic eth0
       valid_lft 86083sec preferred_lft 86083sec
    inet6 fe80::20c:29ff:febb:4d0c/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:0c:29:bb:4d:16 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.10/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
shopik@shopik-virtual-machine:~$ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:bb:4d:0c
          inet addr:192.168.0.23  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:febb:4d0c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4681 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2032 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:839768 (839.7 KB)  TX bytes:269329 (269.3 KB)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:bb:4d:16
          inet addr:10.10.10.10  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Base address:0x2000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:350 errors:0 dropped:0 overruns:0 frame:0
          TX packets:350 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:31005 (31.0 KB)  TX bytes:31005 (31.0 KB)

@alfredh
Copy link
Collaborator

alfredh commented Sep 20, 2015

thanks for the input

at the moment I am not planning to make any changes here. it would be nice to filter
out interfaces that are "down" but ICE itself will take care of checking this.

perhaps later add a new function to libre to check if an interface is up/down?

@alfredh alfredh closed this as completed Sep 20, 2015
@nshopik
Copy link
Author

nshopik commented Sep 20, 2015

Well I think problem that ICE doesn't try detect peers in parallel, thus several interfaces make not so useful you have to wait about 30 second before you can hear anything.

Even with 1 interface its serial detection when there 3 candidates (host, srflx, turn) it takes about ~20 second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants