User A User B
1 3 2
Client iP2P Control function iP2P Control function B.3 Server
5 4
iP2P Socket API SMS API SMS API iP2P Socket API
Public IP
BW Network network BW Network
involved. Assume that the SMS modules of both In this procedure, the identification phase
peers are activated, and the BW modules are consists of Steps B.1–B.4, and the communica-
turned off to save power (and therefore, are tions phase starts with Step B.5.
detached from the IP network).
Step B.1 User A activates the BW module,
attaches to the IP network, and obtains the IP2P CONNECTION SET UP FOR
public IP address IP A through the DHCP. PRIVATE IP NETWORKS: STUNT #2
Using User B’s MSISDN, User A starts the
client application (called App-A) and executes Suppose that the calling and the called peers
the DNS resolution procedure with User B’s reside in different private IP networks. To
MSISDN. In DNS resolution, the iP2P socket resolve the NAT traversing issue for TCP, iP2P
API detects that the destination domain name must adopt a NAT traversal mechanism [6–8] to
is an MSISDN. Instead of querying an exter- establish the P2P connection. In this section, we
nal DNS server, the iP2P socket API reserves use the STUNT #2 approach [6] as an example
a local port (i.e., PortA) for App-A and passes to illustrate how iP2P solves the NAT traversing
the application name and the App-A transport issue for a P2P application.
address (i.e., IP A:Port A) to the iP2P control First we describe the STUNT mechanism
function. when both the server and the client applications
Step B.2 User A’s iP2P control function sends already have attached to the private IP networks.
an iP2P control message including the App-A As shown in Fig. 3, user A (the STUNT client)
transport address (IPA:PortA) and the applica- resides in the private IP network A behind the
tion name (e.g., FTP) to user B through SMS. NAT server NAT-A, and user B (the STUNT
User A’s iP2P control function then listens on server) resides in another private IP network B
PortA. behind the NAT server NAT-B. The P2P con-
Step B.3 Upon receipt of the iP2P control mes- nection set-up procedure is described as follows:
sage, user B activates the BW module, attach- Step C.0 At the beginning, both the user A client
es to the IP network, and obtains the public application App-A and the user B server appli-
IP address IPB through the DHCP. Then, user cation App-B establish TCP connections (called
B starts the corresponding server application ConnectionA and ConnectionB, respectively) to
(called App-B) and listens on PortB. a proxy server in the public IP network and
Step B.4 User B’s iP2P control function sends then register their identifications to the proxy
the App-B transport address (IPB:PortB) and server through these TCP connections. Con-
the application name to user A’s iP2P control nection A and ConnectionB are always main-
function through the BW and the IP networks. tained so that App-A and App-B can access
Upon receipt of user B’s response, user A’s the public IP network through the proxy server.
iP2P socket API maps user B’s MSISDN to its Step C.1 To inform user B to establish a P2P
transport address. connection, user A sends a connection request
Step B.5 App-A establishes a TCP connection to to the proxy server with user B’s identification
App-B through the IP network. through ConnectionA. The proxy server then
C.8
X C.7
C.6 C.6
C.5 C.5
relays this connection request to user B Step C.4 Similarly, App-B reserves a local port
through ConnectionB. (i.e., Port b ) for the P2P connection and
Step C.2 If user B accepts the connection queries the port prediction server to predict
request, it replies with an acknowledgment to public transport addresses (IPB:Port B) to be
user A through the same path in the reverse assigned by NAT-B.
direction. Step C.5 App-A sends the mapping of its public
We note that ConnectionA and ConnectionB and the private transport addresses (IPa:Porta
are not used for P2P data transfer to avoid the ↔ IPA:PortA) to App-B through ConnectionA
scalability problem in the proxy server. Therefore, and ConnectionB.
to establish a P2P connection directly between Step C.6 Similarly, App-B sends the mapping of
users A and B, STUNT utilizes a port prediction its public and the private transport addresses
server to find the public transport addresses for (IPb:Portb ↔ IPB:PortB) to App-A through the
the private transport addresses of the peers at same path in the reverse direction.
Steps C.3 and C.4 (described below). Then, the Step C.7 Upon receipt of App-A’s mapping of
corresponding mapping entries are created in its public and the private transport addresses,
NAT-A and NAT-B, respectively, at Steps C.7 App-B sends a synchronize (SYN) packet
and C.8. Then, the P2P connection can be estab- from App-B’s private transport address
lished directly between App-A and App-B. (IP b :Port b ) to App-A’s public transport
Step C.3 Upon receipt of user B’s acknowledg- address (IPA:PortA). This SYN packet is sent
ment through ConnectionA, App-A reserves a with a time-to-live (TTL) parameter large
local port (i.e., Porta), and uses private trans- enough to enable the SYN packet to pass
port addresses (IPa:Porta) to query a port pre- through NAT-B so that the corresponding
diction server in the public IP network [9]. The mapping entry can be created in NAT-B. On
port prediction server predicts a public trans- the other hand, the TTL value must be suffi-
port address (IPA:PortA) that will be assigned ciently small such that the packet is dropped
by NAT-A to map to the private transport before it arrives at NAT-A. If this SYN packet
address (IPa:Porta) of the P2P connection. arrives at NAT-A before NAT-A has created
User A User B
iP2P Socket API SMS API SMS API iP2P Socket API
D.6 D.1 D.4 D.2 SMS network D.2 D.4 D.3 D.5 D.6
NAT-A NAT-B
D.1 D.3
BW Private IP Port prediction server Private IP Private IP
network network A D.5 network B network
D.6
Public IP
network
User A User B
iP2P Socket API SMS API SMS API iP2P Socket API
E.4
E.5
Private IP Public IP Private IP
BW network network A network B BW network
network
replies with an iP2P control message with the some NAT servers randomly assign the mapping
App-B public transport address (IP B:Port B) ports, which cannot be predicted.
and the application name to user A through
SMS.
Step D.5 App-B sends a SYN packet with a IP2P CONNECTION SET UP FOR
proper TTL value from the App-B private PRIVATE IP NETWORKS: UPNP
transport address (IP b :Port b ) to the App-A
public transport address (IP A:Port A). When Universal plug and play (UPnP) [10] provides
this SYN packet passes through NAT-B, a another solution to solve NAT traversing for
mapping entry is created in NAT-B as shown TCP. Usually, a UPnP system consists of several
in Table 1a. We assume that the SYN packet UPnP clients and an Internet gateway device
is dropped before it arrives at NAT-A. (IGD), which provides Internet connectivity for
Step D.6 App-A waits for a period (so that the the protected local area network (LAN). UPnP
corresponding mapping entry in NAT-B has is a network protocol for automatic discovery
been created at Step D.5) and sends a SYN and configuration when a device (i.e., a UPnP
packet from its private transport address client) is online. Therefore, the mapping of the
(IP a :Port a ) to the App-B public transport public and the private transport addresses in
address (IPB:PortB). This SYN packet results both the UPnP client and the IGD can be estab-
in the mapping entry creation in NAT-A as lished automatically by the UPnP protocol.
shown in Table 1b. Upon receipt of this SYN UPnP can be integrated easily with iP2P to sup-
packet, App-B executes the standard TCP port NAT traversal for the peers in different pri-
three-way handshake procedure, and the P2P vate IP networks. To support UPnP in an iP2P
connection is established. peer, the iP2P socket API must include the
Clearly, iP2P, with the STUNT #2 approach, UPnP API functionalities, and the iP2P control
can solve the NAT traversing issue for TCP as function on the mobile device is a UPnP client.
the conventional STUNT #2 approach without In Fig. 5, suppose that both NAT-A and NAT-B
the maintenance of the centralized proxy server support the IGD functionalities. The steps of
(see Step C.0), and both ConnectionA and Con- iP2P connection set up are described as follows:
nectionB are eliminated. Furthermore, the called Step E.1 User A activates the BW module,
peer is not required to attach to the IP network attaches to the IP network, and obtains the
before the iP2P connection is initiated. Note private IP address IP a through the DHCP.
that the STUNT solution may pose problems. User A starts the client application App-A and
First, setting an appropriate TTL value of the executes the DNS resolution procedure with
SYN packet (at Step C.7 and Step D.5) might user B’s MSISDN. Because user A resides in a
not be trivial. Furthermore, the port prediction private IP network, its iP2P socket API issues
server cannot guarantee to provide the precise a UPnP multicast M-SEARCH request to iden-
mapping of the public and the private transport tify the IGD (i.e., NAT-A). Then, it sends a
addresses for all the NAT servers. For example, UPnP GetExternalIPAddress request to