New issue
Advanced search Search tips

Issue 845679 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug


Previous locations:
webrtc:9209


Sign in to add a comment

ICMP error packets (Destination Unreachable, Time Exceeded) disables UdpPacketSocket::OnReadCompleted handler

Reported by stefanpr...@gmail.com, Apr 27 2018

Issue description

What steps will reproduce the problem?
1. simple case: create ICE session between hosts with same local IPs, but in different networks
1. real case: router return ICMP error packets when we try establish direct connection

What is the expected result?
established connection by p2p or relay

What do you see instead?
relay phase not work properly after errors in direct stage.
stun packets delivered to viewer and remote host application layer, but not processed.

What version of the product are you using? On what operating system? windows


Please provide any additional information below.

Attached icmp_problem.7z file contain: 
1. wireshark log for problem session.
2. host side log with errors corresponding to ICMP  
... ERROR:chromium_socket_factory.cc(xxx)] Received error when reading from UDP socket: -101

problem:
ICMP packet on direct phase disables UdpPacketSocket::OnReadCompleted handler. 
In the next stages we can only send packets, but can not dispatch/read packets

possible fix:

...\chromium\src\remoting\protocol\chromium_socket_factory.cc

void UdpPacketSocket::OnReadCompleted(int result) {
  HandleReadResult(result);
  if (result >= 0) {
    DoRead();
  }
  // Fix UDP, ICMP error packets (Destination Unreachable,  Time Exceeded) 
  // Ignore this errors for UDP
  //    WSAECONNRESET: (10054) Port Unreachable
  //    WSAENETRESET: (10052)  Related to keep-alive (TTL)
  if (result == net::ERR_CONNECTION_RESET) {
    //LOG(ERROR) << "===> [Error] skip, Received error when reading from UDP socket ERR_CONNECTION_RESET (re call DoRead): " << result << " , local addr:" << GetLocalAddress().ToString();
    DoRead();
  }
}
 
icmp_problem.7z
2.5 MB Download

Comment 1 by phoglund@webrtc.org, Apr 30 2018

Components: Network>ICE
Project: chromium
Moved issue webrtc:9209 to now be issue chromium:845679.
Components: Services>Chromoting
If I understand correctly: after receiving an ICMP error when trying to send packets to a private address, it renders the socket completely unusable, even when receiving packets from a different address (relay address)? Because UdpPacketSocket just stops attempting to read from the underlying socket after it gets a result < 0?

Instead of just "result == net::ERR_CONNECTION_RESET", we may want to copy "IsTransientError" from here: https://cs.chromium.org/chromium/src/content/browser/renderer_host/p2p/socket_host_udp.cc?l=57&rcl=b443acd42bd4d776676f8916db70d01f2a938ff1

Which includes ERR_CONNECTION_RESET along with some errors.
Cc: sergeyu@chromium.org
Sergey, does this make sense for us? What's the likely impact?


Cc: -sergeyu@chromium.org
Owner: sergeyu@chromium.org
Ping Sergey.
Proposed fix makes sense. The P2P sockets socket layer in the browser already handles this case properly, see https://codesearch.chromium.org/chromium/src/content/browser/renderer_host/p2p/socket_host_udp.cc?l=48 . I think this logic should be copied to ChromiumSocketFactory.
Owner: lambroslambrou@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)

Sign in to add a comment