Professional Documents
Culture Documents
Sriram A 2014
Sriram A 2014
Abstract—The emergence of mobile terminals with enhanced one can consider. Technologies such as OpenID [3], Ses-
features like high processing power, more memory, inbuilt sen- sion Initiation Protocol (SIP) [4], Extensible Messaging and
sors, low power consumption, etc. have lead to their extensive Presence Protocol (XMPP) [5], Zero-configuration networking
usage in different domains like mobile social networking, mobile (zeroconf) [6] and Universal Plug and Play (UPnP) [7]
cloud and Internet of Things (IoT). However, to successfully have offered solutions for addressing devices in different P2P
utilize these devices as information providing/processing entities,
we need proper means of identification and addressing, so that
setups. Although there are different addressing mechanisms
the devices and their offered data/services are accessible also proposed, the most popular and widely used addressing mech-
from outside the mobile network. Addressing devices in mobile anism for internet is Internet Protocol Address (IP address).
networks has been studied extensively over the years and there IP addressing provides a globally unique 32 bit address for
are several solutions one can consider. However, the most popular each and every device connected to the internetwork. Network
and widely used addressing mechanism for internet, IP address, operators always have provided different means to address the
is also being extensively used in mobile data networks (3G/4G). devices with IP addresses, so that they could be accessed from
Typically, the IP address assigned to mobile devices ends up with the Internet [8]. However, IP address space is limited and
barriers like their temporarily availability, known only within the have mostly exhausted due to drastically growing number of
mobile operator’s network, Network Address Translation (NAT) devices attached to the internet. Internet Protocol version 6
etc., which makes it difficult to use the addresses in IoT scenarios.
To address these problems we propose to use UDP sessions with a
(IPv6) [9] is the latest revision of the IP, developed by the
Rendezvous server to send and receive peer information and TCP Internet Engineering Task Force (IETF), to deal with the long-
sessions established in a hole punching process over NAT, so that anticipated problem of IPv4 address exhaustion. However its
information can be exchanged over these devices. The approach adaption is still in its infancy.
is explained in detail along with its prototype implementation As a temporary solution for the insufficient number of us-
and conceptual limitations.
able public IP addresses, the IETF introduced a new private IP
Keywords—Hole Punching, NAT, 3G Mobile Network, Address- address space [10] for the internal usage of any organization.
ing devices. Normally many organizations use this private IP address space
to assign IP addresses for their intranet devices. However,
when these devices need to communicate with a device outside
I. I NTRODUCTION the network, private IP address should be translated to the
In recent years, smart phones have entered the market public IP address. This process is called Network Address
with enhanced features like high processing power, more Translation (NAT). Although private IP address space is a
memory, HD video, inbuilt sensors, touchscreen, low power good solution for the problem under consideration, NAT causes
consumption, etc. There are many new applications and ser- several difficulties for mobile P2P communication. NAT boxes
vices developed for mobile users and the mobile phone can mostly drop the unsolicited inbound traffic and only allow if
even be used to provide services to other mobile users [1], the traffic is a reply for the session initiated by the device
[2]. Similarly, now there are several mobile Peer to Peer (P2P) within the network.
and mobile social networking applications such as playing To tackle the problem we propose to use UDP (User
online games, sharing photos and videos with friends, teacher Datagram Protocol) sessions with a Rendezvous server to send
sharing blackboard with a group of students etc. While the and receive peer information and TCP (Transmission Control
applications are interesting, for successful adoption of these Protocol) sessions established in a hole punching process over
mobile P2P and social applications, the mobile terminal, that NAT. There are several NAT traversal techniques that have
is registered and connected to the mobile operator network, been proposed to establish a connection when hosts are behind
requires some means of identification and addressing. The the NAT Box. Most of these solutions were designed for the
problem is also relevant in the Internet of Things (IoT) domain hosts in Wi-Fi or on Fixed LAN environment. But the solution
where every device is connected and can act as an information proposed here is mainly targeted at addressing Android devices
providing/processing entity. in the mobile 3G network. The paper is organized as follows:
Addressing devices in mobile networks has been studied Section 2 introduces the background details needed for
extensively over the years and there are several solutions TCP hole punching. Section 3 describes our proposed solution
91
Fig. 3. Address Restricted Cone NAT
4) Symmetric NAT: This is the most restricted mapping Transmission Control Protocol (TCP) is connection ori-
method in comparison with other three methods. In all the ented and reliable protocol mainly used to transport data in a
above cases the internal socket’s port number is directly reliable manner. The size of the TCP header is 20 Bytes. Some
mapped to the public socket’s same port number. But in important fields of the TCP header which are interesting for
symmetric NAT the internal socket is mapped to a completely the hole punching and the rest of the discussion of the paper
different new external socket. If the internal device uses same are described below.
socket to send data to a different external host, the NAT device
maps it with another new external socket. This prevents any Source port: The source port is the number that is assigned
type of unsolicited inbound traffic. But it is very hard to predict by the local host when it transmits data to the remote host.
the port mappings in this NAT process even though we know This is a random number which is normally higher than 1023
the internal socket details. In Symmetric NAT only the external according to the Internet Assigned Numbers Authority (IANA)
device that receives a packet from internal device can send a port numbering procedure. Source device can distinguish the
packet back to the internal host. The scenario is illustrated in sessions by referring the source port.
figure 5. Destination port: The destination port is normally a well-
known port number which is used by the remote device to
identify the service requested by the source device.
Sequence number: It is a 32 bit number, which indicates the
reference number of the transmission data byte. This number
helps to maintain the ordered delivery of data byres.
Acknowledgment number: This is a 32 bit number which is
used to maintain the reliability of the data transmission. The
receiver should acknowledge the transmitter about the received
data.
TCP is a connection oriented protocol. That means, first
the transmitter and the receiver should establish the logical
connection before the data transmission. Then data can be sent
through this connection and the connection should properly
Fig. 5. Symmetric NAT terminate at the end. The connection establishment process of
92
Fig. 8. Details of the datagram in registration
93
Fig. 10. Sequence diagram showing the timeline of activities performed
during the connection establishment between the devices
94
Fig. 12. Android application with the messages
It is interesting to note that, in the above scenario, host A Here we observed interesting results. When sending mes-
wanted to initiate the session, however if one thinks from a sages from host A (A initiates connection) to host B our pro-
pure TCP perspective, the scenario ended up as though host B posed solution failed. However, when sending messages from
initiated the TCP session host B (B initiates connection) to host A it was successful.
Similar results we observed when host A is in TELE2 and
host B in Elisa.
IV. T EST S CENARIOS AND THE R ESULTS
Table III summarizes the results of different test scenarios
The proposed solution is implemented and tested with with the three common Estonian mobile networks. So we
few Estonian mobile networks, TELE 2 [19], Elisa [20], observed, when one of the devices is in the TELE2 mobile
EMT [21]. The considered test scenarios and the results are network, connection can be established form any other mobile
described below. network, by making the second device to initiate connection.
95
It should be remembered that once connection is established, Address translation of the ELISA mobile network is more
both the devices can send the messages to each other as long likely similar to the symmetric NAT translation. We found that
as the connection persists (TCP connection is bidirectional). ELISA translates a local socket into a completely new public
socket. Even the request coming from same local socket to
Connection initiator Receiving mobile Result the different destination, NAT assigns a new socket for that
TELE2 EMT Fail
Elisa Fail
session. It is very difficult to implement hole-punching because
EMT TELE2 Success of the port prediction which will be involved in this case.
Elisa Fail
Elisa TELE2 Success When implementing our solution we only considered about
EMT Fail
how the NAT maps local socket and the public socket. But in
TABLE III. T EST RESULTS OF THE HOLEPUNCHING APPROACH TCP session, sequence numbers also play a major role. Some
ACROSS DIFFERENT MOBILE NETWORKS NAT boxes are also checking the sequence numbers of the
incoming TCP packets. If this sequence number is invalid,
NAT just closes the public socket. To overcome this problem
V. D ISCUSSION OF THE R ESULTS AND L IMITATIONS OF we should also learn the sequence numbers of end points TCP
THE A PPROACH process. But to capture the sequence numbers we need the help
of the raw sockets. Creating a raw socket is not difficult for a
According to the test results we observed that some hosts PC but is very difficult for android devices, which most often
cannot establish connections properly. There are few internal needs rooting the device. We have a solution developed based
and external factors that will limit the functionality of our on this approach, but we think this approach is too invasive
implementation. Main external factor is the differences in for the mobile device or IoT [22]. However, one can consider
behavior of the NAT techniques used by the mobile operators. the case as one of the limitations of our implemented solution
To get a better idea about the behavior of the NAT box rather than the proposed solution.
applied, we implemented a simple application which can
retrieve devices’ own public socket details. This application
sends two messages using same local socket to two different VI. R ELATED W ORK
servers. These servers replied to the host with the public socket Establishing a TCP session through NAT has been studied
details assigned by the respective NAT for that communication. extensively. There are few prominent techniques which are
Table IV summarizes the result of the NAT translation of three summarized here.
common mobile operators in Estonia.
NUTSS is an approach which proposed using an external
Mobile network Local socket Public socket Public socket STUNT server and simultaneous NAT traversal technique that
(from server1) (from server2) is applicable to devices connected to the fixed network [23].
TELE2 83.176.3.195 83.176.3.195 83.176.3.195
(subscription :35049 :35049 :35049 According to this approach both end points send an initial
1) SYN with a little TTL value that is just enough to cross
TELE2 83.176.2.178 83.176.2.178 83.176.2.178 their own NATs. This SYN is dropped in the middle of the
(subscription :40756 :40756 :40756
2) network before reaching to its destination. End points can learn
EMT (subscrip- 10.145.20.13 217.71.46.13 217.71.46.13 their initial sequence number by listening to their outbound
tion 1) :52142 :52142 :52142
EMT (subscrip- 10.128.194.59 217.71.44.59 217.71.44.59
SYN using PCAP or a RAW socket. Then both endpoints
tion 2) :58296 :58296 :58296 inform this sequence number to the STUN server hosted on the
Elisa (subscrip- 10.27.201.251 194.150.65.155 194.150.65.155 public network. The STUN server spoofs a SYNACK to each
tion 1) :51605 :55251 :55252
Elisa (subscrip- 10.26.164.121 194.150.65.24 194.150.65.24
host with the properly settled sequence numbers. After that
tion 2) :33045 :32322 :32323 both hosts send ACK to complete the handshaking process.
TABLE IV. NAT ACROSS DIFFERENT MOBILE NETWORKS IN E STONIA There are some potential problems which can be seen when
implementing this approach. We need to set the lower TTL
value in the SYN packet that should be more enough to cross
Our approach is basically working properly on the TELE2 the own NAT but less enough to cross the destination NAT.
mobile network. When we analyze the IP address assignment But it is impossible to set that kind of the TTL value if both
here we can see that TELE2 always assigns a public IP address devices are located behind the same NAT. To set the TTL value
(observed actually a huge pool of them) to a mobile device. we need to access the OS TCP process using a raw socket. But
Since, probably there is no NAT translation applied in TELE2, when considering android devices creating a raw socket is still
devices from any mobile network (even when having NAT complicated and needs a rooted device.
applied within) can directly initiate a session with a device
that is attached to the TELE2 mobile network. Similarly, in NATBLASTER approach both devices use
SYN packet with lower TTL value to initiate the session [18].
When considering EMT mobile, it assigns a private IP This SYN packet is dropped in the middle of the network
address to the clients and translates it into a public IP address before reaching its destination. Then hosts learn the initial
when needed. During NAT it keeps the local port number as the sequence numbers of the SYN packet and send it to the
same and only translates the private IP address into the public publicly accessible third party server. This server exchanges
IP address. Our implementation currently supports only full- initial sequence number with the hosts. Instead of using server
cone type NAT and EMT might be using a technique other to forge SYNACK packets here each host forges SYNACK to
than full-cone NAT and connection can’t be initiated to the the other host. After this step each host can establish the TCP
EMT network. session by sending ACK to the peer. Again, The approach ends
96
up with the problem of setting a TTL value and making raw [2] S. N. Srirama and C. Paniagua, “Mobile web service provisioning and
socket which needs root privileges. discovery in android days,” in Proceedings of the 2013 IEEE Second
International Conference on Mobile Services. IEEE Computer Society,
Nattrav is a software approach to solve the NAT problems 2013, pp. 15–22.
for P2P applications [16]. First peers should register with [3] D. Recordon and D. Reed, “Openid 2.0: a platform for user-centric
identity management,” in Proceedings of the second ACM workshop on
a connection broker which provides current network address Digital identity management. ACM, 2006, pp. 11–16.
for the recipients and facilitate the NAT traversal if peers are [4] J. Rosenberg, H. Schulzrinne, G. Camarillo, A. Johnston, J. Peterson,
behind the NAT. In the registration, peers register with the R. Sparks, M. Handley, E. Schooler et al., “Sip: session initiation
connection broker by providing the peer’s URI. Connection protocol,” RFC 3261, Internet Engineering Task Force, Tech. Rep.,
broker uses this URI to send subsequent connection requests 2002.
from other peers. When a peer device needs to connect with [5] P. Saint-Andre, “Extensible messaging and presence protocol (xmpp):
other peer device it should send the lookup message to the Core,” 2011.
connection broker. The connection broker eventually replies [6] D. Braun, S. Mukherjee, and C. Akinlar, “Zero configuration network-
ing,” Feb. 21 2006, uS Patent 7,002,924.
back with the IP address and the port number of the destination
peer. Since peers know the other side endpoint details they [7] U. Plug and P. Forum, “Universal plug and play forum.” [Online].
Available: http://www.upnp.org/forum/default.htm
can establish a connection by sending a SYN packet. If the
[8] S. N. Srirama, M. Jarke, and W. Prinz, “Mobile host: A feasibility anal-
peers are behind the NAT connection, broker helps the traversal ysis of mobile web service provisioning,” in 4th International Workshop
by providing a public endpoint details of the destination on Ubiquitous Mobile Information and Collaboration Systems, UMICS.
peer. In the implementation they used a Java package called Citeseer, 2006, pp. 942–953.
”nattrav” which provides classes for setting up TCP sockets. [9] S. E. Deering, “Internet protocol, version 6 (ipv6) specification,” 1998.
This solution is conceptually the most similar approach to the [10] G. J. d. Groot, Y. Rekhter, D. Karrenberg, and E. Lear, “Address
one proposed by us. However, our approach is specifically allocation for private internets,” 1996.
targeted for mobile devices, which makes it different from any [11] I. global standard for international mobile telecommunications.
proposed solutions. [Online]. Available: www.imt-2000.org
[12] K. Richardson, “Umts overview,” Electronics & Communication Engi-
neering Journal, vol. 12, no. 3, pp. 93–100, 2000.
VII. C ONCLUSIONS AND F UTURE W ORK [13] P. Srisuresh and M. Holdrege, “Ip network address translator (nat)
terminology and considerations,” 1999.
In this paper, we analyzed addressing a mobile device in the [14] B. Sterman and D. Schwartz, “Nat traversal in sip,” IEC Annual Review
mobile 3G network (also applicable for 4G) using TCP hole of Communications, vol. 56, 2002.
punching approach. We introduced the approach and developed [15] B. Ford, P. Srisuresh, and D. Kegel, “Peer-to-peer communication across
a prototype solution as an android application that helps in network address translators.” in USENIX Annual Technical Conference,
General Track, 2005, pp. 179–192.
making the TCP hole punching. The testing results showed that
the connections can be established following the approach in [16] J. L. Eppinger, “Tcp connections for p2p apps: A software approach to
solving the nat problem,” Institute for Software Research, p. 16, 2005.
different networks. However, there are some situations where
[17] S. Guha and P. Francis, “Characterization and measurement of tcp
the approach is unusable, in some networks. The main reason traversal through nats and firewalls,” in Proceedings of the 5th ACM
is that there is no standard for the NAT process. Different SIGCOMM conference on Internet Measurement. USENIX Associa-
mobile operators use different NAT process and it is difficult tion, 2005, pp. 18–18.
to implement all in one solution. In this context, the limitations [18] A. Biggadike, D. Ferullo, G. Wilson, and A. Perrig, “Natblaster:
of the approach are discussed in detail. Establishing tcp connections between hosts behind nats,” in ACM
SIGCOMM Asia Workshop, vol. 5, 2005.
To overcome these limitations we propose to implement [19] Tele2. [Online]. Available: http://www.tele2.ee/index.html
a TCP server that can relay the messages in between hosts. [20] Elisa. [Online]. Available: https://www.elisa.ee/
Then the host should first establish a connection with the [21] EMT. [Online]. Available: https://www.emt.ee/en/
server. When the host needs to send a message to another host [22] K. Reinloo, “Addressing smartphones located
that message is forwarded to the relay server and the server behind firewalls,” 2013. [Online]. Available:
forwards it to the destination host. However, this approach is http://dspace.utlib.ee/dspace/handle/10062/32957?show=full
applicable only when we consider sending one off messages. [23] S. Guha, Y. Takeda, and P. Francis, “Nutss: A sip-based approach to udp
In scenarios explained by the paper like mobiles providing and tcp network connectivity,” in Proceedings of the ACM SIGCOMM
workshop on Future directions in network architecture. ACM, 2004,
services and establishing the mobile Internet of things the pp. 43–48.
solution may not be suitable.
ACKNOWLEDGMENT
This work is supported by European Regional Develop-
ment Fund through EXCS, Estonian Science Foundation grant
PUT360 and Target Funding theme SF0180008s12.
R EFERENCES
[1] S. N. Srirama, M. Jarke, and W. Prinz, “Mobile web service provi-
sioning,” in Int. Conf. on Internet and Web Applications and Services
(ICIW’06). IEEE, 2006, pp. 120–125.
97