rfc4718.txt 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251
  1. Network Working Group P. Eronen
  2. Request for Comments: 4718 Nokia
  3. Category: Informational P. Hoffman
  4. VPN Consortium
  5. October 2006
  6. IKEv2 Clarifications and Implementation Guidelines
  7. Status of This Memo
  8. This memo provides information for the Internet community. It does
  9. not specify an Internet standard of any kind. Distribution of this
  10. memo is unlimited.
  11. Copyright Notice
  12. Copyright (C) The Internet Society (2006).
  13. Abstract
  14. This document clarifies many areas of the IKEv2 specification. It
  15. does not to introduce any changes to the protocol, but rather
  16. provides descriptions that are less prone to ambiguous
  17. interpretations. The purpose of this document is to encourage the
  18. development of interoperable implementations.
  19. Eronen & Hoffman Informational [Page 1]
  20. RFC 4718 IKEv2 Clarifications October 2006
  21. Table of Contents
  22. 1. Introduction ....................................................4
  23. 2. Creating the IKE_SA .............................................4
  24. 2.1. SPI Values in IKE_SA_INIT Exchange .........................4
  25. 2.2. Message IDs for IKE_SA_INIT Messages .......................5
  26. 2.3. Retransmissions of IKE_SA_INIT Requests ....................5
  27. 2.4. Interaction of COOKIE and INVALID_KE_PAYLOAD ...............6
  28. 2.5. Invalid Cookies ............................................8
  29. 3. Authentication ..................................................9
  30. 3.1. Data Included in AUTH Payload Calculation ..................9
  31. 3.2. Hash Function for RSA Signatures ...........................9
  32. 3.3. Encoding Method for RSA Signatures ........................10
  33. 3.4. Identification Type for EAP ...............................11
  34. 3.5. Identity for Policy Lookups When Using EAP ................11
  35. 3.6. Certificate Encoding Types ................................12
  36. 3.7. Shared Key Authentication and Fixed PRF Key Size ..........12
  37. 3.8. EAP Authentication and Fixed PRF Key Size .................13
  38. 3.9. Matching ID Payloads to Certificate Contents ..............13
  39. 3.10. Message IDs for IKE_AUTH Messages ........................14
  40. 4. Creating CHILD_SAs .............................................14
  41. 4.1. Creating SAs with the CREATE_CHILD_SA Exchange ............14
  42. 4.2. Creating an IKE_SA without a CHILD_SA .....................16
  43. 4.3. Diffie-Hellman for First CHILD_SA .........................16
  44. 4.4. Extended Sequence Numbers (ESN) Transform .................17
  45. 4.5. Negotiation of ESP_TFC_PADDING_NOT_SUPPORTED ..............17
  46. 4.6. Negotiation of NON_FIRST_FRAGMENTS_ALSO ...................18
  47. 4.7. Semantics of Complex Traffic Selector Payloads ............18
  48. 4.8. ICMP Type/Code in Traffic Selector Payloads ...............19
  49. 4.9. Mobility Header in Traffic Selector Payloads ..............20
  50. 4.10. Narrowing the Traffic Selectors ..........................20
  51. 4.11. SINGLE_PAIR_REQUIRED .....................................21
  52. 4.12. Traffic Selectors Violating Own Policy ...................21
  53. 4.13. Traffic Selector Authorization ...........................22
  54. 5. Rekeying and Deleting SAs ......................................23
  55. 5.1. Rekeying SAs with the CREATE_CHILD_SA Exchange ............23
  56. 5.2. Rekeying the IKE_SA vs. Reauthentication ..................24
  57. 5.3. SPIs When Rekeying the IKE_SA .............................25
  58. 5.4. SPI When Rekeying a CHILD_SA ..............................25
  59. 5.5. Changing PRFs When Rekeying the IKE_SA ....................26
  60. 5.6. Deleting vs. Closing SAs ..................................26
  61. 5.7. Deleting a CHILD_SA Pair ..................................26
  62. 5.8. Deleting an IKE_SA ........................................27
  63. 5.9. Who is the original initiator of IKE_SA ...................27
  64. 5.10. Comparing Nonces .........................................27
  65. 5.11. Exchange Collisions ......................................28
  66. 5.12. Diffie-Hellman and Rekeying the IKE_SA ...................36
  67. Eronen & Hoffman Informational [Page 2]
  68. RFC 4718 IKEv2 Clarifications October 2006
  69. 6. Configuration Payloads .........................................37
  70. 6.1. Assigning IP Addresses ....................................37
  71. 6.2. Requesting any INTERNAL_IP4/IP6_ADDRESS ...................38
  72. 6.3. INTERNAL_IP4_SUBNET/INTERNAL_IP6_SUBNET ...................38
  73. 6.4. INTERNAL_IP4_NETMASK ......................................41
  74. 6.5. Configuration Payloads for IPv6 ...........................42
  75. 6.6. INTERNAL_IP6_NBNS .........................................43
  76. 6.7. INTERNAL_ADDRESS_EXPIRY ...................................43
  77. 6.8. Address Assignment Failures ...............................44
  78. 7. Miscellaneous Issues ...........................................45
  79. 7.1. Matching ID_IPV4_ADDR and ID_IPV6_ADDR ....................45
  80. 7.2. Relationship of IKEv2 to RFC 4301 .........................45
  81. 7.3. Reducing the Window Size ..................................46
  82. 7.4. Minimum Size of Nonces ....................................46
  83. 7.5. Initial Zero Octets on Port 4500 ..........................46
  84. 7.6. Destination Port for NAT Traversal ........................47
  85. 7.7. SPI Values for Messages outside an IKE_SA .................47
  86. 7.8. Protocol ID/SPI Fields in Notify Payloads .................48
  87. 7.9. Which message should contain INITIAL_CONTACT ..............48
  88. 7.10. Alignment of Payloads ....................................48
  89. 7.11. Key Length Transform Attribute ...........................48
  90. 7.12. IPsec IANA Considerations ................................49
  91. 7.13. Combining ESP and AH .....................................50
  92. 8. Implementation Mistakes ........................................50
  93. 9. Security Considerations ........................................51
  94. 10. Acknowledgments ...............................................51
  95. 11. References ....................................................51
  96. 11.1. Normative References .....................................51
  97. 11.2. Informative References ...................................52
  98. Appendix A. Exchanges and Payloads ................................54
  99. A.1. IKE_SA_INIT Exchange ......................................54
  100. A.2. IKE_AUTH Exchange without EAP .............................54
  101. A.3. IKE_AUTH Exchange with EAP ................................55
  102. A.4. CREATE_CHILD_SA Exchange for Creating/Rekeying
  103. CHILD_SAs .................................................56
  104. A.5. CREATE_CHILD_SA Exchange for Rekeying the IKE_SA ..........56
  105. A.6. INFORMATIONAL Exchange ....................................56
  106. Eronen & Hoffman Informational [Page 3]
  107. RFC 4718 IKEv2 Clarifications October 2006
  108. 1. Introduction
  109. This document clarifies many areas of the IKEv2 specification that
  110. may be difficult to understand to developers not intimately familiar
  111. with the specification and its history. The clarifications in this
  112. document come from the discussion on the IPsec WG mailing list, from
  113. experience in interoperability testing, and from implementation
  114. issues that have been brought to the editors' attention.
  115. IKEv2/IPsec can be used for several different purposes, including
  116. IPsec-based remote access (sometimes called the "road warrior" case),
  117. site-to-site virtual private networks (VPNs), and host-to-host
  118. protection of application traffic. While this document attempts to
  119. consider all of these uses, the remote access scenario has perhaps
  120. received more attention here than the other uses.
  121. This document does not place any requirements on anyone and does not
  122. use [RFC2119] keywords such as "MUST" and "SHOULD", except in
  123. quotations from the original IKEv2 documents. The requirements are
  124. given in the IKEv2 specification [IKEv2] and IKEv2 cryptographic
  125. algorithms document [IKEv2ALG].
  126. In this document, references to a numbered section (such as "Section
  127. 2.15") mean that section in [IKEv2]. References to mailing list
  128. messages or threads refer to the IPsec WG mailing list at
  129. ipsec@ietf.org. Archives of the mailing list can be found at
  130. <http://www.ietf.org/mail-archive/web/ipsec/index.html>.
  131. 2. Creating the IKE_SA
  132. 2.1. SPI Values in IKE_SA_INIT Exchange
  133. Normal IKE messages include the initiator's and responder's Security
  134. Parameter Indexes (SPIs), both of which are non-zero, in the IKE
  135. header. However, there are some corner cases where the IKEv2
  136. specification is not fully consistent about what values should be
  137. used.
  138. First, Section 3.1 says that the Responder's SPI "...MUST NOT be zero
  139. in any other message" (than the first message of the IKE_SA_INIT
  140. exchange). However, the figure in Section 2.6 shows the second
  141. IKE_SA_INIT message as "HDR(A,0), N(COOKIE)", contradicting the text
  142. in 3.1.
  143. Since the responder's SPI identifies security-related state held by
  144. the responder, and in this case no state is created, sending a zero
  145. value seems reasonable.
  146. Eronen & Hoffman Informational [Page 4]
  147. RFC 4718 IKEv2 Clarifications October 2006
  148. Second, in addition to cookies, there are several other cases when
  149. the IKE_SA_INIT exchange does not result in the creation of an IKE_SA
  150. (for instance, INVALID_KE_PAYLOAD or NO_PROPOSAL_CHOSEN). What
  151. responder SPI value should be used in the IKE_SA_INIT response in
  152. this case?
  153. Since the IKE_SA_INIT request always has a zero responder SPI, the
  154. value will not be actually used by the initiator. Thus, we think
  155. sending a zero value is correct also in this case.
  156. If the responder sends a non-zero responder SPI, the initiator should
  157. not reject the response only for that reason. However, when retrying
  158. the IKE_SA_INIT request, the initiator will use a zero responder SPI,
  159. as described in Section 3.1: "Responder's SPI [...] This value MUST
  160. be zero in the first message of an IKE Initial Exchange (including
  161. repeats of that message including a cookie) [...]". We believe the
  162. intent was to cover repeats of that message due to other reasons,
  163. such as INVALID_KE_PAYLOAD, as well.
  164. (References: "INVALID_KE_PAYLOAD and clarifications document" thread,
  165. Sep-Oct 2005.)
  166. 2.2. Message IDs for IKE_SA_INIT Messages
  167. The Message ID for IKE_SA_INIT messages is always zero. This
  168. includes retries of the message due to responses such as COOKIE and
  169. INVALID_KE_PAYLOAD.
  170. This is because Message IDs are part of the IKE_SA state, and when
  171. the responder replies to IKE_SA_INIT request with N(COOKIE) or
  172. N(INVALID_KE_PAYLOAD), the responder does not allocate any state.
  173. (References: "Question about N(COOKIE) and N(INVALID_KE_PAYLOAD)
  174. combination" thread, Oct 2004. Tero Kivinen's mail "Comments of
  175. draft-eronen-ipsec-ikev2-clarifications-02.txt", 2005-04-05.)
  176. 2.3. Retransmissions of IKE_SA_INIT Requests
  177. When a responder receives an IKE_SA_INIT request, it has to determine
  178. whether the packet is a retransmission belonging to an existing
  179. "half-open" IKE_SA (in which case the responder retransmits the same
  180. response), or a new request (in which case the responder creates a
  181. new IKE_SA and sends a fresh response).
  182. The specification does not describe in detail how this determination
  183. is done. In particular, it is not sufficient to use the initiator's
  184. SPI and/or IP address for this purpose: two different peers behind a
  185. single NAT could choose the same initiator SPI (and the probability
  186. Eronen & Hoffman Informational [Page 5]
  187. RFC 4718 IKEv2 Clarifications October 2006
  188. of this happening is not necessarily small, since IKEv2 does not
  189. require SPIs to be chosen randomly). Instead, the responder should
  190. do the IKE_SA lookup using the whole packet or its hash (or at the
  191. minimum, the Ni payload which is always chosen randomly).
  192. For all other packets than IKE_SA_INIT requests, looking up right
  193. IKE_SA is of course done based on the recipient's SPI (either the
  194. initiator or responder SPI depending on the value of the Initiator
  195. bit in the IKE header).
  196. 2.4. Interaction of COOKIE and INVALID_KE_PAYLOAD
  197. There are two common reasons why the initiator may have to retry the
  198. IKE_SA_INIT exchange: the responder requests a cookie or wants a
  199. different Diffie-Hellman group than was included in the KEi payload.
  200. Both of these cases are quite simple alone, but it is not totally
  201. obvious what happens when they occur at the same time, that is, the
  202. IKE_SA_INIT exchange is retried several times.
  203. The main question seems to be the following: if the initiator
  204. receives a cookie from the responder, should it include the cookie in
  205. only the next retry of the IKE_SA_INIT request, or in all subsequent
  206. retries as well? Section 3.10.1 says that:
  207. "This notification MUST be included in an IKE_SA_INIT request
  208. retry if a COOKIE notification was included in the initial
  209. response."
  210. This could be interpreted as saying that when a cookie is received in
  211. the initial response, it is included in all retries. On the other
  212. hand, Section 2.6 says that:
  213. "Initiators who receive such responses MUST retry the
  214. IKE_SA_INIT with a Notify payload of type COOKIE containing
  215. the responder supplied cookie data as the first payload and
  216. all other payloads unchanged."
  217. Including the same cookie in later retries makes sense only if the
  218. "all other payloads unchanged" restriction applies only to the first
  219. retry, but not to subsequent retries.
  220. It seems that both interpretations can peacefully coexist. If the
  221. initiator includes the cookie only in the next retry, one additional
  222. roundtrip may be needed in some cases:
  223. Eronen & Hoffman Informational [Page 6]
  224. RFC 4718 IKEv2 Clarifications October 2006
  225. Initiator Responder
  226. ----------- -----------
  227. HDR(A,0), SAi1, KEi, Ni -->
  228. <-- HDR(A,0), N(COOKIE)
  229. HDR(A,0), N(COOKIE), SAi1, KEi, Ni -->
  230. <-- HDR(A,0), N(INVALID_KE_PAYLOAD)
  231. HDR(A,0), SAi1, KEi', Ni -->
  232. <-- HDR(A,0), N(COOKIE')
  233. HDR(A,0), N(COOKIE'), SAi1, KEi',Ni -->
  234. <-- HDR(A,B), SAr1, KEr, Nr
  235. An additional roundtrip is needed also if the initiator includes the
  236. cookie in all retries, but the responder does not support this
  237. functionality. For instance, if the responder includes the SAi1 and
  238. KEi payloads in cookie calculation, it will reject the request by
  239. sending a new cookie (see also Section 2.5 of this document for more
  240. text about invalid cookies):
  241. Initiator Responder
  242. ----------- -----------
  243. HDR(A,0), SAi1, KEi, Ni -->
  244. <-- HDR(A,0), N(COOKIE)
  245. HDR(A,0), N(COOKIE), SAi1, KEi, Ni -->
  246. <-- HDR(A,0), N(INVALID_KE_PAYLOAD)
  247. HDR(A,0), N(COOKIE), SAi1, KEi', Ni -->
  248. <-- HDR(A,0), N(COOKIE')
  249. HDR(A,0), N(COOKIE'), SAi1, KEi',Ni -->
  250. <-- HDR(A,B), SAr1, KEr, Nr
  251. If both peers support including the cookie in all retries, a slightly
  252. shorter exchange can happen:
  253. Initiator Responder
  254. ----------- -----------
  255. HDR(A,0), SAi1, KEi, Ni -->
  256. <-- HDR(A,0), N(COOKIE)
  257. HDR(A,0), N(COOKIE), SAi1, KEi, Ni -->
  258. <-- HDR(A,0), N(INVALID_KE_PAYLOAD)
  259. HDR(A,0), N(COOKIE), SAi1, KEi', Ni -->
  260. <-- HDR(A,B), SAr1, KEr, Nr
  261. This document recommends that implementations should support this
  262. shorter exchange, but it must not be assumed the other peer also
  263. supports the shorter exchange.
  264. Eronen & Hoffman Informational [Page 7]
  265. RFC 4718 IKEv2 Clarifications October 2006
  266. In theory, even this exchange has one unnecessary roundtrip, as both
  267. the cookie and Diffie-Hellman group could be checked at the same
  268. time:
  269. Initiator Responder
  270. ----------- -----------
  271. HDR(A,0), SAi1, KEi, Ni -->
  272. <-- HDR(A,0), N(COOKIE),
  273. N(INVALID_KE_PAYLOAD)
  274. HDR(A,0), N(COOKIE), SAi1, KEi',Ni -->
  275. <-- HDR(A,B), SAr1, KEr, Nr
  276. However, it is clear that this case is not allowed by the text in
  277. Section 2.6, since "all other payloads" clearly includes the KEi
  278. payload as well.
  279. (References: "INVALID_KE_PAYLOAD and clarifications document" thread,
  280. Sep-Oct 2005.)
  281. 2.5. Invalid Cookies
  282. There has been some confusion what should be done when an IKE_SA_INIT
  283. request containing an invalid cookie is received ("invalid" in the
  284. sense that its contents do not match the value expected by the
  285. responder).
  286. The correct action is to ignore the cookie and process the message as
  287. if no cookie had been included (usually this means sending a response
  288. containing a new cookie). This is shown in Section 2.6 when it says
  289. "The responder in that case MAY reject the message by sending another
  290. response with a new cookie [...]".
  291. Other possible actions, such as ignoring the whole request (or even
  292. all requests from this IP address for some time), create strange
  293. failure modes even in the absence of any malicious attackers and do
  294. not provide any additional protection against DoS attacks.
  295. (References: "Invalid Cookie" thread, Sep-Oct 2005.)
  296. Eronen & Hoffman Informational [Page 8]
  297. RFC 4718 IKEv2 Clarifications October 2006
  298. 3. Authentication
  299. 3.1. Data Included in AUTH Payload Calculation
  300. Section 2.15 describes how the AUTH payloads are calculated; this
  301. calculation involves values prf(SK_pi,IDi') and prf(SK_pr,IDr'). The
  302. text describes the method in words, but does not give clear
  303. definitions of what is signed or MACed (i.e., protected with a
  304. message authentication code).
  305. The initiator's signed octets can be described as:
  306. InitiatorSignedOctets = RealMessage1 | NonceRData | MACedIDForI
  307. GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR
  308. RealIKEHDR = SPIi | SPIr | . . . | Length
  309. RealMessage1 = RealIKEHDR | RestOfMessage1
  310. NonceRPayload = PayloadHeader | NonceRData
  311. InitiatorIDPayload = PayloadHeader | RestOfIDPayload
  312. RestOfInitIDPayload = IDType | RESERVED | InitIDData
  313. MACedIDForI = prf(SK_pi, RestOfInitIDPayload)
  314. The responder's signed octets can be described as:
  315. ResponderSignedOctets = RealMessage2 | NonceIData | MACedIDForR
  316. GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR
  317. RealIKEHDR = SPIi | SPIr | . . . | Length
  318. RealMessage2 = RealIKEHDR | RestOfMessage2
  319. NonceIPayload = PayloadHeader | NonceIData
  320. ResponderIDPayload = PayloadHeader | RestOfIDPayload
  321. RestOfRespIDPayload = IDType | RESERVED | InitIDData
  322. MACedIDForR = prf(SK_pr, RestOfRespIDPayload)
  323. 3.2. Hash Function for RSA Signatures
  324. Section 3.8 says that RSA digital signature is "Computed as specified
  325. in section 2.15 using an RSA private key over a PKCS#1 padded hash."
  326. Unlike IKEv1, IKEv2 does not negotiate a hash function for the
  327. IKE_SA. The algorithm for signatures is selected by the signing
  328. party who, in general, may not know beforehand what algorithms the
  329. verifying party supports. Furthermore, [IKEv2ALG] does not say what
  330. algorithms implementations are required or recommended to support.
  331. This clearly has a potential for causing interoperability problems,
  332. since authentication will fail if the signing party selects an
  333. algorithm that is not supported by the verifying party, or not
  334. acceptable according to the verifying party's policy.
  335. Eronen & Hoffman Informational [Page 9]
  336. RFC 4718 IKEv2 Clarifications October 2006
  337. This document recommends that all implementations support SHA-1 and
  338. use SHA-1 as the default hash function when generating the
  339. signatures, unless there are good reasons (such as explicit manual
  340. configuration) to believe that the peer supports something else.
  341. Note that hash function collision attacks are not important for the
  342. AUTH payloads, since they are not intended for third-party
  343. verification, and the data includes fresh nonces. See [HashUse] for
  344. more discussion about hash function attacks and IPsec.
  345. Another reasonable choice would be to use the hash function that was
  346. used by the CA when signing the peer certificate. However, this does
  347. not guarantee that the IKEv2 peer would be able to validate the AUTH
  348. payload, because the same code might not be used to validate
  349. certificate signatures and IKEv2 message signatures, and these two
  350. routines may support a different set of hash algorithms. The peer
  351. could be configured with a fingerprint of the certificate, or
  352. certificate validation could be performed by an external entity using
  353. [SCVP]. Furthermore, not all CERT payloads types include a
  354. signature, and the certificate could be signed with some algorithm
  355. other than RSA.
  356. Note that unlike IKEv1, IKEv2 uses the PKCS#1 v1.5 [PKCS1v20]
  357. signature encoding method (see next section for details), which
  358. includes the algorithm identifier for the hash algorithm. Thus, when
  359. the verifying party receives the AUTH payload it can at least
  360. determine which hash function was used.
  361. (References: Magnus Alstrom's mail "RE:", 2005-01-03. Pasi Eronen's
  362. reply, 2005-01-04. Tero Kivinen's reply, 2005-01-04. "First draft
  363. of IKEv2.1" thread, Dec 2005/Jan 2006.)
  364. 3.3. Encoding Method for RSA Signatures
  365. Section 3.8 says that the RSA digital signature is "Computed as
  366. specified in section 2.15 using an RSA private key over a PKCS#1
  367. padded hash."
  368. The PKCS#1 specification [PKCS1v21] defines two different encoding
  369. methods (ways of "padding the hash") for signatures. However, the
  370. Internet-Draft approved by the IESG had a reference to the older
  371. PKCS#1 v2.0 [PKCS1v20]. That version has only one encoding method
  372. for signatures (EMSA-PKCS1-v1_5), and thus there is no ambiguity.
  373. Eronen & Hoffman Informational [Page 10]
  374. RFC 4718 IKEv2 Clarifications October 2006
  375. Note that this encoding method is different from the encoding method
  376. used in IKEv1. If future revisions of IKEv2 provide support for
  377. other encoding methods (such as EMSA-PSS), they will be given new
  378. Auth Method numbers.
  379. (References: Pasi Eronen's mail "RE:", 2005-01-04.)
  380. 3.4. Identification Type for EAP
  381. Section 3.5 defines several different types for identification
  382. payloads, including, e.g., ID_FQDN, ID_RFC822_ADDR, and ID_KEY_ID.
  383. EAP [EAP] does not mandate the use of any particular type of
  384. identifier, but often EAP is used with Network Access Identifiers
  385. (NAIs) defined in [NAI]. Although NAIs look a bit like email
  386. addresses (e.g., "joe@example.com"), the syntax is not exactly the
  387. same as the syntax of email address in [RFC822]. This raises the
  388. question of which identification type should be used.
  389. This document recommends that ID_RFC822_ADDR identification type is
  390. used for those NAIs that include the realm component. Therefore,
  391. responder implementations should not attempt to verify that the
  392. contents actually conform to the exact syntax given in [RFC822] or
  393. [RFC2822], but instead should accept any reasonable looking NAI.
  394. For NAIs that do not include the realm component, this document
  395. recommends using the ID_KEY_ID identification type.
  396. (References: "need your help on this IKEv2/i18n/EAP issue" and "IKEv2
  397. identifier issue with EAP" threads, Aug 2004.)
  398. 3.5. Identity for Policy Lookups When Using EAP
  399. When the initiator authentication uses EAP, it is possible that the
  400. contents of the IDi payload is used only for AAA routing purposes and
  401. selecting which EAP method to use. This value may be different from
  402. the identity authenticated by the EAP method (see [EAP], Sections 5.1
  403. and 7.3).
  404. It is important that policy lookups and access control decisions use
  405. the actual authenticated identity. Often the EAP server is
  406. implemented in a separate AAA server that communicates with the IKEv2
  407. responder using, e.g., RADIUS [RADEAP]. In this case, the
  408. authenticated identity has to be sent from the AAA server to the
  409. IKEv2 responder.
  410. (References: Pasi Eronen's mail "RE: Reauthentication in IKEv2",
  411. 2004-10-28. "Policy lookups" thread, Oct/Nov 2004. RFC 3748,
  412. Section 7.3.)
  413. Eronen & Hoffman Informational [Page 11]
  414. RFC 4718 IKEv2 Clarifications October 2006
  415. 3.6. Certificate Encoding Types
  416. Section 3.6 defines a total of twelve different certificate encoding
  417. types, and continues that "Specific syntax is for some of the
  418. certificate type codes above is not defined in this document."
  419. However, the text does not provide references to other documents that
  420. would contain information about the exact contents and use of those
  421. values.
  422. Without this information, it is not possible to develop interoperable
  423. implementations. Therefore, this document recommends that the
  424. following certificate encoding values should not be used before new
  425. specifications that specify their use are available.
  426. PKCS #7 wrapped X.509 certificate 1
  427. PGP Certificate 2
  428. DNS Signed Key 3
  429. Kerberos Token 6
  430. SPKI Certificate 9
  431. This document recommends that most implementations should use only
  432. those values that are "MUST"/"SHOULD" requirements in [IKEv2]; i.e.,
  433. "X.509 Certificate - Signature" (4), "Raw RSA Key" (11), "Hash and
  434. URL of X.509 certificate" (12), and "Hash and URL of X.509 bundle"
  435. (13).
  436. Furthermore, Section 3.7 says that the "Certificate Encoding" field
  437. for the Certificate Request payload uses the same values as for
  438. Certificate payload. However, the contents of the "Certification
  439. Authority" field are defined only for X.509 certificates (presumably
  440. covering at least types 4, 10, 12, and 13). This document recommends
  441. that other values should not be used before new specifications that
  442. specify their use are available.
  443. The "Raw RSA Key" type needs one additional clarification. Section
  444. 3.6 says it contains "a PKCS #1 encoded RSA key". What this means is
  445. a DER-encoded RSAPublicKey structure from PKCS#1 [PKCS1v21].
  446. 3.7. Shared Key Authentication and Fixed PRF Key Size
  447. Section 2.15 says that "If the negotiated prf takes a fixed-size key,
  448. the shared secret MUST be of that fixed size". This statement is
  449. correct: the shared secret must be of the correct size. If it is
  450. not, it cannot be used; there is no padding, truncation, or other
  451. processing involved to force it to that correct size.
  452. Eronen & Hoffman Informational [Page 12]
  453. RFC 4718 IKEv2 Clarifications October 2006
  454. This requirement means that it is difficult to use these pseudo-
  455. random functions (PRFs) with shared key authentication. The authors
  456. think this part of the specification was very poorly thought out, and
  457. using PRFs with a fixed key size is likely to result in
  458. interoperability problems. Thus, we recommend that such PRFs should
  459. not be used with shared key authentication. PRF_AES128_XCBC
  460. [RFC3664] originally used fixed key sizes; that RFC has been updated
  461. to handle variable key sizes in [RFC4434].
  462. Note that Section 2.13 also contains text that is related to PRFs
  463. with fixed key size: "When the key for the prf function has fixed
  464. length, the data provided as a key is truncated or padded with zeros
  465. as necessary unless exceptional processing is explained following the
  466. formula". However, this text applies only to the prf+ construction,
  467. so it does not contradict the text in Section 2.15.
  468. (References: Paul Hoffman's mail "Re: ikev2-07: last nits",
  469. 2003-05-02. Hugo Krawczyk's reply, 2003-05-12. Thread "Question
  470. about PRFs with fixed size key", Jan 2005.)
  471. 3.8. EAP Authentication and Fixed PRF Key Size
  472. As described in the previous section, PRFs with a fixed key size
  473. require a shared secret of exactly that size. This restriction
  474. applies also to EAP authentication. For instance, a PRF that
  475. requires a 128-bit key cannot be used with EAP since [EAP] specifies
  476. that the MSK is at least 512 bits long.
  477. (References: Thread "Question about PRFs with fixed size key", Jan
  478. 2005.)
  479. 3.9. Matching ID Payloads to Certificate Contents
  480. In IKEv1, there was some confusion about whether or not the
  481. identities in certificates used to authenticate IKE were required to
  482. match the contents of the ID payloads. The PKI4IPsec Working Group
  483. produced the document [PKI4IPsec] which covers this topic in much
  484. more detail. However, Section 3.5 of [IKEv2] explicitly says that
  485. the ID payload "does not necessarily have to match anything in the
  486. CERT payload".
  487. Eronen & Hoffman Informational [Page 13]
  488. RFC 4718 IKEv2 Clarifications October 2006
  489. 3.10. Message IDs for IKE_AUTH Messages
  490. According to Section 2.2, "The IKE_SA initial setup messages will
  491. always be numbered 0 and 1." That is true when the IKE_AUTH exchange
  492. does not use EAP. When EAP is used, each pair of messages has their
  493. message numbers incremented. The first pair of AUTH messages will
  494. have an ID of 1, the second will be 2, and so on.
  495. (References: "Question about MsgID in AUTH exchange" thread, April
  496. 2005.)
  497. 4. Creating CHILD_SAs
  498. 4.1. Creating SAs with the CREATE_CHILD_SA Exchange
  499. Section 1.3's organization does not lead to clear understanding of
  500. what is needed in which environment. The section can be reorganized
  501. with subsections for each use of the CREATE_CHILD_SA exchange
  502. (creating child SAs, rekeying IKE SAs, and rekeying child SAs.)
  503. The new Section 1.3 with subsections and the above changes might look
  504. like the following.
  505. NEW-1.3 The CREATE_CHILD_SA Exchange
  506. The CREATE_CHILD_SA Exchange is used to create new CHILD_SAs and
  507. to rekey both IKE_SAs and CHILD_SAs. This exchange consists of
  508. a single request/response pair, and some of its function was
  509. referred to as a phase 2 exchange in IKEv1. It MAY be initiated
  510. by either end of the IKE_SA after the initial exchanges are
  511. completed.
  512. All messages following the initial exchange are
  513. cryptographically protected using the cryptographic algorithms
  514. and keys negotiated in the first two messages of the IKE
  515. exchange. These subsequent messages use the syntax of the
  516. Encrypted Payload described in section 3.14. All subsequent
  517. messages include an Encrypted Payload, even if they are referred
  518. to in the text as "empty".
  519. The CREATE_CHILD_SA is used for rekeying IKE_SAs and CHILD_SAs.
  520. This section describes the first part of rekeying, the creation
  521. of new SAs; Section 2.8 covers the mechanics of rekeying,
  522. including moving traffic from old to new SAs and the deletion of
  523. the old SAs. The two sections must be read together to
  524. understand the entire process of rekeying.
  525. Eronen & Hoffman Informational [Page 14]
  526. RFC 4718 IKEv2 Clarifications October 2006
  527. Either endpoint may initiate a CREATE_CHILD_SA exchange, so in
  528. this section the term initiator refers to the endpoint
  529. initiating this exchange. An implementation MAY refuse all
  530. CREATE_CHILD_SA requests within an IKE_SA.
  531. The CREATE_CHILD_SA request MAY optionally contain a KE payload
  532. for an additional Diffie-Hellman exchange to enable stronger
  533. guarantees of forward secrecy for the CHILD_SA or IKE_SA. The
  534. keying material for the SA is a function of SK_d established
  535. during the establishment of the IKE_SA, the nonces exchanged
  536. during the CREATE_CHILD_SA exchange, and the Diffie-Hellman
  537. value (if KE payloads are included in the CREATE_CHILD_SA
  538. exchange). The details are described in sections 2.17 and 2.18.
  539. If a CREATE_CHILD_SA exchange includes a KEi payload, at least
  540. one of the SA offers MUST include the Diffie-Hellman group of
  541. the KEi. The Diffie-Hellman group of the KEi MUST be an element
  542. of the group the initiator expects the responder to accept
  543. (additional Diffie-Hellman groups can be proposed). If the
  544. responder rejects the Diffie-Hellman group of the KEi payload,
  545. the responder MUST reject the request and indicate its preferred
  546. Diffie-Hellman group in the INVALID_KE_PAYLOAD Notification
  547. payload. In the case of such a rejection, the CREATE_CHILD_SA
  548. exchange fails, and the initiator SHOULD retry the exchange with
  549. a Diffie-Hellman proposal and KEi in the group that the
  550. responder gave in the INVALID_KE_PAYLOAD.
  551. NEW-1.3.1 Creating New CHILD_SAs with the CREATE_CHILD_SA Exchange
  552. A CHILD_SA may be created by sending a CREATE_CHILD_SA request.
  553. The CREATE_CHILD_SA request for creating a new CHILD_SA is:
  554. Initiator Responder
  555. ----------- -----------
  556. HDR, SK {[N+], SA, Ni, [KEi],
  557. TSi, TSr} -->
  558. The initiator sends SA offer(s) in the SA payload, a nonce in
  559. the Ni payload, optionally a Diffie-Hellman value in the KEi
  560. payload, and the proposed traffic selectors for the proposed
  561. CHILD_SA in the TSi and TSr payloads. The request can also
  562. contain Notify payloads that specify additional details for the
  563. CHILD_SA: these include IPCOMP_SUPPORTED, USE_TRANSPORT_MODE,
  564. ESP_TFC_PADDING_NOT_SUPPORTED, and NON_FIRST_FRAGMENTS_ALSO.
  565. Eronen & Hoffman Informational [Page 15]
  566. RFC 4718 IKEv2 Clarifications October 2006
  567. The CREATE_CHILD_SA response for creating a new CHILD_SA is:
  568. <-- HDR, SK {[N+], SA, Nr,
  569. [KEr], TSi, TSr}
  570. The responder replies with the accepted offer in an SA payload,
  571. and a Diffie-Hellman value in the KEr payload if KEi was
  572. included in the request and the selected cryptographic suite
  573. includes that group. As with the request, optional Notification
  574. payloads can specify additional details for the CHILD_SA.
  575. The traffic selectors for traffic to be sent on that SA are
  576. specified in the TS payloads in the response, which may be a
  577. subset of what the initiator of the CHILD_SA proposed.
  578. The text about rekeying SAs can be found in Section 5.1 of this
  579. document.
  580. 4.2. Creating an IKE_SA without a CHILD_SA
  581. CHILD_SAs can be created either by being piggybacked on the IKE_AUTH
  582. exchange, or using a separate CREATE_CHILD_SA exchange. The
  583. specification is not clear about what happens if creating the
  584. CHILD_SA during the IKE_AUTH exchange fails for some reason.
  585. Our recommendation in this situation is that the IKE_SA is created as
  586. usual. This is also in line with how the CREATE_CHILD_SA exchange
  587. works: a failure to create a CHILD_SA does not close the IKE_SA.
  588. The list of responses in the IKE_AUTH exchange that do not prevent an
  589. IKE_SA from being set up include at least the following:
  590. NO_PROPOSAL_CHOSEN, TS_UNACCEPTABLE, SINGLE_PAIR_REQUIRED,
  591. INTERNAL_ADDRESS_FAILURE, and FAILED_CP_REQUIRED.
  592. (References: "Questions about internal address" thread, April 2005.)
  593. 4.3. Diffie-Hellman for First CHILD_SA
  594. Section 1.2 shows that IKE_AUTH messages do not contain KEi/KEr or
  595. Ni/Nr payloads. This implies that the SA payload in IKE_AUTH
  596. exchange cannot contain Transform Type 4 (Diffie-Hellman Group) with
  597. any other value than NONE. Implementations should probably leave the
  598. transform out entirely in this case.
  599. Eronen & Hoffman Informational [Page 16]
  600. RFC 4718 IKEv2 Clarifications October 2006
  601. 4.4. Extended Sequence Numbers (ESN) Transform
  602. The description of the ESN transform in Section 3.3 has be proved
  603. difficult to understand. The ESN transform has the following
  604. meaning:
  605. o A proposal containing one ESN transform with value 0 means "do not
  606. use extended sequence numbers".
  607. o A proposal containing one ESN transform with value 1 means "use
  608. extended sequence numbers".
  609. o A proposal containing two ESN transforms with values 0 and 1 means
  610. "I support both normal and extended sequence numbers, you choose".
  611. (Obviously this case is only allowed in requests; the response
  612. will contain only one ESN transform.)
  613. In most cases, the exchange initiator will include either the first
  614. or third alternative in its SA payload. The second alternative is
  615. rarely useful for the initiator: it means that using normal sequence
  616. numbers is not acceptable (so if the responder does not support ESNs,
  617. the exchange will fail with NO_PROPOSAL_CHOSEN).
  618. Note that including the ESN transform is mandatory when creating
  619. ESP/AH SAs (it was optional in earlier drafts of the IKEv2
  620. specification).
  621. (References: "Technical change needed to IKEv2 before publication",
  622. "STRAW POLL: Dealing with the ESN negotiation interop issue in IKEv2"
  623. and "Results of straw poll regarding: IKEv2 interoperability issue"
  624. threads, March-April 2005.)
  625. 4.5. Negotiation of ESP_TFC_PADDING_NOT_SUPPORTED
  626. The description of ESP_TFC_PADDING_NOT_SUPPORTED notification in
  627. Section 3.10.1 says that "This notification asserts that the sending
  628. endpoint will NOT accept packets that contain Flow Confidentiality
  629. (TFC) padding".
  630. However, the text does not say in which messages this notification
  631. should be included, or whether the scope of this notification is a
  632. single CHILD_SA or all CHILD_SAs of the peer.
  633. Our interpretation is that the scope is a single CHILD_SA, and thus
  634. this notification is included in messages containing an SA payload
  635. negotiating a CHILD_SA. If neither endpoint accepts TFC padding,
  636. this notification will be included in both the request proposing an
  637. SA and the response accepting it. If this notification is included
  638. Eronen & Hoffman Informational [Page 17]
  639. RFC 4718 IKEv2 Clarifications October 2006
  640. in only one of the messages, TFC padding can still be sent in one
  641. direction.
  642. 4.6. Negotiation of NON_FIRST_FRAGMENTS_ALSO
  643. NON_FIRST_FRAGMENTS_ALSO notification is described in Section 3.10.1
  644. simply as "Used for fragmentation control. See [RFC4301] for
  645. explanation."
  646. [RFC4301] says "Implementations that will transmit non-initial
  647. fragments on a tunnel mode SA that makes use of non-trivial port (or
  648. ICMP type/code or MH type) selectors MUST notify a peer via the IKE
  649. NOTIFY NON_FIRST_FRAGMENTS_ALSO payload. The peer MUST reject this
  650. proposal if it will not accept non-initial fragments in this context.
  651. If an implementation does not successfully negotiate transmission of
  652. non-initial fragments for such an SA, it MUST NOT send such fragments
  653. over the SA."
  654. However, it is not clear exactly how the negotiation works. Our
  655. interpretation is that the negotiation works the same way as for
  656. IPCOMP_SUPPORTED and USE_TRANSPORT_MODE: sending non-first fragments
  657. is enabled only if NON_FIRST_FRAGMENTS_ALSO notification is included
  658. in both the request proposing an SA and the response accepting it.
  659. In other words, if the peer "rejects this proposal", it only omits
  660. NON_FIRST_FRAGMENTS_ALSO notification from the response, but does not
  661. reject the whole CHILD_SA creation.
  662. 4.7. Semantics of Complex Traffic Selector Payloads
  663. As described in Section 3.13, the TSi/TSr payloads can include one or
  664. more individual traffic selectors.
  665. There is no requirement that TSi and TSr contain the same number of
  666. individual traffic selectors. Thus, they are interpreted as follows:
  667. a packet matches a given TSi/TSr if it matches at least one of the
  668. individual selectors in TSi, and at least one of the individual
  669. selectors in TSr.
  670. For instance, the following traffic selectors:
  671. TSi = ((17, 100, 192.0.1.66-192.0.1.66),
  672. (17, 200, 192.0.1.66-192.0.1.66))
  673. TSr = ((17, 300, 0.0.0.0-255.255.255.255),
  674. (17, 400, 0.0.0.0-255.255.255.255))
  675. would match UDP packets from 192.0.1.66 to anywhere, with any of the
  676. four combinations of source/destination ports (100,300), (100,400),
  677. (200,300), and (200, 400).
  678. Eronen & Hoffman Informational [Page 18]
  679. RFC 4718 IKEv2 Clarifications October 2006
  680. This implies that some types of policies may require several CHILD_SA
  681. pairs. For instance, a policy matching only source/destination ports
  682. (100,300) and (200,400), but not the other two combinations, cannot
  683. be negotiated as a single CHILD_SA pair using IKEv2.
  684. (References: "IKEv2 Traffic Selectors?" thread, Feb 2005.)
  685. 4.8. ICMP Type/Code in Traffic Selector Payloads
  686. The traffic selector types 7 and 8 can also refer to ICMP type and
  687. code fields. As described in Section 3.13.1, "For the ICMP protocol,
  688. the two one-octet fields Type and Code are treated as a single 16-bit
  689. integer (with Type in the most significant eight bits and Code in the
  690. least significant eight bits) port number for the purposes of
  691. filtering based on this field."
  692. Since ICMP packets do not have separate source and destination port
  693. fields, there is some room for confusion what exactly the four TS
  694. payloads (two in the request, two in the response, each containing
  695. both start and end port fields) should contain.
  696. The answer to this question can be found from [RFC4301] Section
  697. 4.4.1.3.
  698. To give a concrete example, if a host at 192.0.1.234 wants to create
  699. a transport mode SA for sending "Destination Unreachable" packets
  700. (ICMPv4 type 3) to 192.0.2.155, but is not willing to receive them
  701. over this SA pair, the CREATE_CHILD_SA exchange would look like this:
  702. Initiator Responder
  703. ----------- -----------
  704. HDR, SK { N(USE_TRANSPORT_MODE), SA, Ni,
  705. TSi(1, 0x0300-0x03FF, 192.0.1.234-192.0.1.234),
  706. TSr(1, 65535-0, 192.0.2.155-192.0.2.155) } -->
  707. <-- HDR, SK { N(USE_TRANSPORT_MODE), SA, Nr,
  708. TSi(1, 0x0300-0x03FF, 192.0.1.234-192.0.1.234),
  709. TSr(1, 65535-0, 192.0.2.155-192.0.2.155) }
  710. Since IKEv2 always creates IPsec SAs in pairs, two SAs are also
  711. created in this case, even though the second SA is never used for
  712. data traffic.
  713. An exchange creating an SA pair that can be used both for sending and
  714. receiving "Destination Unreachable" places the same value in all the
  715. port:
  716. Eronen & Hoffman Informational [Page 19]
  717. RFC 4718 IKEv2 Clarifications October 2006
  718. Initiator Responder
  719. ----------- -----------
  720. HDR, SK { N(USE_TRANSPORT_MODE), SA, Ni,
  721. TSi(1, 0x0300-0x03FF, 192.0.1.234-192.0.1.234),
  722. TSr(1, 0x0300-0x03FF, 192.0.2.155-192.0.2.155) } -->
  723. <-- HDR, SK { N(USE_TRANSPORT_MODE), SA, Nr,
  724. TSi(1, 0x0300-0x03FF, 192.0.1.234-192.0.1.234),
  725. TSr(1, 0x0300-0x03FF, 192.0.2.155-192.0.2.155) }
  726. (References: "ICMP and MH TSs for IKEv2" thread, Sep 2005.)
  727. 4.9. Mobility Header in Traffic Selector Payloads
  728. Traffic selectors can use IP Protocol ID 135 to match the IPv6
  729. mobility header [MIPv6]. However, the IKEv2 specification does not
  730. define how to represent the "MH Type" field in traffic selectors.
  731. At some point, it was expected that this will be defined in a
  732. separate document later. However, [RFC4301] says that "For IKE, the
  733. IPv6 mobility header message type (MH type) is placed in the most
  734. significant eight bits of the 16 bit local "port" selector". The
  735. direction semantics of TSi/TSr port fields are the same as for ICMP
  736. and are described in the previous section.
  737. (References: Tero Kivinen's mail "Issue #86: Add IPv6 mobility header
  738. message type as selector", 2003-10-14. "ICMP and MH TSs for IKEv2"
  739. thread, Sep 2005.)
  740. 4.10. Narrowing the Traffic Selectors
  741. Section 2.9 describes how traffic selectors are negotiated when
  742. creating a CHILD_SA. A more concise summary of the narrowing process
  743. is presented below.
  744. o If the responder's policy does not allow any part of the traffic
  745. covered by TSi/TSr, it responds with TS_UNACCEPTABLE.
  746. o If the responder's policy allows the entire set of traffic covered
  747. by TSi/TSr, no narrowing is necessary, and the responder can
  748. return the same TSi/TSr values.
  749. o Otherwise, narrowing is needed. If the responder's policy allows
  750. all traffic covered by TSi[1]/TSr[1] (the first traffic selectors
  751. in TSi/TSr) but not entire TSi/TSr, the responder narrows to an
  752. acceptable subset of TSi/TSr that includes TSi[1]/TSr[1].
  753. Eronen & Hoffman Informational [Page 20]
  754. RFC 4718 IKEv2 Clarifications October 2006
  755. o If the responder's policy does not allow all traffic covered by
  756. TSi[1]/TSr[1], but does allow some parts of TSi/TSr, it narrows to
  757. an acceptable subset of TSi/TSr.
  758. In the last two cases, there may be several subsets that are
  759. acceptable (but their union is not); in this case, the responder
  760. arbitrarily chooses one of them and includes ADDITIONAL_TS_POSSIBLE
  761. notification in the response.
  762. 4.11. SINGLE_PAIR_REQUIRED
  763. The description of the SINGLE_PAIR_REQUIRED notify payload in
  764. Sections 2.9 and 3.10.1 is not fully consistent.
  765. We do not attempt to describe this payload in this document either,
  766. since it is expected that most implementations will not have policies
  767. that require separate SAs for each address pair.
  768. Thus, if only some part (or parts) of the TSi/TSr proposed by the
  769. initiator is (are) acceptable to the responder, most responders
  770. should simply narrow TSi/TSr to an acceptable subset (as described in
  771. the last two paragraphs of Section 2.9), rather than use
  772. SINGLE_PAIR_REQUIRED.
  773. 4.12. Traffic Selectors Violating Own Policy
  774. Section 2.9 describes traffic selector negotiation in great detail.
  775. One aspect of this negotiation that may need some clarification is
  776. that when creating a new SA, the initiator should not propose traffic
  777. selectors that violate its own policy. If this rule is not followed,
  778. valid traffic may be dropped.
  779. This is best illustrated by an example. Suppose that host A has a
  780. policy whose effect is that traffic to 192.0.1.66 is sent via host B
  781. encrypted using Advanced Encryption Standard (AES), and traffic to
  782. all other hosts in 192.0.1.0/24 is also sent via B, but encrypted
  783. using Triple Data Encryption Standard (3DES). Suppose also that host
  784. B accepts any combination of AES and 3DES.
  785. If host A now proposes an SA that uses 3DES, and includes TSr
  786. containing (192.0.1.0-192.0.1.0.255), this will be accepted by host
  787. B. Now, host B can also use this SA to send traffic from 192.0.1.66,
  788. but those packets will be dropped by A since it requires the use of
  789. AES for those traffic. Even if host A creates a new SA only for
  790. 192.0.1.66 that uses AES, host B may freely continue to use the first
  791. SA for the traffic. In this situation, when proposing the SA, host A
  792. should have followed its own policy, and included a TSr containing
  793. ((192.0.1.0-192.0.1.65),(192.0.1.67-192.0.1.255)) instead.
  794. Eronen & Hoffman Informational [Page 21]
  795. RFC 4718 IKEv2 Clarifications October 2006
  796. In general, if (1) the initiator makes a proposal "for traffic X
  797. (TSi/TSr), do SA", and (2) for some subset X' of X, the initiator
  798. does not actually accept traffic X' with SA, and (3) the initiator
  799. would be willing to accept traffic X' with some SA' (!=SA), valid
  800. traffic can be unnecessarily dropped since the responder can apply
  801. either SA or SA' to traffic X'.
  802. (References: "Question about "narrowing" ..." thread, Feb 2005.
  803. "IKEv2 needs a "policy usage mode"..." thread, Feb 2005. "IKEv2
  804. Traffic Selectors?" thread, Feb 2005. "IKEv2 traffic selector
  805. negotiation examples", 2004-08-08.)
  806. 4.13. Traffic Selector Authorization
  807. IKEv2 relies on information in the Peer Authorization Database (PAD)
  808. when determining what kind of IPsec SAs a peer is allowed to create.
  809. This process is described in [RFC4301] Section 4.4.3. When a peer
  810. requests the creation of an IPsec SA with some traffic selectors, the
  811. PAD must contain "Child SA Authorization Data" linking the identity
  812. authenticated by IKEv2 and the addresses permitted for traffic
  813. selectors.
  814. For example, the PAD might be configured so that authenticated
  815. identity "sgw23.example.com" is allowed to create IPsec SAs for
  816. 192.0.2.0/24, meaning this security gateway is a valid
  817. "representative" for these addresses. Host-to-host IPsec requires
  818. similar entries, linking, for example, "fooserver4.example.com" with
  819. 192.0.1.66/32, meaning this identity a valid "owner" or
  820. "representative" of the address in question.
  821. As noted in [RFC4301], "It is necessary to impose these constraints
  822. on creation of child SAs to prevent an authenticated peer from
  823. spoofing IDs associated with other, legitimate peers." In the
  824. example given above, a correct configuration of the PAD prevents
  825. sgw23 from creating IPsec SAs with address 192.0.1.66 and prevents
  826. fooserver4 from creating IPsec SAs with addresses from 192.0.2.0/24.
  827. It is important to note that simply sending IKEv2 packets using some
  828. particular address does not imply a permission to create IPsec SAs
  829. with that address in the traffic selectors. For example, even if
  830. sgw23 would be able to spoof its IP address as 192.0.1.66, it could
  831. not create IPsec SAs matching fooserver4's traffic.
  832. The IKEv2 specification does not specify how exactly IP address
  833. assignment using configuration payloads interacts with the PAD. Our
  834. interpretation is that when a security gateway assigns an address
  835. Eronen & Hoffman Informational [Page 22]
  836. RFC 4718 IKEv2 Clarifications October 2006
  837. using configuration payloads, it also creates a temporary PAD entry
  838. linking the authenticated peer identity and the newly allocated inner
  839. address.
  840. It has been recognized that configuring the PAD correctly may be
  841. difficult in some environments. For instance, if IPsec is used
  842. between a pair of hosts whose addresses are allocated dynamically
  843. using Dynamic Host Configuration Protocol (DHCP), it is extremely
  844. difficult to ensure that the PAD specifies the correct "owner" for
  845. each IP address. This would require a mechanism to securely convey
  846. address assignments from the DHCP server and link them to identities
  847. authenticated using IKEv2.
  848. Due to this limitation, some vendors have been known to configure
  849. their PADs to allow an authenticated peer to create IPsec SAs with
  850. traffic selectors containing the same address that was used for the
  851. IKEv2 packets. In environments where IP spoofing is possible (i.e.,
  852. almost everywhere) this essentially allows any peer to create IPsec
  853. SAs with any traffic selectors. This is not an appropriate or secure
  854. configuration in most circumstances. See [Aura05] for an extensive
  855. discussion about this issue, and the limitations of host-to-host
  856. IPsec in general.
  857. 5. Rekeying and Deleting SAs
  858. 5.1. Rekeying SAs with the CREATE_CHILD_SA Exchange
  859. Continued from Section 4.1 of this document.
  860. NEW-1.3.2 Rekeying IKE_SAs with the CREATE_CHILD_SA Exchange
  861. The CREATE_CHILD_SA request for rekeying an IKE_SA is:
  862. Initiator Responder
  863. ----------- -----------
  864. HDR, SK {SA, Ni, [KEi]} -->
  865. The initiator sends SA offer(s) in the SA payload, a nonce in
  866. the Ni payload, and optionally a Diffie-Hellman value in the KEi
  867. payload.
  868. The CREATE_CHILD_SA response for rekeying an IKE_SA is:
  869. <-- HDR, SK {SA, Nr, [KEr]}
  870. Eronen & Hoffman Informational [Page 23]
  871. RFC 4718 IKEv2 Clarifications October 2006
  872. The responder replies (using the same Message ID to respond)
  873. with the accepted offer in an SA payload, a nonce in the Nr
  874. payload, and, optionally, a Diffie-Hellman value in the KEr
  875. payload.
  876. The new IKE_SA has its message counters set to 0, regardless of
  877. what they were in the earlier IKE_SA. The window size starts at
  878. 1 for any new IKE_SA. The new initiator and responder SPIs are
  879. supplied in the SPI fields of the SA payloads.
  880. NEW-1.3.3 Rekeying CHILD_SAs with the CREATE_CHILD_SA Exchange
  881. The CREATE_CHILD_SA request for rekeying a CHILD_SA is:
  882. Initiator Responder
  883. ----------- -----------
  884. HDR, SK {N(REKEY_SA), [N+], SA,
  885. Ni, [KEi], TSi, TSr} -->
  886. The leading Notify payload of type REKEY_SA identifies the
  887. CHILD_SA being rekeyed, and it contains the SPI that the initiator
  888. expects in the headers of inbound packets. In addition, the
  889. initiator sends SA offer(s) in the SA payload, a nonce in the Ni
  890. payload, optionally a Diffie-Hellman value in the KEi payload,
  891. and the proposed traffic selectors in the TSi and TSr payloads.
  892. The request can also contain Notify payloads that specify
  893. additional details for the CHILD_SA.
  894. The CREATE_CHILD_SA response for rekeying a CHILD_SA is:
  895. <-- HDR, SK {[N+], SA, Nr,
  896. [KEr], TSi, TSr}
  897. The responder replies with the accepted offer in an SA payload,
  898. and a Diffie-Hellman value in the KEr payload if KEi was
  899. included in the request and the selected cryptographic suite
  900. includes that group.
  901. The traffic selectors for traffic to be sent on that SA are
  902. specified in the TS payloads in the response, which may be a
  903. subset of what the initiator of the CHILD_SA proposed.
  904. 5.2. Rekeying the IKE_SA vs. Reauthentication
  905. Rekeying the IKE_SA and reauthentication are different concepts in
  906. IKEv2. Rekeying the IKE_SA establishes new keys for the IKE_SA and
  907. resets the Message ID counters, but it does not authenticate the
  908. parties again (no AUTH or EAP payloads are involved).
  909. Eronen & Hoffman Informational [Page 24]
  910. RFC 4718 IKEv2 Clarifications October 2006
  911. While rekeying the IKE_SA may be important in some environments,
  912. reauthentication (the verification that the parties still have access
  913. to the long-term credentials) is often more important.
  914. IKEv2 does not have any special support for reauthentication.
  915. Reauthentication is done by creating a new IKE_SA from scratch (using
  916. IKE_SA_INIT/IKE_AUTH exchanges, without any REKEY_SA notify
  917. payloads), creating new CHILD_SAs within the new IKE_SA (without
  918. REKEY_SA notify payloads), and finally deleting the old IKE_SA (which
  919. deletes the old CHILD_SAs as well).
  920. This means that reauthentication also establishes new keys for the
  921. IKE_SA and CHILD_SAs. Therefore, while rekeying can be performed
  922. more often than reauthentication, the situation where "authentication
  923. lifetime" is shorter than "key lifetime" does not make sense.
  924. While creation of a new IKE_SA can be initiated by either party
  925. (initiator or responder in the original IKE_SA), the use of EAP
  926. authentication and/or configuration payloads means in practice that
  927. reauthentication has to be initiated by the same party as the
  928. original IKE_SA. IKEv2 base specification does not allow the
  929. responder to request reauthentication in this case; however, this
  930. functionality is added in [ReAuth].
  931. (References: "Reauthentication in IKEv2" thread, Oct/Nov 2004.)
  932. 5.3. SPIs When Rekeying the IKE_SA
  933. Section 2.18 says that "New initiator and responder SPIs are supplied
  934. in the SPI fields". This refers to the SPI fields in the Proposal
  935. structures inside the Security Association (SA) payloads, not the SPI
  936. fields in the IKE header.
  937. (References: Tom Stiemerling's mail "Rekey IKE SA", 2005-01-24.
  938. Geoffrey Huang's reply, 2005-01-24.)
  939. 5.4. SPI When Rekeying a CHILD_SA
  940. Section 3.10.1 says that in REKEY_SA notifications, "The SPI field
  941. identifies the SA being rekeyed."
  942. Since CHILD_SAs always exist in pairs, there are two different SPIs.
  943. The SPI placed in the REKEY_SA notification is the SPI the exchange
  944. initiator would expect in inbound ESP or AH packets (just as in
  945. Delete payloads).
  946. Eronen & Hoffman Informational [Page 25]
  947. RFC 4718 IKEv2 Clarifications October 2006
  948. 5.5. Changing PRFs When Rekeying the IKE_SA
  949. When rekeying the IKE_SA, Section 2.18 says that "SKEYSEED for the
  950. new IKE_SA is computed using SK_d from the existing IKE_SA as
  951. follows:
  952. SKEYSEED = prf(SK_d (old), [g^ir (new)] | Ni | Nr)"
  953. If the old and new IKE_SA selected a different PRF, it is not totally
  954. clear which PRF should be used.
  955. Since the rekeying exchange belongs to the old IKE_SA, it is the old
  956. IKE_SA's PRF that is used. This also follows the principle that the
  957. same key (the old SK_d) should not be used with multiple
  958. cryptographic algorithms.
  959. Note that this may work poorly if the new IKE_SA's PRF has a fixed
  960. key size, since the output of the PRF may not be of the correct size.
  961. This supports our opinion earlier in the document that the use of
  962. PRFs with a fixed key size is a bad idea.
  963. (References: "Changing PRFs when rekeying the IKE_SA" thread, June
  964. 2005.)
  965. 5.6. Deleting vs. Closing SAs
  966. The IKEv2 specification talks about "closing" and "deleting" SAs, but
  967. it is not always clear what exactly is meant. However, other parts
  968. of the specification make it clear that when local state related to a
  969. CHILD_SA is removed, the SA must also be actively deleted with a
  970. Delete payload.
  971. In particular, Section 2.4 says that "If an IKE endpoint chooses to
  972. delete CHILD_SAs, it MUST send Delete payloads to the other end
  973. notifying it of the deletion". Section 1.4 also explains that "ESP
  974. and AH SAs always exist in pairs, with one SA in each direction.
  975. When an SA is closed, both members of the pair MUST be closed."
  976. 5.7. Deleting a CHILD_SA Pair
  977. Section 1.4 describes how to delete SA pairs using the Informational
  978. exchange: "To delete an SA, an INFORMATIONAL exchange with one or
  979. more delete payloads is sent listing the SPIs (as they would be
  980. expected in the headers of inbound packets) of the SAs to be deleted.
  981. The recipient MUST close the designated SAs."
  982. Eronen & Hoffman Informational [Page 26]
  983. RFC 4718 IKEv2 Clarifications October 2006
  984. The "one or more delete payloads" phrase has caused some confusion.
  985. You never send delete payloads for the two sides of an SA in a single
  986. message. If you have many SAs to delete at the same time (such as
  987. the nested example given in that paragraph), you include delete
  988. payloads for the inbound half of each SA in your Informational
  989. exchange.
  990. 5.8. Deleting an IKE_SA
  991. Since IKE_SAs do not exist in pairs, it is not totally clear what the
  992. response message should contain when the request deleted the IKE_SA.
  993. Since there is no information that needs to be sent to the other side
  994. (except that the request was received), an empty Informational
  995. response seems like the most logical choice.
  996. (References: "Question about delete IKE SA" thread, May 2005.)
  997. 5.9. Who is the original initiator of IKE_SA
  998. In the IKEv2 document, "initiator" refers to the party who initiated
  999. the exchange being described, and "original initiator" refers to the
  1000. party who initiated the whole IKE_SA. However, there is some
  1001. potential for confusion because the IKE_SA can be rekeyed by either
  1002. party.
  1003. To clear up this confusion, we propose that "original initiator"
  1004. always refers to the party who initiated the exchange that resulted
  1005. in the current IKE_SA. In other words, if the "original responder"
  1006. starts rekeying the IKE_SA, that party becomes the "original
  1007. initiator" of the new IKE_SA.
  1008. (References: Paul Hoffman's mail "Original initiator in IKEv2",
  1009. 2005-04-21.)
  1010. 5.10. Comparing Nonces
  1011. Section 2.8 about rekeying says that "If redundant SAs are created
  1012. though such a collision, the SA created with the lowest of the four
  1013. nonces used in the two exchanges SHOULD be closed by the endpoint
  1014. that created it."
  1015. Eronen & Hoffman Informational [Page 27]
  1016. RFC 4718 IKEv2 Clarifications October 2006
  1017. Here "lowest" uses an octet-by-octet (lexicographical) comparison
  1018. (instead of, for instance, comparing the nonces as large integers).
  1019. In other words, start by comparing the first octet; if they're equal,
  1020. move to the next octet, and so on. If you reach the end of one
  1021. nonce, that nonce is the lower one.
  1022. (References: "IKEv2 rekeying question" thread, July 2005.)
  1023. 5.11. Exchange Collisions
  1024. Since IKEv2 exchanges can be initiated by both peers, it is possible
  1025. that two exchanges affecting the same SA partly overlap. This can
  1026. lead to a situation where the SA state information is temporarily not
  1027. synchronized, and a peer can receive a request it cannot process in a
  1028. normal fashion. Some of these corner cases are discussed in the
  1029. specification, some are not.
  1030. Obviously, using a window size greater than one leads to infinitely
  1031. more complex situations, especially if requests are processed out of
  1032. order. In this section, we concentrate on problems that can arise
  1033. even with window size 1.
  1034. (References: "IKEv2: invalid SPI in DELETE payload" thread, Dec 2005/
  1035. Jan 2006. "Problem with exchanges collisions" thread, Dec 2005.)
  1036. 5.11.1. Simultaneous CHILD_SA Close
  1037. Probably the simplest case happens if both peers decide to close the
  1038. same CHILD_SA pair at the same time:
  1039. Host A Host B
  1040. -------- --------
  1041. send req1: D(SPIa) -->
  1042. <-- send req2: D(SPIb)
  1043. --> recv req1
  1044. <-- send resp1: ()
  1045. recv resp1
  1046. recv req2
  1047. send resp2: () -->
  1048. --> recv resp2
  1049. This case is described in Section 1.4 and is handled by omitting the
  1050. Delete payloads from the response messages.
  1051. Eronen & Hoffman Informational [Page 28]
  1052. RFC 4718 IKEv2 Clarifications October 2006
  1053. 5.11.2. Simultaneous IKE_SA Close
  1054. Both peers can also decide to close the IKE_SA at the same time. The
  1055. desired end result is obvious; however, in certain cases the final
  1056. exchanges may not be fully completed.
  1057. Host A Host B
  1058. -------- --------
  1059. send req1: D() -->
  1060. <-- send req2: D()
  1061. --> recv req1
  1062. At this point, host B should reply as usual (with empty Informational
  1063. response), close the IKE_SA, and stop retransmitting req2. This is
  1064. because once host A receives resp1, it may not be able to reply any
  1065. longer. The situation is symmetric, so host A should behave the same
  1066. way.
  1067. Host A Host B
  1068. -------- --------
  1069. <-- send resp1: ()
  1070. send resp2: ()
  1071. Even if neither resp1 nor resp2 ever arrives, the end result is still
  1072. correct: the IKE_SA is gone. The same happens if host A never
  1073. receives req2.
  1074. 5.11.3. Simultaneous CHILD_SA Rekeying
  1075. Another case that is described in the specification is simultaneous
  1076. rekeying. Section 2.8 says
  1077. "If the two ends have the same lifetime policies, it is possible
  1078. that both will initiate a rekeying at the same time (which will
  1079. result in redundant SAs). To reduce the probability of this
  1080. happening, the timing of rekeying requests SHOULD be jittered
  1081. (delayed by a random amount of time after the need for rekeying is
  1082. noticed).
  1083. This form of rekeying may temporarily result in multiple similar
  1084. SAs between the same pairs of nodes. When there are two SAs
  1085. eligible to receive packets, a node MUST accept incoming packets
  1086. through either SA. If redundant SAs are created though such a
  1087. collision, the SA created with the lowest of the four nonces used
  1088. in the two exchanges SHOULD be closed by the endpoint that created
  1089. it."
  1090. Eronen & Hoffman Informational [Page 29]
  1091. RFC 4718 IKEv2 Clarifications October 2006
  1092. However, a better explanation on what impact this has on
  1093. implementations is needed. Assume that hosts A and B have an
  1094. existing IPsec SA pair with SPIs (SPIa1,SPIb1), and both start
  1095. rekeying it at the same time:
  1096. Host A Host B
  1097. -------- --------
  1098. send req1: N(REKEY_SA,SPIa1),
  1099. SA(..,SPIa2,..),Ni1,.. -->
  1100. <-- send req2: N(REKEY_SA,SPIb1),
  1101. SA(..,SPIb2,..),Ni2,..
  1102. recv req2 <--
  1103. At this point, A knows there is a simultaneous rekeying going on.
  1104. However, it cannot yet know which of the exchanges will have the
  1105. lowest nonce, so it will just note the situation and respond as
  1106. usual.
  1107. send resp2: SA(..,SPIa3,..),Nr1,.. -->
  1108. --> recv req1
  1109. Now B also knows that simultaneous rekeying is going on. Similarly
  1110. as host A, it has to respond as usual.
  1111. <-- send resp1: SA(..,SPIb3,..),Nr2,..
  1112. recv resp1 <--
  1113. --> recv resp2
  1114. At this point, there are three CHILD_SA pairs between A and B (the
  1115. old one and two new ones). A and B can now compare the nonces.
  1116. Suppose that the lowest nonce was Nr1 in message resp2; in this case,
  1117. B (the sender of req2) deletes the redundant new SA, and A (the node
  1118. that initiated the surviving rekeyed SA) deletes the old one.
  1119. send req3: D(SPIa1) -->
  1120. <-- send req4: D(SPIb2)
  1121. --> recv req3
  1122. <-- send resp4: D(SPIb1)
  1123. recv req4 <--
  1124. send resp4: D(SPIa3) -->
  1125. The rekeying is now finished.
  1126. However, there is a second possible sequence of events that can
  1127. happen if some packets are lost in the network, resulting in
  1128. retransmissions. The rekeying begins as usual, but A's first packet
  1129. (req1) is lost.
  1130. Eronen & Hoffman Informational [Page 30]
  1131. RFC 4718 IKEv2 Clarifications October 2006
  1132. Host A Host B
  1133. -------- --------
  1134. send req1: N(REKEY_SA,SPIa1),
  1135. SA(..,SPIa2,..),Ni1,.. --> (lost)
  1136. <-- send req2: N(REKEY_SA,SPIb1),
  1137. SA(..,SPIb2,..),Ni2,..
  1138. recv req2 <--
  1139. send resp2: SA(..,SPIa3,..),Nr1,.. -->
  1140. --> recv resp2
  1141. <-- send req3: D(SPIb1)
  1142. recv req3 <--
  1143. send resp3: D(SPIa1) -->
  1144. --> recv resp3
  1145. From B's point of view, the rekeying is now completed, and since it
  1146. has not yet received A's req1, it does not even know that these was
  1147. simultaneous rekeying. However, A will continue retransmitting the
  1148. message, and eventually it will reach B.
  1149. resend req1 -->
  1150. --> recv req1
  1151. What should B do in this point? To B, it looks like A is trying to
  1152. rekey an SA that no longer exists; thus failing the request with
  1153. something non-fatal such as NO_PROPOSAL_CHOSEN seems like a
  1154. reasonable approach.
  1155. <-- send resp1: N(NO_PROPOSAL_CHOSEN)
  1156. recv resp1 <--
  1157. When A receives this error, it already knows there was simultaneous
  1158. rekeying, so it can ignore the error message.
  1159. 5.11.4. Simultaneous IKE_SA Rekeying
  1160. Probably the most complex case occurs when both peers try to rekey
  1161. the IKE_SA at the same time. Basically, the text in Section 2.8
  1162. applies to this case as well; however, it is important to ensure that
  1163. the CHILD_SAs are inherited by the right IKE_SA.
  1164. The case where both endpoints notice the simultaneous rekeying works
  1165. the same way as with CHILD_SAs. After the CREATE_CHILD_SA exchanges,
  1166. three IKE_SAs exist between A and B; the one containing the lowest
  1167. nonce inherits the CHILD_SAs.
  1168. However, there is a twist to the other case where one rekeying
  1169. finishes first:
  1170. Eronen & Hoffman Informational [Page 31]
  1171. RFC 4718 IKEv2 Clarifications October 2006
  1172. Host A Host B
  1173. -------- --------
  1174. send req1:
  1175. SA(..,SPIa1,..),Ni1,.. -->
  1176. <-- send req2: SA(..,SPIb1,..),Ni2,..
  1177. --> recv req1
  1178. <-- send resp1: SA(..,SPIb2,..),Nr2,..
  1179. recv resp1 <--
  1180. send req3: D() -->
  1181. --> recv req3
  1182. At this point, host B sees a request to close the IKE_SA. There's
  1183. not much more to do than to reply as usual. However, at this point
  1184. host B should stop retransmitting req2, since once host A receives
  1185. resp3, it will delete all the state associated with the old IKE_SA
  1186. and will not be able to reply to it.
  1187. <-- send resp3: ()
  1188. 5.11.5. Closing and Rekeying a CHILD_SA
  1189. A case similar to simultaneous rekeying can occur if one peer decides
  1190. to close an SA and the other peer tries to rekey it:
  1191. Host A Host B
  1192. -------- --------
  1193. send req1: D(SPIa) -->
  1194. <-- send req2: N(REKEY_SA,SPIb),SA,..
  1195. --> recv req1
  1196. At this point, host B notices that host A is trying to close an SA
  1197. that host B is currently rekeying. Replying as usual is probably the
  1198. best choice:
  1199. <-- send resp1: D(SPIb)
  1200. Depending on in which order req2 and resp1 arrive, host A sees either
  1201. a request to rekey an SA that it is currently closing, or a request
  1202. to rekey an SA that does not exist. In both cases,
  1203. NO_PROPOSAL_CHOSEN is probably fine.
  1204. recv req2
  1205. recv resp1
  1206. send resp2: N(NO_PROPOSAL_CHOSEN) -->
  1207. --> recv resp2
  1208. Eronen & Hoffman Informational [Page 32]
  1209. RFC 4718 IKEv2 Clarifications October 2006
  1210. 5.11.6. Closing a New CHILD_SA
  1211. Yet another case occurs when host A creates a CHILD_SA pair, but soon
  1212. thereafter host B decides to delete it (possible because its policy
  1213. changed):
  1214. Host A Host B
  1215. -------- --------
  1216. send req1: [N(REKEY_SA,SPIa1)],
  1217. SA(..,SPIa2,..),.. -->
  1218. --> recv req1
  1219. (lost) <-- send resp1: SA(..,SPIb2,..),..
  1220. <-- send req2: D(SPIb2)
  1221. recv req2
  1222. At this point, host A has not yet received message resp1 (and is
  1223. retransmitting message req1), so it does not recognize SPIb in
  1224. message req2. What should host A do?
  1225. One option would be to reply with an empty Informational response.
  1226. However, this same reply would also be sent if host A has received
  1227. resp1, but has already sent a new request to delete the SA that was
  1228. just created. This would lead to a situation where the peers are no
  1229. longer in sync about which SAs exist between them. However, host B
  1230. would eventually notice that the other half of the CHILD_SA pair has
  1231. not been deleted. Section 1.4 describes this case and notes that "a
  1232. node SHOULD regard half-closed connections as anomalous and audit
  1233. their existence should they persist", and continues that "if
  1234. connection state becomes sufficiently messed up, a node MAY close the
  1235. IKE_SA".
  1236. Another solution that has been proposed is to reply with an
  1237. INVALID_SPI notification that contains SPIb. This would explicitly
  1238. tell host B that the SA was not deleted, so host B could try deleting
  1239. it again later. However, this usage is not part of the IKEv2
  1240. specification and would not be in line with normal use of the
  1241. INVALID_SPI notification where the data field contains the SPI the
  1242. recipient of the notification would put in outbound packets.
  1243. Yet another solution would be to ignore req2 at this time and wait
  1244. until we have received resp1. However, this alternative has not been
  1245. fully analyzed at this time; in general, ignoring valid requests is
  1246. always a bit dangerous, because both endpoints could do it, leading
  1247. to a deadlock.
  1248. This document recommends the first alternative.
  1249. Eronen & Hoffman Informational [Page 33]
  1250. RFC 4718 IKEv2 Clarifications October 2006
  1251. 5.11.7. Rekeying a New CHILD_SA
  1252. Yet another case occurs when a CHILD_SA is rekeyed soon after it has
  1253. been created:
  1254. Host A Host B
  1255. -------- --------
  1256. send req1: [N(REKEY_SA,SPIa1)],
  1257. SA(..,SPIa2,..),.. -->
  1258. (lost) <-- send resp1: SA(..,SPIb2,..),..
  1259. <-- send req2: N(REKEY_SA,SPIb2),
  1260. SA(..,SPIb3,..),..
  1261. recv req2 <--
  1262. To host A, this looks like a request to rekey an SA that does not
  1263. exist. Like in the simultaneous rekeying case, replying with
  1264. NO_PROPOSAL_CHOSEN is probably reasonable:
  1265. send resp2: N(NO_PROPOSAL_CHOSEN) -->
  1266. recv resp1
  1267. 5.11.8. Collisions with IKE_SA Rekeying
  1268. Another set of cases occurs when one peer starts rekeying the IKE_SA
  1269. at the same time the other peer starts creating, rekeying, or closing
  1270. a CHILD_SA. Suppose that host B starts creating a CHILD_SA, and soon
  1271. after, host A starts rekeying the IKE_SA:
  1272. Host A Host B
  1273. -------- --------
  1274. <-- send req1: SA,Ni1,TSi,TSr
  1275. send req2: SA,Ni2,.. -->
  1276. --> recv req2
  1277. What should host B do at this point? Replying as usual would seem
  1278. like a reasonable choice:
  1279. <-- send resp2: SA,Ni2,..
  1280. recv resp2 <--
  1281. send req3: D() -->
  1282. --> recv req3
  1283. Now, a problem arises: If host B now replies normally with an empty
  1284. Informational response, this will cause host A to delete state
  1285. associated with the IKE_SA. This means host B should stop
  1286. retransmitting req1. However, host B cannot know whether or not host
  1287. A has received req1. If host A did receive it, it will move the
  1288. Eronen & Hoffman Informational [Page 34]
  1289. RFC 4718 IKEv2 Clarifications October 2006
  1290. CHILD_SA to the new IKE_SA as usual, and the state information will
  1291. then be out of sync.
  1292. It seems this situation is tricky to handle correctly. Our proposal
  1293. is as follows: if a host receives a request to rekey the IKE_SA when
  1294. it has CHILD_SAs in "half-open" state (currently being created or
  1295. rekeyed), it should reply with NO_PROPOSAL_CHOSEN. If a host
  1296. receives a request to create or rekey a CHILD_SA after it has started
  1297. rekeying the IKE_SA, it should reply with NO_ADDITIONAL_SAS.
  1298. The case where CHILD_SAs are being closed is even worse. Our
  1299. recommendation is that if a host receives a request to rekey the
  1300. IKE_SA when it has CHILD_SAs in "half-closed" state (currently being
  1301. closed), it should reply with NO_PROPOSAL_CHOSEN. And if a host
  1302. receives a request to close a CHILD_SA after it has started rekeying
  1303. the IKE_SA, it should reply with an empty Informational response.
  1304. This ensures that at least the other peer will eventually notice that
  1305. the CHILD_SA is still in "half-closed" state and will start a new
  1306. IKE_SA from scratch.
  1307. 5.11.9. Closing and Rekeying the IKE_SA
  1308. The final case considered in this section occurs if one peer decides
  1309. to close the IKE_SA while the other peer tries to rekey it.
  1310. Host A Host B
  1311. -------- --------
  1312. send req1: SA(..,SPIa1,..),Ni1 -->
  1313. <-- send req2: D()
  1314. --> recv req1
  1315. recv req2 <--
  1316. At this point, host B should probably reply with NO_PROPOSAL_CHOSEN,
  1317. and host A should reply as usual, close the IKE_SA, and stop
  1318. retransmitting req1.
  1319. <-- send resp1: N(NO_PROPOSAL_CHOSEN)
  1320. send resp2: ()
  1321. If host A wants to continue communication with B, it can now start a
  1322. new IKE_SA.
  1323. 5.11.10. Summary
  1324. If a host receives a request to rekey:
  1325. o a CHILD_SA pair that the host is currently trying to close: reply
  1326. with NO_PROPOSAL_CHOSEN.
  1327. Eronen & Hoffman Informational [Page 35]
  1328. RFC 4718 IKEv2 Clarifications October 2006
  1329. o a CHILD_SA pair that the host is currently rekeying: reply as
  1330. usual, but prepare to close redundant SAs later based on the
  1331. nonces.
  1332. o a CHILD_SA pair that does not exist: reply with
  1333. NO_PROPOSAL_CHOSEN.
  1334. o the IKE_SA, and the host is currently rekeying the IKE_SA: reply
  1335. as usual, but prepare to close redundant SAs and move inherited
  1336. CHILD_SAs later based on the nonces.
  1337. o the IKE_SA, and the host is currently creating, rekeying, or
  1338. closing a CHILD_SA: reply with NO_PROPOSAL_CHOSEN.
  1339. o the IKE_SA, and the host is currently trying to close the IKE_SA:
  1340. reply with NO_PROPOSAL_CHOSEN.
  1341. If a host receives a request to close:
  1342. o a CHILD_SA pair that the host is currently trying to close: reply
  1343. without Delete payloads.
  1344. o a CHILD_SA pair that the host is currently rekeying: reply as
  1345. usual, with Delete payload.
  1346. o a CHILD_SA pair that does not exist: reply without Delete
  1347. payloads.
  1348. o the IKE_SA, and the host is currently rekeying the IKE_SA: reply
  1349. as usual, and forget about our own rekeying request.
  1350. o the IKE_SA, and the host is currently trying to close the IKE_SA:
  1351. reply as usual, and forget about our own close request.
  1352. If a host receives a request to create or rekey a CHILD_SA when it is
  1353. currently rekeying the IKE_SA: reply with NO_ADDITIONAL_SAS.
  1354. If a host receives a request to delete a CHILD_SA when it is
  1355. currently rekeying the IKE_SA: reply without Delete payloads.
  1356. 5.12. Diffie-Hellman and Rekeying the IKE_SA
  1357. There has been some confusion whether doing a new Diffie-Hellman
  1358. exchange is mandatory when the IKE_SA is rekeyed.
  1359. It seems that this case is allowed by the IKEv2 specification.
  1360. Section 2.18 shows the Diffie-Hellman term (g^ir) in brackets.
  1361. Section 3.3.3 does not contradict this when it says that including
  1362. Eronen & Hoffman Informational [Page 36]
  1363. RFC 4718 IKEv2 Clarifications October 2006
  1364. the D-H transform is mandatory: although including the transform is
  1365. mandatory, it can contain the value "NONE".
  1366. However, having the option to skip the Diffie-Hellman exchange when
  1367. rekeying the IKE_SA does not add useful functionality to the
  1368. protocol. The main purpose of rekeying the IKE_SA is to ensure that
  1369. the compromise of old keying material does not provide information
  1370. about the current keys, or vice versa. This requires performing the
  1371. Diffie-Hellman exchange when rekeying. Furthermore, it is likely
  1372. that this option would have been removed from the protocol as
  1373. unnecessary complexity had it been discussed earlier.
  1374. Given this, we recommend that implementations should have a hard-
  1375. coded policy that requires performing a new Diffie-Hellman exchange
  1376. when rekeying the IKE_SA. In other words, the initiator should not
  1377. propose the value "NONE" for the D-H transform, and the responder
  1378. should not accept such a proposal. This policy also implies that a
  1379. successful exchange rekeying the IKE_SA always includes the KEi/KEr
  1380. payloads.
  1381. (References: "Rekeying IKE_SAs with the CREATE_CHILD_SA exhange"
  1382. thread, Oct 2005. "Comments of
  1383. draft-eronen-ipsec-ikev2-clarifications-02.txt" thread, Apr 2005.)
  1384. 6. Configuration Payloads
  1385. 6.1. Assigning IP Addresses
  1386. Section 2.9 talks about traffic selector negotiation and mentions
  1387. that "In support of the scenario described in section 1.1.3, an
  1388. initiator may request that the responder assign an IP address and
  1389. tell the initiator what it is."
  1390. This sentence is correct, but its placement is slightly confusing.
  1391. IKEv2 does allow the initiator to request assignment of an IP address
  1392. from the responder, but this is done using configuration payloads,
  1393. not traffic selector payloads. An address in a TSi payload in a
  1394. response does not mean that the responder has assigned that address
  1395. to the initiator; it only means that if packets matching these
  1396. traffic selectors are sent by the initiator, IPsec processing can be
  1397. performed as agreed for this SA. The TSi payload itself does not
  1398. give the initiator permission to configure the initiator's TCP/IP
  1399. stack with the address and use it as its source address.
  1400. In other words, IKEv2 does not have two different mechanisms for
  1401. assigning addresses, but only one: configuration payloads. In the
  1402. scenario described in Section 1.1.3, both configuration and traffic
  1403. selector payloads are usually included in the same message, and they
  1404. Eronen & Hoffman Informational [Page 37]
  1405. RFC 4718 IKEv2 Clarifications October 2006
  1406. often contain the same information in the response message (see
  1407. Section 6.3 of this document for some examples). However, their
  1408. semantics are still different.
  1409. 6.2. Requesting any INTERNAL_IP4/IP6_ADDRESS
  1410. When describing the INTERNAL_IP4/IP6_ADDRESS attributes, Section
  1411. 3.15.1 says that "In a request message, the address specified is a
  1412. requested address (or zero if no specific address is requested)".
  1413. The question here is whether "zero" means an address "0.0.0.0" or a
  1414. zero-length string.
  1415. Earlier, the same section also says that "If an attribute in the
  1416. CFG_REQUEST Configuration Payload is not zero-length, it is taken as
  1417. a suggestion for that attribute". Also, the table of configuration
  1418. attributes shows that the length of INTERNAL_IP4_ADDRESS is either "0
  1419. or 4 octets", and likewise, INTERNAL_IP6_ADDRESS is either "0 or 17
  1420. octets".
  1421. Thus, if the client does not request a specific address, it includes
  1422. a zero-length INTERNAL_IP4/IP6_ADDRESS attribute, not an attribute
  1423. containing an all-zeroes address. The example in 2.19 is thus
  1424. incorrect, since it shows the attribute as
  1425. "INTERNAL_ADDRESS(0.0.0.0)".
  1426. However, since the value is only a suggestion, implementations are
  1427. recommended to ignore suggestions they do not accept; or in other
  1428. words, to treat the same way a zero-length INTERNAL_IP4_ADDRESS,
  1429. "0.0.0.0", and any other addresses the implementation does not
  1430. recognize as a reasonable suggestion.
  1431. 6.3. INTERNAL_IP4_SUBNET/INTERNAL_IP6_SUBNET
  1432. Section 3.15.1 describes the INTERNAL_IP4_SUBNET as "The protected
  1433. sub-networks that this edge-device protects. This attribute is made
  1434. up of two fields: the first is an IP address and the second is a
  1435. netmask. Multiple sub-networks MAY be requested. The responder MAY
  1436. respond with zero or more sub-network attributes."
  1437. INTERNAL_IP6_SUBNET is defined in a similar manner.
  1438. This raises two questions: first, since this information is usually
  1439. included in the TSr payload, what functionality does this attribute
  1440. add? And second, what does this attribute mean in CFG_REQUESTs?
  1441. For the first question, there seem to be two sensible
  1442. interpretations. Clearly TSr (in IKE_AUTH or CREATE_CHILD_SA
  1443. response) indicates which subnets are accessible through the SA that
  1444. was just created.
  1445. Eronen & Hoffman Informational [Page 38]
  1446. RFC 4718 IKEv2 Clarifications October 2006
  1447. The first interpretation of the INTERNAL_IP4/6_SUBNET attributes is
  1448. that they indicate additional subnets that can be reached through
  1449. this gateway, but need a separate SA. According to this
  1450. interpretation, the INTERNAL_IP4/6_SUBNET attributes are useful
  1451. mainly when they contain addresses not included in TSr.
  1452. The second interpretation is that the INTERNAL_IP4/6_SUBNET
  1453. attributes express the gateway's policy about what traffic should be
  1454. sent through the gateway. The client can choose whether other
  1455. traffic (covered by TSr, but not in INTERNAL_IP4/6_SUBNET) is sent
  1456. through the gateway or directly to the destination. According to
  1457. this interpretation, the attributes are useful mainly when TSr
  1458. contains addresses not included in the INTERNAL_IP4/6_SUBNET
  1459. attributes.
  1460. It turns out that these two interpretations are not incompatible, but
  1461. rather two sides of the same principle: traffic to the addresses
  1462. listed in the INTERNAL_IP4/6_SUBNET attributes should be sent via
  1463. this gateway. If there are no existing IPsec SAs whose traffic
  1464. selectors cover the address in question, new SAs have to be created.
  1465. A couple of examples are given below. For instance, if there are two
  1466. subnets, 192.0.1.0/26 and 192.0.2.0/24, and the client's request
  1467. contains the following:
  1468. CP(CFG_REQUEST) =
  1469. INTERNAL_IP4_ADDRESS()
  1470. TSi = (0, 0-65535, 0.0.0.0-255.255.255.255)
  1471. TSr = (0, 0-65535, 0.0.0.0-255.255.255.255)
  1472. Then a valid response could be the following (in which TSr and
  1473. INTERNAL_IP4_SUBNET contain the same information):
  1474. CP(CFG_REPLY) =
  1475. INTERNAL_IP4_ADDRESS(192.0.1.234)
  1476. INTERNAL_IP4_SUBNET(192.0.1.0/255.255.255.192)
  1477. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  1478. TSi = (0, 0-65535, 192.0.1.234-192.0.1.234)
  1479. TSr = ((0, 0-65535, 192.0.1.0-192.0.1.63),
  1480. (0, 0-65535, 192.0.2.0-192.0.2.255))
  1481. In these cases, the INTERNAL_IP4_SUBNET does not really carry any
  1482. useful information. Another possible reply would have been this:
  1483. CP(CFG_REPLY) =
  1484. INTERNAL_IP4_ADDRESS(192.0.1.234)
  1485. INTERNAL_IP4_SUBNET(192.0.1.0/255.255.255.192)
  1486. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  1487. Eronen & Hoffman Informational [Page 39]
  1488. RFC 4718 IKEv2 Clarifications October 2006
  1489. TSi = (0, 0-65535, 192.0.1.234-192.0.1.234)
  1490. TSr = (0, 0-65535, 0.0.0.0-255.255.255.255)
  1491. This would mean that the client can send all its traffic through the
  1492. gateway, but the gateway does not mind if the client sends traffic
  1493. not included by INTERNAL_IP4_SUBNET directly to the destination
  1494. (without going through the gateway).
  1495. A different situation arises if the gateway has a policy that
  1496. requires the traffic for the two subnets to be carried in separate
  1497. SAs. Then a response like this would indicate to the client that if
  1498. it wants access to the second subnet, it needs to create a separate
  1499. SA:
  1500. CP(CFG_REPLY) =
  1501. INTERNAL_IP4_ADDRESS(192.0.1.234)
  1502. INTERNAL_IP4_SUBNET(192.0.1.0/255.255.255.192)
  1503. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  1504. TSi = (0, 0-65535, 192.0.1.234-192.0.1.234)
  1505. TSr = (0, 0-65535, 192.0.1.0-192.0.1.63)
  1506. INTERNAL_IP4_SUBNET can also be useful if the client's TSr included
  1507. only part of the address space. For instance, if the client requests
  1508. the following:
  1509. CP(CFG_REQUEST) =
  1510. INTERNAL_IP4_ADDRESS()
  1511. TSi = (0, 0-65535, 0.0.0.0-255.255.255.255)
  1512. TSr = (0, 0-65535, 192.0.2.155-192.0.2.155)
  1513. Then the gateway's reply could be this:
  1514. CP(CFG_REPLY) =
  1515. INTERNAL_IP4_ADDRESS(192.0.1.234)
  1516. INTERNAL_IP4_SUBNET(192.0.1.0/255.255.255.192)
  1517. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  1518. TSi = (0, 0-65535, 192.0.1.234-192.0.1.234)
  1519. TSr = (0, 0-65535, 192.0.2.155-192.0.2.155)
  1520. It is less clear what the attributes mean in CFG_REQUESTs, and
  1521. whether other lengths than zero make sense in this situation (but for
  1522. INTERNAL_IP6_SUBNET, zero length is not allowed at all!). This
  1523. document recommends that implementations should not include
  1524. INTERNAL_IP4_SUBNET or INTERNAL_IP6_SUBNET attributes in
  1525. CFG_REQUESTs.
  1526. For the IPv4 case, this document recommends using only netmasks
  1527. consisting of some amount of "1" bits followed by "0" bits; for
  1528. Eronen & Hoffman Informational [Page 40]
  1529. RFC 4718 IKEv2 Clarifications October 2006
  1530. instance, "255.0.255.0" would not be a valid netmask for
  1531. INTERNAL_IP4_SUBNET.
  1532. It is also worthwhile to note that the contents of the INTERNAL_IP4/
  1533. 6_SUBNET attributes do not imply link boundaries. For instance, a
  1534. gateway providing access to a large company intranet using addresses
  1535. from the 10.0.0.0/8 block can send a single INTERNAL_IP4_SUBNET
  1536. attribute (10.0.0.0/255.0.0.0) even if the intranet has hundreds of
  1537. routers and separate links.
  1538. (References: Tero Kivinen's mail "Intent of couple of attributes in
  1539. Configuration Payload in IKEv2?", 2004-11-19. Srinivasa Rao
  1540. Addepalli's mail "INTERNAL_IP4_SUBNET and INTERNAL_IP6_SUBNET in
  1541. IKEv2", 2004-09-10. Yoav Nir's mail "Re: New I-D: IKEv2
  1542. Clarifications and Implementation Guidelines", 2005-02-07.
  1543. "Clarifications open issue: INTERNAL_IP4_SUBNET/NETMASK" thread,
  1544. April 2005.)
  1545. 6.4. INTERNAL_IP4_NETMASK
  1546. Section 3.15.1 defines the INTERNAL_IP4_NETMASK attribute and says
  1547. that "The internal network's netmask. Only one netmask is allowed in
  1548. the request and reply messages (e.g., 255.255.255.0) and it MUST be
  1549. used only with an INTERNAL_IP4_ADDRESS attribute".
  1550. However, it is not clear what exactly this attribute means, as the
  1551. concept of "netmask" is not very well defined for point-to-point
  1552. links (unlike multi-access links, where it means "you can reach hosts
  1553. inside this netmask directly using layer 2, instead of sending
  1554. packets via a router"). Even if the operating system's TCP/IP stack
  1555. requires a netmask to be configured, for point-to-point links it
  1556. could be just set to 255.255.255.255. So, why is this information
  1557. sent in IKEv2?
  1558. One possible interpretation would be that the host is given a whole
  1559. block of IP addresses instead of a single address. This is also what
  1560. Framed-IP-Netmask does in [RADIUS], the IPCP "subnet mask" extension
  1561. does in PPP [IPCPSubnet], and the prefix length in the IPv6 Framed-
  1562. IPv6-Prefix attribute does in [RADIUS6]. However, nothing in the
  1563. specification supports this interpretation, and discussions on the
  1564. IPsec WG mailing list have confirmed it was not intended. Section
  1565. 3.15.1 also says that multiple addresses are assigned using multiple
  1566. INTERNAL_IP4/6_ADDRESS attributes.
  1567. Currently, this document's interpretation is the following:
  1568. INTERNAL_IP4_NETMASK in a CFG_REPLY means roughly the same thing as
  1569. INTERNAL_IP4_SUBNET containing the same information ("send traffic to
  1570. these addresses through me"), but also implies a link boundary. For
  1571. Eronen & Hoffman Informational [Page 41]
  1572. RFC 4718 IKEv2 Clarifications October 2006
  1573. instance, the client could use its own address and the netmask to
  1574. calculate the broadcast address of the link. (Whether the gateway
  1575. will actually deliver broadcast packets to other VPN clients and/or
  1576. other nodes connected to this link is another matter.)
  1577. An empty INTERNAL_IP4_NETMASK attribute can be included in a
  1578. CFG_REQUEST to request this information (although the gateway can
  1579. send the information even when not requested). However, it seems
  1580. that non-empty values for this attribute do not make sense in
  1581. CFG_REQUESTs.
  1582. Fortunately, Section 4 clearly says that a minimal implementation
  1583. does not need to include or understand the INTERNAL_IP4_NETMASK
  1584. attribute, and thus this document recommends that implementations
  1585. should not use the INTERNAL_IP4_NETMASK attribute or assume that the
  1586. other peer supports it.
  1587. (References: Charlie Kaufman's mail "RE: Proposed Last Call based
  1588. revisions to IKEv2", 2004-05-27. Email discussion with Tero Kivinen,
  1589. Jan 2005. Yoav Nir's mail "Re: New I-D: IKEv2 Clarifications and
  1590. Implementation Guidelines", 2005-02-07. "Clarifications open issue:
  1591. INTERNAL_IP4_SUBNET/NETMASK" thread, April 2005.)
  1592. 6.5. Configuration Payloads for IPv6
  1593. IKEv2 also defines configuration payloads for IPv6. However, they
  1594. are based on the corresponding IPv4 payloads and do not fully follow
  1595. the "normal IPv6 way of doing things".
  1596. A client can be assigned an IPv6 address using the
  1597. INTERNAL_IP6_ADDRESS configuration payload. A minimal exchange could
  1598. look like this:
  1599. CP(CFG_REQUEST) =
  1600. INTERNAL_IP6_ADDRESS()
  1601. INTERNAL_IP6_DNS()
  1602. TSi = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  1603. TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  1604. CP(CFG_REPLY) =
  1605. INTERNAL_IP6_ADDRESS(2001:DB8:0:1:2:3:4:5/64)
  1606. INTERNAL_IP6_DNS(2001:DB8:99:88:77:66:55:44)
  1607. TSi = (0, 0-65535, 2001:DB8:0:1:2:3:4:5 - 2001:DB8:0:1:2:3:4:5)
  1608. TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  1609. In particular, IPv6 stateless autoconfiguration or router
  1610. advertisement messages are not used; neither is neighbor discovery.
  1611. Eronen & Hoffman Informational [Page 42]
  1612. RFC 4718 IKEv2 Clarifications October 2006
  1613. The client can also send a non-empty INTERNAL_IP6_ADDRESS attribute
  1614. in the CFG_REQUEST to request a specific address or interface
  1615. identifier. The gateway first checks if the specified address is
  1616. acceptable, and if it is, returns that one. If the address was not
  1617. acceptable, the gateway will attempt to use the interface identifier
  1618. with some other prefix; if even that fails, the gateway will select
  1619. another interface identifier.
  1620. The INTERNAL_IP6_ADDRESS attribute also contains a prefix length
  1621. field. When used in a CFG_REPLY, this corresponds to the
  1622. INTERNAL_IP4_NETMASK attribute in the IPv4 case (and indeed, was
  1623. called INTERNAL_IP6_NETMASK in earlier versions of the IKEv2 draft).
  1624. See the previous section for more details.
  1625. While this approach to configuring IPv6 addresses is reasonably
  1626. simple, it has some limitations: IPsec tunnels configured using IKEv2
  1627. are not fully-featured "interfaces" in the IPv6 addressing
  1628. architecture [IPv6Addr] sense. In particular, they do not
  1629. necessarily have link-local addresses, and this may complicate the
  1630. use of protocols that assume them, such as [MLDv2]. (Whether they
  1631. are called "interfaces" in some particular operating system is a
  1632. different issue.)
  1633. (References: "VPN remote host configuration IPv6 ?" thread, May 2004.
  1634. "Clarifications open issue: INTERNAL_IP4_SUBNET/NETMASK" thread,
  1635. April 2005.)
  1636. 6.6. INTERNAL_IP6_NBNS
  1637. Section 3.15.1 defines the INTERNAL_IP6_NBNS attribute for sending
  1638. the IPv6 address of NetBIOS name servers.
  1639. However, NetBIOS is not defined for IPv6 and probably never will be.
  1640. Thus, this attribute most likely does not make much sense.
  1641. (Pointed out by Bernard Aboba in the IP Configuration Security (ICOS)
  1642. BoF at IETF62.)
  1643. 6.7. INTERNAL_ADDRESS_EXPIRY
  1644. Section 3.15.1 defines the INTERNAL_ADDRESS_EXPIRY attribute as
  1645. "Specifies the number of seconds that the host can use the internal
  1646. IP address. The host MUST renew the IP address before this expiry
  1647. time. Only one of these attributes MAY be present in the reply."
  1648. Expiry times and explicit renewals are primarily useful in
  1649. environments like DHCP, where the server cannot reliably know when
  1650. Eronen & Hoffman Informational [Page 43]
  1651. RFC 4718 IKEv2 Clarifications October 2006
  1652. the client has gone away. However, in IKEv2 this is known, and the
  1653. gateway can simply free the address when the IKE_SA is deleted.
  1654. Also, Section 4 says that supporting renewals is not mandatory.
  1655. Given that this functionality is usually not needed, we recommend
  1656. that gateways should not send the INTERNAL_ADDRESS_EXPIRY attribute.
  1657. (And since this attribute does not seem to make much sense for
  1658. CFG_REQUESTs, clients should not send it either.)
  1659. Note that according to Section 4, clients are required to understand
  1660. INTERNAL_ADDRESS_EXPIRY if they receive it. A minimum implementation
  1661. would use the value to limit the lifetime of the IKE_SA.
  1662. (References: Tero Kivinen's mail "Comments of
  1663. draft-eronen-ipsec-ikev2-clarifications-02.txt", 2005-04-05.
  1664. "Questions about internal address" thread, April 2005.)
  1665. 6.8. Address Assignment Failures
  1666. If the responder encounters an error while attempting to assign an IP
  1667. address to the initiator, it responds with an
  1668. INTERNAL_ADDRESS_FAILURE notification as described in Section 3.10.1.
  1669. However, there are some more complex error cases.
  1670. First, if the responder does not support configuration payloads at
  1671. all, it can simply ignore all configuration payloads. This type of
  1672. implementation never sends INTERNAL_ADDRESS_FAILURE notifications.
  1673. If the initiator requires the assignment of an IP address, it will
  1674. treat a response without CFG_REPLY as an error.
  1675. A second case is where the responder does support configuration
  1676. payloads, but only for particular type of addresses (IPv4 or IPv6).
  1677. Section 4 says that "A minimal IPv4 responder implementation will
  1678. ignore the contents of the CP payload except to determine that it
  1679. includes an INTERNAL_IP4_ADDRESS attribute". If, for instance, the
  1680. initiator includes both INTERNAL_IP4_ADDRESS and INTERNAL_IP6_ADDRESS
  1681. in the CFG_REQUEST, an IPv4-only responder can thus simply ignore the
  1682. IPv6 part and process the IPv4 request as usual.
  1683. A third case is where the initiator requests multiple addresses of a
  1684. type that the responder supports: what should happen if some (but not
  1685. all) of the requests fail? It seems that an optimistic approach
  1686. would be the best one here: if the responder is able to assign at
  1687. least one address, it replies with those; it sends
  1688. INTERNAL_ADDRESS_FAILURE only if no addresses can be assigned.
  1689. (References: "ikev2 and internal_ivpn_address" thread, June 2005.)
  1690. Eronen & Hoffman Informational [Page 44]
  1691. RFC 4718 IKEv2 Clarifications October 2006
  1692. 7. Miscellaneous Issues
  1693. 7.1. Matching ID_IPV4_ADDR and ID_IPV6_ADDR
  1694. When using the ID_IPV4_ADDR/ID_IPV6_ADDR identity types in IDi/IDr
  1695. payloads, IKEv2 does not require this address to match anything in
  1696. the TSi/TSr payloads. For example, in a site-to-site VPN between two
  1697. security gateways, the gateways could authenticate each other as
  1698. ID_IPV4_ADDR(192.0.1.1) and ID_IPV4_ADDR(192.0.2.1), and then create
  1699. a CHILD_SA for protecting traffic between 192.0.1.55/32 (a host
  1700. behind the first security gateway) and 192.0.2.240/28 (a network
  1701. behind the second security gateway). The authenticated identities
  1702. (IDi/IDr) are linked to the authorized traffic selectors (TSi/TSr)
  1703. using "Child SA Authorization Data" in the Peer Authorization
  1704. Database (PAD).
  1705. Furthermore, IKEv2 does not require that the addresses in
  1706. ID_IPV4_ADDR/ID_IPV6_ADDR match the address in the IP header of the
  1707. IKE packets. However, other specifications may place additional
  1708. requirements regarding this. For example, [PKI4IPsec] requires that
  1709. implementation must be capable of comparing the addresses in the
  1710. ID_IPV4_ADDR/ID_IPV6_ADDR with the addresses in the IP header of the
  1711. IKE packets, and this comparison must be enabled by default.
  1712. (References: "Identities types IP address,FQDN/user FQDN and DN and
  1713. its usage in preshared key authentication" thread, Jan 2005.
  1714. "Matching ID_IPV4_ADDR and ID_IPV6_ADDR" thread, May 2006.)
  1715. 7.2. Relationship of IKEv2 to RFC 4301
  1716. The IKEv2 specification refers to [RFC4301], but it never clearly
  1717. defines the exact relationship.
  1718. However, there are some requirements in the specification that make
  1719. it clear that IKEv2 requires [RFC4301]. In other words, an
  1720. implementation that does IPsec processing strictly according to
  1721. [RFC2401] cannot be compliant with the IKEv2 specification.
  1722. One such example can be found in Section 2.24: "Specifically, tunnel
  1723. encapsulators and decapsulators for all tunnel-mode SAs created by
  1724. IKEv2 [...] MUST implement the tunnel encapsulation and
  1725. decapsulation processing specified in [RFC4301] to prevent discarding
  1726. of ECN congestion indications."
  1727. Nevertheless, the changes required to existing [RFC2401]
  1728. implementations are not very large, especially since supporting many
  1729. of the new features (such as Extended Sequence Numbers) is optional.
  1730. Eronen & Hoffman Informational [Page 45]
  1731. RFC 4718 IKEv2 Clarifications October 2006
  1732. 7.3. Reducing the Window Size
  1733. In IKEv2, the window size is assumed to be a (possibly configurable)
  1734. property of a particular implementation and is not related to
  1735. congestion control (unlike the window size in TCP, for instance).
  1736. In particular, it is not defined what the responder should do when it
  1737. receives a SET_WINDOW_SIZE notification containing a smaller value
  1738. than is currently in effect. Thus, there is currently no way to
  1739. reduce the window size of an existing IKE_SA. However, when rekeying
  1740. an IKE_SA, the new IKE_SA starts with window size 1 until it is
  1741. explicitly increased by sending a new SET_WINDOW_SIZE notification.
  1742. (References: Tero Kivinen's mail "Comments of
  1743. draft-eronen-ipsec-ikev2-clarifications-02.txt", 2005-04-05.)
  1744. 7.4. Minimum Size of Nonces
  1745. Section 2.10 says that "Nonces used in IKEv2 MUST be randomly chosen,
  1746. MUST be at least 128 bits in size, and MUST be at least half the key
  1747. size of the negotiated prf."
  1748. However, the initiator chooses the nonce before the outcome of the
  1749. negotiation is known. In this case, the nonce has to be long enough
  1750. for all the PRFs being proposed.
  1751. 7.5. Initial Zero Octets on Port 4500
  1752. It is not clear whether a peer sending an IKE_SA_INIT request on port
  1753. 4500 should include the initial four zero octets. Section 2.23 talks
  1754. about how to upgrade to tunneling over port 4500 after message 2, but
  1755. it does not say what to do if message 1 is sent on port 4500.
  1756. IKE MUST listen on port 4500 as well as port 500.
  1757. [...]
  1758. The IKE initiator MUST check these payloads if present and if
  1759. they do not match the addresses in the outer packet MUST tunnel
  1760. all future IKE and ESP packets associated with this IKE_SA over
  1761. UDP port 4500.
  1762. To tunnel IKE packets over UDP port 4500, the IKE header has four
  1763. octets of zero prepended and the result immediately follows the
  1764. UDP header. [...]
  1765. Eronen & Hoffman Informational [Page 46]
  1766. RFC 4718 IKEv2 Clarifications October 2006
  1767. The very beginning of Section 2 says "... though IKE messages may
  1768. also be received on UDP port 4500 with a slightly different format
  1769. (see section 2.23)."
  1770. That "slightly different format" is only described in discussing what
  1771. to do after changing to port 4500. However, [RFC3948] shows clearly
  1772. the format has the initial zeros even for initiators on port 4500.
  1773. Furthermore, without the initial zeros, the processing engine cannot
  1774. determine whether the packet is an IKE packet or an ESP packet.
  1775. Thus, all packets sent on port 4500 need the four-zero prefix;
  1776. otherwise, the receiver won't know how to handle them.
  1777. 7.6. Destination Port for NAT Traversal
  1778. Section 2.23 says that "an IPsec endpoint that discovers a NAT
  1779. between it and its correspondent MUST send all subsequent traffic to
  1780. and from port 4500".
  1781. This sentence is misleading. The peer "outside" the NAT uses source
  1782. port 4500 for the traffic it sends, but the destination port is, of
  1783. course, taken from packets sent by the peer behind the NAT. This
  1784. port number is usually dynamically allocated by the NAT.
  1785. 7.7. SPI Values for Messages outside an IKE_SA
  1786. The IKEv2 specification is not quite clear what SPI values should be
  1787. used in the IKE header for the small number of notifications that are
  1788. allowed to be sent outside an IKE_SA. Note that such notifications
  1789. are explicitly not Informational exchanges; Section 1.5 makes it
  1790. clear that these are one-way messages that must not be responded to.
  1791. There are two cases when such a one-way notification can be sent:
  1792. INVALID_IKE_SPI and INVALID_SPI.
  1793. In case of INVALID_IKE_SPI, the message sent is a response message,
  1794. and Section 2.21 says that "If a response is sent, the response MUST
  1795. be sent to the IP address and port from whence it came with the same
  1796. IKE SPIs and the Message ID copied."
  1797. In case of INVALID_SPI, however, there are no IKE SPI values that
  1798. would be meaningful to the recipient of such a notification. Also,
  1799. the message sent is now an INFORMATIONAL request. A strict
  1800. interpretation of the specification would require the sender to
  1801. invent garbage values for the SPI fields. However, we think this was
  1802. not the intention, and using zero values is acceptable.
  1803. (References: "INVALID_IKE_SPI" thread, June 2005.)
  1804. Eronen & Hoffman Informational [Page 47]
  1805. RFC 4718 IKEv2 Clarifications October 2006
  1806. 7.8. Protocol ID/SPI Fields in Notify Payloads
  1807. Section 3.10 says that the Protocol ID field in Notify payloads "For
  1808. notifications that do not relate to an existing SA, this field MUST
  1809. be sent as zero and MUST be ignored on receipt". However, the
  1810. specification does not clearly say which notifications are related to
  1811. existing SAs and which are not.
  1812. Since the main purpose of the Protocol ID field is to specify the
  1813. type of the SPI, our interpretation is that the Protocol ID field
  1814. should be non-zero only when the SPI field is non-empty.
  1815. There are currently only two notifications where this is the case:
  1816. INVALID_SELECTORS and REKEY_SA.
  1817. 7.9. Which message should contain INITIAL_CONTACT
  1818. The description of the INITIAL_CONTACT notification in Section 3.10.1
  1819. says that "This notification asserts that this IKE_SA is the only
  1820. IKE_SA currently active between the authenticated identities".
  1821. However, neither Section 2.4 nor 3.10.1 says in which message this
  1822. payload should be placed.
  1823. The general agreement is that INITIAL_CONTACT is best communicated in
  1824. the first IKE_AUTH request, not as a separate exchange afterwards.
  1825. (References: "Clarifying the use of INITIAL_CONTACT in IKEv2" thread,
  1826. April 2005. "Initial Contact messages" thread, December 2004.
  1827. "IKEv2 and Initial Contact" thread, September 2004 and April 2005.)
  1828. 7.10. Alignment of Payloads
  1829. Many IKEv2 payloads contain fields marked as "RESERVED", mostly
  1830. because IKEv1 had them, and partly because they make the pictures
  1831. easier to draw. In particular, payloads in IKEv2 are not, in
  1832. general, aligned to 4-octet boundaries. (Note that payloads were not
  1833. aligned to 4-octet boundaries in IKEv1 either.)
  1834. (References: "IKEv2: potential 4-byte alignment problem" thread, June
  1835. 2004.)
  1836. 7.11. Key Length Transform Attribute
  1837. Section 3.3.5 says that "The only algorithms defined in this document
  1838. that accept attributes are the AES based encryption, integrity, and
  1839. pseudo-random functions, which require a single attribute specifying
  1840. key width."
  1841. Eronen & Hoffman Informational [Page 48]
  1842. RFC 4718 IKEv2 Clarifications October 2006
  1843. This is incorrect. The AES-based integrity and pseudo-random
  1844. functions defined in [IKEv2] always use a 128-bit key. In fact,
  1845. there are currently no integrity or PRF algorithms that use the key
  1846. length attribute (and we recommend that they should not be defined in
  1847. the future either).
  1848. For encryption algorithms, the situation is slightly more complex
  1849. since there are three different types of algorithms:
  1850. o The key length attribute is never used with algorithms that use a
  1851. fixed length key, such as DES and IDEA.
  1852. o The key length attribute is always included for the currently
  1853. defined AES-based algorithms (Cipher Block Chaining (CBC), Counter
  1854. (CTR) Mode, Counter with CBC-MAC (CCM), and Galois/Counter Mode
  1855. (GCM)). Omitting the key length attribute is not allowed; if the
  1856. proposal does not contain it, the proposal has to be rejected.
  1857. o For other algorithms, the key length attribute can be included but
  1858. is not mandatory. These algorithms include, e.g., RC5, CAST, and
  1859. BLOWFISH. If the key length attribute is not included, the
  1860. default value specified in [RFC2451] is used.
  1861. 7.12. IPsec IANA Considerations
  1862. There are currently three different IANA registry files that contain
  1863. important numbers for IPsec: ikev2-registry, isakmp-registry, and
  1864. ipsec-registry. Implementers should note that IKEv2 may use numbers
  1865. different from those of IKEv1 for a particular algorithm.
  1866. For instance, an encryption algorithm can have up to three different
  1867. numbers: the IKEv2 "Transform Type 1" identifier in ikev2-registry,
  1868. the IKEv1 phase 1 "Encryption Algorithm" identifier in ipsec-
  1869. registry, and the IKEv1 phase 2 "IPSEC ESP Transform Identifier"
  1870. isakmp-registry. Although some algorithms have the same number in
  1871. all three registries, the registries are not identical.
  1872. Similarly, an integrity algorithm can have at least the IKEv2
  1873. "Transform Type 3" identifier in ikev2-registry, the IKEv1 phase 2
  1874. "IPSEC AH Transform Identifier" in isakmp-registry, and the IKEv1
  1875. phase 2 ESP "Authentication Algorithm Security Association Attribute"
  1876. identifier in isakmp-registry. And there is also the IKEv1 phase 1
  1877. "Hash Algorithm" list in ipsec-registry.
  1878. This issue needs special care also when writing a specification for
  1879. how a new algorithm is used with IPsec.
  1880. Eronen & Hoffman Informational [Page 49]
  1881. RFC 4718 IKEv2 Clarifications October 2006
  1882. 7.13. Combining ESP and AH
  1883. The IKEv2 specification contains some misleading text about how ESP
  1884. and AH can be combined.
  1885. IKEv2 is based on [RFC4301], which does not include "SA bundles" that
  1886. were part of [RFC2401]. While a single packet can go through IPsec
  1887. processing multiple times, each of these passes uses a separate SA,
  1888. and the passes are coordinated by the forwarding tables. In IKEv2,
  1889. each of these SAs has to be created using a separate CREATE_CHILD_SA
  1890. exchange. Thus, the text in Section 2.7 about a single proposal
  1891. containing both ESP and AH is incorrect.
  1892. Moreover, the combination of ESP and AH (between the same endpoints)
  1893. had already become largely obsolete in 1998 when RFC 2406 was
  1894. published. Our recommendation is that IKEv2 implementations should
  1895. not support this combination, and implementers should not assume the
  1896. combination can be made to work in an interoperable manner.
  1897. (References: "Rekeying SA bundles" thread, Oct 2005.)
  1898. 8. Implementation Mistakes
  1899. Some implementers at the early IKEv2 bakeoffs didn't do everything
  1900. correctly. This may seem like an obvious statement, but it is
  1901. probably useful to list a few things that were clear in the document,
  1902. but that some implementers didn't do. All of these things caused
  1903. interoperability problems.
  1904. o Some implementations continued to send traffic on a CHILD_SA after
  1905. it was rekeyed, even after receiving an DELETE payload.
  1906. o After rekeying an IKE_SA, some implementations did not reset their
  1907. message counters to zero. One set the counter to 2, another did
  1908. not reset the counter at all.
  1909. o Some implementations could only handle a single pair of traffic
  1910. selectors or would only process the first pair in the proposal.
  1911. o Some implementations responded to a delete request by sending an
  1912. empty INFORMATIONAL response and then initiated their own
  1913. INFORMATIONAL exchange with the pair of SAs to delete.
  1914. o Although this did not happen at the bakeoff, from the discussion
  1915. there, it is clear that some people had not implemented message
  1916. window sizes correctly. Some implementations might have sent
  1917. Eronen & Hoffman Informational [Page 50]
  1918. RFC 4718 IKEv2 Clarifications October 2006
  1919. messages that did not fit into the responder's message windows,
  1920. and some implementations may not have torn down an SA if they did
  1921. not ever receive a message that they know they should have.
  1922. 9. Security Considerations
  1923. This document does not introduce any new security considerations to
  1924. IKEv2. If anything, clarifying complex areas of the specification
  1925. can reduce the likelihood of implementation problems that may have
  1926. security implications.
  1927. 10. Acknowledgments
  1928. This document is mainly based on conversations on the IPsec WG
  1929. mailing list. The authors would especially like to thank Bernard
  1930. Aboba, Jari Arkko, Vijay Devarapalli, William Dixon, Francis Dupont,
  1931. Alfred Hoenes, Mika Joutsenvirta, Charlie Kaufman, Stephen Kent, Tero
  1932. Kivinen, Yoav Nir, Michael Richardson, and Joel Snyder for their
  1933. contributions.
  1934. In addition, the authors would like to thank all the participants of
  1935. the first public IKEv2 bakeoff, held in Santa Clara in February 2005,
  1936. for their questions and proposed clarifications.
  1937. 11. References
  1938. 11.1. Normative References
  1939. [IKEv2] Kaufman, C., Ed., "Internet Key Exchange (IKEv2)
  1940. Protocol", RFC 4306, December 2005.
  1941. [IKEv2ALG] Schiller, J., "Cryptographic Algorithms for Use in the
  1942. Internet Key Exchange Version 2 (IKEv2)", RFC 4307,
  1943. December 2005.
  1944. [PKCS1v20] Kaliski, B. and J. Staddon, "PKCS #1: RSA Cryptography
  1945. Specifications Version 2.0", RFC 2437, October 1998.
  1946. [PKCS1v21] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
  1947. Standards (PKCS) #1: RSA Cryptography Specifications
  1948. Version 2.1", RFC 3447, February 2003.
  1949. [RFC2401] Kent, S. and R. Atkinson, "Security Architecture for
  1950. the Internet Protocol", RFC 2401, November 1998.
  1951. [RFC4301] Kent, S. and K. Seo, "Security Architecture for the
  1952. Internet Protocol", RFC 4301, December 2005.
  1953. Eronen & Hoffman Informational [Page 51]
  1954. RFC 4718 IKEv2 Clarifications October 2006
  1955. 11.2. Informative References
  1956. [Aura05] Aura, T., Roe, M., and A. Mohammed, "Experiences with
  1957. Host-to-Host IPsec", 13th International Workshop on
  1958. Security Protocols, Cambridge, UK, April 2005.
  1959. [EAP] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and
  1960. H. Levkowetz, "Extensible Authentication Protocol
  1961. (EAP)", RFC 3748, June 2004.
  1962. [HashUse] Hoffman, P., "Use of Hash Algorithms in IKE and IPsec",
  1963. Work in Progress, July 2006.
  1964. [IPCPSubnet] Cisco Systems, Inc., "IPCP Subnet Mask Support
  1965. Enhancements", http://www.cisco.com/univercd/cc/td/
  1966. doc/product/software/ios121/121newft/121limit/121dc/
  1967. 121dc3/ipcp_msk.htm, January 2003.
  1968. [IPv6Addr] Hinden, R. and S. Deering, "IP Version 6 Addressing
  1969. Architecture", RFC 4291, February 2006.
  1970. [MIPv6] Johnson, D., Perkins, C., and J. Arkko, "Mobility
  1971. Support in IPv6", RFC 3775, June 2004.
  1972. [MLDv2] Vida, R. and L. Costa, "Multicast Listener Discovery
  1973. Version 2 (MLDv2) for IPv6", RFC 3810, June 2004.
  1974. [NAI] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The
  1975. Network Access Identifier", RFC 4282, December 2005.
  1976. [PKI4IPsec] Korver, B., "Internet PKI Profile of IKEv1/ISAKMP,
  1977. IKEv2, and PKIX", Work in Progress, April 2006.
  1978. [RADEAP] Aboba, B. and P. Calhoun, "RADIUS (Remote
  1979. Authentication Dial In User Service) Support For
  1980. Extensible Authentication Protocol (EAP)", RFC 3579,
  1981. September 2003.
  1982. [RADIUS] Rigney, C., Willens, S., Rubens, A., and W. Simpson,
  1983. "Remote Authentication Dial In User Service (RADIUS)",
  1984. RFC 2865, June 2000.
  1985. [RADIUS6] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6",
  1986. RFC 3162, August 2001.
  1987. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  1988. Requirement Levels", RFC 2119, March 1997.
  1989. Eronen & Hoffman Informational [Page 52]
  1990. RFC 4718 IKEv2 Clarifications October 2006
  1991. [RFC2451] Pereira, R. and R. Adams, "The ESP CBC-Mode Cipher
  1992. Algorithms", RFC 2451, November 1998.
  1993. [RFC2822] Resnick, P., "Internet Message Format", RFC 2822,
  1994. April 2001.
  1995. [RFC3664] Hoffman, P., "The AES-XCBC-PRF-128 Algorithm for the
  1996. Internet Key Exchange Protocol (IKE)", RFC 3664,
  1997. January 2004.
  1998. [RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and
  1999. M. Stenberg, "UDP Encapsulation of IPsec ESP Packets",
  2000. RFC 3948, January 2005.
  2001. [RFC4434] Hoffman, P., "The AES-XCBC-PRF-128 Algorithm for the
  2002. Internet Key Exchange Protocol (IKE)", RFC 4434,
  2003. February 2006.
  2004. [RFC822] Crocker, D., "Standard for the format of ARPA Internet
  2005. text messages", RFC 822, August 1982.
  2006. [ReAuth] Nir, Y., "Repeated Authentication in Internet Key
  2007. Exchange (IKEv2) Protocol", RFC 4478, April 2006.
  2008. [SCVP] Freeman, T., Housley, R., Malpani, A., Cooper, D., and
  2009. T. Polk, "Simple Certificate Validation Protocol
  2010. (SCVP)", Work in Progress, June 2006.
  2011. Eronen & Hoffman Informational [Page 53]
  2012. RFC 4718 IKEv2 Clarifications October 2006
  2013. Appendix A. Exchanges and Payloads
  2014. This appendix contains a short summary of the IKEv2 exchanges, and
  2015. what payloads can appear in which message. This appendix is purely
  2016. informative; if it disagrees with the body of this document or the
  2017. IKEv2 specification, the other text is considered correct.
  2018. Vendor-ID (V) payloads may be included in any place in any message.
  2019. This sequence shows what are, in our opinion, the most logical places
  2020. for them.
  2021. The specification does not say which messages can contain
  2022. N(SET_WINDOW_SIZE). It can possibly be included in any message, but
  2023. it is not yet shown below.
  2024. A.1. IKE_SA_INIT Exchange
  2025. request --> [N(COOKIE)],
  2026. SA, KE, Ni,
  2027. [N(NAT_DETECTION_SOURCE_IP)+,
  2028. N(NAT_DETECTION_DESTINATION_IP)],
  2029. [V+]
  2030. normal response <-- SA, KE, Nr,
  2031. (no cookie) [N(NAT_DETECTION_SOURCE_IP),
  2032. N(NAT_DETECTION_DESTINATION_IP)],
  2033. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  2034. [V+]
  2035. A.2. IKE_AUTH Exchange without EAP
  2036. request --> IDi, [CERT+],
  2037. [N(INITIAL_CONTACT)],
  2038. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  2039. [IDr],
  2040. AUTH,
  2041. [CP(CFG_REQUEST)],
  2042. [N(IPCOMP_SUPPORTED)+],
  2043. [N(USE_TRANSPORT_MODE)],
  2044. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2045. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2046. SA, TSi, TSr,
  2047. [V+]
  2048. Eronen & Hoffman Informational [Page 54]
  2049. RFC 4718 IKEv2 Clarifications October 2006
  2050. response <-- IDr, [CERT+],
  2051. AUTH,
  2052. [CP(CFG_REPLY)],
  2053. [N(IPCOMP_SUPPORTED)],
  2054. [N(USE_TRANSPORT_MODE)],
  2055. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2056. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2057. SA, TSi, TSr,
  2058. [N(ADDITIONAL_TS_POSSIBLE)],
  2059. [V+]
  2060. A.3. IKE_AUTH Exchange with EAP
  2061. first request --> IDi,
  2062. [N(INITIAL_CONTACT)],
  2063. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  2064. [IDr],
  2065. [CP(CFG_REQUEST)],
  2066. [N(IPCOMP_SUPPORTED)+],
  2067. [N(USE_TRANSPORT_MODE)],
  2068. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2069. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2070. SA, TSi, TSr,
  2071. [V+]
  2072. first response <-- IDr, [CERT+], AUTH,
  2073. EAP,
  2074. [V+]
  2075. / --> EAP
  2076. repeat 1..N times |
  2077. \ <-- EAP
  2078. last request --> AUTH
  2079. last response <-- AUTH,
  2080. [CP(CFG_REPLY)],
  2081. [N(IPCOMP_SUPPORTED)],
  2082. [N(USE_TRANSPORT_MODE)],
  2083. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2084. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2085. SA, TSi, TSr,
  2086. [N(ADDITIONAL_TS_POSSIBLE)],
  2087. [V+]
  2088. Eronen & Hoffman Informational [Page 55]
  2089. RFC 4718 IKEv2 Clarifications October 2006
  2090. A.4. CREATE_CHILD_SA Exchange for Creating/Rekeying CHILD_SAs
  2091. request --> [N(REKEY_SA)],
  2092. [N(IPCOMP_SUPPORTED)+],
  2093. [N(USE_TRANSPORT_MODE)],
  2094. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2095. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2096. SA, Ni, [KEi], TSi, TSr
  2097. response <-- [N(IPCOMP_SUPPORTED)],
  2098. [N(USE_TRANSPORT_MODE)],
  2099. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  2100. [N(NON_FIRST_FRAGMENTS_ALSO)],
  2101. SA, Nr, [KEr], TSi, TSr,
  2102. [N(ADDITIONAL_TS_POSSIBLE)]
  2103. A.5. CREATE_CHILD_SA Exchange for Rekeying the IKE_SA
  2104. request --> SA, Ni, [KEi]
  2105. response <-- SA, Nr, [KEr]
  2106. A.6. INFORMATIONAL Exchange
  2107. request --> [N+],
  2108. [D+],
  2109. [CP(CFG_REQUEST)]
  2110. response <-- [N+],
  2111. [D+],
  2112. [CP(CFG_REPLY)]
  2113. Eronen & Hoffman Informational [Page 56]
  2114. RFC 4718 IKEv2 Clarifications October 2006
  2115. Authors' Addresses
  2116. Pasi Eronen
  2117. Nokia Research Center
  2118. P.O. Box 407
  2119. FIN-00045 Nokia Group
  2120. Finland
  2121. EMail: pasi.eronen@nokia.com
  2122. Paul Hoffman
  2123. VPN Consortium
  2124. 127 Segre Place
  2125. Santa Cruz, CA 95060
  2126. USA
  2127. EMail: paul.hoffman@vpnc.org
  2128. Eronen & Hoffman Informational [Page 57]
  2129. RFC 4718 IKEv2 Clarifications October 2006
  2130. Full Copyright Statement
  2131. Copyright (C) The Internet Society (2006).
  2132. This document is subject to the rights, licenses and restrictions
  2133. contained in BCP 78, and except as set forth therein, the authors
  2134. retain all their rights.
  2135. This document and the information contained herein are provided on an
  2136. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  2137. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  2138. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  2139. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  2140. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  2141. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  2142. Intellectual Property
  2143. The IETF takes no position regarding the validity or scope of any
  2144. Intellectual Property Rights or other rights that might be claimed to
  2145. pertain to the implementation or use of the technology described in
  2146. this document or the extent to which any license under such rights
  2147. might or might not be available; nor does it represent that it has
  2148. made any independent effort to identify any such rights. Information
  2149. on the procedures with respect to rights in RFC documents can be
  2150. found in BCP 78 and BCP 79.
  2151. Copies of IPR disclosures made to the IETF Secretariat and any
  2152. assurances of licenses to be made available, or the result of an
  2153. attempt made to obtain a general license or permission for the use of
  2154. such proprietary rights by implementers or users of this
  2155. specification can be obtained from the IETF on-line IPR repository at
  2156. http://www.ietf.org/ipr.
  2157. The IETF invites any interested party to bring to its attention any
  2158. copyrights, patents or patent applications, or other proprietary
  2159. rights that may cover technology that may be required to implement
  2160. this standard. Please address the information to the IETF at
  2161. ietf-ipr@ietf.org.
  2162. Acknowledgement
  2163. Funding for the RFC Editor function is provided by the IETF
  2164. Administrative Support Activity (IASA).
  2165. Eronen & Hoffman Informational [Page 58]