1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
|
<pre>Internet Engineering Task Force (IETF) M. Komu
Request for Comments: 5770 HIIT
Category: Experimental T. Henderson
ISSN: 2070-1721 The Boeing Company
H. Tschofenig
Nokia Siemens Networks
J. Melen
A. Keranen, Ed.
Ericsson Research Nomadiclab
April 2010
<span class="h1">Basic Host Identity Protocol (HIP) Extensions for</span>
<span class="h1">Traversal of Network Address Translators</span>
Abstract
This document specifies extensions to the Host Identity Protocol
(HIP) to facilitate Network Address Translator (NAT) traversal. The
extensions are based on the use of the Interactive Connectivity
Establishment (ICE) methodology to discover a working path between
two end-hosts, and on standard techniques for encapsulating
Encapsulating Security Payload (ESP) packets within the User Datagram
Protocol (UDP). This document also defines elements of a procedure
for NAT traversal, including the optional use of a HIP relay server.
With these extensions HIP is able to work in environments that have
NATs and provides a generic NAT traversal solution to higher-layer
networking applications.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for examination, experimental implementation, and
evaluation.
This document defines an Experimental Protocol for the Internet
community. This document is a product of the Internet Engineering
Task Force (IETF). It represents the consensus of the IETF
community. It has received public review and has been approved for
publication by the Internet Engineering Steering Group (IESG). Not
all documents approved by the IESG are a candidate for any level of
Internet Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc5770">http://www.rfc-editor.org/info/rfc5770</a>.
<span class="grey">Komu, et al. Experimental [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
This document may contain material from IETF Documents or IETF
Contributions published or made publicly available before November
10, 2008. The person(s) controlling the copyright in some of this
material may not have granted the IETF Trust the right to allow
modifications of such material outside the IETF Standards Process.
Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other
than English.
<span class="grey">Komu, et al. Experimental [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-4">4</a>
<a href="#section-2">2</a>. Terminology .....................................................<a href="#page-6">6</a>
<a href="#section-3">3</a>. Overview of Operation ...........................................<a href="#page-7">7</a>
<a href="#section-4">4</a>. Protocol Description ............................................<a href="#page-8">8</a>
<a href="#section-4.1">4.1</a>. Relay Registration .........................................<a href="#page-8">8</a>
<a href="#section-4.2">4.2</a>. ICE Candidate Gathering ...................................<a href="#page-10">10</a>
<a href="#section-4.3">4.3</a>. NAT Traversal Mode Negotiation ............................<a href="#page-10">10</a>
<a href="#section-4.4">4.4</a>. Connectivity Check Pacing Negotiation .....................<a href="#page-12">12</a>
<a href="#section-4.5">4.5</a>. Base Exchange via HIP Relay Server ........................<a href="#page-12">12</a>
<a href="#section-4.6">4.6</a>. ICE Connectivity Checks ...................................<a href="#page-15">15</a>
<a href="#section-4.7">4.7</a>. NAT Keepalives ............................................<a href="#page-16">16</a>
<a href="#section-4.8">4.8</a>. Base Exchange without ICE Connectivity Checks .............<a href="#page-16">16</a>
4.9. Initiating a Base Exchange Both with and without
UDP Encapsulation .........................................<a href="#page-17">17</a>
<a href="#section-4.10">4.10</a>. Sending Control Packets after the Base Exchange ..........<a href="#page-18">18</a>
<a href="#section-5">5</a>. Packet Formats .................................................<a href="#page-18">18</a>
<a href="#section-5.1">5.1</a>. HIP Control Packets .......................................<a href="#page-19">19</a>
<a href="#section-5.2">5.2</a>. Connectivity Checks .......................................<a href="#page-19">19</a>
<a href="#section-5.3">5.3</a>. Keepalives ................................................<a href="#page-20">20</a>
<a href="#section-5.4">5.4</a>. NAT Traversal Mode Parameter ..............................<a href="#page-21">21</a>
<a href="#section-5.5">5.5</a>. Connectivity Check Transaction Pacing Parameter ...........<a href="#page-22">22</a>
<a href="#section-5.6">5.6</a>. Relay and Registration Parameters .........................<a href="#page-22">22</a>
<a href="#section-5.7">5.7</a>. LOCATOR Parameter .........................................<a href="#page-23">23</a>
<a href="#section-5.8">5.8</a>. RELAY_HMAC Parameter ......................................<a href="#page-25">25</a>
<a href="#section-5.9">5.9</a>. Registration Types ........................................<a href="#page-25">25</a>
<a href="#section-5.10">5.10</a>. Notify Packet Types ......................................<a href="#page-26">26</a>
<a href="#section-5.11">5.11</a>. ESP Data Packets .........................................<a href="#page-26">26</a>
<a href="#section-6">6</a>. Security Considerations ........................................<a href="#page-27">27</a>
<a href="#section-6.1">6.1</a>. Privacy Considerations ....................................<a href="#page-27">27</a>
<a href="#section-6.2">6.2</a>. Opportunistic Mode ........................................<a href="#page-27">27</a>
<a href="#section-6.3">6.3</a>. Base Exchange Replay Protection for HIP Relay Server ......<a href="#page-28">28</a>
<a href="#section-6.4">6.4</a>. Demuxing Different HIP Associations .......................<a href="#page-28">28</a>
<a href="#section-7">7</a>. IANA Considerations ............................................<a href="#page-28">28</a>
<a href="#section-8">8</a>. Contributors ...................................................<a href="#page-29">29</a>
<a href="#section-9">9</a>. Acknowledgments ................................................<a href="#page-29">29</a>
<a href="#section-10">10</a>. References ....................................................<a href="#page-29">29</a>
<a href="#section-10.1">10.1</a>. Normative References .....................................<a href="#page-29">29</a>
<a href="#section-10.2">10.2</a>. Informative References ...................................<a href="#page-30">30</a>
<a href="#appendix-A">Appendix A</a>. Selecting a Value for Check Pacing ....................<a href="#page-32">32</a>
<a href="#appendix-B">Appendix B</a>. Base Exchange through a Rendezvous Server .............<a href="#page-33">33</a>
<span class="grey">Komu, et al. Experimental [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
HIP [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] is defined as a protocol that runs directly over IPv4
or IPv6, and HIP coordinates the setup of ESP security associations
[<a href="./rfc5202" title=""Using the Encapsulating Security Payload (ESP) Transport Format with the Host Identity Protocol (HIP)"">RFC5202</a>] that are also specified to run over IPv4 or IPv6. This
approach is known to have problems traversing NATs and other
middleboxes [<a href="./rfc5207" title=""NAT and Firewall Traversal Issues of Host Identity Protocol (HIP) Communication"">RFC5207</a>]. This document defines HIP extensions for the
traversal of both Network Address Translator (NAT) and Network
Address and Port Translator (NAPT) middleboxes. The document
generally uses the term NAT to refer to these types of middleboxes.
Currently deployed NAT devices do not operate consistently even
though a recommended behavior is described in [<a href="./rfc4787" title=""Network Address Translation (NAT) Behavioral Requirements for Unicast UDP"">RFC4787</a>]. The HIP
protocol extensions in this document make as few assumptions as
possible about the behavior of the NAT devices so that NAT traversal
will work even with legacy NAT devices. The purpose of these
extensions is to allow two HIP-enabled hosts to communicate with each
other even if one or both of the communicating hosts are in a network
that is behind one or more NATs.
Using the extensions defined in this document, HIP end-hosts use
techniques drawn from the Interactive Connectivity Establishment
(ICE) methodology [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>] to find operational paths for the HIP
control protocol and for ESP encapsulated data traffic. The hosts
test connectivity between different locators and try to discover a
direct end-to-end path between them. However, with some legacy NATs,
utilizing the shortest path between two end-hosts located behind NATs
is not possible without relaying the traffic through a relay, such as
a Traversal Using Relay NAT (TURN) server [<a href="./rfc5128" title=""State of Peer- to-Peer (P2P) Communication across Network Address Translators (NATs)"">RFC5128</a>]. Because
relaying traffic increases the roundtrip delay and consumes resources
from the relay, with the extensions described in this document, hosts
try to avoid using the TURN server whenever possible.
HIP has defined a rendezvous server [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>] to allow for mobile HIP
hosts to establish a stable point-of-contact in the Internet. This
document defines extensions to the rendezvous server that solve the
same problems, but for both NATed and non-NATed networks. The
extended rendezvous server, called a "HIP relay server", forwards HIP
control packets between an Initiator and a Responder, allowing hosts
to be located behind NATs. This behavior is in contrast to the HIP
rendezvous service that forwards only the initial I1 packet of the
base exchange; an approach that is less likely to work in a NATed
environment [<a href="./rfc5128" title=""State of Peer- to-Peer (P2P) Communication across Network Address Translators (NATs)"">RFC5128</a>]. Therefore, when using relays to traverse
NATs, HIP uses a HIP relay server for the control traffic and a TURN
server for the data traffic.
The basis for the connectivity checks is ICE [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]. [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]
describes ICE as follows:
<span class="grey">Komu, et al. Experimental [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
A technique for NAT traversal for UDP-based media streams (though
ICE can be extended to handle other transport protocols, such as
TCP) established by the offer/answer model. ICE is an extension
to the offer/answer model, and works by including a multiplicity
of IP addresses and ports in SDP offers and answers, which are
then tested for connectivity by peer-to-peer connectivity checks.
The IP addresses and ports included in the SDP and the
connectivity checks are performed using the revised [Simple
Traversal of the UDP Protocol through NAT (STUN)] specification
[<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>], now renamed to Session Traversal Utilities for NAT.
The standard ICE [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>] is specified with SIP in mind and it has
some features that are not necessary or suitable as such for other
protocols. [<a href="#ref-MMUSIC-ICE" title=""Guidelines for Usage of Interactive Connectivity Establishment (ICE) by non Session Initiation Protocol (SIP) Protocols"">MMUSIC-ICE</a>] gives instructions and recommendations on
how ICE can be used for other protocols and this document follows
those guidelines.
Two HIP hosts that implement this specification communicate their
locators to each other in the HIP base exchange. The locators are
then paired with the locators of the other endpoint and prioritized
according to recommended and local policies. These locator pairs are
then tested sequentially by both of the end-hosts. The tests may
result in multiple operational pairs but ICE procedures determine a
single preferred address pair to be used for subsequent
communication.
In summary, the extensions in this document define:
o UDP encapsulation of HIP packets
o UDP encapsulation of IPsec ESP packets
o registration extensions for HIP relay services
o how the ICE "offer" and "answer" are carried in the base exchange
o interaction with ICE connectivity check messages
o backwards compatibility issues with rendezvous servers
o a number of optimizations (such as when the ICE connectivity tests
can be omitted)
<span class="grey">Komu, et al. Experimental [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
This document borrows terminology from [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>], [<a href="./rfc5206" title=""End-Host Mobility and Multihoming with the Host Identity Protocol"">RFC5206</a>],
[<a href="./rfc4423" title=""Host Identity Protocol (HIP) Architecture"">RFC4423</a>], [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>], and [<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>]. Additionally, the following
terms are used:
Rendezvous server:
A host that forwards I1 packets to the Responder.
HIP relay server:
A host that forwards any kind of HIP control packets between the
Initiator and the Responder.
TURN server:
A server that forwards data traffic between two end-hosts as
defined in [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>].
Locator:
As defined in [<a href="./rfc5206" title=""End-Host Mobility and Multihoming with the Host Identity Protocol"">RFC5206</a>]: "A name that controls how the packet is
routed through the network and demultiplexed by the end-host. It
may include a concatenation of traditional network addresses such
as an IPv6 address and end-to-end identifiers such as an ESP SPI.
It may also include transport port numbers or IPv6 Flow Labels as
demultiplexing context, or it may simply be a network address."
LOCATOR (written in capital letters):
Denotes a HIP control packet parameter that bundles multiple
locators together.
ICE offer:
The Initiator's LOCATOR parameter in a HIP I2 control packet.
ICE answer:
The Responder's LOCATOR parameter in a HIP R2 control packet.
Transport address:
Transport layer port and the corresponding IPv4/v6 address.
Candidate:
A transport address that is a potential point of contact for
receiving data.
<span class="grey">Komu, et al. Experimental [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Host candidate:
A candidate obtained by binding to a specific port from an IP
address on the host.
Server reflexive candidate:
A translated transport address of a host as observed by a HIP
relay server or a STUN/TURN server.
Peer reflexive candidate:
A translated transport address of a host as observed by its peer.
Relayed candidate:
A transport address that exists on a TURN server. Packets that
arrive at this address are relayed towards the TURN client.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Overview of Operation</span>
+-------+
| HIP |
+--------+ | Relay | +--------+
| TURN | +-------+ | STUN |
| Server | / \ | Server |
+--------+ / \ +--------+
/ \
/ \
/ \
/ <- Signaling -> \
/ \
+-------+ +-------+
| NAT | | NAT |
+-------+ +-------+
/ \
/ \
+-------+ +-------+
| Init- | | Resp- |
| iator | | onder |
+-------+ +-------+
Figure 1: Example Network Configuration
In the example configuration depicted in Figure 1, both Initiator and
Responder are behind one or more NATs, and both private networks are
connected to the public Internet. To be contacted from behind a NAT,
the Responder must be registered with a HIP relay server reachable on
the public Internet, and we assume, as a starting point, that the
Initiator knows both the Responder's Host Identity Tag (HIT) and the
<span class="grey">Komu, et al. Experimental [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
address of one of its relay servers (how the Initiator learns of the
Responder's relay server is outside of the scope of this document,
but may be through DNS or another name service).
The first steps are for both the Initiator and Responder to register
with a relay server (need not be the same one) and gather a set of
address candidates. The hosts may use TURN and STUN servers for
gathering the candidates. Next, the HIP base exchange is carried out
by encapsulating the HIP control packets in UDP datagrams and sending
them through the Responder's relay server. As part of the base
exchange, each HIP host learns of the peer's candidate addresses
through the ICE offer/answer procedure embedded in the base exchange.
Once the base exchange is completed, HIP has established a working
communication session (for signaling) via a relay server, but the
hosts still work to find a better path, preferably without a relay,
for the ESP data flow. For this, ICE connectivity checks are carried
out until a working pair of addresses is discovered. At the end of
the procedure, if successful, the hosts will have enabled a UDP-based
flow that traverses both NATs, with the data flowing directly from
NAT to NAT or via a TURN server. Further HIP signaling can be sent
over the same address/port pair and is demultiplexed from data
traffic via a marker in the payload. Finally, NAT keepalives will be
sent as needed.
If either one of the hosts knows that it is not behind a NAT, hosts
can negotiate during the base exchange a different mode of NAT
traversal that does not use ICE connectivity checks, but only UDP
encapsulation of HIP and ESP. Also, it is possible for the Initiator
to simultaneously try a base exchange with and without UDP
encapsulation. If a base exchange without UDP encapsulation
succeeds, no ICE connectivity checks or UDP encapsulation of ESP are
needed.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Protocol Description</span>
This section describes the normative behavior of the protocol
extension. Examples of packet exchanges are provided for
illustration purposes.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Relay Registration</span>
HIP rendezvous servers operate in non-NATed environments and their
use is described in [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>]. This section specifies a new
middlebox extension, called the HIP relay server, for operating in
NATed environments. A HIP relay server forwards HIP control packets
between the Initiator and the Responder.
<span class="grey">Komu, et al. Experimental [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
End-hosts cannot use the HIP relay service for forwarding the ESP
data plane. Instead, they use TURN servers [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>].
A HIP relay server MUST silently drop packets to a HIP relay client
that has not previously registered with the HIP relay. The
registration process follows the generic registration extensions
defined in [<a href="./rfc5203" title=""Host Identity Protocol (HIP) Registration Extension"">RFC5203</a>] and is illustrated in Figure 2.
HIP HIP
Relay Relay
Client Server
| 1. UDP(I1) |
+------------------------------------------------------->|
| |
| 2. UDP(R1(REG_INFO(RELAY_UDP_HIP))) |
|<-------------------------------------------------------+
| |
| 3. UDP(I2(REG_REQ(RELAY_UDP_HIP))) |
+------------------------------------------------------->|
| |
| 4. UDP(R2(REG_RES(RELAY_UDP_HIP), REG_FROM)) |
|<-------------------------------------------------------+
| |
Figure 2: Example Registration with a HIP Relay
In step 1, the relay client (Initiator) starts the registration
procedure by sending an I1 packet over UDP. It is RECOMMENDED that
the Initiator select a random port number from the ephemeral port
range 49152-65535 for initiating a base exchange. Alternatively, a
host MAY also use a single fixed port for initiating all outgoing
connections. However, the allocated port MUST be maintained until
all of the corresponding HIP Associations are closed. It is
RECOMMENDED that the HIP relay server listen to incoming connections
at UDP port 10500. If some other port number is used, it needs to be
known by potential Initiators.
In step 2, the HIP relay server (Responder) lists the services that
it supports in the R1 packet. The support for HIP-over-UDP relaying
is denoted by the Registration Type value RELAY_UDP_HIP (see
<a href="#section-5.9">Section 5.9</a>).
In step 3, the Initiator selects the services for which it registers
and lists them in the REG_REQ parameter. The Initiator registers for
HIP relay service by listing the RELAY_UDP_HIP value in the request
parameter.
<span class="grey">Komu, et al. Experimental [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
In step 4, the Responder concludes the registration procedure with an
R2 packet and acknowledges the registered services in the REG_RES
parameter. The Responder denotes unsuccessful registrations (if any)
in the REG_FAILED parameter of R2. The Responder also includes a
REG_FROM parameter that contains the transport address of the client
as observed by the relay (Server Reflexive candidate). After the
registration, the client sends NAT keepalives, as described in
<a href="#section-4.7">Section 4.7</a>, periodically to the relay to keep possible NAT bindings
between the client and the relay alive. The relay client maintains
the HIP association with the relay server as long as it requires
relaying service from it.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. ICE Candidate Gathering</span>
If a host is going to use ICE, it needs to gather a set of address
candidates. The candidate gathering SHOULD be done as defined in
<a href="./rfc5245#section-4.1">Section 4.1 of [RFC5245]</a>. Candidates need to be gathered for the
UDP-encapsulated flow of HIP and ESP traffic. This flow corresponds
to one ICE media stream and component. Since ICE component IDs are
not needed, they are not explicitly signaled and ID value of 1 SHOULD
be used for ICE processing, where needed. The Initiator takes the
role of the ICE controlling agent.
The candidate gathering can be done at any time, but it needs to be
done before sending an I2 or R2 in the base exchange if ICE is to be
used for the connectivity checks. It is RECOMMENDED that all three
types of candidates (host, server reflexive, and relayed) are
gathered to maximize the probability of successful NAT traversal.
However, if no TURN server is used, and the host has only a single
local IP address to use, the host MAY use the local address as the
only host candidate and the address from the REG_FROM parameter
discovered during the relay registration as a server reflexive
candidate. In this case, no further candidate gathering is needed.
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. NAT Traversal Mode Negotiation</span>
This section describes the usage of a new non-critical parameter
type. The presence of the parameter in a HIP base exchange means
that the end-host supports NAT traversal extensions described in this
document. As the parameter is non-critical (as defined in <a href="./rfc5201#section-5.2.1">Section</a>
<a href="./rfc5201#section-5.2.1">5.2.1 of [RFC5201]</a>), it can be ignored by an end-host, which means
that the host does not support or is not willing to use these
extensions.
With registration with a HIP relay, it is usually sufficient to use
the UDP-ENCAPSULATION mode of NAT traversal since the relay is
assumed to be in public address space. Thus, the relay SHOULD
propose the UDP-ENCAPSULATION mode as the preferred or only mode.
<span class="grey">Komu, et al. Experimental [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The NAT traversal mode negotiation in a HIP base exchange is
illustrated in Figure 3.
Initiator Responder
| 1. UDP(I1) |
+--------------------------------------------------------------->|
| |
| 2. UDP(R1(.., NAT_TRAVERSAL_MODE(list of modes), ..)) |
|<---------------------------------------------------------------+
| |
| 3. UDP(I2(.., NAT_TRAVERSAL_MODE(selected mode), LOCATOR, ..)) |
+--------------------------------------------------------------->|
| |
| 4. UDP(R2(.., LOCATOR, ..)) |
|<---------------------------------------------------------------+
| |
Figure 3: Negotiation of NAT Traversal Mode
In step 1, the Initiator sends an I1 to the Responder. In step 2,
the Responder responds with an R1. The NAT_TRAVERSAL_MODE parameter
in R1 contains a list of NAT traversal modes the Responder supports.
The modes specified in this document are shown in Table 1 and their
values are specified in <a href="#section-5.4">Section 5.4</a>.
+-------------------+-----------------------------------------------+
| Type | Purpose |
+-------------------+-----------------------------------------------+
| RESERVED | Reserved for future use |
| | |
| UDP-ENCAPSULATION | Use only UDP encapsulation of the HIP |
| | signaling traffic and ESP (no ICE |
| | connectivity checks) |
| | |
| ICE-STUN-UDP | UDP-encapsulated control and data traffic |
| | with ICE-based connectivity checks using STUN |
| | messages |
+-------------------+-----------------------------------------------+
Table 1: NAT Traversal Modes
In step 3, the Initiator sends an I2 that includes a
NAT_TRAVERSAL_MODE parameter. It contains the mode selected by the
Initiator from the list of modes offered by the Responder. If ICE
mode was selected, the I2 also includes the "Transport address"
locators (as defined in <a href="#section-5.7">Section 5.7</a>) of the Initiator in a LOCATOR
parameter. The locators in I2 are the "ICE offer".
<span class="grey">Komu, et al. Experimental [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
In step 4, the Responder concludes the base exchange with an R2
packet. If the Initiator chose ICE NAT traversal mode, the Responder
includes a LOCATOR parameter in the R2 packet. The locators in R2,
encoded like the locators in I2, are the "ICE answer". If the NAT
traversal mode selected by the Initiator is not supported by the
Responder, the Responder SHOULD reply with a NOTIFY packet with type
NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER and abort the base exchange.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Connectivity Check Pacing Negotiation</span>
As explained in [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>], when a NAT traversal mode with
connectivity checks is used, new transactions should not be started
too fast to avoid congestion and overwhelming the NATs.
For this purpose, during the base exchange, hosts can negotiate a
transaction pacing value, Ta, using a TRANSACTION_PACING parameter in
R1 and I2 packets. The parameter contains the minimum time
(expressed in milliseconds) the host would wait between two NAT
traversal transactions, such as starting a new connectivity check or
retrying a previous check. If a host does not include this parameter
in the base exchange, a Ta value of 500 ms MUST be used as that
host's minimum value. The value that is used by both of the hosts is
the higher out of the two offered values.
Hosts SHOULD NOT use values smaller than 20 ms for the minimum Ta,
since such values may not work well with some NATs, as explained in
[<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]. The Initiator MUST NOT propose a smaller value than what
the Responder offered.
The minimum Ta value SHOULD be configurable, and if no value is
configured, a value of 500 ms MUST be used. Guidelines for selecting
a Ta value are given in <a href="#appendix-A">Appendix A</a>. Currently this feature applies
only to the ICE-STUN-UDP NAT traversal mode, but any other mode using
connectivity checks SHOULD utilize this feature.
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. Base Exchange via HIP Relay Server</span>
This section describes how the Initiator and Responder perform a base
exchange through a HIP relay server. The NAT traversal mode
negotiation (denoted as NAT_TM in the example) was described in
<a href="#section-4.3">Section 4.3</a> and is not repeated here. If a relay receives an R1 or
I2 packet without the NAT traversal mode parameter, it MUST drop it
and SHOULD send a NOTIFY error packet with type
NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER to the sender of the R1/I2.
<span class="grey">Komu, et al. Experimental [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
It is RECOMMENDED that the Initiator send an I1 packet encapsulated
in UDP when it is destined to an IPv4 address of the Responder.
Respectively, the Responder MUST respond to such an I1 packet with a
UDP-encapsulated R1 packet and the rest of the base exchange, I2 and
R2, MUST also use UDP encapsulation.
Initiator HIP relay Responder
| 1. UDP(I1) | |
+----------------------------->| 2. UDP(I1(RELAY_FROM)) |
| +------------------------------->|
| | |
| | 3. UDP(R1(RELAY_TO, NAT_TM)) |
| 4. UDP(R1(RELAY_TO, NAT_TM)) |<-------------------------------+
|<-----------------------------+ |
| | |
| 5. UDP(I2(LOCATOR, NAT_TM)) | |
+----------------------------->| 6. UDP(I2(LOCATOR, RELAY_FROM, |
| | NAT_TM)) |
| +------------------------------->|
| | |
| | 7. UDP(R2(LOCATOR, RELAY_TO)) |
| 8. UDP(R2(LOCATOR, RELAY_TO))|<-------------------------------+
|<-----------------------------+ |
| | |
Figure 4: Base Exchange via a HIP Relay Server
In step 1 of Figure 4, the Initiator sends an I1 packet over the
transport layer to the HIT of the Responder and IP address and port
of the HIP relay server. The source address is one of the locators
of the Initiator.
In step 2, the HIP relay server receives the I1 packet. If the
destination HIT belongs to a registered Responder, the relay
processes the packet. Otherwise, the relay MUST drop the packet
silently. The relay appends a RELAY_FROM parameter to the I1 packet,
which contains the transport source address and port of the I1 as
observed by the relay. The relay protects the I1 packet with
RELAY_HMAC as described in [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>], except that the parameter type
is different (see <a href="#section-5.8">Section 5.8</a>). The relay changes the source and
destination ports and IP addresses of the packet to match the values
the Responder used when registering to the relay, i.e., the reverse
of the R2 used in the registration. The relay MUST recalculate the
transport checksum and forward the packet to the Responder.
<span class="grey">Komu, et al. Experimental [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
In step 3, the Responder receives the I1 packet. The Responder
processes it according to the rules in [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]. In addition, the
Responder validates the RELAY_HMAC according to [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>] and
silently drops the packet if the validation fails. The Responder
replies with an R1 packet to which it includes RELAY_TO and NAT
traversal mode parameters. The RELAY_TO parameter MUST contain the
same information as the RELAY_FROM parameter, i.e., the Initiator's
transport address, but the type of the parameter is different. The
RELAY_TO parameter is not integrity protected by the signature of the
R1 to allow pre-created R1 packets at the Responder.
In step 4, the relay receives the R1 packet. The relay drops the
packet silently if the source HIT belongs to an unregistered host.
The relay MAY verify the signature of the R1 packet and drop it if
the signature is invalid. Otherwise, the relay rewrites the source
address and port, and changes the destination address and port to
match RELAY_TO information. Finally, the relay recalculates
transport checksum and forwards the packet.
In step 5, the Initiator receives the R1 packet and processes it
according to [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]. The Initiator MAY use the address in the
RELAY_TO parameter as a local peer-reflexive candidate for this HIP
association if it is different from all known local candidates. The
Initiator replies with an I2 packet that uses the destination
transport address of R1 as the source address and port. The I2
packet contains a LOCATOR parameter that lists all the ICE candidates
(ICE offer) of the Initiator. The candidates are encoded using the
format defined in <a href="#section-5.7">Section 5.7</a>. The I2 packet MUST also contain a NAT
traversal mode parameter with the mode the Initiator selected.
In step 6, the relay receives the I2 packet. The relay appends a
RELAY_FROM and a RELAY_HMAC to the I2 packet as explained in step 2.
In step 7, the Responder receives the I2 packet and processes it
according to [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]. It replies with an R2 packet and includes a
RELAY_TO parameter as explained in step 3. The R2 packet includes a
LOCATOR parameter that lists all the ICE candidates (ICE answer) of
the Responder. The RELAY_TO parameter is protected by the HMAC.
In step 8, the relay processes the R2 as described in step 4. The
relay forwards the packet to the Initiator. After the Initiator has
received the R2 and processed it successfully, the base exchange is
completed.
Hosts MUST include the address of one or more HIP relay servers
(including the one that is being used for the initial signaling) in
the LOCATOR parameter in I2/R2 if they intend to use such servers for
relaying HIP signaling immediately after the base exchange completes.
<span class="grey">Komu, et al. Experimental [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The traffic type of these addresses MUST be "HIP signaling" and they
MUST NOT be used as ICE candidates. If the HIP relay server locator
used for the base exchange is not included in I2/R2 LOCATOR
parameters, it SHOULD NOT be used after the base exchange, but
further HIP signaling SHOULD use the same path as the data traffic.
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a>. ICE Connectivity Checks</span>
If a HIP relay server was used, the Responder completes the base
exchange with the R2 packet through the relay. However, the
destination address the Initiator and Responder used for the base
exchange packets belongs to the HIP relay server. Therefore, that
address MUST NOT be used as a destination for ESP traffic. Instead,
if a NAT traversal mode with ICE connectivity checks was selected,
the Initiator and Responder MUST start the connectivity checks.
Creating the checklist for the ICE connectivity checks should be
performed as described in <a href="./rfc5245#section-5.7">Section 5.7 of [RFC5245]</a> bearing in mind
that only one media stream and component is needed (so there will be
only a single checklist and all candidates should have the same
component ID value). The actual connectivity checks MUST be
performed as described in <a href="./rfc5245#section-7">Section 7 of [RFC5245]</a>. Regular mode
SHOULD be used for the candidate nomination. <a href="#section-5.2">Section 5.2</a> defines the
details of the STUN control packets. As a result of the ICE
connectivity checks, ICE nominates a single transport address pair to
be used if an operational address pair was found. The end-hosts MUST
use this address pair for the ESP traffic.
The connectivity check messages MUST be paced by the value negotiated
during the base exchange as described in <a href="#section-4.4">Section 4.4</a>. If neither one
of the hosts announced a minimum pacing value, a value of 500 ms MUST
be used.
For retransmissions, the retransmission timeout (RTO) value SHOULD be
calculated as follows:
RTO = MAX (500ms, Ta * (Num-Waiting + Num-In-Progress))
In the RTO formula, Ta is the value used for the connectivity check
pacing, Num-Waiting is the number of pairs in the checklist in the
"Waiting" state, and Num-In-Progress is the number of pairs in the
"In-Progress" state. This is identical to the formula in [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]
if there is only one checklist.
<span class="grey">Komu, et al. Experimental [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
If the ICE connectivity checks failed, the hosts MUST NOT send ESP
traffic to each other but MAY continue communicating using HIP
packets and the locators used for the base exchange. Also, the hosts
SHOULD notify each other about the failure with a
CONNECTIVITY_CHECKS_FAILED NOTIFY packet (see <a href="#section-5.10">Section 5.10</a>).
<span class="h3"><a class="selflink" id="section-4.7" href="#section-4.7">4.7</a>. NAT Keepalives</span>
To prevent NAT states from expiring, communicating hosts send
periodic keepalives to each other. HIP relay servers MAY refrain
from sending keepalives if it's known that they are not behind a
middlebox that requires keepalives. An end-host MUST send keepalives
every 15 seconds to refresh the UDP port mapping at the NAT(s) when
the control or data channel is idle. To implement failure tolerance,
an end-host SHOULD have a shorter keepalive period.
The keepalives are STUN Binding Indications if the hosts have agreed
on ICE-STUN-UDP NAT traversal mode during the base exchange.
Otherwise, HIP NOTIFY packets MAY be used as keepalives.
The communicating hosts MUST send keepalives to each other using the
transport locators they agreed to use for data and signaling when
they are in the ESTABLISHED state. Also, the Initiator MUST send a
NOTIFY packet to the relay to keep the NAT states alive on the path
between the Initiator and relay when the Initiator has not received
any response to its I1 or I2 from the Responder in 15 seconds.
<span class="h3"><a class="selflink" id="section-4.8" href="#section-4.8">4.8</a>. Base Exchange without ICE Connectivity Checks</span>
In certain network environments, the ICE connectivity checks can be
omitted to reduce initial connection set-up latency because a base
exchange acts as an implicit connectivity test itself. For this to
work, the Initiator MUST be able to reach the Responder by simply UDP
encapsulating HIP and ESP packets sent to the Responder's address.
Detecting and configuring this particular scenario is prone to
failure unless carefully planned.
In such a scenario, the Responder MAY include UDP-ENCAPSULATION NAT
traversal mode as one of the supported modes in the R1 packet. If
the Responder has registered to a HIP relay server, it MUST also
include a LOCATOR parameter in R1 that contains a preferred address
where the Responder is able to receive UDP-encapsulated ESP and HIP
packets. This locator MUST be of type "Transport address", its
Traffic type MUST be "both", and it MUST have the "Preferred bit" set
(see Table 2). If there is no such locator in R1, the source address
of R1 is used as the Responder's preferred address.
<span class="grey">Komu, et al. Experimental [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The Initiator MAY choose the UDP-ENCAPSULATION mode if the Responder
listed it in the supported modes and the Initiator does not wish to
use ICE for searching for a more optimal path. In this case, the
Initiator sends the I2 with UDP-ENCAPSULATION mode in the NAT
traversal mode parameter directly to the Responder's preferred
address (i.e., to the preferred locator in R1 or to the address where
R1 was received from if there was no preferred locator in R1). The
Initiator MAY include locators in I2 but they MUST NOT be taken as
ICE candidates, since ICE will not be used for connections with UDP-
ENCAPSULATION NAT traversal mode. Instead, if R2 and I2 are received
and processed successfully, a security association can be created and
UDP-encapsulated ESP can be exchanged between the hosts after the
base exchange completes. However, the Responder SHOULD NOT send any
ESP to the Initiator's address before it has received data from the
Initiator, as specified in Sections <a href="#section-4.4.2">4.4.2</a>. and 6.9 of [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] and
in Sections <a href="#section-3.2.9">3.2.9</a> and <a href="#section-5.4">5.4</a> of [<a href="./rfc5206" title=""End-Host Mobility and Multihoming with the Host Identity Protocol"">RFC5206</a>].
Since an I2 packet with UDP-ENCAPSULATION NAT traversal mode selected
MUST NOT be sent via a relay, the Responder SHOULD reject such I2
packets and reply with a NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER NOTIFY
packet (see <a href="#section-5.10">Section 5.10</a>).
If there is no answer for the I2 packet sent directly to the
Responder's preferred address, the Initiator MAY send another I2 via
the HIP relay server, but it MUST NOT choose UDP-ENCAPSULATION NAT
traversal mode for that I2.
<span class="h3"><a class="selflink" id="section-4.9" href="#section-4.9">4.9</a>. Initiating a Base Exchange Both with and without UDP Encapsulation</span>
The Initiator MAY also try to simultaneously perform a base exchange
with the Responder without UDP encapsulation. In such a case, the
Initiator sends two I1 packets, one without and one with UDP
encapsulation, to the Responder. The Initiator MAY wait for a while
before sending the other I1. How long to wait and in which order to
send the I1 packets can be decided based on local policy. For
retransmissions, the procedure is repeated.
The I1 packet without UDP encapsulation may arrive directly, without
any relays, at the Responder. When this happens, the procedures in
[<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] are followed for the rest of the base exchange. The
Initiator may receive multiple R1 packets, with and without UDP
encapsulation, from the Responder. However, after receiving a valid
R1 and answering it with an I2, further R1 packets that are not
retransmits of the original R1 MUST be ignored.
<span class="grey">Komu, et al. Experimental [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The I1 packet without UDP encapsulation may also arrive at a HIP-
capable middlebox. When the middlebox is a HIP rendezvous server and
the Responder has successfully registered with the rendezvous
service, the middlebox follows rendezvous procedures in [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>].
If the Initiator receives a NAT traversal mode parameter in R1
without UDP encapsulation, the Initiator MAY ignore this parameter
and send an I2 without UDP encapsulation and without any selected NAT
traversal mode. When the Responder receives the I2 without UDP
encapsulation and without NAT traversal mode, it will assume that no
NAT traversal mechanism is needed. The packet processing will be
done as described in [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]. The Initiator MAY store the NAT
traversal modes for future use, e.g., in case of a mobility or
multihoming event that causes NAT traversal to be used during the
lifetime of the HIP association.
<span class="h3"><a class="selflink" id="section-4.10" href="#section-4.10">4.10</a>. Sending Control Packets after the Base Exchange</span>
After the base exchange, the end-hosts MAY send HIP control packets
directly to each other using the transport address pair established
for a data channel without sending the control packets through the
HIP relay server. When a host does not get acknowledgments, e.g., to
an UPDATE or CLOSE packet after a timeout based on local policies,
the host SHOULD resend the packet through the relay, if it was listed
in the LOCATOR parameter in the base exchange.
If control packets are sent through a HIP relay server, the host
registered with the relay MUST utilize the RELAY_TO parameter as in
the base exchange. The HIP relay server SHOULD forward HIP packets
to the registered hosts and forward packets from a registered host to
the address in the RELAY_TO parameter. The relay MUST add a
RELAY_FROM parameter to the control packets it relays to the
registered hosts.
If the HIP relay server is not willing or able to relay a HIP packet,
it MAY notify the sender of the packet with MESSAGE_NOT_RELAYED error
notification (see <a href="#section-5.10">Section 5.10</a>).
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Packet Formats</span>
The following subsections define the parameter and packet encodings
for the HIP, ESP, and ICE connectivity check packets. All values
MUST be in network byte order.
<span class="grey">Komu, et al. Experimental [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. HIP Control Packets</span>
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 32 bits of zeroes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
~ HIP Header and Parameters ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: Format of UDP-Encapsulated HIP Control Packets
HIP control packets are encapsulated in UDP packets as defined in
<a href="./rfc3948#section-2.2">Section 2.2 of [RFC3948]</a>, "IKE Header Format for Port 4500", except a
different port number is used. Figure 5 illustrates the
encapsulation. The UDP header is followed by 32 zero bits that can
be used to differentiate HIP control packets from ESP packets. The
HIP header and parameters follow the conventions of [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] with
the exception that the HIP header checksum MUST be zero. The HIP
header checksum is zero for two reasons. First, the UDP header
already contains a checksum. Second, the checksum definition in
[<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] includes the IP addresses in the checksum calculation. The
NATs unaware of HIP cannot recompute the HIP checksum after changing
IP addresses.
A HIP relay server or a Responder without a relay SHOULD listen at
UDP port 10500 for incoming UDP-encapsulated HIP control packets. If
some other port number is used, it needs to be known by potential
Initiators.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Connectivity Checks</span>
The connectivity checks are performed using STUN Binding requests as
defined in [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]. This section describes the details of the
parameters in the STUN messages.
The Binding requests MUST use STUN short-term credentials with the
last 32 bits of the HITs of the Initiator and Responder as the
username fragments. The username is formed from the username
fragments as defined in <a href="./rfc5245#section-7.1.1.3">Section 7.1.1.3 of [RFC5245]</a>. The 32-bit
username fragments are expressed using lowercase hexadecimal ASCII
characters. The leading zeroes MUST NOT be omitted so that the
<span class="grey">Komu, et al. Experimental [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
username's size is fixed (8 characters); for example, if the local
HIT is 2001:15:8ebe:1aa7:42f5:b413:7237:6c0a and the remote HIT is
2001:18:46fa:97c0:ba5:cd77:51:47b, the local username would be
72376c0a and the remote username 0051047b.
The STUN password is drawn from the Diffie-Hellman (DH) keying
material. Drawing of HIP keys is defined in <a href="./rfc5201#section-6.5">[RFC5201], Section 6.5</a>
and drawing of ESP keys in <a href="./rfc5202#section-7">[RFC5202], Section 7</a>. Correspondingly,
the hosts MUST draw symmetric keys for STUN according to <a href="./rfc5201#section-6.5">[RFC5201],
Section 6.5</a>. The hosts draw the STUN key after HIP keys, or after
ESP keys if ESP transform was successfully negotiated in the base
exchange. Both hosts draw a 128-bit key from the DH keying material,
express that in hexadecimal ASCII format using only lowercase letters
(resulting in 32 numbers or lowercase letters), and use that as both
the local and peer password. [<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>] describes how hosts use the
password for message integrity of STUN messages.
Both the username and password are expressed in ASCII hexadecimal
format to prevent the need to run them through SASLPrep as defined in
[<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>].
The connectivity checks MUST contain the PRIORITY attribute. They
MAY contain the USE-CANDIDATE attribute as defined in <a href="./rfc5245#section-7.1.1.1">Section 7.1.1.1
of [RFC5245]</a>.
The Initiator is always in the controlling role during a base
exchange. When two hosts are initiating a connection to each other
simultaneously, the HIP state machine detects it and assigns the host
with the larger HIT as the Responder as explained in Sections <a href="#section-4.4.2">4.4.2</a>
and 6.7 in [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]. Hence, the ICE-CONTROLLED and ICE-CONTROLLING
attributes are not needed to resolve role conflicts. However, the
attributes SHOULD be added to the connectivity check messages to
ensure interoperability with different ICE stacks, and they can be
safely ignored on received connectivity checks.
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. Keepalives</span>
The keepalives for HIP associations that are created with ICE are
STUN Binding Indications, as defined in [<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>]. In contrast to
the UDP-encapsulated HIP header, the non-ESP-marker between the UDP
header and the STUN header is excluded. Keepalives MUST contain the
FINGERPRINT STUN attribute but SHOULD NOT contain any other STUN
attributes and SHOULD NOT utilize any authentication mechanism. STUN
messages are demultiplexed from ESP and HIP control packets using the
STUN markers, such as the magic cookie value and the FINGERPRINT
attribute.
<span class="grey">Komu, et al. Experimental [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Keepalives for HIP associations created without ICE are HIP control
packets that have NOTIFY as the packet type. The keepalive NOTIFY
packets do not contain any parameters.
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a>. NAT Traversal Mode Parameter</span>
The format of the NAT_TRAVERSAL_MODE parameter is similar to the
format of the ESP_TRANSFORM parameter in [<a href="./rfc5202" title=""Using the Encapsulating Security Payload (ESP) Transport Format with the Host Identity Protocol (HIP)"">RFC5202</a>] and is shown in
Figure 6. This specification defines traversal mode identifiers UDP-
ENCAPSULATION and ICE-STUN-UDP. The identifier RESERVED is reserved
for future use. Future specifications may define more traversal
modes.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | Mode ID #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mode ID #2 | Mode ID #3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mode ID #n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 608
Length length in octets, excluding Type, Length, and padding
Reserved zero when sent, ignored when received
Mode ID defines the proposed or selected NAT traversal mode(s)
The following NAT traversal mode IDs are defined:
ID name Value
RESERVED 0
UDP-ENCAPSULATION 1
ICE-STUN-UDP 2
Figure 6: Format of the NAT_TRAVERSAL_MODE Parameter
The sender of a NAT_TRAVERSAL_MODE parameter MUST make sure that
there are no more than six (6) Mode IDs in one NAT_TRAVERSAL_MODE
parameter. Conversely, a recipient MUST be prepared to handle
received NAT traversal mode parameters that contain more than six
Mode IDs by accepting the first six Mode IDs and dropping the rest.
The limited number of Mode IDs sets the maximum size of the
NAT_TRAVERSAL_MODE parameter. The modes MUST be in preference order,
most preferred mode(s) first.
<span class="grey">Komu, et al. Experimental [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a>. Connectivity Check Transaction Pacing Parameter</span>
The TRANSACTION_PACING parameter shown in Figure 7 contains only the
connectivity check pacing value, expressed in milliseconds, as a 32-
bit unsigned integer.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Min Ta |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 610
Length 4
Min Ta the minimum connectivity check transaction pacing
value the host would use
Figure 7: Format of the TRANSACTION_PACING Parameter
<span class="h3"><a class="selflink" id="section-5.6" href="#section-5.6">5.6</a>. Relay and Registration Parameters</span>
The format of the REG_FROM, RELAY_FROM, and RELAY_TO parameters is
shown in Figure 8. All parameters are identical except for the type.
REG_FROM is the only parameter covered with the signature.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Port | Protocol | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type REG_FROM: 950
RELAY_FROM: 63998
RELAY_TO: 64002
Length 20
Port transport port number; zero when plain IP is used
Protocol IANA assigned, Internet Protocol number.
17 for UDP, 0 for plain IP
<span class="grey">Komu, et al. Experimental [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Reserved reserved for future use; zero when sent, ignored
when received
Address an IPv6 address or an IPv4 address in "IPv4-Mapped
IPv6 address" format
Figure 8: Format of the REG_FROM, RELAY_FROM, and RELAY_TO Parameters
REG_FROM contains the transport address and protocol from which the
HIP relay server sees the registration coming. RELAY_FROM contains
the address from which the relayed packet was received by the relay
server and the protocol that was used. RELAY_TO contains the same
information about the address to which a packet should be forwarded.
<span class="h3"><a class="selflink" id="section-5.7" href="#section-5.7">5.7</a>. LOCATOR Parameter</span>
The generic LOCATOR parameter format is the same as in [<a href="./rfc5206" title=""End-Host Mobility and Multihoming with the Host Identity Protocol"">RFC5206</a>].
However, presenting ICE candidates requires a new locator type. The
generic and NAT-traversal-specific locator parameters are illustrated
in Figure 9.
<span class="grey">Komu, et al. Experimental [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Traffic Type | Locator Type | Locator Length| Reserved |P|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Locator Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Locator |
| |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Traffic Type | Loc Type = 2 | Locator Length| Reserved |P|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Locator Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Transport Port | Transp. Proto| Kind |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Priority |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SPI |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address |
| |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 9: LOCATOR Parameter
The individual fields in the LOCATOR parameter are described in
Table 2.
<span class="grey">Komu, et al. Experimental [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
+-----------+----------+--------------------------------------------+
| Field | Value(s) | Purpose |
+-----------+----------+--------------------------------------------+
| Type | 193 | Parameter type |
| Length | Variable | Length in octets, excluding Type and |
| | | Length fields and padding |
| Traffic | 0-2 | Is the locator for HIP signaling (1), for |
| Type | | ESP (2), or for both (0) |
| Locator | 2 | "Transport address" locator type |
| Type | | |
| Locator | 7 | Length of the fields after Locator |
| Length | | Lifetime in 4-octet units |
| Reserved | 0 | Reserved for future extensions |
| Preferred | 0 or 1 | Set to 1 for a Locator in R1 if the |
| (P) bit | | Responder can use it for the rest of the |
| | | base exchange, otherwise set to zero |
| Locator | Variable | Locator lifetime in seconds |
| Lifetime | | |
| Transport | Variable | Transport layer port number |
| Port | | |
| Transport | Variable | IANA assigned, transport layer Internet |
| Protocol | | Protocol number. Currently only UDP (17) |
| | | is supported. |
| Kind | Variable | 0 for host, 1 for server reflexive, 2 for |
| | | peer reflexive or 3 for relayed address |
| Priority | Variable | Locator's priority as described in |
| | | [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>] |
| SPI | Variable | Security Parameter Index (SPI) value that |
| | | the host expects to see in incoming ESP |
| | | packets that use this locator |
| Address | Variable | IPv6 address or an "IPv4-Mapped IPv6 |
| | | address" format IPv4 address [<a href="./rfc4291" title=""IP Version 6 Addressing Architecture"">RFC4291</a>] |
+-----------+----------+--------------------------------------------+
Table 2: Fields of the LOCATOR Parameter
<span class="h3"><a class="selflink" id="section-5.8" href="#section-5.8">5.8</a>. RELAY_HMAC Parameter</span>
The RELAY_HMAC parameter value has the TLV type 65520. It has the
same semantics as RVS_HMAC [<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>].
<span class="h3"><a class="selflink" id="section-5.9" href="#section-5.9">5.9</a>. Registration Types</span>
The REG_INFO, REG_REQ, REG_RESP, and REG_FAILED parameters contain
Registration Type [<a href="./rfc5203" title=""Host Identity Protocol (HIP) Registration Extension"">RFC5203</a>] values for HIP relay server registration.
The value for RELAY_UDP_HIP is 2.
<span class="grey">Komu, et al. Experimental [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h3"><a class="selflink" id="section-5.10" href="#section-5.10">5.10</a>. Notify Packet Types</span>
A HIP relay server and end-hosts can use NOTIFY packets to signal
different error conditions. The new Notify Packet Types [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>]
defined in this document are shown below. The Notification Data
field for the error notifications SHOULD contain the HIP header of
the rejected packet and SHOULD be empty for the
CONNECTIVITY_CHECKS_FAILED type.
NOTIFICATION PARAMETER - ERROR TYPES Value
------------------------------------ -----
NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER 60
If a HIP relay server does not forward a base exchange packet due
to missing NAT traversal mode parameter, or the Initiator selects
a NAT traversal mode that the Responder did not expect, the relay
or the Responder may send back a NOTIFY error packet with this
type.
CONNECTIVITY_CHECKS_FAILED 61
Used by the end-hosts to signal that NAT traversal connectivity
checks failed and did not produce a working path.
MESSAGE_NOT_RELAYED 62
Used by a HIP relay server to signal that is was not able or
willing to relay a HIP packet.
<span class="h3"><a class="selflink" id="section-5.11" href="#section-5.11">5.11</a>. ESP Data Packets</span>
[<a id="ref-RFC3948">RFC3948</a>] describes the UDP encapsulation of the IPsec ESP transport
and tunnel mode. On the wire, the HIP ESP packets do not differ from
the transport mode ESP, and thus the encapsulation of the HIP ESP
packets is same as the UDP encapsulation transport mode ESP.
However, the (semantic) difference to Bound End-to-End Tunnel (BEET)
mode ESP packets used by HIP is that IP header is not used in BEET
integrity protection calculation.
During the HIP base exchange, the two peers exchange parameters that
enable them to define a pair of IPsec ESP security associations (SAs)
as described in [<a href="./rfc5202" title=""Using the Encapsulating Security Payload (ESP) Transport Format with the Host Identity Protocol (HIP)"">RFC5202</a>]. When two peers perform a UDP-encapsulated
base exchange, they MUST define a pair of IPsec SAs that produces
UDP-encapsulated ESP data traffic.
<span class="grey">Komu, et al. Experimental [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The management of encryption/authentication protocols and SPIs is
defined in [<a href="./rfc5202" title=""Using the Encapsulating Security Payload (ESP) Transport Format with the Host Identity Protocol (HIP)"">RFC5202</a>]. The UDP encapsulation format and processing of
HIP ESP traffic is described in <a href="./rfc5202#section-6.1">Section 6.1 of [RFC5202]</a>.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Privacy Considerations</span>
The locators are in plain text format in favor of inspection at HIP-
aware middleboxes in the future. The current document does not
specify encrypted versions of LOCATORs, even though it could be
beneficial for privacy reasons to avoid disclosing them to
middleboxes.
It is also possible that end-users may not want to reveal all
locators to each other. For example, tracking the physical location
of a multihoming end-host may become easier if it reveals all
locators to its peer during a base exchange. Also, revealing host
addresses exposes information about the local topology that may not
be allowed in all corporate environments. For these two reasons, an
end-host may exclude certain host addresses from its LOCATOR
parameter. However, such behavior creates non-optimal paths when the
hosts are located behind the same NAT. Especially, this could be
problematic with a legacy NAT that does not support routing from the
private address realm back to itself through the outer address of the
NAT. This scenario is referred to as the hairpin problem [<a href="./rfc5128" title=""State of Peer- to-Peer (P2P) Communication across Network Address Translators (NATs)"">RFC5128</a>].
With such a legacy NAT, the only option left would be to use a
relayed transport address from a TURN server.
The use of HIP relay servers and TURN relays can be also useful for
privacy purposes. For example, a privacy concerned Responder may
reveal only its HIP relay server and Relayed candidates to
Initiators. This same mechanism also protects the Responder against
Denial-of-Service (DoS) attacks by allowing the Responder to initiate
new connections even if its relays would be unavailable due to a DoS
attack.
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. Opportunistic Mode</span>
A HIP relay server should have one address per relay client when a
HIP relay is serving more than one relay client and supports
opportunistic mode. Otherwise, it cannot be guaranteed that the HIP
relay server can deliver the I1 packet to the intended recipient.
<span class="grey">Komu, et al. Experimental [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a>. Base Exchange Replay Protection for HIP Relay Server</span>
In certain scenarios, it is possible that an attacker, or two
attackers, can replay an earlier base exchange through a HIP relay
server by masquerading as the original Initiator and Responder. The
attack does not require the attacker(s) to compromise the private
key(s) of the attacked host(s). However, for this attack to succeed,
the Responder has to be disconnected from the HIP relay server.
The relay can protect itself against replay attacks by becoming
involved in the base exchange by introducing nonces that the end-
hosts (Initiator and Responder) are required to sign. One way to do
this is to add ECHO_REQUEST_M parameters to the R1 and I2 packets as
described in [<a href="#ref-HIP-MIDDLE" title=""End-Host Authentication for HIP Middleboxes"">HIP-MIDDLE</a>] and drop the I2 or R2 packets if the
corresponding ECHO_RESPONSE_M parameters are not present.
<span class="h3"><a class="selflink" id="section-6.4" href="#section-6.4">6.4</a>. Demuxing Different HIP Associations</span>
<a href="./rfc3948#section-5.1">Section 5.1 of [RFC3948]</a> describes a security issue for the UDP
encapsulation in the standard IP tunnel mode when two hosts behind
different NATs have the same private IP address and initiate
communication to the same Responder in the public Internet. The
Responder cannot distinguish between two hosts, because security
associations are based on the same inner IP addresses.
This issue does not exist with the UDP encapsulation of HIP ESP
transport format because the Responder uses HITs to distinguish
between different Initiators.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. IANA Considerations</span>
This section is to be interpreted according to [<a href="./rfc5226" title="">RFC5226</a>].
This document updates the IANA Registry for HIP Parameter Types
[<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] by assigning new HIP Parameter Type values for the new HIP
Parameters: RELAY_FROM, RELAY_TO, and REG_FROM (defined in
<a href="#section-5.6">Section 5.6</a>), RELAY_HMAC (defined in <a href="#section-5.8">Section 5.8</a>), TRANSACTION_PACING
(defined in <a href="#section-5.5">Section 5.5</a>), and NAT_TRAVERSAL_MODE (defined in
<a href="#section-5.4">Section 5.4</a>).
This document defines an additional registration type for the HIP
Registration Extension [<a href="./rfc5203" title=""Host Identity Protocol (HIP) Registration Extension"">RFC5203</a>] that allows registering with a HIP
relay server for relaying service: RELAY_UDP_HIP (defined in
<a href="#section-5.9">Section 5.9</a>).
This document also defines NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER,
CONNECTIVITY_CHECKS_FAILED, and MESSAGE_NOT_RELAYED Notify Packet
Types [<a href="./rfc5201" title=""Host Identity Protocol"">RFC5201</a>] in <a href="#section-5.10">Section 5.10</a>.
<span class="grey">Komu, et al. Experimental [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
The NAT_TRAVERSAL_MODE parameter has 16-bit unsigned integer fields
for different modes, for which IANA has created and maintains a new
sub-registry entitled "HIP NAT Traversal Modes" under the "Host
Identity Protocol (HIP) Parameters". Initial values for the NAT
traversal mode registry are given in <a href="#section-5.4">Section 5.4</a>; future assignments
are to be made through IETF Review [<a href="./rfc5226" title="">RFC5226</a>]. Assignments consist of
a NAT traversal mode identifier name and its associated value.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Contributors</span>
This RFC is a product of a design team that also included Marcelo
Bagnulo and Philip Matthews, who both have made major contributions
to this document.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Acknowledgments</span>
Thanks to Jonathan Rosenberg and the rest of the MMUSIC WG folks for
the excellent work on ICE. In addition, the authors would like to
thank Andrei Gurtov, Simon Schuetz, Martin Stiemerling, Lars Eggert,
Vivien Schmitt, and Abhinav Pathak for their contributions and Tobias
Heer, Teemu Koponen, Juhana Mattila, Jeffrey M. Ahrenholz, Kristian
Slavov, Janne Lindqvist, Pekka Nikander, Lauri Silvennoinen, Jukka
Ylitalo, Juha Heinanen, Joakim Koskela, Samu Varjonen, Dan Wing, and
Jani Hautakorpi for their comments on this document.
Miika Komu has been working in the Networking Research group at
Helsinki Institute for Information Technology (HIIT). The work has
been funded by Tekes, Telia-Sonera, Elisa, Nokia, the Finnish Defence
Forces, Ericsson and Birdstep in InfraHIP I and II projects.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. References</span>
<span class="h3"><a class="selflink" id="section-10.1" href="#section-10.1">10.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC4291">RFC4291</a>] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", <a href="./rfc4291">RFC 4291</a>, February 2006.
[<a id="ref-RFC4423">RFC4423</a>] Moskowitz, R. and P. Nikander, "Host Identity Protocol
(HIP) Architecture", <a href="./rfc4423">RFC 4423</a>, May 2006.
[<a id="ref-RFC5201">RFC5201</a>] Moskowitz, R., Nikander, P., Jokela, P., and T.
Henderson, "Host Identity Protocol", <a href="./rfc5201">RFC 5201</a>,
April 2008.
<span class="grey">Komu, et al. Experimental [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
[<a id="ref-RFC5202">RFC5202</a>] Jokela, P., Moskowitz, R., and P. Nikander, "Using the
Encapsulating Security Payload (ESP) Transport Format
with the Host Identity Protocol (HIP)", <a href="./rfc5202">RFC 5202</a>,
April 2008.
[<a id="ref-RFC5203">RFC5203</a>] Laganier, J., Koponen, T., and L. Eggert, "Host
Identity Protocol (HIP) Registration Extension",
<a href="./rfc5203">RFC 5203</a>, April 2008.
[<a id="ref-RFC5204">RFC5204</a>] Laganier, J. and L. Eggert, "Host Identity Protocol
(HIP) Rendezvous Extension", <a href="./rfc5204">RFC 5204</a>, April 2008.
[<a id="ref-RFC5206">RFC5206</a>] Nikander, P., Henderson, T., Vogt, C., and J. Arkko,
"End-Host Mobility and Multihoming with the Host
Identity Protocol", <a href="./rfc5206">RFC 5206</a>, April 2008.
[<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing
an IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>,
<a href="./rfc5226">RFC 5226</a>, May 2008.
[<a id="ref-RFC5245">RFC5245</a>] Rosenberg, J., "Interactive Connectivity Establishment
(ICE): A Protocol for Network Address Translator (NAT)
Traversal for Offer/Answer Protocols", <a href="./rfc5245">RFC 5245</a>,
April 2010.
[<a id="ref-RFC5389">RFC5389</a>] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing,
"Session Traversal Utilities for NAT (STUN)", <a href="./rfc5389">RFC 5389</a>,
October 2008.
[<a id="ref-RFC5766">RFC5766</a>] Rosenberg, J., Mahy, R., and P. Matthews, "Traversal
Using Relays around NAT (TURN): Relay Extensions to
Session Traversal Utilities for NAT (STUN)", <a href="./rfc5766">RFC 5766</a>,
April 2010.
<span class="h3"><a class="selflink" id="section-10.2" href="#section-10.2">10.2</a>. Informative References</span>
[<a id="ref-HIP-MIDDLE">HIP-MIDDLE</a>] Heer, T., Wehrle, K., and M. Komu, "End-Host
Authentication for HIP Middleboxes", Work in Progress,
February 2009.
[<a id="ref-MMUSIC-ICE">MMUSIC-ICE</a>] Rosenberg, J., "Guidelines for Usage of Interactive
Connectivity Establishment (ICE) by non Session
Initiation Protocol (SIP) Protocols", Work in Progress,
July 2008.
[<a id="ref-RFC3948">RFC3948</a>] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and
M. Stenberg, "UDP Encapsulation of IPsec ESP Packets",
<a href="./rfc3948">RFC 3948</a>, January 2005.
<span class="grey">Komu, et al. Experimental [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
[<a id="ref-RFC4787">RFC4787</a>] Audet, F. and C. Jennings, "Network Address Translation
(NAT) Behavioral Requirements for Unicast UDP",
<a href="https://www.rfc-editor.org/bcp/bcp127">BCP 127</a>, <a href="./rfc4787">RFC 4787</a>, January 2007.
[<a id="ref-RFC5128">RFC5128</a>] Srisuresh, P., Ford, B., and D. Kegel, "State of Peer-
to-Peer (P2P) Communication across Network Address
Translators (NATs)", <a href="./rfc5128">RFC 5128</a>, March 2008.
[<a id="ref-RFC5207">RFC5207</a>] Stiemerling, M., Quittek, J., and L. Eggert, "NAT and
Firewall Traversal Issues of Host Identity Protocol
(HIP) Communication", <a href="./rfc5207">RFC 5207</a>, April 2008.
<span class="grey">Komu, et al. Experimental [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Selecting a Value for Check Pacing</span>
Selecting a suitable value for the connectivity check transaction
pacing is essential for the performance of connectivity check-based
NAT traversal. The value should not be so small that the checks
cause network congestion or overwhelm the NATs. On the other hand, a
pacing value that is too high makes the checks last for a long time,
thus increasing the connection setup delay.
The Ta value may be configured by the user in environments where the
network characteristics are known beforehand. However, if the
characteristics are not known, it is recommended that the value is
adjusted dynamically. In this case, it's recommended that the hosts
estimate the round-trip time (RTT) between them and set the minimum
Ta value so that only two connectivity check messages are sent on
every RTT.
One way to estimate the RTT is to use the time it takes for the HIP
relay server registration exchange to complete; this would give an
estimate on the registering host's access link's RTT. Also, the
I1/R1 exchange could be used for estimating the RTT, but since the R1
can be cached in the network, or the relaying service can increase
the delay notably, it is not recommended.
<span class="grey">Komu, et al. Experimental [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. Base Exchange through a Rendezvous Server</span>
When the Initiator looks up the information of the Responder from
DNS, it's possible that it discovers a rendezvous server (RVS) record
[<a href="./rfc5204" title=""Host Identity Protocol (HIP) Rendezvous Extension"">RFC5204</a>]. In this case, if the Initiator uses NAT traversal methods
described in this document, it MAY use its own HIP relay server to
forward HIP traffic to the rendezvous server. The Initiator will
send the I1 packet using its HIP relay server, which will then
forward it to the RVS server of the Responder. In this case, the
value of the protocol field in the RELAY_TO parameter MUST be IP
since RVS does not support UDP-encapsulated base exchange packets.
The Responder will send the R1 packet directly to the Initiator's HIP
relay server and the following I2 and R2 packets are also sent
directly using the relay.
In case the Initiator is not able to distinguish which records are
RVS address records and which are Responder's address records (e.g.,
if the DNS server did not support HIP extensions), the Initiator
SHOULD first try to contact the Responder directly, without using a
HIP relay server. If none of the addresses are reachable, it MAY try
them out using its own HIP relay server as described above.
<span class="grey">Komu, et al. Experimental [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc5770">RFC 5770</a> Basic NAT Traversal for HIP April 2010</span>
Authors' Addresses
Miika Komu
Helsinki Institute for Information Technology
Metsanneidonkuja 4
Espoo
Finland
Phone: +358503841531
Fax: +35896949768
EMail: miika@iki.fi
URI: <a href="http://www.hiit.fi/">http://www.hiit.fi/</a>
Thomas Henderson
The Boeing Company
P.O. Box 3707
Seattle, WA
USA
EMail: thomas.r.henderson@boeing.com
Hannes Tschofenig
Nokia Siemens Networks
Linnoitustie 6
Espoo 02600
Finland
Phone: +358 (50) 4871445
EMail: Hannes.Tschofenig@gmx.net
URI: <a href="http://www.tschofenig.priv.at/">http://www.tschofenig.priv.at/</a>
Jan Melen
Ericsson Research Nomadiclab
Hirsalantie 11
02420 Jorvas
Finland
Phone: +358 9 2991
EMail: jan.melen@ericsson.com
Ari Keranen (editor)
Ericsson Research Nomadiclab
Hirsalantie 11
02420 Jorvas
Finland
Phone: +358 9 2991
EMail: ari.keranen@ericsson.com
Komu, et al. Experimental [Page 34]
</pre>
|