An Empirical Investigation Into Peer-To-Peer Network Address Translation (NAT) by Using Internet Protocol Version 4 & 6
Total Page:16
File Type:pdf, Size:1020Kb
Cyber Journals: Multidisciplinary Journals in Science and Technology, Journal of Selected Areas in Telecommunications (JSAT), October Edition, 2011 An Empirical Investigation into Peer-to-Peer Network Address Translation (NAT) by using Internet Protocol Version 4 & 6 MOHAMMAD SADEGHPOUR NAZARI Faculty of Arts, Computing, Engineering and Sciences, Sheffield Hallam University, Sheffield, UK [email protected] Abstract - Although Internet Protocol version 6 (IPv6) rectified Different scaling options such as CIDR (Classless Inter the valid IPv4 shortage, Network Address Translation (NAT) was Domain Routing) and VLSM (Variable Length Subnet Mask) deployed to decrease overwhelming demand for registered IPv4 have been implemented to make IP addresses as usable as addresses. possible. However, by increasing the request for the public IP By using NAT in both client / server and Peer-to-Peer networks, address, the number of available IP addresses is reduced. many problems which effect the rate of data downloading and uploading for users such as network overhead and packet To rectify this problem, two different techniques were discarding were encountered; however, the effecting rate of each deployed. The first method was a next-generation IP address problem relates to the use of TCP and UDP ports. definition, called “IP version 6” (IPv6). This version of IP There are many different methods which are used to rectify P2P address has 128 bits and 2 128 addresses are available for all the NAT problems. One of the best and most basic methods used in users in the world. The second technique, which was defined P2P NAT is Hole Punching. This technique, which has been to slow the depletion of IPv4 addressing, was address discussed in this article, allows clients in private networks to translation. [2] connect together by using TCP and UDP ports. During the next few years, although due to the explosion in use of I.2) Internet Protocol Version 6 IPv6 the request for NAT will decrease, address translation will still be needed by many clients, who use IPv4. Therefore, a new The Internet Protocol Version 6 (IPv6) is defined by RFC protocol, which is called Network Address Translation - Protocol 2460. According to Cisco Networking Academy (2010), by 38 Translation (NAT-PT), is necessary to translate the packet’s using IPv6, 3.4 x 10 usable IP addresses can be allocated to header from IPv4 to IPv6. Replacing IPv4 by IPv6 has the hosts. [3] There are many advantages for deploying IPv6. intensified these problems for the clients and ISPs; hence IPv6 Global reach ability and flexibility; aggregation; auto has not been very popular so far. configuration; end-to-end connection without address The main objectives of this paper is aimed to analyze the NAT translation; renumbering; routing efficiency; no broadcasts; issues as throughput and overhead of the network via using and no checksums are the most important benefits of using different analyzers such as Network Observer by investigating IPv6. into Peer - to - Peer NAT [Protocol Translation] when TCP/UDP ports and IPv4/6 are used. These later results are an important step for research in this field; I.3) Peer-to-Peer Networks However, they also clearly highlight the existing lack of Peer to Peer technology (P2P) is an emerging paradigm that is information in this domain. now viewed as a potential technology to redesign distributed architectures." [4] Keywords : P2P NAT, TCP/UDP Hole Punching Algorithm, One of the most important issues in Peer-to-Peer networks is NAT-PT connecting two or more PCs which are in different networks and have private IP addresses. For connecting these two I. Introduction nodes together and making a Peer-to-Peer network, address I.1) IPv4 Addressing translation is needed. NAT in Peer-to-Peer networks causes The IP address is one of the basic requirements for any device, well-known difficulties, because in P2P NAT the destination which connects to any network. Traditionally, each IP address may not be reachable at any globally valid IP address. has 32 bits and is divided into 4 octets. [1] The Regional Internet Registry (RIR) has defined two different kinds of I.4) Network Address Translation (NAT) IPv4 address: public and private. Public IP addresses are NAT is a process of addresses manipulation in the header of routable, unique and known to all internet users; whilst private packets and is defined by RFC 1631. [4] It is used to translate IP addresses are not permitted to be routed through the private IP addresses to public IP addresses, which are routable internet and organisations and private users can use them as through the internet and vice versa. It is usually used on the much as they need. border of networks, especially “stub networks” (Figure 1). 9 I.5) User Datagram Protocol (UDP) UDP is the simplest protocol and is the only connectionless and unreliable protocol in this layer, which runs up to 40% faster than TCP . [8] It is defined by RFC 768 and has different characteristics such as: No reliability mechanism, No delivery guarantees and No buffering services. I.6) Transmission Control Protocol (TCP) TCP, which is defined by RFC 793, is the most important Figure 1: Schematic showing different NAT names. protocol in the transport layer and serves as the intermediary between application layer programs and network layer processes. [8] An overview of TCP shows that it is a There are three different types of address translation mapping connection-oriented service which has error recovery, on networks. They include: sequencing, end-to-end reliability and flexibility. [9] 1- Static NAT 2- Dynamic NAT I.7) Network Address Translation - Protocol Translation 3- Overloaded NAT (PAT) (NAT-PT) NAT-PT, which is defined by RFC 2765 & 2766, is used to Many different techniques are used to implement P2P NAT establish a connection between IPv4 and IPv6 devices by and to rectify its problems. According to Hu (2005), UPnP translation of IPv4 packet’s header to IPv6 and vice versa. (Universal Plug and Play), STUN (Simple Traversal UDP [10] through Network Address Translation), ALG (Application Level Gateway) and UDP/TCP, Hole Punching is the basic I.8) Synchronisation of NAT with Transport Layer Protocols technique used for Peer-to-Peer NAT. [6] The Hole Punching (Discussion) is widely used in both UDP- and TCP-based applications. Although NAT conserves registered IP addresses and This method is introduced by RFC 3027 and is one of the increases the flexibility and reliability of connection to public simplest methods to make an end-to-end TCP or UDP reliable networks, it loses end-to-end traceability. It, also, supports session between two nodes. [7] (Figure 2) TCP and UDP traffic, which do not carry the IP addresses of sources and destinations. [4] In addition, that it increases the delay between sending and receiving packets, because the router CPU must check the header of each packet and decide whether it has to be translated or not. Therefore, the TTL (Time-to-Live) of some packets, which use TCP or UDP ports, might fall to zero, resulting in the packet being dropped. [11] Ruffi (2006) also believes that this might happen when the connection and translation slots are in idle time. According to him, “the idle times for translation slots in TCP connections are freed approximately every 60 seconds”. After this time, the connection is closed and the packet will be dropped. Blechschmidt (2005) believes that sometimes in P2P Figure 2: Hole Punching peer behind different NATs. networks, the NAT traverse sends unrequested data to the NAT gateway through the UDP port. These packets are UDP and TCP Hole Punching are two different methods of dropped by the firewall or NAT gateway. [12] However, this Hole Punching algorithm. However, although TCP Hole matter does not occur in the ports that use TCP protocol, Punching is more reliable, the UDP Hole Punching method is because before using the TCP protocol a request must be sent faster in sending and receiving data; easier to implement; and to the data sender. Any requests sent through the TCP causes less congestion on the network. Therefore, most of the protocol, which uses three-way handshakes, should be P2P networks that need a greater data transfer speed use UDP received by another peer and then the connection is Hole Punching. established. Therefore, the overhead of the network using TCP ports is more than that using UDP ports. As mentioned earlier, in all kinds of P2P Address Translation According to Ford et al. (2005), by using UDP port in Hole the transport layer protocols have a very important role. Punching Algorithm, the connection becomes unreliable, Therefore, understanding the function of TCP and UDP ports because after 20 seconds the UDP port reverts to idle time and and applications in P2P NAT is vital. the traffic is blocked. Therefore, if the application which uses UDP ports wants to be in an active state, it should send a periodic “keep-alive” message to guarantee that the relevant 10 translation state in the NATs does not disappear. of each private network, to translate the private IP address to Unfortunately this method provides an excessive amount of the Public IP address and vice versa. keep-alive traffic and is another cause of congestion in the network. Guha and Francis (2005) believe that in TCP Hole Punching, both endpoints initiate a connection by sending SYN packets. If, when the SYN packets are delivered, both endpoints respond with SYN ACK packets, a connection is established. [13] According to Hong et al. (2003), using IPv6 as the back bone of the network is more effective than using IPv4. [10] They believe that deploying IPv6 in the access layer, in which some nodes may still use IPv4, is one reason why packet process speed falls.