• No results found

3.4 Implementing ICE

3.4.3 Stopping the Connectivity Checks

The ICE specification only defines that a controlling agent should stop connectivity checks as soon as it meets its stopping criterion. However, an exact rule for the criterion is not de- fined to give the opportunity for local optimization. The stopping criterion is a compromise between the duration of the connectivity checks and the confidence on having selected the best working candidate pair for communication.

The stopping criterion chosen for our implementation is the following: The controlling agent nominates a highest priority candidate pair immediately after having received a suc- cess response to a check on that pair. In case that no success response is received to a highest priority candidate pair after 2 seconds wait, the highest priority non-relayed valid pair (if one exists) is nominated. A maximum of 10 seconds is waited, from the start of the checks, before nominating a valid pair that requires relaying. If the valid list is still empty at that point, the connectivity checks are said to have failed.

The decision for the 2 seconds wait is based on the recommendations by the International Telecommunication Union (ITU). ITU states that the mean post-selection delay on local connections under normal load should be on average 3 seconds [53]. Therefore due to the additional delays caused by the ICE processing, a 1 second margin is left for exchanging the candidates and for nominating the selected candidate pair(s).

The implemented stopping criterion takes into consideration the fact that certain pairs are more preferable, as well as bounds the maximum duration to an upper limit. The favor- ability is implemented by giving the higher priority candidate pairs more time to succeed in case retransmissions are required. The disadvantage of the criterion is that a total of 10

seconds needs to be waited every time that a relayed candidate pair is the only working pair. Additionally, the user experience substantially decreases if an operation takes a long time to complete without a response. If no progress indicators are shown, 10 seconds is about the limit for keeping the user’s attention [37].

The same maximum duration for the connectivity checks is also used by other implemen- tations [34]. Without an upper limit for the duration, in case of no working candidate pair, it might take a minimum of 40 seconds for the checks to conclude. This is the approximate time it takes for a candidate pair to use up all its retransmissions.

3.5

Summary

For the purpose of NAT traversal on mobile phones, an ICE prototype was implemented using Java 2 Micro Edition (J2ME). The ICE prototype consists of 13 classes and around 7000 lines of code. A STUN prototype with a TURN extension was first implemented since it forms the basis of the ICE prototype.

The idea of the ICE prototype is to provide the main ICE functionality. However, some features were implemented in addition to the basic functionality, such as the frozen algo- rithm used to optimize the ICE processing, and the triggered check queue used to prior- itize certain checks. Some features of ICE were not implemented since they were seen as non-essential for the measurements performed for the thesis. The biggest difference of the implementation compared to the specification is the lack of security options and error messages. Additionally, some differences from the specification were unavoidable due to the limited J2ME library: three additional attributes were implemented for the functions to work somewhat according to the ICE specification.

The ICE specification does not specify an exact rule for when to stop the ICE checks. Our ICE prototype meets its stopping criterion if any of the following rules applies: (1) the highest priority candidate pair works, (2) a non-relayed candidate pair works after 2 second, or (3) the maximum time for connectivity checks (10 seconds) is exceeded. When the stopping criterion is met, the highest priority candidate pair in the valid list gets chosen for communication. If the valid list is still empty after 10 seconds, the ICE checks have failed.

Measurements and Evaluation

In this Chapter, we describe the prototyping environment and show the measurements that were conducted to examine NAT traversal on mobile phones. We start this chapter by describing the P2PSIP prototype that was integrated to our ICE prototype for the purpose of testing the delays that NAT traversal causes in P2PSIP networks. Then we describe the prototyping environment, including the mobile and fixed access networks, as well as the different end devices. Before going to the actual measurements, we show some baseline measurements performed on the test mobile phone. Some of actual measurements were performed using the ICE prototype alone, such as the TURN and STUN client and server tests. Finally, we present the measurement results and finally evaluate the outcome.

4.1

P2PSIP Prototype

Before describing the prototyping environment in more detail, we need to take a look at the P2PSIP prototype, since it plays a major role in the call setup delay measurements. The prototype was not presented in the previous chapter, since we use an existing P2PSIP im- plementation [17] that consists of roughly 100000 lines of code for managing the P2PSIP overlay. In order for the P2PSIP prototype to work in the presence of NATs, it was inte- grated with the ICE prototype. The contribution of this thesis was to implement the ICE stack. The work required to integrate ICE to P2PP, SIP, RTP, and the Chord connection management logic was done by other developers.

The P2PSIP prototype is provided in two versions, one for PCs and one for mobile phones. Both are implemented in Java programming language, but they use different editions of

Java, J2SE (Java 2 Standard Edition) and J2ME, respectively. The two versions of the pro- totype are interoperable. Although we are mainly concentrating on the mobile implemen- tation, it is interesting to make comparison as some of the tests are run on PCs as well. The J2SE implementation proved also useful in most of the mobile measurements in helping to implement those parts of the test setup that were not being examined.

P2PSIP Prototype

Graphical User Interface

Session Initiation Protocol

Peer-to-Peer Protocol

Chord

Interactive Connectivity Establishment

Figure 4.1: Architecture of the P2PSIP prototype

Figure 4.1 shows the architecture of the P2PSIP prototype after integration to the ICE li- brary. All protocols run on top of the UDP transport protocol. The P2PSIP prototype provides a graphical user interface to make the prototype easier to use. The prototype uses SIP for controlling media communication sessions, such as voice calls. SIP uses the prede- cessor protocol of RELOAD, P2PP, for creating and maintaining the P2PSIP overlay and for mapping SIP Address-of-Record (AoR) values to contact Uniform Resource Identifiers (URIs). The DHT algorithm used by the prototype is Chord, since it is specified by the P2PSIP working group of the IETF as mandatory to implement. ICE takes care of NAT traversal by utilizing the functionalities of STUN and TURN. The P2PSIP prototype sup- ports two types of nodes, P2PSIP peers and P2PSIP clients. The clients run only a subset of the P2P protocol stack, even though they implement the same stacks as the P2PSIP peers.