﻿<?xml version="1.0" encoding="UTF-8"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2544 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2544.xml">
<!ENTITY RFC4814 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4814.xml">
<!ENTITY RFC5180 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5180.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8219 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8219.xml">

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-lencse-v6ops-transition-scalability-03" ipr="trust200902">

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
          full title is longer than 39 characters -->

    <title abbrev="Scalability of IPv4aaS Technologies">Scalability of IPv6 Transition
    Technologies for IPv4aaS</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Gabor Lencse" initials="G." surname="Lencse">
      <organization >Szechenyi Istvan University</organization>
      <address>
        <postal>
          <street>Egyetem ter 1.</street>
          <!-- Reorder these if your country does things differently -->
          <city>Gyor</city>
          <region></region>
          <code>H-9026</code>
          <country>Hungary</country>
        </postal>
        <phone></phone>
        <email>lencse@sze.hu</email>
      </address>
    </author>

    <date year="2022" />

    <!-- Meta-data Declarations -->

    <area>ops</area>

    <workgroup>v6ops</workgroup>

    <!-- WG name at the upperleft corner of the doc,
          IETF is fine for individual submissions.  
    If this element is not present, the default is "Network Working Group",
          which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>IPv6, Transition Technologies, Comparison, IPv4aaS, IPv6-only, 464XLAT, DNS64, Dual Stack Lite, Lightweight 4over6, MAP-E, MAP-T</keyword>

    <!-- Keywords will be incorporated into HTML output
          files in a meta tag but they have no effect on text or nroff
          output. If you submit your draft to the RFC Editor, the
          keywords will be used for the search engine. -->

    <abstract>
      <t>Several IPv6 transition technologies have been developed to
      provide customers with IPv4-as-a-Service (IPv4aaS) for ISPs with an
      IPv6-only access and/or core network. All these technologies have their
      advantages and disadvantages, and depending on existing topology, skills,
      strategy and other preferences, one of these technologies may be the
      most appropriate solution for a network operator.</t>

      <t>This document examines the scalability of the five most prominent
      IPv4aaS technologies (464XLAT, Dual Stack Lite, Lightweight 4over6, 
	  MAP-E, MAP-T) considering two aspects: (1) how their performance 
	  scales up with the number of CPU cores, (2) how their performance degrades, 
	  when the number of concurrent sessions is increased until hardware limit 
	  is reached.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>IETF has standardized several IPv6 transition technologies 
	  <xref target="LEN2019"/> and occupied a neutral position trusting 
	  the selection of the most appropriate ones to the market.  
	  <xref target="I-D.ietf-v6ops-transition-comparison"/> provides a
      comprehensive comparative analysis of the five most prominent 
	  IPv4aaS technologies to assist operators with this problem. 
	  This document adds one more detail: measurement data regarding the 
	  scalability of the examined IPv4aaS technologies.</t>

	  <t>Currently, this document contains only the scalability 
	  measurements of the iptables stateful NAT44 implementation. It serves 
	  as a sample to test if the disclosed results are (1) useful and (2) sufficient
	  for the network operators.</t>
	  
      <section title="Requirements Language">
        <t>
           The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 
           "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", 
           and "OPTIONAL" in this document are to be interpreted as described 
           in BCP14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
           when, and only when, they appear in all capitals, as shown here.
         </t>
      </section>
    </section>


    <section anchor="iptables" title="Scalability of iptables">
	
      <section title="Introduction to iptables">

	  <t>Netfilter <xref target="NETFLTR"/> is a widely used firewall, NAT 
	  and packet mangling framework for Linux. It is often called as 
	  "iptables" after the name of its user space command line tool. 
	  From our point of view, iptables is used as a stateful NAT44 solution. 
	  (Also called as NAPT: Network Address and Port Translation.) 
	  It is a free and open source software under the GPLv2 license.</t>

	  <t>This document deals with iptables for multiple considerations:
      <list style="symbols">
      	<t>To provide a reference for the scalability of various stateful 
		NAT64 implementations. (We use it to prove that a stateful NATxy solution 
		does not need to exhibit a poor scalability.)</t>
      	<t>To provide IPv6 operators with a basis for comparison if is it worth 
		using an IPv4aaS solution over Carrier-grade NAT.</t>
      	<t>To prove the scalability of iptables, when iptables is used as a part
		of the CE of MAP-T (see later).</t>		
      </list></t> 
      </section>	


      <section title="Measurement Method">

	  <t><xref target="RFC8219"/> has defined a benchmarking methodology for IPv6 
	  transition technologies. <xref target="I-D.lencse-bmwg-benchmarking-stateful"/>
	  has amended it by addressing how to benchmark stateful NATxy gateways using 
	  pseudorandom port numbers recommended by <xref target="RFC4814"/>. It has
	  defined measurement procedures for maximum connection establishment rate, 
	  connection tear down rate and connection table capacity measurement, plus it 
	  reused the classic measurement procedures like throughput, latency, frame loss 
	  rate, etc. from <xref target="RFC8219"/>. Besides the new metrics, we used 
	  throughput to characterize the performance of the examined system.</t>
	  
	  <t>The scalability of iptables is examined in two aspects:
      <list style="symbols">
      	<t>How its performance scales up with the number of CPU cores?</t>
      	<t>How its performance degrades, when the number of concurrent sessions is increased?</t>
      </list></t>	  
	  
        <figure anchor="test_setup_sfnat44" align="center" title="Test setup for benchmarking
		stateful NAT44 gateways">
          <preamble></preamble>

          <artwork align="center"><![CDATA[
              +--------------------------------------+
     10.0.0.2 |Initiator                    Responder| 198.19.0.2
+-------------|                Tester                |<------------+
| private IPv4|                         [state table]| public IPv4 |
|             +--------------------------------------+             |
|                                                                  |
|             +--------------------------------------+             |
|    10.0.0.1 |                 DUT:                 | 198.19.0.1  |
+------------>|        Sateful NAT44 gateway         |-------------+
  private IPv4|     [connection tracking table]      | public IPv4
              +--------------------------------------+

            ]]></artwork>

        <postamble></postamble>
        </figure>	  	  


	  <t>The test setup in <xref target="test_setup_sfnat44"/> was followed. 
	  The two devices, the Tester and the DUT (Device Under Test), were both Dell 
	  PowerEdge R430 servers having two 2.1GHz Intel Xeon E5-2683 v4 CPUs, 384GB 2400MHz 
	  DDR4 RAM and Intel 10G dual port X540 network adapters. The NICs of the servers were 
	  interconnected by direct cables, and the CPU clock frequecy was set to fixed 2.1 GHz on 
	  both servers. They had Debian 9.13 Linux operating system with 4.9.0-16-amd64 kernel. The 
	  measurements were performed by siitperf <xref target="LEN2021"/> using the "stateful" 
	  branch (latest commit Aug. 16, 2021). 
	  The DPDK version was 16.11.11-1+deb9u2. The version of iptables was 1.6.0.</t>
	  
	  <t>The ratio of number of connections in the connection tracking table and the 
	  value of the hashsize parameter of iptables significantly influences its performance. Although 
	  the default setting is hashsize=nf_conntrack_max/8, we have usually set hashsize=nf_conntrack_max 
	  to increase the performance of iptables, which was crucial, when high number of 
	  connections were used, because then the execution time of the tests was dominated by the 
	  preliminary phase, when several hundereds of millions connections had to be established. 
	  (In some cases, we had to use different settings due to memory limitations. The tables 
	  presenting the results always contain these parameters.)</t>
	  
	  <t>The size of the port number pool is an important parameter of the bechmarking method 
	  for stateful NATxy gateways, thus it is also given for all tests.</t>
  
      </section>	

      <section title="Performance scale up against the number of CPU cores">

	  <t>To examine how the performance of iptables scales up with the number of CPU cores, 
	  the number of active CPU cores was set to 1, 2, 4, 8, 16 using the "maxcpus=" kernel 
	  parameter.</t>
	  
	  <t>The number of connections was always 4,000,000 using 4,000 different source port 
	  numbers and 1,000 different destination port numbers. Both the connection tracking 
	  table size and the hash table size was set to 2^23.</t>
	  
	  <t>The error of the binary search was chosen to be lower than 0.1% of the expected 
	  results. The experiments were executed 10 times.</t>
	  
	  <t>Besides the connection establishment rate and the throughput of iptables, also the 
	  throughput of the IPv4 packet forwarding of the Linux kernel was measured to provide 
	  a basis for comparison.</t>
	  
	  <t>The results are presented in <xref target="iptables-cpu-scale"/>. The unit for the maximum
	  connection establishment rate is 1,000 connections per second. The unit for throughput 
	  is 1,000 packets per second (measured with bidirectional traffic, and the number of 
	  all packets per second is displayed).</t>

        <figure anchor="iptables-cpu-scale" align="center" title="Scale up of iptables 
		against the number of CPU cores (Please refer to the next figure for the 
		explanation of the abbreviations.)"> 

        <preamble></preamble>

        <artwork align="left"><![CDATA[
num. CPU cores          1          2          4          8         16
src ports           4,000      4,000      4,000      4,000      4,000
dst ports           1,000      1,000      1,000      1,000      1,000
num. conn.      4,000,000  4,000,000  4,000,000  4,000,000  4,000,000
conntrack t. s.      2^23       2^23       2^23       2^23       2^23
hash table size      2^23       2^23       2^23       2^23       2^23
c.t.s/num.conn.     2.097      2.097      2.097      2.097      2.097
num. experiments       10         10         10         10         10
error                 100        100        100      1,000      1,000
cps median          223.5      371.1      708.7      1,341      2,383
cps min             221.6      367.7      701.7      1,325      2,304
cps max             226.7      375.9      723.6      1,376      2,417
cps rel. scale up       1      0.830      0.793      0.750      0.666
throughput median   414.9      742.3      1,379      2,336      4,557
throughput min      413.9      740.6      1,373      2,311      4,436
throughput max      416.1      746.9      1,395      2,361      4,627
tp. rel. scale up       1      0.895      0.831      0.704      0.686
IPv4 packet forwarding (using the same port number ranges)
error                 200        500      1,000      1,000      1,000
throughput median   910.9      1,523      3,016      5,920     11,561
throughput min      874.8      1,485      2,951      5,811     10,998
throughput max      914.3      1,534      3,037      5,940     11,627
tp. rel. scale up       1      0.836      0.828      0.812      0.793
throughput ratio (%) 45.5       48.8       45.7       39.5       39.4
          ]]></artwork>

        <postamble></postamble>
        </figure>

        <figure anchor="abbrev-iptables-cpu-scale" align="center" 
		title="Explanation of the abbreviations for the scale up of iptables 
		against the number of CPU cores">
        <preamble></preamble>

        <artwork align="left"><![CDATA[
abbreviation          explanation
------------          -----------
num. CPU cores        number of CPU cores
src ports             size of the source port number range
dst ports             size of the destination port number range
num. conn.            number of connections = src ports * dst ports
conntrack t. s.       size of the connection tracking table of the
                      DUT
hash table size       size of the hash table of the DUT
c.t.s/num.conn.       conntrack table size / number of connections
num. experiments      number of experiments
error                 the difference between the upper and the lower 
                      bound of the binary search when it stops
cps (median/min/max)  maximum connection establishment rate
                      (median, minimum, maximum)
cps rel. scale up     the relative scale up of the maximum connection 
                      establishment rate against the number of CPU
                      cores
tp. rel. scale up     the relative scale up of the throughput
throughput ratio (%)  the ratio of the throughput of iptables and the
                      throughput of IPv4 packet forwarding
          ]]></artwork>

        <postamble></postamble>
        </figure>

	  
	  <t>Whereas the throughput of IPv4 packet forwarding scaled up from 0.91Mpps to 11.56Mpps 
	  showing a relative scale up of 0.793, the throughput of iptables scaled up from 414.9kpps 
	  to 4,557kpps showing a relative scale up of 0.686 (and the relative scale up of the maximum
	  connection establishment rate is only 0.666). On the one hand, this is the price of the 
	  stateful operation. On the other hand, this result is quite good compared to the scale-up 
	  results of NSD (a high performance authoritative DNS server) presented in Table 9 of <xref target="LEN2020"/>, 
	  which is only 0.52. (1,454,661/177,432=8.2-fold performance using 16 cores.) And DNS is 
	  not a stateful technology.</t>
	  
	  
      </section>	


      <section anchor="iptables-perf-deg" title="Performance degradation caused by the number of sessions">

	  <t>To examine how the performance of iptables degrades with the number connections in 
	  the connection tracking table, the number of connections was increased fourfold by 
	  doubling the size of both the source port number range and the destination port number range.
	  Both the connection tracking table size and the hash table size was also increased four fold. 
	  However, we reached the limits of the hardware at 400,000,000 connections: we could not set 
	  the size of the hash table to 2^29 but only to 2^28. The same value was used at 800,000,000 
	  connections too, when the number of connections was only doubled, because 1.6 billion connections 
	  would not fit into the memory.</t>
	  
	  <t>The error of the binary search was chosen to be lower than 0.1% of the expected 
	  results. The experiments were executed 10 times (except for the very long lasting measurements 
	  with 800,000,000 connections).</t>
	  
	  <t>The results are presented in <xref target="iptables-conn-scale"/>. The unit for the maximum
	  connection establishment rate is 1,000,000 connections per second. The unit for throughput 
	  is 1,000,000 packets per second (measured with bidirectional traffic, and the number of 
	  all packets per second is displayed).</t>


        <figure anchor="iptables-conn-scale" align="center" title="Performance of iptables 
		against the number of sessions">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
num. conn.       1.56M   6.25M     25M     100M     400M     800M
src ports        2,500   5,000  10,000   20,000   40,000   40,000
dst ports          625   1,250   2,500    5,000   10,000   20,000
conntrack t. s.   2^21    2^23    2^25     2^27     2^29     2^30
hash table size   2^21    2^23    2^25     2^27     2^28     2^28
num. exp.           10      10      10       10       10        5
error            1,000   1,000   1,000    1,000    1,000    1,000
n.c./h.t.s.      0.745   0.745   0.745    0.745    1.490    2.980
cps median       2.406   2.279   2.278    2.237    2.013    1.405
cps min          2.358   2.226   2.226    2.124    1.983    1.390
cps max          2.505   2.315   2.317    2.290    2.050    1.440
throughput med.  5.326   4.369   4.510    4.516    4.244    3.689
throughput min   5.217   4.240   3.994    4.373    4.217    3.670
throughput max   5.533   4.408   4.572    4.537    4.342    3.709
          ]]></artwork>

        <postamble></postamble>
        </figure>

	  <t>The performance of iptables shows degradation at 6.25M connections compared to 1.56M 
	  connections very likely due to the exhaustion of the L3 cache of the CPU of the DUT.
	  Then the performance of iptables is fearly constant up to 100M connections. A small 
	  performance decrease can be observed at 400M connections due to the lower hash table size. 
	  A more significant performance decrease can be observed at 800M connections. It is caused 
	  by two factors:<list style="symbols">
      	<t>on average, about 3 connections were hashed to the same place</t>
      	<t>non NUMA local memory was also used.</t>
      </list></t>
	  <t>We note that the CPU has 2 NUMA nodes, cores 0, 2, ... 14 belong to NUMA node 0, and 
	  cores 1, 3, ... 15 belong to NUMA node 1. The maximum memory consumption with 400,000,000 
	  connections was below 150GB, thus it could be stored in NUMA local memory.</t>
	  
	  <t>Therefore, we have pointed out important limitations of the stateful NAT44 technology:<list style="symbols">
      	<t>there is a performance decrease, when approaching hardware limits</t>
      	<t>there is a hardware limit, beyond which the system cannot handle the connections 
		at all (e.g. 1600M connections would not fit into the memory).</t>
      </list></t>
	  
	  <t>Therefore, we can conclude that, on the one hand, a well tailored hashing may guarantee 
	  an excellent scale-up of stateful NAT44 regarding the number of connections in a wide range, 
	  however, on the other hand, stateful operation has its limits resulting both in performance 
	  decrease, when approaching hardware limits and also in inability to handle more sessions, 
	  when reaching the memory limits.</t>

      </section>	

      <section anchor="iptables-ctd" title="Connection tear down rate">

	  <t><xref target="I-D.lencse-bmwg-benchmarking-stateful"/> has defined connection tear 
	  down rate measurement as an aggregate measurement, that is, N number of 
	  connections are loaded into the connection tracking table of the DUT and then 
	  the entire content of the connection tracking table is deleted, and its deletion 
	  time is measured (T). Finally, the connection tear down rate is computed as: N/T.)</t>
	  
	  <t>We have observed that the deletion of an empty connection tracking table of iptables my take
	  a significant amount of time depending on its size. Therefore, we made our measurements more 
	  accurate by subtracting the deletion time of the empty connection tracking table from that of 
	  the filled one, thus we got the time spent with the deleting of the connections.</t>
	  
	  <t>The same setup and parameters were used as in <xref target="iptables-perf-deg"/> and 
	  the experiments were executed 10 times (except for the long lasting measurements with 800,000,000 
	  connections).</t>
	  
	  <t>The results are presented in <xref target="iptables-conn-tear-down"/>.</t>


        <figure anchor="iptables-conn-tear-down" align="center" title="Connection tear down rate of iptables 
		against the number of connections">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
num. conn.            1.56M   6.35M     25M    100M    400M    800M
src ports             2,500   5,000  10,000  20,000  40,000  40,000
dst ports               625   1,250   2,500   5,000  10,000  20,000
conntrack t. s.        2^21    2^23    2^25    2^27    2^29    2^30
hash table size        2^21    2^23    2^25    2^27    2^28    2^28
num. exp.                10      10      10      10      10       5
n.c./h.t.s.           0.745   0.745   0.745   0.745   1.490   2.980
full contr. del med    4.33   18.05   74.47  305.33 1,178.3 2,263.1
full contr. del min    4.25   17.93   72.04  299.06 1,164.0 2,259.6
full contr. del max    4.38   18.20   75.13  310.05 1,188.3 2,275.2
empty contr. del med   0.55    1.28    4.17   15.74    31.2    31.2
empty contr. del min   0.55    1.26    4.16   15.73    31.1    31.1
empty contr. del max   0.57    1.29    4.22   15.79    31.2    31.2
conn. deletion time    3.78   16.77   70.30  289.59 1,147.2 2,232.0
conn. tear d. rate  413,360 372,689 355,619 345,316 348,690 358,429
          ]]></artwork>

        <postamble></postamble>
        </figure>

	  <t>The connection tear down performance of iptables shows significant degradation at 
	  6.25M connections compared to 1.56M connections very likely due to the exhaustion of 
	  the L3 cache of the CPU of the DUT. Then it shows only a minor degradation up to 100M 
	  connections. A small performance increase can be observed at 400M connections 
	  due to the relatively lower hash table size. A more visible performance decrease can 
	  be observed at 800M connections. It is likely caused by keeping the hash table size 
	  constant and doubling the number of connections. The same thing that caused performance
	  degradation of the maximum connection establishment rate and throughput, made now the deletion
	  of the connections faster and thus caused an increase of the connection tear down rate.
	  </t>
	  
	  <t>We note that according to the recommended settings of iptables, 8 connections are 
	  hashed to each place of the hash table on average, but we wilfully used much smaller 
	  number (0.745 whenever it was possible) to increase the maximum connection estabilishment 
	  rate and thus to speed up experimenting. However, finally this choice significantly slowed 
	  down our experiments due to the very low connection tear down rate. </t>

      </section>

      <section anchor="iptables-cttc" title="Connection tracking table capacity">

	  <t><xref target="I-D.lencse-bmwg-benchmarking-stateful"/> has defined connection 
	  tracking table capacity measurement using the following quantities:
	  <list style="symbols">
      	<t>C0: initial safe value for the size of the connection tracking table (the 
		connection tracking table can surely store C0 entries)</t>
      	<t>R0: safe connection establisment rate for C0 connections (measured initially)</t>
      	<t>CS: safe value for the size of the connection tracking table during the 
		current measurement (taken from the previous iteration step)</t>
      	<t>RS: safe connection establisment rate for CS connections during the 
		current measurement (measured during the previous iteration)</t>
      	<t>CT: the currently tested size of the connection tracking table 
		during the exponential search; also used in the final binary search.</t>
      	<t>RT: the currently used connection establisment rate for testing with CT 
		number of connections during the exponential search</t>
		<t>alpha: safety factor to prevent that connection validation fails due to
		sending the validation frames at a too high rate</t>
		<t>beta: factor to express a too high drop of the connection establishment 
		rate during the exponential search</t>
		<t>gamma: factor to express a too high drop of the connection establishment 
		rate during the final binary search</t>			
      </list></t>

	  <t>First, the order of magnitude of the size of the connection tracking table is 
	  determined by an exponential search. When it stops, then the C capacity of the 
	  connection tracking table is between CS and CT=2*CS.</t>
	  
	  <t>Then the C size of the connection tracking table is determined by a binary search within 
	  E error.</t>
	  
	  <t>Measurements were performed with the following parameters: 
	  hashsize=nf_conntrack_max=2**22=4,194,304; R0=1,000,000; E=1, 
	  alpha=1.0; beta=0.2; gamma=0.4. The measurements were 
	  performed 10 times to see the stability of the results.</t>
	  
	  <t>The results are presented in <xref target="iptables-cttc-res"/>. The exponential 
	  search finished at its third step (CS=4,000,000 and CT=8,000,000). And the result 
	  of the final binary search was always very close to 4,194,304.</t>


        <figure anchor="iptables-cttc-res" align="center" title="Connection tracking table 
		capacity measurement resultss for iptables (actual size: 4,194,304)">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
              C0        R0        CS        RS        CT         C
median 1,000,000  2,562,500  4,000,000  2,250,945  8,000,000  4,194,301
min    1,000,000  2,437,500  4,000,000  2,139,953  8,000,000  4,194,300
max    1,000,000  2,687,500  4,000,000  2,327,269  8,000,000  4,194,302
          ]]></artwork>

        <postamble></postamble>
        </figure>

      </section>
	  	  
    </section>

    <section anchor="jool" title="Scalability of Jool">
	
      <section title="Introduction to Jool">

	  <t>Jool <xref target="JOOLMX"/> is an open source SIIT and stateful NAT64 
	  implementation for Linux. Since its version 4.2 it also supports MAP-T.
	  It has been developed by NIC Mexico in cooperation with ITESM (Monterrey 
	  Institute of Technology and Higher Education). Its source code is released 
	  under GPLv2 license.</t>

      </section>	
	
	
	
      <section title="Measurement Method">
	  <t>The same methodology was used as in <xref target="iptables"/>, but now the test setup 
	  in <xref target="test_setup_sfnat64"/> was followed. The same Tester and DUT devices
	  were used as before, but the operating system of the DUT was updated to Debian 10.11 
	  with 4.19.0-18-amd64 kernel to meet the requirement of the jool-tools package. 
	  The version of Jool was 4.1.6. (The most mature version of Jool at the date of starting 
	  the measurements, Relase Date: 2021-12-10.) </t>
        <figure anchor="test_setup_sfnat64" align="center" title="Test setup for benchmarking
		stateful NAT64 gateways">
          <preamble></preamble>

          <artwork align="center"><![CDATA[
              +--------------------------------------+
    2001:2::2 |Initiator                    Responder| 198.19.0.2
+-------------|                Tester                |<------------+
| IPv6 address|                         [state table]| IPv4 address|
|             +--------------------------------------+             |
|                                                                  |
|             +--------------------------------------+             |
|   2001:2::1 |                 DUT:                 | 198.19.0.1  |
+------------>|        Sateful NAT64 gateway         |-------------+
  IPv6 address|     [connection tracking table]      | IPv4 address
              +--------------------------------------+
            ]]></artwork>

        <postamble></postamble>
        </figure>	  	  


	  
	  
	  <t>Unlike with iptables, we did not find any way to tune the hashsize or any other parameters of Jool.</t>
	  
  
      </section>	

      <section title="Performance scale up against the number of CPU cores">

	  <t>The number of connections was always 1,000,000 using 2,000 different source port 
	  numbers and 500 different destination port numbers.</t>
	  
	  <t>The error of the binary search was chosen to be lower than 0.1% of the expected 
	  results. The experiments were executed 10 times.</t>
	    
	  <t>The results are presented in <xref target="jool-cpu-scale"/>. The unit for the maximum
	  connection establishment rate is 1,000 connections per second. The unit for throughput 
	  is 1,000 packets per second (measured with bidirectional traffic, and the number of 
	  all packets per second is displayed).</t>

        <figure anchor="jool-cpu-scale" align="center" title="Scale up of Jool 
		against the number of CPU cores">
        <preamble></preamble>

        <artwork align="left"><![CDATA[
num. CPU cores          1          2          4          8         16
src ports           2,000      2,000      2,000      2,000      2,000
dst ports             500        500        500        500        500
num. conn.      1,000,000  1,000,000  1,000,000  1,000,000  1,000,000
num. experiments       10         10         10         10         10
error                 100        100        100        100        100
cps median          228.6      358.5      537.4      569.9      602.6
cps min             226.5      352.5      530.7      562.0      593.7
cps max             230.5      362.4        543      578.3      609.7
cps rel. scale up       1      0.784      0.588      0.312      0.165
throughput median   251.8      405.7      582.4      604.1      612.3
throughput min      249.8      402.9      573.2      587.3      599.8
throughput max      253.3      409.6      585.7      607.2      616.6
tp. rel. scale up       1      0.806      0.578      0.300      0.152
          ]]></artwork>

        <postamble></postamble>
        </figure>
		
		
	  <t>Both the maximum connection establishment rate and the throughput
	  scaled up poorly with the number of active CPU cores. The increase of 
	  the performance was very low above 4 CPU cores.</t>
	  
      </section>	


      <section title="Performance degradation caused by the number of sessions">

	  <t>To examine how the performance of Jool degrades with the number connections,
	  the number of connections was increased fourfold by 
	  doubling the size of both the source port number range and the destination port number range.
	  We did not reach the limits of the hardware regarding the number of connections, because 
	  unlike iptables, Jool worked also with 1.6 billion connections.</t>
	  
	  <t>The error of the binary search was chosen to be lower than 0.1% of the expected 
	  results and the experiments were executed 10 times (except for the very long lasting 
	  measurements with 800 million and 1.6 billion connections to save execution time).</t>
	  
	  <t>The results are presented in <xref target="jool-conn-scale"/>. The unit for the maximum
	  connection establishment rate is 1,000 connections per second. The unit for throughput 
	  is 1,000 packets per second (measured with bidirectional traffic, and the number of 
	  all packets per second is displayed).</t>


        <figure anchor="jool-conn-scale" align="center" title="Performance of Jool 
		against the number of sessions">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
num. conn.       1.56M   6.35M     25M    100M    400M   1600M
src ports        2,500   5,000  10,000  20,000  40,000  40,000
dst ports          625   1,250   2,500   5,000  10,000  40,000
num. exp.           10      10      10      10       5       5
error              100     100     100     100   1,000   1,000
cps median       480.2   394.8   328.6   273.0   243.0   232.0
cps min          468.6   392.7   324.9   269.4   243.0   230.5
cps max          484.9   397.4   331.3   280.6   244.5   233.6
throughput med.  511.5   423.9   350.0   286.5   257.8   198.4
throughput min   509.2   420.3   348.2   284.2   257.8   195.3
throughput max   513.1   428.3   352.5   290.8   260.9   201.6
          ]]></artwork>

        <postamble></postamble>
        </figure>

	  <t>The performance of Jool shows degradation at the entire range of the number of connections. 
	  We did not analyze the root cause of the degradation yet. And we are not aware of the 
	  implementation of its connection tracking table. We also plan to check the memory 
	  consumption of Jool, what is definitely lower that that of iptables.</t>
	
      </section>

      <section anchor="jool-ctd" title="Connection tear down rate">

	  <t>Basically, the same measurement method was used as in <xref target="iptables-ctd"/>, 
	  however having no parameter of Jool to tune, only a single measurement series was 
	  performed to determine the deletion time of the empty connection tracking table. The median, 
	  minimum and maximum values of the 10 measurements were 0.46s, 0.42s and 0.50s respectively.</t>
	  
	  <t>The same setup and parameters were used as in <xref target="iptables-perf-deg"/> and 
	  the experiments were executed 10 times (except for the long lasting measurements with 800,000,000 
	  connections).</t>
	  
	  <t>The results are presented in <xref target="jool-conn-tear-down"/>. The unit for the connection 
	  tear down rate is 1,000,000 connections per second.</t>


        <figure anchor="jool-conn-tear-down" align="center" title="Connection tear down rate of Jool 
		against the number of connections">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
num. conn.            1.56M   6.35M     25M    100M    400M   1600M
src ports             2,500   5,000  10,000  20,000  40,000  40,000
dst ports               625   1,250   2,500   5,000  10,000  40,000
num. exp.                10      10      10      10      10       5
full contr. del med    0.87    2.05    7.84   36.38  126.09  474.68
full contr. del min    0.80    2.02    7.80   36.27  125.84  473.20
full contr. del max    0.91    2.09    7.94   36.80  127.54  481.38
empty contr. del med   0.46    0.46    0.46    0.46    0.46    0.46
conn. deletion time    0.41    1.59    7.38   35.92  125.63  474.22
conn. t. d. r. (M)    3.811   3.931   3.388   2.784   3.184   3.374
          ]]></artwork>

        <postamble></postamble>
        </figure>

	  <t>The connection tear down performance of Jool is excellent at any number 
	  of connections. It is about and order of magnitude higher that its connection 
	  establishment rate and than the connection tear down rate of iptables. 
	  (A slight degradation can be observed at 100M connections.)</t>

      </section>	

      <section anchor="jool-cval" title="Validation of connection establishment">

	  <t>The measurement of connection establishment rate with validation was performed using
	  different values for the "alpha" parameter. </t>

	  
	  <t>The results are presented in <xref target="jool-conn-valid"/>. It is well 
	  visible that alpha values 0.8 and 0.6 cause significant decrease 
	  of the validated rate, therefore, they are unsuitable. Values 0.5 and 0.25 
	  make no difference compared to the unvalidated connection establishment rate. 
	  (The less than 1,000 cps increase of the median is deliberately a measurement 
	  error.)</t>


        <figure anchor="jool-conn-valid" align="center" title="Connection establishment rate rate of Jool 
		against the alpha parameter">
        <preamble></preamble>

        <artwork align="center"><![CDATA[
alpha            0.8       0.6       0.5      0.25  no validation
num. conn. 4,000,000 4,000,000 4,000,000 4,000,000      4,000,000
src ports      4,000     4,000     4,000     4,000          4,000
dst ports      1,000     1,000     1,000     1,000          1,000
num. exp.         10        10        10        10             10
error            100       100       100       100            100
cps median   323,534   429,491   479,296   479,199        478,417
cps min      322,948   426,464   473,339   474,120        474,902
cps max      325,097   431,542   483,690   483,299        484,667
          ]]></artwork>

        <postamble></postamble>
        </figure>

      </section>	



    </section>


 
   <section anchor="Acknowledgements" title="Acknowledgements">
     <t>The measurements were carried out by remotely using the resources 
	 of NICT StarBED, 2-12 Asahidai, Nomi-City, Ishikawa 923-1211, Japan.  
	 The author would like to thank Shuuhei Takimoto for the possibility to 
	 use StarBED, as well as to Satoru Gonno and Makoto Yoshida for their 
	 help and advice in StarBED usage related issues.</t>
   
     <t>The author would like to thank Ole Troan for his comments on the v6ops 
	 mailing list, while the scalalability measurements of iptables were intended 
	 to be a part of <xref target="I-D.ietf-v6ops-transition-comparison"/>.</t>
   </section>

   <!-- Possibly a 'Contributors' section ... -->

   <section anchor="IANA" title="IANA Considerations">
     <t>This document does not make any request to IANA.</t>
   </section>

   <section anchor="Security" title="Security Considerations">
     <t>TBD. </t>

   </section>
 </middle>

 <!--  *****BACK MATTER ***** -->

 <back>
   <!-- References split into informative and normative -->

   <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
    2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
       (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included files in the same
    directory as the including file. You can also define the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

   <references title="Normative References">
    <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
    &RFC2119;
    &RFC4814;
    &RFC8174;
    &RFC8219;

   </references>

   <references title="Informative References">
     <!-- Here we use entities that we defined at the beginning. -->
 
    <?rfc include='reference.I-D.ietf-v6ops-transition-comparison'?>
    <?rfc include='reference.I-D.lencse-bmwg-benchmarking-stateful'?>	

 	<reference anchor="JOOLMX" 
    target="https://jool.mx/">
      <front>
        <title>Jool: SIIT and NAT64
        </title>
         <author initials="" surname="NIC Mexico">
          <organization></organization>
        </author>
		<date year="2022" />		
      </front>
      <seriesInfo name="" value="The home page of Jool"/>
    </reference>
 
    <reference anchor="LEN2019" 
    target="http://www.hit.bme.hu/~lencse/publications/e102-b_10_2021.pdf">
      <front>
        <title>Comprehensive Survey of IPv6 Transition Technologies: 
		A Subjective Classification for Security Analysis
        </title>

        <author initials="G." surname="Lencse">
          <organization></organization>
        </author>
        <author initials="Y." surname="Kadobayashi">
          <organization></organization>
        </author>

        <date day="1" month="Oct" year="2019" />
      </front>
      <seriesInfo name="" value="IEICE Transactions on Communications, vol. E102-B, no.10, pp. 2021-2035."/>
      <seriesInfo name="" value="DOI: 10.1587/transcom.2018EBR0002"/>
    </reference>
	
	<reference anchor="LEN2020" 
    target="https://ieeexplore.ieee.org/document/9139929">
      <front>
        <title>Benchmarking Authoritative DNS Servers</title>

        <author initials="G." surname="Lencse">
          <organization></organization>
        </author>
		
		<date day="" month="July" year="2020" />
     
      </front>
      <seriesInfo name="" value="IEEE Access, vol. 8. pp. 130224-130238"/>
	  <seriesInfo name="" value="DOI: 10.1109/ACCESS.2020.3009141"/>
    </reference>
	
	<reference anchor="LEN2021" 
    target="http://www.hit.bme.hu/~lencse/publications/IEICE-2020-siitperf-revised.pdf">
      <front>
        <title>Design and Implementation of a Software Tester for Benchmarking Stateless NAT64 Gateways
        </title>

        <author initials="G." surname="Lencse">
          <organization></organization>
        </author>
		
		<date day="1" month="February" year="2021" />
     
      </front>
      <seriesInfo name="" value="IEICE Transactions on Communications"/>
	  <seriesInfo name="" value="DOI: 10.1587/transcom.2019EBN0010"/>
    </reference>
	
	<reference anchor="NETFLTR" 
    target="https://www.netfilter.org/">
      <front>
        <title>Netfilter: Firewalling, NAT, and packet mangling for Linux
        </title>
         <author initials="" surname="The Netfilter's webmasters">
          <organization></organization>
        </author>
		<date year="2021" />		
      </front>
      <seriesInfo name="" value="The netfilter.org project home page"/>
    </reference>
	
	
   </references>

   <section anchor="change_log" title="Change Log">
    <section title="00">
      <t>Initial version: scale up of iptables.
      </t>
    </section>
    <section title="01">
      <t>Added the scale up of Jool.
      </t>
    </section>
    <section title="02">
      <t>Connection tear down rate measurements of iptables and Jool.
      </t>
    </section>
    <section title="03">
      <t>Added: introductions to iptables and Jool, connection tracking table capacity measurement of iptables and connection validation measurement of Jool.
      </t>
    </section>	
   </section>
  </back>
</rfc>