You are on page 1of 3

WK,(((,QWHUQDWLRQDO&RQIHUHQFHRQ&RPPXQLFDWLRQ7HFKQRORJ\3URFHHGLQJV

A Method for Accessing Web Services Behind


Network Address Translators (NATs)

Wenhao Lu, Xi Zhou*, Yingxiao Xu, Yinsheng Li, Weiwei Sun


School of Computer Science
Fudan University
Shanghai, P.R.China 200433
{062053036, zhouxi, xuyx, liys, wwsun}@fudan.edu.cn

Abstract—Due to some reasons, quite a lot of Web Services are


running inside private networks behind Network Address II. CURRENT NAT TRAVERSAL APPROACHES
Translators (NATs), which makes it difficult for consumers to
directly access the services. In this article we propose an indirect A. NAT Traversal Protocols and Techniques Based on NAT
method for accessing web services behind NATs. Behavior
x Simple Traversal of UDP over NATs (STUN) [2]: A
Keywords-Web Services; NAT traversal;
standards-based IP protocol used as in applications of
real-time voice, video, messaging and other interactive
I. INTRODUCTION IP communications. The protocol requires assistance
A Web Service is a software system designed to support from a 3rd-party network server.
interoperable machine-to-machine interaction over a network
x Traversal Using Relay NAT (TURN) [3]: A protocol
[1]. As the need for interoperability and application-to-
that allows for an element behind a NAT or firewall to
application communication grows, the use of web services is
receive incoming data over TCP/UDP connections. It
expanding rapidly in recent years.
is most useful for elements behind symmetric NATs [2]
In the mid-1990’s Network Address Translation (NAT) or firewalls that wish to be on the receiving end of a
became a popular tool for alleviating the IPv4 address shortage. connection to a single peer.
The illusion of anonymity (private IP addresses) and
x UDP hole punching [4]: A method for establishing
inaccessibility of the internal hosts behind a NAT device is not
bidirectional UDP connections between Internet hosts
a problem for application such as web browser, which only
in private networks using NAT. The technique is
need to initiate outgoing connections. This illusion of
widely used in P2P software and VoIP [5] telephony. It
anonymity and inaccessibility is sometimes perceived as a
is one of the methods used in Skype [6] to bypass
privacy benefit. Nevertheless, hosts behind NAT-enabled
firewalls and NAT devices. It can also be used to
routers do not have end-to-end connectivity and cannot
establish VPNs [7].
participate in some Internet protocols. Services that require the
initiation of TCP connections from the outside network, or x TCP hole punching [4]: Extended from UDP hole
stateless protocols such as those using UDP, can be disrupted. punching, albeit with much less success.
Unless the NAT router makes a specific effort to support such
protocols, incoming packets cannot reach their destination. B. NAT Traversal Based on NAT Control
Most Web Services running on publicly addressable hosts x NAT Port Mapping Protocol (NAT PMP) [8]: An
can be easily consumed. However, serious lack of IPv4 address Internet Engineering Task Force (IETF) Internet Draft.
space results in Network Address Translators (NATs). The It allows a computer in a private network (behind a
present-day Internet has seen ubiquitous deployment of NATs NAT router) to automatically configure the router to
and quite some Web Services are running inside private allow parties outside the private network to contact
networks behind NATs. Without publicly routable IP addresses, itself.
these services cannot be accessed directly.
x Universal Plug and Play (UPnP) [9]: A set of protocols
There are a variety of NAT devices and a variety of aims to allow devices to connect seamlessly and to
network topologies utilizing NAT devices in deployments. simplify the implementation of networks in the home
According to different situations and application scenarios, and corporate environments.
different solutions are adopted to traverse NATs. Many
techniques exist for NAT traversal, but no technique works in x Application Layer Gateway (ALG) [10]: consists of a
every situation since NAT behavior is not standardized. security component that augments a firewall or NAT

This research is supported by the National High-Tech Research and


Development Plan of China under Grant 2006AA01Z234
üüüüüüüüüüüüüüüüüü
978-1-4244-2251-7/08/$25.00 ©2008 I E E E


WK,(((,QWHUQDWLRQDO&RQIHUHQFHRQ&RPPXQLFDWLRQ7HFKQRORJ\3URFHHGLQJV

on Host A through this connection. The connection can only be


initiated by Host B.
Main Internet
B. Create and Register the Service
Create Service B (with Host S’ information in its
description) on host B and Register it in a UDDI registry.
NAT NAT
(202.120.224.18) (222.72.255.192) Without a publicly addressable IP address, something must
be added to the description (WSDL file [12]) of Service B. We
add Service S’ WSDL file’s URI to the “documentation”
Private Private element of Service B’s WSDL file. So the “documentation”
Network Network element of B’s WSDL file should look like this:
<documentation>
<![CDATA[
Service S’ WSDL file’s URI
]]>
Web Service Consumer Web Service Provider
(10.132.142.8) (10.68.5.28) </documentation>
C. Service Discovery
Figure 1. A common case scenario.
The consumer from Host A may look up a service it needs
employed in a computer network. It allows customized from a certain UDDI [1]. It gets the description of Service B.
NAT traversal filters to be plugged into the gateway to Service B’s WSDL file is parsed by a program on Host A.
support address and port translation for certain The program first checks the “documentation” element. If there
application layer protocols. is a CDATA section inside the element, Host A will know that
Service B is behind a NAT and the program will get Service S’
C. NAT Traversal Combining Several Techniques WSDL file according to the URI. Then the program generates
x Interactive Connectivity Establishment (ICE) [11]: a SOAP message [13] based on Service S’ WSDL file and
Provides a mechanism for NAT traversal using various input parameters from Host A. When SOAP connection is
techniques. created between Host A and Host S, Service S can be
consumed.
Most of the above techniques cannot meet our need for
accessing Web Services behind NATs because none of them D. Call the Broker
are born to do it. Consider the scenario in Fig. 1. Service
consumer and service provider both have private IP addresses The consumer notices that Service B is behind a NAT
and lie behind different NAT devices. Hole punching technique device and it can be accessed through a broker service –
doesn’t work here because usually we can’t expect a consumer Service S on Host S. So the consumer calls the broker.
to initiate a connection with a rendezvous server and the Service S has two input parameters. One is the URI of
technique requires the NATs to be EIM-NATs [4]. Also UPnP Service B’s WSDL file, the other is a set of input parameters
is not a good choice either since some operating systems don’t from Host A. Service S returns what Service B returns. Service
support UPnP or in many cases, the UPnP function is turned S gets the SOAP message from Host A. After receiving this
off by network administrators. For accessing Web Services message, it’s Service S’ job to send a SOAP message to Host B.
behind NATs, we here present a new method as follows. This SOAP connection may not work if the NAT of Host B is a
non-EIM-NAT [4]. We can run a program on S to capture that
III. OUR APPROACH SOAP message heading toward Host B and send this message
Our Approach is somewhat like TURN. In this approach, as a raw XML file through the connection established between
we introduce a public addressable Host S as a broker that will Host B and Host S earlier. Later, Host B will resend this
help the consumer access the service. See Fig. 2 (We don’t care message through its local SOAP connection to Service B.
whether the consumer is behind a NAT). In Fig. 2 the
consumer from Host A wants to access the Web Service E. Consume the Service behind NAT
running on Host B (Service B). Host S runs a broker service Through the connection already established, Service S
(also a Web Service – Service S) that consumes Service B for consumes Service B and gets Service B’s return value(s) as its
the consumer. own return values.

A. Connect the Service Provider with a Broker F. Return Value(s) to the Original Consumer
Host B initiates a connection to Host S. (This step can be The consumer on Host A gets the return value(s) from
omitted if Server S happens to be the gateway of the private Service S.
network where Server B lies.) It’s a client/server connection.
Service S will consume Service B on behalf of the consumer


WK,(((,QWHUQDWLRQDO&RQIHUHQFHRQ&RPPXQLFDWLRQ7HFKQRORJ\3URFHHGLQJV

publicly addressable hosts are accessed without broker server


automatically. The average response time for consuming
services behind NATs is below 3 seconds and the worst case is
5.573 seconds.

V. CONLUSION AND FUTRUE WORK


We provide a new method to access Web Services behind
NATs. This method works for almost all type of NAT devices.
Services need broker servers to make them available on main
Internet. This method can be adopted when NAT traversal
based on NAT control cannot work.
The broker server in our method is doing the relaying job.
One disadvantage of the method is that it consumes the broker
servers’ processing power and network bandwidth. There is a
number limitation of broker services that can be deployed on
broker server. The tradeoff must be balanced.
In some situations a service behind NAT may be consumed
continuously by a single consumer. It would be better if a
direct connection between the consumer and the service can be
established with the help of a broker server. We will try to
improve this method to make it work more efficiently.

REFERENCES
[1] W3C Web Services Architecture, http://www.w3.org/TR/ws-arch/
[2] Rosenberg, J., Weinberger, J., Huitema, C., and R. Mahy, “STUN –
Simple Traversal of User Datagram Protocol (UDP) Through Network
Address Translators (NATs)”, RFC3489, March 2003.
[3] Rosenberg, J., Mahy, R., and P. Matthews, "Traversal Using Relays
Figure 2. Architechture of our approach. around NAT (TURN): Relay Extensions to Session Traversal Utilities
for NAT (STUN)", Work in Progress, January 2008.
[4] P. Srisuresh, B. Ford, D. Kegel, “State of Peer-to-Peer (P2P)
IV. EXPERIMENTS Communication across Network Address Translators (NATs)”,
RFC5128, March 2008.
In fact, Service B is part of a service composition, which is
[5] D. Collins, Carrier Grade Voice Over IP (second edition). McGraw-Hill
maintained by School of Computer Science, Fudan University Professional, 2002.
in Shanghai. Like service B, many services of this service [6] http://www.skype.com.
composition are behind NATs. And for some reasons, we have
[7] B. Gleeson, A. Lin, J. Heinanen, T. Finland, G.Armitage, A. Malis, “A
to access all the services of the service composition from Framework for IP Based Virtual Private Networks”, RFC2764, February
Beijing. And that’s why we’re working on NAT traversal for 2000.
Web Services in the first place. We did two experiments. [8] Cheshire, S., Krochmal, M., and K. Sekar, “NAT Port Mapping Protocol
(NAT-PMP)”, Work in Progress, October 2006.
First we use three hosts interconnected by a LAN switch to
[9] UPnP Forum, “Internet Gateway Device (IGD) Standardized Device
do the experiment. One of the hosts is installed with a Virtual Control Protocol V 1.0”, November 2001,
Machine and the Web Service is running on this virtual http://www.upnp.org/standardizeddcps/igd.asp
machine. Two of the hosts are Windows 2000 and another one [10] P. Srisuresh, M. Holdrege, “IP Network Address Translator (NAT)
is Fedora 5 Linux. We use Java Web Services Developer Pack Terminology and Considerations” (refer section 2.9), RFC2663, August
2.0 to parse WSDL files and to send SOAP messages. Our 1999
approach worked. We successfully consumed Service B behind [11] Rosenberg, J., “Interactive Connectivity Establishment (ICE): A
NAT. Methodology for Network Address Translator (NAT) Traversal for
Offer/Answer Protocols”, Work in Progress, October 2007.
Then we put our method into practice to meet our real [12] W3C Web Service Description Language (WSDL) Version 2.0 Part 0:
needs. We used two different NAT devices. A consumer in Primer, http://www.w3.org/TR/2007/REC-wsdl20-primer-2007062
Beijing successfully called a Web Service behind NAT in [13] W3C SOAP Version 1.2 Part 0: Primer (Second Edition),
Shanghai. We did more tests. Most services of the service http://www.w3.org/TR/2007/REC-soap12-part0-20070427/
composition must be consumed in turn. Services deployed on



You might also like