rfc4306.txt 245 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547
  1. Network Working Group C. Kaufman, Ed.
  2. Request for Comments: 4306 Microsoft
  3. Obsoletes: 2407, 2408, 2409 December 2005
  4. Category: Standards Track
  5. Internet Key Exchange (IKEv2) Protocol
  6. Status of This Memo
  7. This document specifies an Internet standards track protocol for the
  8. Internet community, and requests discussion and suggestions for
  9. improvements. Please refer to the current edition of the "Internet
  10. Official Protocol Standards" (STD 1) for the standardization state
  11. and status of this protocol. Distribution of this memo is unlimited.
  12. Copyright Notice
  13. Copyright (C) The Internet Society (2005).
  14. Abstract
  15. This document describes version 2 of the Internet Key Exchange (IKE)
  16. protocol. IKE is a component of IPsec used for performing mutual
  17. authentication and establishing and maintaining security associations
  18. (SAs).
  19. This version of the IKE specification combines the contents of what
  20. were previously separate documents, including Internet Security
  21. Association and Key Management Protocol (ISAKMP, RFC 2408), IKE (RFC
  22. 2409), the Internet Domain of Interpretation (DOI, RFC 2407), Network
  23. Address Translation (NAT) Traversal, Legacy authentication, and
  24. remote address acquisition.
  25. Version 2 of IKE does not interoperate with version 1, but it has
  26. enough of the header format in common that both versions can
  27. unambiguously run over the same UDP port.
  28. Kaufman Standards Track [Page 1]
  29. RFC 4306 IKEv2 December 2005
  30. Table of Contents
  31. 1. Introduction ....................................................3
  32. 1.1. Usage Scenarios ............................................5
  33. 1.2. The Initial Exchanges ......................................7
  34. 1.3. The CREATE_CHILD_SA Exchange ...............................9
  35. 1.4. The INFORMATIONAL Exchange ................................11
  36. 1.5. Informational Messages outside of an IKE_SA ...............12
  37. 2. IKE Protocol Details and Variations ............................12
  38. 2.1. Use of Retransmission Timers ..............................13
  39. 2.2. Use of Sequence Numbers for Message ID ....................14
  40. 2.3. Window Size for Overlapping Requests ......................14
  41. 2.4. State Synchronization and Connection Timeouts .............15
  42. 2.5. Version Numbers and Forward Compatibility .................17
  43. 2.6. Cookies ...................................................18
  44. 2.7. Cryptographic Algorithm Negotiation .......................21
  45. 2.8. Rekeying ..................................................22
  46. 2.9. Traffic Selector Negotiation ..............................24
  47. 2.10. Nonces ...................................................26
  48. 2.11. Address and Port Agility .................................26
  49. 2.12. Reuse of Diffie-Hellman Exponentials .....................27
  50. 2.13. Generating Keying Material ...............................27
  51. 2.14. Generating Keying Material for the IKE_SA ................28
  52. 2.15. Authentication of the IKE_SA .............................29
  53. 2.16. Extensible Authentication Protocol Methods ...............31
  54. 2.17. Generating Keying Material for CHILD_SAs .................33
  55. 2.18. Rekeying IKE_SAs Using a CREATE_CHILD_SA exchange ........34
  56. 2.19. Requesting an Internal Address on a Remote Network .......34
  57. 2.20. Requesting the Peer's Version ............................35
  58. 2.21. Error Handling ...........................................36
  59. 2.22. IPComp ...................................................37
  60. 2.23. NAT Traversal ............................................38
  61. 2.24. Explicit Congestion Notification (ECN) ...................40
  62. 3. Header and Payload Formats .....................................41
  63. 3.1. The IKE Header ............................................41
  64. 3.2. Generic Payload Header ....................................44
  65. 3.3. Security Association Payload ..............................46
  66. 3.4. Key Exchange Payload ......................................56
  67. 3.5. Identification Payloads ...................................56
  68. 3.6. Certificate Payload .......................................59
  69. 3.7. Certificate Request Payload ...............................61
  70. 3.8. Authentication Payload ....................................63
  71. 3.9. Nonce Payload .............................................64
  72. 3.10. Notify Payload ...........................................64
  73. 3.11. Delete Payload ...........................................72
  74. 3.12. Vendor ID Payload ........................................73
  75. 3.13. Traffic Selector Payload .................................74
  76. 3.14. Encrypted Payload ........................................77
  77. Kaufman Standards Track [Page 2]
  78. RFC 4306 IKEv2 December 2005
  79. 3.15. Configuration Payload ....................................79
  80. 3.16. Extensible Authentication Protocol (EAP) Payload .........84
  81. 4. Conformance Requirements .......................................85
  82. 5. Security Considerations ........................................88
  83. 6. IANA Considerations ............................................90
  84. 7. Acknowledgements ...............................................91
  85. 8. References .....................................................91
  86. 8.1. Normative References ......................................91
  87. 8.2. Informative References ....................................92
  88. Appendix A: Summary of Changes from IKEv1 .........................96
  89. Appendix B: Diffie-Hellman Groups .................................97
  90. B.1. Group 1 - 768 Bit MODP ....................................97
  91. B.2. Group 2 - 1024 Bit MODP ...................................97
  92. 1. Introduction
  93. IP Security (IPsec) provides confidentiality, data integrity, access
  94. control, and data source authentication to IP datagrams. These
  95. services are provided by maintaining shared state between the source
  96. and the sink of an IP datagram. This state defines, among other
  97. things, the specific services provided to the datagram, which
  98. cryptographic algorithms will be used to provide the services, and
  99. the keys used as input to the cryptographic algorithms.
  100. Establishing this shared state in a manual fashion does not scale
  101. well. Therefore, a protocol to establish this state dynamically is
  102. needed. This memo describes such a protocol -- the Internet Key
  103. Exchange (IKE). This is version 2 of IKE. Version 1 of IKE was
  104. defined in RFCs 2407, 2408, and 2409 [Pip98, MSST98, HC98]. This
  105. single document is intended to replace all three of those RFCs.
  106. Definitions of the primitive terms in this document (such as Security
  107. Association or SA) can be found in [RFC4301].
  108. Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and
  109. "MAY" that appear in this document are to be interpreted as described
  110. in [Bra97].
  111. The term "Expert Review" is to be interpreted as defined in
  112. [RFC2434].
  113. IKE performs mutual authentication between two parties and
  114. establishes an IKE security association (SA) that includes shared
  115. secret information that can be used to efficiently establish SAs for
  116. Encapsulating Security Payload (ESP) [RFC4303] and/or Authentication
  117. Header (AH) [RFC4302] and a set of cryptographic algorithms to be
  118. used by the SAs to protect the traffic that they carry. In this
  119. document, the term "suite" or "cryptographic suite" refers to a
  120. Kaufman Standards Track [Page 3]
  121. RFC 4306 IKEv2 December 2005
  122. complete set of algorithms used to protect an SA. An initiator
  123. proposes one or more suites by listing supported algorithms that can
  124. be combined into suites in a mix-and-match fashion. IKE can also
  125. negotiate use of IP Compression (IPComp) [IPCOMP] in connection with
  126. an ESP and/or AH SA. We call the IKE SA an "IKE_SA". The SAs for
  127. ESP and/or AH that get set up through that IKE_SA we call
  128. "CHILD_SAs".
  129. All IKE communications consist of pairs of messages: a request and a
  130. response. The pair is called an "exchange". We call the first
  131. messages establishing an IKE_SA IKE_SA_INIT and IKE_AUTH exchanges
  132. and subsequent IKE exchanges CREATE_CHILD_SA or INFORMATIONAL
  133. exchanges. In the common case, there is a single IKE_SA_INIT
  134. exchange and a single IKE_AUTH exchange (a total of four messages) to
  135. establish the IKE_SA and the first CHILD_SA. In exceptional cases,
  136. there may be more than one of each of these exchanges. In all cases,
  137. all IKE_SA_INIT exchanges MUST complete before any other exchange
  138. type, then all IKE_AUTH exchanges MUST complete, and following that
  139. any number of CREATE_CHILD_SA and INFORMATIONAL exchanges may occur
  140. in any order. In some scenarios, only a single CHILD_SA is needed
  141. between the IPsec endpoints, and therefore there would be no
  142. additional exchanges. Subsequent exchanges MAY be used to establish
  143. additional CHILD_SAs between the same authenticated pair of endpoints
  144. and to perform housekeeping functions.
  145. IKE message flow always consists of a request followed by a response.
  146. It is the responsibility of the requester to ensure reliability. If
  147. the response is not received within a timeout interval, the requester
  148. needs to retransmit the request (or abandon the connection).
  149. The first request/response of an IKE session (IKE_SA_INIT) negotiates
  150. security parameters for the IKE_SA, sends nonces, and sends Diffie-
  151. Hellman values.
  152. The second request/response (IKE_AUTH) transmits identities, proves
  153. knowledge of the secrets corresponding to the two identities, and
  154. sets up an SA for the first (and often only) AH and/or ESP CHILD_SA.
  155. The types of subsequent exchanges are CREATE_CHILD_SA (which creates
  156. a CHILD_SA) and INFORMATIONAL (which deletes an SA, reports error
  157. conditions, or does other housekeeping). Every request requires a
  158. response. An INFORMATIONAL request with no payloads (other than the
  159. empty Encrypted payload required by the syntax) is commonly used as a
  160. check for liveness. These subsequent exchanges cannot be used until
  161. the initial exchanges have completed.
  162. Kaufman Standards Track [Page 4]
  163. RFC 4306 IKEv2 December 2005
  164. In the description that follows, we assume that no errors occur.
  165. Modifications to the flow should errors occur are described in
  166. section 2.21.
  167. 1.1. Usage Scenarios
  168. IKE is expected to be used to negotiate ESP and/or AH SAs in a number
  169. of different scenarios, each with its own special requirements.
  170. 1.1.1. Security Gateway to Security Gateway Tunnel
  171. +-+-+-+-+-+ +-+-+-+-+-+
  172. ! ! IPsec ! !
  173. Protected !Tunnel ! tunnel !Tunnel ! Protected
  174. Subnet <-->!Endpoint !<---------->!Endpoint !<--> Subnet
  175. ! ! ! !
  176. +-+-+-+-+-+ +-+-+-+-+-+
  177. Figure 1: Security Gateway to Security Gateway Tunnel
  178. In this scenario, neither endpoint of the IP connection implements
  179. IPsec, but network nodes between them protect traffic for part of the
  180. way. Protection is transparent to the endpoints, and depends on
  181. ordinary routing to send packets through the tunnel endpoints for
  182. processing. Each endpoint would announce the set of addresses
  183. "behind" it, and packets would be sent in tunnel mode where the inner
  184. IP header would contain the IP addresses of the actual endpoints.
  185. 1.1.2. Endpoint-to-Endpoint Transport
  186. +-+-+-+-+-+ +-+-+-+-+-+
  187. ! ! IPsec transport ! !
  188. !Protected! or tunnel mode SA !Protected!
  189. !Endpoint !<---------------------------------------->!Endpoint !
  190. ! ! ! !
  191. +-+-+-+-+-+ +-+-+-+-+-+
  192. Figure 2: Endpoint to Endpoint
  193. In this scenario, both endpoints of the IP connection implement
  194. IPsec, as required of hosts in [RFC4301]. Transport mode will
  195. commonly be used with no inner IP header. If there is an inner IP
  196. header, the inner addresses will be the same as the outer addresses.
  197. A single pair of addresses will be negotiated for packets to be
  198. protected by this SA. These endpoints MAY implement application
  199. layer access controls based on the IPsec authenticated identities of
  200. the participants. This scenario enables the end-to-end security that
  201. has been a guiding principle for the Internet since [RFC1958],
  202. Kaufman Standards Track [Page 5]
  203. RFC 4306 IKEv2 December 2005
  204. [RFC2775], and a method of limiting the inherent problems with
  205. complexity in networks noted by [RFC3439]. Although this scenario
  206. may not be fully applicable to the IPv4 Internet, it has been
  207. deployed successfully in specific scenarios within intranets using
  208. IKEv1. It should be more broadly enabled during the transition to
  209. IPv6 and with the adoption of IKEv2.
  210. It is possible in this scenario that one or both of the protected
  211. endpoints will be behind a network address translation (NAT) node, in
  212. which case the tunneled packets will have to be UDP encapsulated so
  213. that port numbers in the UDP headers can be used to identify
  214. individual endpoints "behind" the NAT (see section 2.23).
  215. 1.1.3. Endpoint to Security Gateway Tunnel
  216. +-+-+-+-+-+ +-+-+-+-+-+
  217. ! ! IPsec ! ! Protected
  218. !Protected! tunnel !Tunnel ! Subnet
  219. !Endpoint !<------------------------>!Endpoint !<--- and/or
  220. ! ! ! ! Internet
  221. +-+-+-+-+-+ +-+-+-+-+-+
  222. Figure 3: Endpoint to Security Gateway Tunnel
  223. In this scenario, a protected endpoint (typically a portable roaming
  224. computer) connects back to its corporate network through an IPsec-
  225. protected tunnel. It might use this tunnel only to access
  226. information on the corporate network, or it might tunnel all of its
  227. traffic back through the corporate network in order to take advantage
  228. of protection provided by a corporate firewall against Internet-based
  229. attacks. In either case, the protected endpoint will want an IP
  230. address associated with the security gateway so that packets returned
  231. to it will go to the security gateway and be tunneled back. This IP
  232. address may be static or may be dynamically allocated by the security
  233. gateway. In support of the latter case, IKEv2 includes a mechanism
  234. for the initiator to request an IP address owned by the security
  235. gateway for use for the duration of its SA.
  236. In this scenario, packets will use tunnel mode. On each packet from
  237. the protected endpoint, the outer IP header will contain the source
  238. IP address associated with its current location (i.e., the address
  239. that will get traffic routed to the endpoint directly), while the
  240. inner IP header will contain the source IP address assigned by the
  241. security gateway (i.e., the address that will get traffic routed to
  242. the security gateway for forwarding to the endpoint). The outer
  243. destination address will always be that of the security gateway,
  244. while the inner destination address will be the ultimate destination
  245. for the packet.
  246. Kaufman Standards Track [Page 6]
  247. RFC 4306 IKEv2 December 2005
  248. In this scenario, it is possible that the protected endpoint will be
  249. behind a NAT. In that case, the IP address as seen by the security
  250. gateway will not be the same as the IP address sent by the protected
  251. endpoint, and packets will have to be UDP encapsulated in order to be
  252. routed properly.
  253. 1.1.4. Other Scenarios
  254. Other scenarios are possible, as are nested combinations of the
  255. above. One notable example combines aspects of 1.1.1 and 1.1.3. A
  256. subnet may make all external accesses through a remote security
  257. gateway using an IPsec tunnel, where the addresses on the subnet are
  258. routed to the security gateway by the rest of the Internet. An
  259. example would be someone's home network being virtually on the
  260. Internet with static IP addresses even though connectivity is
  261. provided by an ISP that assigns a single dynamically assigned IP
  262. address to the user's security gateway (where the static IP addresses
  263. and an IPsec relay are provided by a third party located elsewhere).
  264. 1.2. The Initial Exchanges
  265. Communication using IKE always begins with IKE_SA_INIT and IKE_AUTH
  266. exchanges (known in IKEv1 as Phase 1). These initial exchanges
  267. normally consist of four messages, though in some scenarios that
  268. number can grow. All communications using IKE consist of
  269. request/response pairs. We'll describe the base exchange first,
  270. followed by variations. The first pair of messages (IKE_SA_INIT)
  271. negotiate cryptographic algorithms, exchange nonces, and do a
  272. Diffie-Hellman exchange [DH].
  273. The second pair of messages (IKE_AUTH) authenticate the previous
  274. messages, exchange identities and certificates, and establish the
  275. first CHILD_SA. Parts of these messages are encrypted and integrity
  276. protected with keys established through the IKE_SA_INIT exchange, so
  277. the identities are hidden from eavesdroppers and all fields in all
  278. the messages are authenticated.
  279. In the following descriptions, the payloads contained in the message
  280. are indicated by names as listed below.
  281. Notation Payload
  282. AUTH Authentication
  283. CERT Certificate
  284. CERTREQ Certificate Request
  285. CP Configuration
  286. D Delete
  287. E Encrypted
  288. Kaufman Standards Track [Page 7]
  289. RFC 4306 IKEv2 December 2005
  290. EAP Extensible Authentication
  291. HDR IKE Header
  292. IDi Identification - Initiator
  293. IDr Identification - Responder
  294. KE Key Exchange
  295. Ni, Nr Nonce
  296. N Notify
  297. SA Security Association
  298. TSi Traffic Selector - Initiator
  299. TSr Traffic Selector - Responder
  300. V Vendor ID
  301. The details of the contents of each payload are described in section
  302. 3. Payloads that may optionally appear will be shown in brackets,
  303. such as [CERTREQ], indicate that optionally a certificate request
  304. payload can be included.
  305. The initial exchanges are as follows:
  306. Initiator Responder
  307. ----------- -----------
  308. HDR, SAi1, KEi, Ni -->
  309. HDR contains the Security Parameter Indexes (SPIs), version numbers,
  310. and flags of various sorts. The SAi1 payload states the
  311. cryptographic algorithms the initiator supports for the IKE_SA. The
  312. KE payload sends the initiator's Diffie-Hellman value. Ni is the
  313. initiator's nonce.
  314. <-- HDR, SAr1, KEr, Nr, [CERTREQ]
  315. The responder chooses a cryptographic suite from the initiator's
  316. offered choices and expresses that choice in the SAr1 payload,
  317. completes the Diffie-Hellman exchange with the KEr payload, and sends
  318. its nonce in the Nr payload.
  319. At this point in the negotiation, each party can generate SKEYSEED,
  320. from which all keys are derived for that IKE_SA. All but the headers
  321. of all the messages that follow are encrypted and integrity
  322. protected. The keys used for the encryption and integrity protection
  323. are derived from SKEYSEED and are known as SK_e (encryption) and SK_a
  324. (authentication, a.k.a. integrity protection). A separate SK_e and
  325. SK_a is computed for each direction. In addition to the keys SK_e
  326. and SK_a derived from the DH value for protection of the IKE_SA,
  327. another quantity SK_d is derived and used for derivation of further
  328. keying material for CHILD_SAs. The notation SK { ... } indicates
  329. that these payloads are encrypted and integrity protected using that
  330. direction's SK_e and SK_a.
  331. Kaufman Standards Track [Page 8]
  332. RFC 4306 IKEv2 December 2005
  333. HDR, SK {IDi, [CERT,] [CERTREQ,] [IDr,]
  334. AUTH, SAi2, TSi, TSr} -->
  335. The initiator asserts its identity with the IDi payload, proves
  336. knowledge of the secret corresponding to IDi and integrity protects
  337. the contents of the first message using the AUTH payload (see section
  338. 2.15). It might also send its certificate(s) in CERT payload(s) and
  339. a list of its trust anchors in CERTREQ payload(s). If any CERT
  340. payloads are included, the first certificate provided MUST contain
  341. the public key used to verify the AUTH field. The optional payload
  342. IDr enables the initiator to specify which of the responder's
  343. identities it wants to talk to. This is useful when the machine on
  344. which the responder is running is hosting multiple identities at the
  345. same IP address. The initiator begins negotiation of a CHILD_SA
  346. using the SAi2 payload. The final fields (starting with SAi2) are
  347. described in the description of the CREATE_CHILD_SA exchange.
  348. <-- HDR, SK {IDr, [CERT,] AUTH,
  349. SAr2, TSi, TSr}
  350. The responder asserts its identity with the IDr payload, optionally
  351. sends one or more certificates (again with the certificate containing
  352. the public key used to verify AUTH listed first), authenticates its
  353. identity and protects the integrity of the second message with the
  354. AUTH payload, and completes negotiation of a CHILD_SA with the
  355. additional fields described below in the CREATE_CHILD_SA exchange.
  356. The recipients of messages 3 and 4 MUST verify that all signatures
  357. and MACs are computed correctly and that the names in the ID payloads
  358. correspond to the keys used to generate the AUTH payload.
  359. 1.3. The CREATE_CHILD_SA Exchange
  360. This exchange consists of a single request/response pair, and was
  361. referred to as a phase 2 exchange in IKEv1. It MAY be initiated by
  362. either end of the IKE_SA after the initial exchanges are completed.
  363. All messages following the initial exchange are cryptographically
  364. protected using the cryptographic algorithms and keys negotiated in
  365. the first two messages of the IKE exchange. These subsequent
  366. messages use the syntax of the Encrypted Payload described in section
  367. 3.14. All subsequent messages included an Encrypted Payload, even if
  368. they are referred to in the text as "empty".
  369. Either endpoint may initiate a CREATE_CHILD_SA exchange, so in this
  370. section the term "initiator" refers to the endpoint initiating this
  371. exchange.
  372. Kaufman Standards Track [Page 9]
  373. RFC 4306 IKEv2 December 2005
  374. A CHILD_SA is created by sending a CREATE_CHILD_SA request. The
  375. CREATE_CHILD_SA request MAY optionally contain a KE payload for an
  376. additional Diffie-Hellman exchange to enable stronger guarantees of
  377. forward secrecy for the CHILD_SA. The keying material for the
  378. CHILD_SA is a function of SK_d established during the establishment
  379. of the IKE_SA, the nonces exchanged during the CREATE_CHILD_SA
  380. exchange, and the Diffie-Hellman value (if KE payloads are included
  381. in the CREATE_CHILD_SA exchange).
  382. In the CHILD_SA created as part of the initial exchange, a second KE
  383. payload and nonce MUST NOT be sent. The nonces from the initial
  384. exchange are used in computing the keys for the CHILD_SA.
  385. The CREATE_CHILD_SA request contains:
  386. Initiator Responder
  387. ----------- -----------
  388. HDR, SK {[N], SA, Ni, [KEi],
  389. [TSi, TSr]} -->
  390. The initiator sends SA offer(s) in the SA payload, a nonce in the Ni
  391. payload, optionally a Diffie-Hellman value in the KEi payload, and
  392. the proposed traffic selectors in the TSi and TSr payloads. If this
  393. CREATE_CHILD_SA exchange is rekeying an existing SA other than the
  394. IKE_SA, the leading N payload of type REKEY_SA MUST identify the SA
  395. being rekeyed. If this CREATE_CHILD_SA exchange is not rekeying an
  396. existing SA, the N payload MUST be omitted. If the SA offers include
  397. different Diffie-Hellman groups, KEi MUST be an element of the group
  398. the initiator expects the responder to accept. If it guesses wrong,
  399. the CREATE_CHILD_SA exchange will fail, and it will have to retry
  400. with a different KEi.
  401. The message following the header is encrypted and the message
  402. including the header is integrity protected using the cryptographic
  403. algorithms negotiated for the IKE_SA.
  404. The CREATE_CHILD_SA response contains:
  405. <-- HDR, SK {SA, Nr, [KEr],
  406. [TSi, TSr]}
  407. The responder replies (using the same Message ID to respond) with the
  408. accepted offer in an SA payload, and a Diffie-Hellman value in the
  409. KEr payload if KEi was included in the request and the selected
  410. cryptographic suite includes that group. If the responder chooses a
  411. cryptographic suite with a different group, it MUST reject the
  412. request. The initiator SHOULD repeat the request, but now with a KEi
  413. payload from the group the responder selected.
  414. Kaufman Standards Track [Page 10]
  415. RFC 4306 IKEv2 December 2005
  416. The traffic selectors for traffic to be sent on that SA are specified
  417. in the TS payloads, which may be a subset of what the initiator of
  418. the CHILD_SA proposed. Traffic selectors are omitted if this
  419. CREATE_CHILD_SA request is being used to change the key of the
  420. IKE_SA.
  421. 1.4. The INFORMATIONAL Exchange
  422. At various points during the operation of an IKE_SA, peers may desire
  423. to convey control messages to each other regarding errors or
  424. notifications of certain events. To accomplish this, IKE defines an
  425. INFORMATIONAL exchange. INFORMATIONAL exchanges MUST ONLY occur
  426. after the initial exchanges and are cryptographically protected with
  427. the negotiated keys.
  428. Control messages that pertain to an IKE_SA MUST be sent under that
  429. IKE_SA. Control messages that pertain to CHILD_SAs MUST be sent
  430. under the protection of the IKE_SA which generated them (or its
  431. successor if the IKE_SA was replaced for the purpose of rekeying).
  432. Messages in an INFORMATIONAL exchange contain zero or more
  433. Notification, Delete, and Configuration payloads. The Recipient of
  434. an INFORMATIONAL exchange request MUST send some response (else the
  435. Sender will assume the message was lost in the network and will
  436. retransmit it). That response MAY be a message with no payloads.
  437. The request message in an INFORMATIONAL exchange MAY also contain no
  438. payloads. This is the expected way an endpoint can ask the other
  439. endpoint to verify that it is alive.
  440. ESP and AH SAs always exist in pairs, with one SA in each direction.
  441. When an SA is closed, both members of the pair MUST be closed. When
  442. SAs are nested, as when data (and IP headers if in tunnel mode) are
  443. encapsulated first with IPComp, then with ESP, and finally with AH
  444. between the same pair of endpoints, all of the SAs MUST be deleted
  445. together. Each endpoint MUST close its incoming SAs and allow the
  446. other endpoint to close the other SA in each pair. To delete an SA,
  447. an INFORMATIONAL exchange with one or more delete payloads is sent
  448. listing the SPIs (as they would be expected in the headers of inbound
  449. packets) of the SAs to be deleted. The recipient MUST close the
  450. designated SAs. Normally, the reply in the INFORMATIONAL exchange
  451. will contain delete payloads for the paired SAs going in the other
  452. direction. There is one exception. If by chance both ends of a set
  453. of SAs independently decide to close them, each may send a delete
  454. payload and the two requests may cross in the network. If a node
  455. receives a delete request for SAs for which it has already issued a
  456. delete request, it MUST delete the outgoing SAs while processing the
  457. request and the incoming SAs while processing the response. In that
  458. Kaufman Standards Track [Page 11]
  459. RFC 4306 IKEv2 December 2005
  460. case, the responses MUST NOT include delete payloads for the deleted
  461. SAs, since that would result in duplicate deletion and could in
  462. theory delete the wrong SA.
  463. A node SHOULD regard half-closed connections as anomalous and audit
  464. their existence should they persist. Note that this specification
  465. nowhere specifies time periods, so it is up to individual endpoints
  466. to decide how long to wait. A node MAY refuse to accept incoming
  467. data on half-closed connections but MUST NOT unilaterally close them
  468. and reuse the SPIs. If connection state becomes sufficiently messed
  469. up, a node MAY close the IKE_SA; doing so will implicitly close all
  470. SAs negotiated under it. It can then rebuild the SAs it needs on a
  471. clean base under a new IKE_SA.
  472. The INFORMATIONAL exchange is defined as:
  473. Initiator Responder
  474. ----------- -----------
  475. HDR, SK {[N,] [D,] [CP,] ...} -->
  476. <-- HDR, SK {[N,] [D,] [CP], ...}
  477. The processing of an INFORMATIONAL exchange is determined by its
  478. component payloads.
  479. 1.5. Informational Messages outside of an IKE_SA
  480. If an encrypted IKE packet arrives on port 500 or 4500 with an
  481. unrecognized SPI, it could be because the receiving node has recently
  482. crashed and lost state or because of some other system malfunction or
  483. attack. If the receiving node has an active IKE_SA to the IP address
  484. from whence the packet came, it MAY send a notification of the
  485. wayward packet over that IKE_SA in an INFORMATIONAL exchange. If it
  486. does not have such an IKE_SA, it MAY send an Informational message
  487. without cryptographic protection to the source IP address. Such a
  488. message is not part of an informational exchange, and the receiving
  489. node MUST NOT respond to it. Doing so could cause a message loop.
  490. 2. IKE Protocol Details and Variations
  491. IKE normally listens and sends on UDP port 500, though IKE messages
  492. may also be received on UDP port 4500 with a slightly different
  493. format (see section 2.23). Since UDP is a datagram (unreliable)
  494. protocol, IKE includes in its definition recovery from transmission
  495. errors, including packet loss, packet replay, and packet forgery.
  496. IKE is designed to function so long as (1) at least one of a series
  497. of retransmitted packets reaches its destination before timing out;
  498. and (2) the channel is not so full of forged and replayed packets so
  499. Kaufman Standards Track [Page 12]
  500. RFC 4306 IKEv2 December 2005
  501. as to exhaust the network or CPU capacities of either endpoint. Even
  502. in the absence of those minimum performance requirements, IKE is
  503. designed to fail cleanly (as though the network were broken).
  504. Although IKEv2 messages are intended to be short, they contain
  505. structures with no hard upper bound on size (in particular, X.509
  506. certificates), and IKEv2 itself does not have a mechanism for
  507. fragmenting large messages. IP defines a mechanism for fragmentation
  508. of oversize UDP messages, but implementations vary in the maximum
  509. message size supported. Furthermore, use of IP fragmentation opens
  510. an implementation to denial of service attacks [KPS03]. Finally,
  511. some NAT and/or firewall implementations may block IP fragments.
  512. All IKEv2 implementations MUST be able to send, receive, and process
  513. IKE messages that are up to 1280 bytes long, and they SHOULD be able
  514. to send, receive, and process messages that are up to 3000 bytes
  515. long. IKEv2 implementations SHOULD be aware of the maximum UDP
  516. message size supported and MAY shorten messages by leaving out some
  517. certificates or cryptographic suite proposals if that will keep
  518. messages below the maximum. Use of the "Hash and URL" formats rather
  519. than including certificates in exchanges where possible can avoid
  520. most problems. Implementations and configuration should keep in
  521. mind, however, that if the URL lookups are possible only after the
  522. IPsec SA is established, recursion issues could prevent this
  523. technique from working.
  524. 2.1. Use of Retransmission Timers
  525. All messages in IKE exist in pairs: a request and a response. The
  526. setup of an IKE_SA normally consists of two request/response pairs.
  527. Once the IKE_SA is set up, either end of the security association may
  528. initiate requests at any time, and there can be many requests and
  529. responses "in flight" at any given moment. But each message is
  530. labeled as either a request or a response, and for each
  531. request/response pair one end of the security association is the
  532. initiator and the other is the responder.
  533. For every pair of IKE messages, the initiator is responsible for
  534. retransmission in the event of a timeout. The responder MUST never
  535. retransmit a response unless it receives a retransmission of the
  536. request. In that event, the responder MUST ignore the retransmitted
  537. request except insofar as it triggers a retransmission of the
  538. response. The initiator MUST remember each request until it receives
  539. the corresponding response. The responder MUST remember each
  540. response until it receives a request whose sequence number is larger
  541. than the sequence number in the response plus its window size (see
  542. section 2.3).
  543. Kaufman Standards Track [Page 13]
  544. RFC 4306 IKEv2 December 2005
  545. IKE is a reliable protocol, in the sense that the initiator MUST
  546. retransmit a request until either it receives a corresponding reply
  547. OR it deems the IKE security association to have failed and it
  548. discards all state associated with the IKE_SA and any CHILD_SAs
  549. negotiated using that IKE_SA.
  550. 2.2. Use of Sequence Numbers for Message ID
  551. Every IKE message contains a Message ID as part of its fixed header.
  552. This Message ID is used to match up requests and responses, and to
  553. identify retransmissions of messages.
  554. The Message ID is a 32-bit quantity, which is zero for the first IKE
  555. request in each direction. The IKE_SA initial setup messages will
  556. always be numbered 0 and 1. Each endpoint in the IKE Security
  557. Association maintains two "current" Message IDs: the next one to be
  558. used for a request it initiates and the next one it expects to see in
  559. a request from the other end. These counters increment as requests
  560. are generated and received. Responses always contain the same
  561. message ID as the corresponding request. That means that after the
  562. initial exchange, each integer n may appear as the message ID in four
  563. distinct messages: the nth request from the original IKE initiator,
  564. the corresponding response, the nth request from the original IKE
  565. responder, and the corresponding response. If the two ends make very
  566. different numbers of requests, the Message IDs in the two directions
  567. can be very different. There is no ambiguity in the messages,
  568. however, because the (I)nitiator and (R)esponse bits in the message
  569. header specify which of the four messages a particular one is.
  570. Note that Message IDs are cryptographically protected and provide
  571. protection against message replays. In the unlikely event that
  572. Message IDs grow too large to fit in 32 bits, the IKE_SA MUST be
  573. closed. Rekeying an IKE_SA resets the sequence numbers.
  574. 2.3. Window Size for Overlapping Requests
  575. In order to maximize IKE throughput, an IKE endpoint MAY issue
  576. multiple requests before getting a response to any of them if the
  577. other endpoint has indicated its ability to handle such requests.
  578. For simplicity, an IKE implementation MAY choose to process requests
  579. strictly in order and/or wait for a response to one request before
  580. issuing another. Certain rules must be followed to ensure
  581. interoperability between implementations using different strategies.
  582. After an IKE_SA is set up, either end can initiate one or more
  583. requests. These requests may pass one another over the network. An
  584. IKE endpoint MUST be prepared to accept and process a request while
  585. Kaufman Standards Track [Page 14]
  586. RFC 4306 IKEv2 December 2005
  587. it has a request outstanding in order to avoid a deadlock in this
  588. situation. An IKE endpoint SHOULD be prepared to accept and process
  589. multiple requests while it has a request outstanding.
  590. An IKE endpoint MUST wait for a response to each of its messages
  591. before sending a subsequent message unless it has received a
  592. SET_WINDOW_SIZE Notify message from its peer informing it that the
  593. peer is prepared to maintain state for multiple outstanding messages
  594. in order to allow greater throughput.
  595. An IKE endpoint MUST NOT exceed the peer's stated window size for
  596. transmitted IKE requests. In other words, if the responder stated
  597. its window size is N, then when the initiator needs to make a request
  598. X, it MUST wait until it has received responses to all requests up
  599. through request X-N. An IKE endpoint MUST keep a copy of (or be able
  600. to regenerate exactly) each request it has sent until it receives the
  601. corresponding response. An IKE endpoint MUST keep a copy of (or be
  602. able to regenerate exactly) the number of previous responses equal to
  603. its declared window size in case its response was lost and the
  604. initiator requests its retransmission by retransmitting the request.
  605. An IKE endpoint supporting a window size greater than one SHOULD be
  606. capable of processing incoming requests out of order to maximize
  607. performance in the event of network failures or packet reordering.
  608. 2.4. State Synchronization and Connection Timeouts
  609. An IKE endpoint is allowed to forget all of its state associated with
  610. an IKE_SA and the collection of corresponding CHILD_SAs at any time.
  611. This is the anticipated behavior in the event of an endpoint crash
  612. and restart. It is important when an endpoint either fails or
  613. reinitializes its state that the other endpoint detect those
  614. conditions and not continue to waste network bandwidth by sending
  615. packets over discarded SAs and having them fall into a black hole.
  616. Since IKE is designed to operate in spite of Denial of Service (DoS)
  617. attacks from the network, an endpoint MUST NOT conclude that the
  618. other endpoint has failed based on any routing information (e.g.,
  619. ICMP messages) or IKE messages that arrive without cryptographic
  620. protection (e.g., Notify messages complaining about unknown SPIs).
  621. An endpoint MUST conclude that the other endpoint has failed only
  622. when repeated attempts to contact it have gone unanswered for a
  623. timeout period or when a cryptographically protected INITIAL_CONTACT
  624. notification is received on a different IKE_SA to the same
  625. authenticated identity. An endpoint SHOULD suspect that the other
  626. endpoint has failed based on routing information and initiate a
  627. request to see whether the other endpoint is alive. To check whether
  628. the other side is alive, IKE specifies an empty INFORMATIONAL message
  629. Kaufman Standards Track [Page 15]
  630. RFC 4306 IKEv2 December 2005
  631. that (like all IKE requests) requires an acknowledgement (note that
  632. within the context of an IKE_SA, an "empty" message consists of an
  633. IKE header followed by an Encrypted payload that contains no
  634. payloads). If a cryptographically protected message has been
  635. received from the other side recently, unprotected notifications MAY
  636. be ignored. Implementations MUST limit the rate at which they take
  637. actions based on unprotected messages.
  638. Numbers of retries and lengths of timeouts are not covered in this
  639. specification because they do not affect interoperability. It is
  640. suggested that messages be retransmitted at least a dozen times over
  641. a period of at least several minutes before giving up on an SA, but
  642. different environments may require different rules. To be a good
  643. network citizen, retranmission times MUST increase exponentially to
  644. avoid flooding the network and making an existing congestion
  645. situation worse. If there has only been outgoing traffic on all of
  646. the SAs associated with an IKE_SA, it is essential to confirm
  647. liveness of the other endpoint to avoid black holes. If no
  648. cryptographically protected messages have been received on an IKE_SA
  649. or any of its CHILD_SAs recently, the system needs to perform a
  650. liveness check in order to prevent sending messages to a dead peer.
  651. Receipt of a fresh cryptographically protected message on an IKE_SA
  652. or any of its CHILD_SAs ensures liveness of the IKE_SA and all of its
  653. CHILD_SAs. Note that this places requirements on the failure modes
  654. of an IKE endpoint. An implementation MUST NOT continue sending on
  655. any SA if some failure prevents it from receiving on all of the
  656. associated SAs. If CHILD_SAs can fail independently from one another
  657. without the associated IKE_SA being able to send a delete message,
  658. then they MUST be negotiated by separate IKE_SAs.
  659. There is a Denial of Service attack on the initiator of an IKE_SA
  660. that can be avoided if the initiator takes the proper care. Since
  661. the first two messages of an SA setup are not cryptographically
  662. protected, an attacker could respond to the initiator's message
  663. before the genuine responder and poison the connection setup attempt.
  664. To prevent this, the initiator MAY be willing to accept multiple
  665. responses to its first message, treat each as potentially legitimate,
  666. respond to it, and then discard all the invalid half-open connections
  667. when it receives a valid cryptographically protected response to any
  668. one of its requests. Once a cryptographically valid response is
  669. received, all subsequent responses should be ignored whether or not
  670. they are cryptographically valid.
  671. Note that with these rules, there is no reason to negotiate and agree
  672. upon an SA lifetime. If IKE presumes the partner is dead, based on
  673. repeated lack of acknowledgement to an IKE message, then the IKE SA
  674. and all CHILD_SAs set up through that IKE_SA are deleted.
  675. Kaufman Standards Track [Page 16]
  676. RFC 4306 IKEv2 December 2005
  677. An IKE endpoint may at any time delete inactive CHILD_SAs to recover
  678. resources used to hold their state. If an IKE endpoint chooses to
  679. delete CHILD_SAs, it MUST send Delete payloads to the other end
  680. notifying it of the deletion. It MAY similarly time out the IKE_SA.
  681. Closing the IKE_SA implicitly closes all associated CHILD_SAs. In
  682. this case, an IKE endpoint SHOULD send a Delete payload indicating
  683. that it has closed the IKE_SA.
  684. 2.5. Version Numbers and Forward Compatibility
  685. This document describes version 2.0 of IKE, meaning the major version
  686. number is 2 and the minor version number is zero. It is likely that
  687. some implementations will want to support both version 1.0 and
  688. version 2.0, and in the future, other versions.
  689. The major version number should be incremented only if the packet
  690. formats or required actions have changed so dramatically that an
  691. older version node would not be able to interoperate with a newer
  692. version node if it simply ignored the fields it did not understand
  693. and took the actions specified in the older specification. The minor
  694. version number indicates new capabilities, and MUST be ignored by a
  695. node with a smaller minor version number, but used for informational
  696. purposes by the node with the larger minor version number. For
  697. example, it might indicate the ability to process a newly defined
  698. notification message. The node with the larger minor version number
  699. would simply note that its correspondent would not be able to
  700. understand that message and therefore would not send it.
  701. If an endpoint receives a message with a higher major version number,
  702. it MUST drop the message and SHOULD send an unauthenticated
  703. notification message containing the highest version number it
  704. supports. If an endpoint supports major version n, and major version
  705. m, it MUST support all versions between n and m. If it receives a
  706. message with a major version that it supports, it MUST respond with
  707. that version number. In order to prevent two nodes from being
  708. tricked into corresponding with a lower major version number than the
  709. maximum that they both support, IKE has a flag that indicates that
  710. the node is capable of speaking a higher major version number.
  711. Thus, the major version number in the IKE header indicates the
  712. version number of the message, not the highest version number that
  713. the transmitter supports. If the initiator is capable of speaking
  714. versions n, n+1, and n+2, and the responder is capable of speaking
  715. versions n and n+1, then they will negotiate speaking n+1, where the
  716. initiator will set the flag indicating its ability to speak a higher
  717. version. If they mistakenly (perhaps through an active attacker
  718. Kaufman Standards Track [Page 17]
  719. RFC 4306 IKEv2 December 2005
  720. sending error messages) negotiate to version n, then both will notice
  721. that the other side can support a higher version number, and they
  722. MUST break the connection and reconnect using version n+1.
  723. Note that IKEv1 does not follow these rules, because there is no way
  724. in v1 of noting that you are capable of speaking a higher version
  725. number. So an active attacker can trick two v2-capable nodes into
  726. speaking v1. When a v2-capable node negotiates down to v1, it SHOULD
  727. note that fact in its logs.
  728. Also for forward compatibility, all fields marked RESERVED MUST be
  729. set to zero by a version 2.0 implementation and their content MUST be
  730. ignored by a version 2.0 implementation ("Be conservative in what you
  731. send and liberal in what you receive"). In this way, future versions
  732. of the protocol can use those fields in a way that is guaranteed to
  733. be ignored by implementations that do not understand them.
  734. Similarly, payload types that are not defined are reserved for future
  735. use; implementations of version 2.0 MUST skip over those payloads and
  736. ignore their contents.
  737. IKEv2 adds a "critical" flag to each payload header for further
  738. flexibility for forward compatibility. If the critical flag is set
  739. and the payload type is unrecognized, the message MUST be rejected
  740. and the response to the IKE request containing that payload MUST
  741. include a Notify payload UNSUPPORTED_CRITICAL_PAYLOAD, indicating an
  742. unsupported critical payload was included. If the critical flag is
  743. not set and the payload type is unsupported, that payload MUST be
  744. ignored.
  745. Although new payload types may be added in the future and may appear
  746. interleaved with the fields defined in this specification,
  747. implementations MUST send the payloads defined in this specification
  748. in the order shown in the figures in section 2 and implementations
  749. SHOULD reject as invalid a message with those payloads in any other
  750. order.
  751. 2.6. Cookies
  752. The term "cookies" originates with Karn and Simpson [RFC2522] in
  753. Photuris, an early proposal for key management with IPsec, and it has
  754. persisted. The Internet Security Association and Key Management
  755. Protocol (ISAKMP) [MSST98] fixed message header includes two eight-
  756. octet fields titled "cookies", and that syntax is used by both IKEv1
  757. and IKEv2 though in IKEv2 they are referred to as the IKE SPI and
  758. there is a new separate field in a Notify payload holding the cookie.
  759. The initial two eight-octet fields in the header are used as a
  760. connection identifier at the beginning of IKE packets. Each endpoint
  761. Kaufman Standards Track [Page 18]
  762. RFC 4306 IKEv2 December 2005
  763. chooses one of the two SPIs and SHOULD choose them so as to be unique
  764. identifiers of an IKE_SA. An SPI value of zero is special and
  765. indicates that the remote SPI value is not yet known by the sender.
  766. Unlike ESP and AH where only the recipient's SPI appears in the
  767. header of a message, in IKE the sender's SPI is also sent in every
  768. message. Since the SPI chosen by the original initiator of the
  769. IKE_SA is always sent first, an endpoint with multiple IKE_SAs open
  770. that wants to find the appropriate IKE_SA using the SPI it assigned
  771. must look at the I(nitiator) Flag bit in the header to determine
  772. whether it assigned the first or the second eight octets.
  773. In the first message of an initial IKE exchange, the initiator will
  774. not know the responder's SPI value and will therefore set that field
  775. to zero.
  776. An expected attack against IKE is state and CPU exhaustion, where the
  777. target is flooded with session initiation requests from forged IP
  778. addresses. This attack can be made less effective if an
  779. implementation of a responder uses minimal CPU and commits no state
  780. to an SA until it knows the initiator can receive packets at the
  781. address from which it claims to be sending them. To accomplish this,
  782. a responder SHOULD -- when it detects a large number of half-open
  783. IKE_SAs -- reject initial IKE messages unless they contain a Notify
  784. payload of type COOKIE. It SHOULD instead send an unprotected IKE
  785. message as a response and include COOKIE Notify payload with the
  786. cookie data to be returned. Initiators who receive such responses
  787. MUST retry the IKE_SA_INIT with a Notify payload of type COOKIE
  788. containing the responder supplied cookie data as the first payload
  789. and all other payloads unchanged. The initial exchange will then be
  790. as follows:
  791. Initiator Responder
  792. ----------- -----------
  793. HDR(A,0), SAi1, KEi, Ni -->
  794. <-- HDR(A,0), N(COOKIE)
  795. HDR(A,0), N(COOKIE), SAi1, KEi, Ni -->
  796. <-- HDR(A,B), SAr1, KEr, Nr, [CERTREQ]
  797. HDR(A,B), SK {IDi, [CERT,] [CERTREQ,] [IDr,]
  798. AUTH, SAi2, TSi, TSr} -->
  799. <-- HDR(A,B), SK {IDr, [CERT,] AUTH,
  800. SAr2, TSi, TSr}
  801. Kaufman Standards Track [Page 19]
  802. RFC 4306 IKEv2 December 2005
  803. The first two messages do not affect any initiator or responder state
  804. except for communicating the cookie. In particular, the message
  805. sequence numbers in the first four messages will all be zero and the
  806. message sequence numbers in the last two messages will be one. 'A' is
  807. the SPI assigned by the initiator, while 'B' is the SPI assigned by
  808. the responder.
  809. An IKE implementation SHOULD implement its responder cookie
  810. generation in such a way as to not require any saved state to
  811. recognize its valid cookie when the second IKE_SA_INIT message
  812. arrives. The exact algorithms and syntax they use to generate
  813. cookies do not affect interoperability and hence are not specified
  814. here. The following is an example of how an endpoint could use
  815. cookies to implement limited DOS protection.
  816. A good way to do this is to set the responder cookie to be:
  817. Cookie = <VersionIDofSecret> | Hash(Ni | IPi | SPIi | <secret>)
  818. where <secret> is a randomly generated secret known only to the
  819. responder and periodically changed and | indicates concatenation.
  820. <VersionIDofSecret> should be changed whenever <secret> is
  821. regenerated. The cookie can be recomputed when the IKE_SA_INIT
  822. arrives the second time and compared to the cookie in the received
  823. message. If it matches, the responder knows that the cookie was
  824. generated since the last change to <secret> and that IPi must be the
  825. same as the source address it saw the first time. Incorporating SPIi
  826. into the calculation ensures that if multiple IKE_SAs are being set
  827. up in parallel they will all get different cookies (assuming the
  828. initiator chooses unique SPIi's). Incorporating Ni into the hash
  829. ensures that an attacker who sees only message 2 can't successfully
  830. forge a message 3.
  831. If a new value for <secret> is chosen while there are connections in
  832. the process of being initialized, an IKE_SA_INIT might be returned
  833. with other than the current <VersionIDofSecret>. The responder in
  834. that case MAY reject the message by sending another response with a
  835. new cookie or it MAY keep the old value of <secret> around for a
  836. short time and accept cookies computed from either one. The
  837. responder SHOULD NOT accept cookies indefinitely after <secret> is
  838. changed, since that would defeat part of the denial of service
  839. protection. The responder SHOULD change the value of <secret>
  840. frequently, especially if under attack.
  841. Kaufman Standards Track [Page 20]
  842. RFC 4306 IKEv2 December 2005
  843. 2.7. Cryptographic Algorithm Negotiation
  844. The payload type known as "SA" indicates a proposal for a set of
  845. choices of IPsec protocols (IKE, ESP, and/or AH) for the SA as well
  846. as cryptographic algorithms associated with each protocol.
  847. An SA payload consists of one or more proposals. Each proposal
  848. includes one or more protocols (usually one). Each protocol contains
  849. one or more transforms -- each specifying a cryptographic algorithm.
  850. Each transform contains zero or more attributes (attributes are
  851. needed only if the transform identifier does not completely specify
  852. the cryptographic algorithm).
  853. This hierarchical structure was designed to efficiently encode
  854. proposals for cryptographic suites when the number of supported
  855. suites is large because multiple values are acceptable for multiple
  856. transforms. The responder MUST choose a single suite, which MAY be
  857. any subset of the SA proposal following the rules below:
  858. Each proposal contains one or more protocols. If a proposal is
  859. accepted, the SA response MUST contain the same protocols in the
  860. same order as the proposal. The responder MUST accept a single
  861. proposal or reject them all and return an error. (Example: if a
  862. single proposal contains ESP and AH and that proposal is accepted,
  863. both ESP and AH MUST be accepted. If ESP and AH are included in
  864. separate proposals, the responder MUST accept only one of them).
  865. Each IPsec protocol proposal contains one or more transforms.
  866. Each transform contains a transform type. The accepted
  867. cryptographic suite MUST contain exactly one transform of each
  868. type included in the proposal. For example: if an ESP proposal
  869. includes transforms ENCR_3DES, ENCR_AES w/keysize 128, ENCR_AES
  870. w/keysize 256, AUTH_HMAC_MD5, and AUTH_HMAC_SHA, the accepted
  871. suite MUST contain one of the ENCR_ transforms and one of the
  872. AUTH_ transforms. Thus, six combinations are acceptable.
  873. Since the initiator sends its Diffie-Hellman value in the
  874. IKE_SA_INIT, it must guess the Diffie-Hellman group that the
  875. responder will select from its list of supported groups. If the
  876. initiator guesses wrong, the responder will respond with a Notify
  877. payload of type INVALID_KE_PAYLOAD indicating the selected group. In
  878. this case, the initiator MUST retry the IKE_SA_INIT with the
  879. corrected Diffie-Hellman group. The initiator MUST again propose its
  880. full set of acceptable cryptographic suites because the rejection
  881. message was unauthenticated and otherwise an active attacker could
  882. trick the endpoints into negotiating a weaker suite than a stronger
  883. one that they both prefer.
  884. Kaufman Standards Track [Page 21]
  885. RFC 4306 IKEv2 December 2005
  886. 2.8. Rekeying
  887. IKE, ESP, and AH security associations use secret keys that SHOULD be
  888. used only for a limited amount of time and to protect a limited
  889. amount of data. This limits the lifetime of the entire security
  890. association. When the lifetime of a security association expires,
  891. the security association MUST NOT be used. If there is demand, new
  892. security associations MAY be established. Reestablishment of
  893. security associations to take the place of ones that expire is
  894. referred to as "rekeying".
  895. To allow for minimal IPsec implementations, the ability to rekey SAs
  896. without restarting the entire IKE_SA is optional. An implementation
  897. MAY refuse all CREATE_CHILD_SA requests within an IKE_SA. If an SA
  898. has expired or is about to expire and rekeying attempts using the
  899. mechanisms described here fail, an implementation MUST close the
  900. IKE_SA and any associated CHILD_SAs and then MAY start new ones.
  901. Implementations SHOULD support in-place rekeying of SAs, since doing
  902. so offers better performance and is likely to reduce the number of
  903. packets lost during the transition.
  904. To rekey a CHILD_SA within an existing IKE_SA, create a new,
  905. equivalent SA (see section 2.17 below), and when the new one is
  906. established, delete the old one. To rekey an IKE_SA, establish a new
  907. equivalent IKE_SA (see section 2.18 below) with the peer to whom the
  908. old IKE_SA is shared using a CREATE_CHILD_SA within the existing
  909. IKE_SA. An IKE_SA so created inherits all of the original IKE_SA's
  910. CHILD_SAs. Use the new IKE_SA for all control messages needed to
  911. maintain the CHILD_SAs created by the old IKE_SA, and delete the old
  912. IKE_SA. The Delete payload to delete itself MUST be the last request
  913. sent over an IKE_SA.
  914. SAs SHOULD be rekeyed proactively, i.e., the new SA should be
  915. established before the old one expires and becomes unusable. Enough
  916. time should elapse between the time the new SA is established and the
  917. old one becomes unusable so that traffic can be switched over to the
  918. new SA.
  919. A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes
  920. were negotiated. In IKEv2, each end of the SA is responsible for
  921. enforcing its own lifetime policy on the SA and rekeying the SA when
  922. necessary. If the two ends have different lifetime policies, the end
  923. with the shorter lifetime will end up always being the one to request
  924. the rekeying. If an SA bundle has been inactive for a long time and
  925. if an endpoint would not initiate the SA in the absence of traffic,
  926. the endpoint MAY choose to close the SA instead of rekeying it when
  927. its lifetime expires. It SHOULD do so if there has been no traffic
  928. since the last time the SA was rekeyed.
  929. Kaufman Standards Track [Page 22]
  930. RFC 4306 IKEv2 December 2005
  931. If the two ends have the same lifetime policies, it is possible that
  932. both will initiate a rekeying at the same time (which will result in
  933. redundant SAs). To reduce the probability of this happening, the
  934. timing of rekeying requests SHOULD be jittered (delayed by a random
  935. amount of time after the need for rekeying is noticed).
  936. This form of rekeying may temporarily result in multiple similar SAs
  937. between the same pairs of nodes. When there are two SAs eligible to
  938. receive packets, a node MUST accept incoming packets through either
  939. SA. If redundant SAs are created though such a collision, the SA
  940. created with the lowest of the four nonces used in the two exchanges
  941. SHOULD be closed by the endpoint that created it.
  942. Note that IKEv2 deliberately allows parallel SAs with the same
  943. traffic selectors between common endpoints. One of the purposes of
  944. this is to support traffic quality of service (QoS) differences among
  945. the SAs (see [RFC2474], [RFC2475], and section 4.1 of [RFC2983]).
  946. Hence unlike IKEv1, the combination of the endpoints and the traffic
  947. selectors may not uniquely identify an SA between those endpoints, so
  948. the IKEv1 rekeying heuristic of deleting SAs on the basis of
  949. duplicate traffic selectors SHOULD NOT be used.
  950. The node that initiated the surviving rekeyed SA SHOULD delete the
  951. replaced SA after the new one is established.
  952. There are timing windows -- particularly in the presence of lost
  953. packets -- where endpoints may not agree on the state of an SA. The
  954. responder to a CREATE_CHILD_SA MUST be prepared to accept messages on
  955. an SA before sending its response to the creation request, so there
  956. is no ambiguity for the initiator. The initiator MAY begin sending
  957. on an SA as soon as it processes the response. The initiator,
  958. however, cannot receive on a newly created SA until it receives and
  959. processes the response to its CREATE_CHILD_SA request. How, then, is
  960. the responder to know when it is OK to send on the newly created SA?
  961. From a technical correctness and interoperability perspective, the
  962. responder MAY begin sending on an SA as soon as it sends its response
  963. to the CREATE_CHILD_SA request. In some situations, however, this
  964. could result in packets unnecessarily being dropped, so an
  965. implementation MAY want to defer such sending.
  966. The responder can be assured that the initiator is prepared to
  967. receive messages on an SA if either (1) it has received a
  968. cryptographically valid message on the new SA, or (2) the new SA
  969. rekeys an existing SA and it receives an IKE request to close the
  970. replaced SA. When rekeying an SA, the responder SHOULD continue to
  971. send messages on the old SA until one of those events occurs. When
  972. establishing a new SA, the responder MAY defer sending messages on a
  973. Kaufman Standards Track [Page 23]
  974. RFC 4306 IKEv2 December 2005
  975. new SA until either it receives one or a timeout has occurred. If an
  976. initiator receives a message on an SA for which it has not received a
  977. response to its CREATE_CHILD_SA request, it SHOULD interpret that as
  978. a likely packet loss and retransmit the CREATE_CHILD_SA request. An
  979. initiator MAY send a dummy message on a newly created SA if it has no
  980. messages queued in order to assure the responder that the initiator
  981. is ready to receive messages.
  982. 2.9. Traffic Selector Negotiation
  983. When an IP packet is received by an RFC4301-compliant IPsec subsystem
  984. and matches a "protect" selector in its Security Policy Database
  985. (SPD), the subsystem MUST protect that packet with IPsec. When no SA
  986. exists yet, it is the task of IKE to create it. Maintenance of a
  987. system's SPD is outside the scope of IKE (see [PFKEY] for an example
  988. protocol), though some implementations might update their SPD in
  989. connection with the running of IKE (for an example scenario, see
  990. section 1.1.3).
  991. Traffic Selector (TS) payloads allow endpoints to communicate some of
  992. the information from their SPD to their peers. TS payloads specify
  993. the selection criteria for packets that will be forwarded over the
  994. newly set up SA. This can serve as a consistency check in some
  995. scenarios to assure that the SPDs are consistent. In others, it
  996. guides the dynamic update of the SPD.
  997. Two TS payloads appear in each of the messages in the exchange that
  998. creates a CHILD_SA pair. Each TS payload contains one or more
  999. Traffic Selectors. Each Traffic Selector consists of an address
  1000. range (IPv4 or IPv6), a port range, and an IP protocol ID. In
  1001. support of the scenario described in section 1.1.3, an initiator may
  1002. request that the responder assign an IP address and tell the
  1003. initiator what it is.
  1004. IKEv2 allows the responder to choose a subset of the traffic proposed
  1005. by the initiator. This could happen when the configurations of the
  1006. two endpoints are being updated but only one end has received the new
  1007. information. Since the two endpoints may be configured by different
  1008. people, the incompatibility may persist for an extended period even
  1009. in the absence of errors. It also allows for intentionally different
  1010. configurations, as when one end is configured to tunnel all addresses
  1011. and depends on the other end to have the up-to-date list.
  1012. The first of the two TS payloads is known as TSi (Traffic Selector-
  1013. initiator). The second is known as TSr (Traffic Selector-responder).
  1014. TSi specifies the source address of traffic forwarded from (or the
  1015. destination address of traffic forwarded to) the initiator of the
  1016. CHILD_SA pair. TSr specifies the destination address of the traffic
  1017. Kaufman Standards Track [Page 24]
  1018. RFC 4306 IKEv2 December 2005
  1019. forwarded to (or the source address of the traffic forwarded from)
  1020. the responder of the CHILD_SA pair. For example, if the original
  1021. initiator request the creation of a CHILD_SA pair, and wishes to
  1022. tunnel all traffic from subnet 192.0.1.* on the initiator's side to
  1023. subnet 192.0.2.* on the responder's side, the initiator would include
  1024. a single traffic selector in each TS payload. TSi would specify the
  1025. address range (192.0.1.0 - 192.0.1.255) and TSr would specify the
  1026. address range (192.0.2.0 - 192.0.2.255). Assuming that proposal was
  1027. acceptable to the responder, it would send identical TS payloads
  1028. back. (Note: The IP address range 192.0.2.* has been reserved for
  1029. use in examples in RFCs and similar documents. This document needed
  1030. two such ranges, and so also used 192.0.1.*. This should not be
  1031. confused with any actual address.)
  1032. The responder is allowed to narrow the choices by selecting a subset
  1033. of the traffic, for instance by eliminating or narrowing the range of
  1034. one or more members of the set of traffic selectors, provided the set
  1035. does not become the NULL set.
  1036. It is possible for the responder's policy to contain multiple smaller
  1037. ranges, all encompassed by the initiator's traffic selector, and with
  1038. the responder's policy being that each of those ranges should be sent
  1039. over a different SA. Continuing the example above, the responder
  1040. might have a policy of being willing to tunnel those addresses to and
  1041. from the initiator, but might require that each address pair be on a
  1042. separately negotiated CHILD_SA. If the initiator generated its
  1043. request in response to an incoming packet from 192.0.1.43 to
  1044. 192.0.2.123, there would be no way for the responder to determine
  1045. which pair of addresses should be included in this tunnel, and it
  1046. would have to make a guess or reject the request with a status of
  1047. SINGLE_PAIR_REQUIRED.
  1048. To enable the responder to choose the appropriate range in this case,
  1049. if the initiator has requested the SA due to a data packet, the
  1050. initiator SHOULD include as the first traffic selector in each of TSi
  1051. and TSr a very specific traffic selector including the addresses in
  1052. the packet triggering the request. In the example, the initiator
  1053. would include in TSi two traffic selectors: the first containing the
  1054. address range (192.0.1.43 - 192.0.1.43) and the source port and IP
  1055. protocol from the packet and the second containing (192.0.1.0 -
  1056. 192.0.1.255) with all ports and IP protocols. The initiator would
  1057. similarly include two traffic selectors in TSr.
  1058. If the responder's policy does not allow it to accept the entire set
  1059. of traffic selectors in the initiator's request, but does allow him
  1060. to accept the first selector of TSi and TSr, then the responder MUST
  1061. narrow the traffic selectors to a subset that includes the
  1062. Kaufman Standards Track [Page 25]
  1063. RFC 4306 IKEv2 December 2005
  1064. initiator's first choices. In this example, the responder might
  1065. respond with TSi being (192.0.1.43 - 192.0.1.43) with all ports and
  1066. IP protocols.
  1067. If the initiator creates the CHILD_SA pair not in response to an
  1068. arriving packet, but rather, say, upon startup, then there may be no
  1069. specific addresses the initiator prefers for the initial tunnel over
  1070. any other. In that case, the first values in TSi and TSr MAY be
  1071. ranges rather than specific values, and the responder chooses a
  1072. subset of the initiator's TSi and TSr that are acceptable. If more
  1073. than one subset is acceptable but their union is not, the responder
  1074. MUST accept some subset and MAY include a Notify payload of type
  1075. ADDITIONAL_TS_POSSIBLE to indicate that the initiator might want to
  1076. try again. This case will occur only when the initiator and
  1077. responder are configured differently from one another. If the
  1078. initiator and responder agree on the granularity of tunnels, the
  1079. initiator will never request a tunnel wider than the responder will
  1080. accept. Such misconfigurations SHOULD be recorded in error logs.
  1081. 2.10. Nonces
  1082. The IKE_SA_INIT messages each contain a nonce. These nonces are used
  1083. as inputs to cryptographic functions. The CREATE_CHILD_SA request
  1084. and the CREATE_CHILD_SA response also contain nonces. These nonces
  1085. are used to add freshness to the key derivation technique used to
  1086. obtain keys for CHILD_SA, and to ensure creation of strong pseudo-
  1087. random bits from the Diffie-Hellman key. Nonces used in IKEv2 MUST
  1088. be randomly chosen, MUST be at least 128 bits in size, and MUST be at
  1089. least half the key size of the negotiated prf. ("prf" refers to
  1090. "pseudo-random function", one of the cryptographic algorithms
  1091. negotiated in the IKE exchange.) If the same random number source is
  1092. used for both keys and nonces, care must be taken to ensure that the
  1093. latter use does not compromise the former.
  1094. 2.11. Address and Port Agility
  1095. IKE runs over UDP ports 500 and 4500, and implicitly sets up ESP and
  1096. AH associations for the same IP addresses it runs over. The IP
  1097. addresses and ports in the outer header are, however, not themselves
  1098. cryptographically protected, and IKE is designed to work even through
  1099. Network Address Translation (NAT) boxes. An implementation MUST
  1100. accept incoming requests even if the source port is not 500 or 4500,
  1101. and MUST respond to the address and port from which the request was
  1102. received. It MUST specify the address and port at which the request
  1103. was received as the source address and port in the response. IKE
  1104. functions identically over IPv4 or IPv6.
  1105. Kaufman Standards Track [Page 26]
  1106. RFC 4306 IKEv2 December 2005
  1107. 2.12. Reuse of Diffie-Hellman Exponentials
  1108. IKE generates keying material using an ephemeral Diffie-Hellman
  1109. exchange in order to gain the property of "perfect forward secrecy".
  1110. This means that once a connection is closed and its corresponding
  1111. keys are forgotten, even someone who has recorded all of the data
  1112. from the connection and gets access to all of the long-term keys of
  1113. the two endpoints cannot reconstruct the keys used to protect the
  1114. conversation without doing a brute force search of the session key
  1115. space.
  1116. Achieving perfect forward secrecy requires that when a connection is
  1117. closed, each endpoint MUST forget not only the keys used by the
  1118. connection but also any information that could be used to recompute
  1119. those keys. In particular, it MUST forget the secrets used in the
  1120. Diffie-Hellman calculation and any state that may persist in the
  1121. state of a pseudo-random number generator that could be used to
  1122. recompute the Diffie-Hellman secrets.
  1123. Since the computing of Diffie-Hellman exponentials is computationally
  1124. expensive, an endpoint may find it advantageous to reuse those
  1125. exponentials for multiple connection setups. There are several
  1126. reasonable strategies for doing this. An endpoint could choose a new
  1127. exponential only periodically though this could result in less-than-
  1128. perfect forward secrecy if some connection lasts for less than the
  1129. lifetime of the exponential. Or it could keep track of which
  1130. exponential was used for each connection and delete the information
  1131. associated with the exponential only when some corresponding
  1132. connection was closed. This would allow the exponential to be reused
  1133. without losing perfect forward secrecy at the cost of maintaining
  1134. more state.
  1135. Decisions as to whether and when to reuse Diffie-Hellman exponentials
  1136. is a private decision in the sense that it will not affect
  1137. interoperability. An implementation that reuses exponentials MAY
  1138. choose to remember the exponential used by the other endpoint on past
  1139. exchanges and if one is reused to avoid the second half of the
  1140. calculation.
  1141. 2.13. Generating Keying Material
  1142. In the context of the IKE_SA, four cryptographic algorithms are
  1143. negotiated: an encryption algorithm, an integrity protection
  1144. algorithm, a Diffie-Hellman group, and a pseudo-random function
  1145. (prf). The pseudo-random function is used for the construction of
  1146. keying material for all of the cryptographic algorithms used in both
  1147. the IKE_SA and the CHILD_SAs.
  1148. Kaufman Standards Track [Page 27]
  1149. RFC 4306 IKEv2 December 2005
  1150. We assume that each encryption algorithm and integrity protection
  1151. algorithm uses a fixed-size key and that any randomly chosen value of
  1152. that fixed size can serve as an appropriate key. For algorithms that
  1153. accept a variable length key, a fixed key size MUST be specified as
  1154. part of the cryptographic transform negotiated. For algorithms for
  1155. which not all values are valid keys (such as DES or 3DES with key
  1156. parity), the algorithm by which keys are derived from arbitrary
  1157. values MUST be specified by the cryptographic transform. For
  1158. integrity protection functions based on Hashed Message Authentication
  1159. Code (HMAC), the fixed key size is the size of the output of the
  1160. underlying hash function. When the prf function takes a variable
  1161. length key, variable length data, and produces a fixed-length output
  1162. (e.g., when using HMAC), the formulas in this document apply. When
  1163. the key for the prf function has fixed length, the data provided as a
  1164. key is truncated or padded with zeros as necessary unless exceptional
  1165. processing is explained following the formula.
  1166. Keying material will always be derived as the output of the
  1167. negotiated prf algorithm. Since the amount of keying material needed
  1168. may be greater than the size of the output of the prf algorithm, we
  1169. will use the prf iteratively. We will use the terminology prf+ to
  1170. describe the function that outputs a pseudo-random stream based on
  1171. the inputs to a prf as follows: (where | indicates concatenation)
  1172. prf+ (K,S) = T1 | T2 | T3 | T4 | ...
  1173. where:
  1174. T1 = prf (K, S | 0x01)
  1175. T2 = prf (K, T1 | S | 0x02)
  1176. T3 = prf (K, T2 | S | 0x03)
  1177. T4 = prf (K, T3 | S | 0x04)
  1178. continuing as needed to compute all required keys. The keys are
  1179. taken from the output string without regard to boundaries (e.g., if
  1180. the required keys are a 256-bit Advanced Encryption Standard (AES)
  1181. key and a 160-bit HMAC key, and the prf function generates 160 bits,
  1182. the AES key will come from T1 and the beginning of T2, while the HMAC
  1183. key will come from the rest of T2 and the beginning of T3).
  1184. The constant concatenated to the end of each string feeding the prf
  1185. is a single octet. prf+ in this document is not defined beyond 255
  1186. times the size of the prf output.
  1187. 2.14. Generating Keying Material for the IKE_SA
  1188. The shared keys are computed as follows. A quantity called SKEYSEED
  1189. is calculated from the nonces exchanged during the IKE_SA_INIT
  1190. exchange and the Diffie-Hellman shared secret established during that
  1191. Kaufman Standards Track [Page 28]
  1192. RFC 4306 IKEv2 December 2005
  1193. exchange. SKEYSEED is used to calculate seven other secrets: SK_d
  1194. used for deriving new keys for the CHILD_SAs established with this
  1195. IKE_SA; SK_ai and SK_ar used as a key to the integrity protection
  1196. algorithm for authenticating the component messages of subsequent
  1197. exchanges; SK_ei and SK_er used for encrypting (and of course
  1198. decrypting) all subsequent exchanges; and SK_pi and SK_pr, which are
  1199. used when generating an AUTH payload.
  1200. SKEYSEED and its derivatives are computed as follows:
  1201. SKEYSEED = prf(Ni | Nr, g^ir)
  1202. {SK_d | SK_ai | SK_ar | SK_ei | SK_er | SK_pi | SK_pr } = prf+
  1203. (SKEYSEED, Ni | Nr | SPIi | SPIr )
  1204. (indicating that the quantities SK_d, SK_ai, SK_ar, SK_ei, SK_er,
  1205. SK_pi, and SK_pr are taken in order from the generated bits of the
  1206. prf+). g^ir is the shared secret from the ephemeral Diffie-Hellman
  1207. exchange. g^ir is represented as a string of octets in big endian
  1208. order padded with zeros if necessary to make it the length of the
  1209. modulus. Ni and Nr are the nonces, stripped of any headers. If the
  1210. negotiated prf takes a fixed-length key and the lengths of Ni and Nr
  1211. do not add up to that length, half the bits must come from Ni and
  1212. half from Nr, taking the first bits of each.
  1213. The two directions of traffic flow use different keys. The keys used
  1214. to protect messages from the original initiator are SK_ai and SK_ei.
  1215. The keys used to protect messages in the other direction are SK_ar
  1216. and SK_er. Each algorithm takes a fixed number of bits of keying
  1217. material, which is specified as part of the algorithm. For integrity
  1218. algorithms based on a keyed hash, the key size is always equal to the
  1219. length of the output of the underlying hash function.
  1220. 2.15. Authentication of the IKE_SA
  1221. When not using extensible authentication (see section 2.16), the
  1222. peers are authenticated by having each sign (or MAC using a shared
  1223. secret as the key) a block of data. For the responder, the octets to
  1224. be signed start with the first octet of the first SPI in the header
  1225. of the second message and end with the last octet of the last payload
  1226. in the second message. Appended to this (for purposes of computing
  1227. the signature) are the initiator's nonce Ni (just the value, not the
  1228. payload containing it), and the value prf(SK_pr,IDr') where IDr' is
  1229. the responder's ID payload excluding the fixed header. Note that
  1230. neither the nonce Ni nor the value prf(SK_pr,IDr') are transmitted.
  1231. Similarly, the initiator signs the first message, starting with the
  1232. first octet of the first SPI in the header and ending with the last
  1233. octet of the last payload. Appended to this (for purposes of
  1234. Kaufman Standards Track [Page 29]
  1235. RFC 4306 IKEv2 December 2005
  1236. computing the signature) are the responder's nonce Nr, and the value
  1237. prf(SK_pi,IDi'). In the above calculation, IDi' and IDr' are the
  1238. entire ID payloads excluding the fixed header. It is critical to the
  1239. security of the exchange that each side sign the other side's nonce.
  1240. Note that all of the payloads are included under the signature,
  1241. including any payload types not defined in this document. If the
  1242. first message of the exchange is sent twice (the second time with a
  1243. responder cookie and/or a different Diffie-Hellman group), it is the
  1244. second version of the message that is signed.
  1245. Optionally, messages 3 and 4 MAY include a certificate, or
  1246. certificate chain providing evidence that the key used to compute a
  1247. digital signature belongs to the name in the ID payload. The
  1248. signature or MAC will be computed using algorithms dictated by the
  1249. type of key used by the signer, and specified by the Auth Method
  1250. field in the Authentication payload. There is no requirement that
  1251. the initiator and responder sign with the same cryptographic
  1252. algorithms. The choice of cryptographic algorithms depends on the
  1253. type of key each has. In particular, the initiator may be using a
  1254. shared key while the responder may have a public signature key and
  1255. certificate. It will commonly be the case (but it is not required)
  1256. that if a shared secret is used for authentication that the same key
  1257. is used in both directions. Note that it is a common but typically
  1258. insecure practice to have a shared key derived solely from a user-
  1259. chosen password without incorporating another source of randomness.
  1260. This is typically insecure because user-chosen passwords are unlikely
  1261. to have sufficient unpredictability to resist dictionary attacks and
  1262. these attacks are not prevented in this authentication method.
  1263. (Applications using password-based authentication for bootstrapping
  1264. and IKE_SA should use the authentication method in section 2.16,
  1265. which is designed to prevent off-line dictionary attacks.) The pre-
  1266. shared key SHOULD contain as much unpredictability as the strongest
  1267. key being negotiated. In the case of a pre-shared key, the AUTH
  1268. value is computed as:
  1269. AUTH = prf(prf(Shared Secret,"Key Pad for IKEv2"), <msg octets>)
  1270. where the string "Key Pad for IKEv2" is 17 ASCII characters without
  1271. null termination. The shared secret can be variable length. The pad
  1272. string is added so that if the shared secret is derived from a
  1273. password, the IKE implementation need not store the password in
  1274. cleartext, but rather can store the value prf(Shared Secret,"Key Pad
  1275. for IKEv2"), which could not be used as a password equivalent for
  1276. protocols other than IKEv2. As noted above, deriving the shared
  1277. secret from a password is not secure. This construction is used
  1278. because it is anticipated that people will do it anyway. The
  1279. Kaufman Standards Track [Page 30]
  1280. RFC 4306 IKEv2 December 2005
  1281. management interface by which the Shared Secret is provided MUST
  1282. accept ASCII strings of at least 64 octets and MUST NOT add a null
  1283. terminator before using them as shared secrets. It MUST also accept
  1284. a HEX encoding of the Shared Secret. The management interface MAY
  1285. accept other encodings if the algorithm for translating the encoding
  1286. to a binary string is specified. If the negotiated prf takes a
  1287. fixed-size key, the shared secret MUST be of that fixed size.
  1288. 2.16. Extensible Authentication Protocol Methods
  1289. In addition to authentication using public key signatures and shared
  1290. secrets, IKE supports authentication using methods defined in RFC
  1291. 3748 [EAP]. Typically, these methods are asymmetric (designed for a
  1292. user authenticating to a server), and they may not be mutual. For
  1293. this reason, these protocols are typically used to authenticate the
  1294. initiator to the responder and MUST be used in conjunction with a
  1295. public key signature based authentication of the responder to the
  1296. initiator. These methods are often associated with mechanisms
  1297. referred to as "Legacy Authentication" mechanisms.
  1298. While this memo references [EAP] with the intent that new methods can
  1299. be added in the future without updating this specification, some
  1300. simpler variations are documented here and in section 3.16. [EAP]
  1301. defines an authentication protocol requiring a variable number of
  1302. messages. Extensible Authentication is implemented in IKE as
  1303. additional IKE_AUTH exchanges that MUST be completed in order to
  1304. initialize the IKE_SA.
  1305. An initiator indicates a desire to use extensible authentication by
  1306. leaving out the AUTH payload from message 3. By including an IDi
  1307. payload but not an AUTH payload, the initiator has declared an
  1308. identity but has not proven it. If the responder is willing to use
  1309. an extensible authentication method, it will place an Extensible
  1310. Authentication Protocol (EAP) payload in message 4 and defer sending
  1311. SAr2, TSi, and TSr until initiator authentication is complete in a
  1312. subsequent IKE_AUTH exchange. In the case of a minimal extensible
  1313. authentication, the initial SA establishment will appear as follows:
  1314. Kaufman Standards Track [Page 31]
  1315. RFC 4306 IKEv2 December 2005
  1316. Initiator Responder
  1317. ----------- -----------
  1318. HDR, SAi1, KEi, Ni -->
  1319. <-- HDR, SAr1, KEr, Nr, [CERTREQ]
  1320. HDR, SK {IDi, [CERTREQ,] [IDr,]
  1321. SAi2, TSi, TSr} -->
  1322. <-- HDR, SK {IDr, [CERT,] AUTH,
  1323. EAP }
  1324. HDR, SK {EAP} -->
  1325. <-- HDR, SK {EAP (success)}
  1326. HDR, SK {AUTH} -->
  1327. <-- HDR, SK {AUTH, SAr2, TSi, TSr }
  1328. For EAP methods that create a shared key as a side effect of
  1329. authentication, that shared key MUST be used by both the initiator
  1330. and responder to generate AUTH payloads in messages 7 and 8 using the
  1331. syntax for shared secrets specified in section 2.15. The shared key
  1332. from EAP is the field from the EAP specification named MSK. The
  1333. shared key generated during an IKE exchange MUST NOT be used for any
  1334. other purpose.
  1335. EAP methods that do not establish a shared key SHOULD NOT be used, as
  1336. they are subject to a number of man-in-the-middle attacks [EAPMITM]
  1337. if these EAP methods are used in other protocols that do not use a
  1338. server-authenticated tunnel. Please see the Security Considerations
  1339. section for more details. If EAP methods that do not generate a
  1340. shared key are used, the AUTH payloads in messages 7 and 8 MUST be
  1341. generated using SK_pi and SK_pr, respectively.
  1342. The initiator of an IKE_SA using EAP SHOULD be capable of extending
  1343. the initial protocol exchange to at least ten IKE_AUTH exchanges in
  1344. the event the responder sends notification messages and/or retries
  1345. the authentication prompt. Once the protocol exchange defined by the
  1346. chosen EAP authentication method has successfully terminated, the
  1347. responder MUST send an EAP payload containing the Success message.
  1348. Similarly, if the authentication method has failed, the responder
  1349. MUST send an EAP payload containing the Failure message. The
  1350. responder MAY at any time terminate the IKE exchange by sending an
  1351. EAP payload containing the Failure message.
  1352. Kaufman Standards Track [Page 32]
  1353. RFC 4306 IKEv2 December 2005
  1354. Following such an extended exchange, the EAP AUTH payloads MUST be
  1355. included in the two messages following the one containing the EAP
  1356. Success message.
  1357. 2.17. Generating Keying Material for CHILD_SAs
  1358. A single CHILD_SA is created by the IKE_AUTH exchange, and additional
  1359. CHILD_SAs can optionally be created in CREATE_CHILD_SA exchanges.
  1360. Keying material for them is generated as follows:
  1361. KEYMAT = prf+(SK_d, Ni | Nr)
  1362. Where Ni and Nr are the nonces from the IKE_SA_INIT exchange if this
  1363. request is the first CHILD_SA created or the fresh Ni and Nr from the
  1364. CREATE_CHILD_SA exchange if this is a subsequent creation.
  1365. For CREATE_CHILD_SA exchanges including an optional Diffie-Hellman
  1366. exchange, the keying material is defined as:
  1367. KEYMAT = prf+(SK_d, g^ir (new) | Ni | Nr )
  1368. where g^ir (new) is the shared secret from the ephemeral Diffie-
  1369. Hellman exchange of this CREATE_CHILD_SA exchange (represented as an
  1370. octet string in big endian order padded with zeros in the high-order
  1371. bits if necessary to make it the length of the modulus).
  1372. A single CHILD_SA negotiation may result in multiple security
  1373. associations. ESP and AH SAs exist in pairs (one in each direction),
  1374. and four SAs could be created in a single CHILD_SA negotiation if a
  1375. combination of ESP and AH is being negotiated.
  1376. Keying material MUST be taken from the expanded KEYMAT in the
  1377. following order:
  1378. All keys for SAs carrying data from the initiator to the responder
  1379. are taken before SAs going in the reverse direction.
  1380. If multiple IPsec protocols are negotiated, keying material is
  1381. taken in the order in which the protocol headers will appear in
  1382. the encapsulated packet.
  1383. If a single protocol has both encryption and authentication keys,
  1384. the encryption key is taken from the first octets of KEYMAT and
  1385. the authentication key is taken from the next octets.
  1386. Each cryptographic algorithm takes a fixed number of bits of keying
  1387. material specified as part of the algorithm.
  1388. Kaufman Standards Track [Page 33]
  1389. RFC 4306 IKEv2 December 2005
  1390. 2.18. Rekeying IKE_SAs Using a CREATE_CHILD_SA exchange
  1391. The CREATE_CHILD_SA exchange can be used to rekey an existing IKE_SA
  1392. (see section 2.8). New initiator and responder SPIs are supplied in
  1393. the SPI fields. The TS payloads are omitted when rekeying an IKE_SA.
  1394. SKEYSEED for the new IKE_SA is computed using SK_d from the existing
  1395. IKE_SA as follows:
  1396. SKEYSEED = prf(SK_d (old), [g^ir (new)] | Ni | Nr)
  1397. where g^ir (new) is the shared secret from the ephemeral Diffie-
  1398. Hellman exchange of this CREATE_CHILD_SA exchange (represented as an
  1399. octet string in big endian order padded with zeros if necessary to
  1400. make it the length of the modulus) and Ni and Nr are the two nonces
  1401. stripped of any headers.
  1402. The new IKE_SA MUST reset its message counters to 0.
  1403. SK_d, SK_ai, SK_ar, SK_ei, and SK_er are computed from SKEYSEED as
  1404. specified in section 2.14.
  1405. 2.19. Requesting an Internal Address on a Remote Network
  1406. Most commonly occurring in the endpoint-to-security-gateway scenario,
  1407. an endpoint may need an IP address in the network protected by the
  1408. security gateway and may need to have that address dynamically
  1409. assigned. A request for such a temporary address can be included in
  1410. any request to create a CHILD_SA (including the implicit request in
  1411. message 3) by including a CP payload.
  1412. This function provides address allocation to an IPsec Remote Access
  1413. Client (IRAC) trying to tunnel into a network protected by an IPsec
  1414. Remote Access Server (IRAS). Since the IKE_AUTH exchange creates an
  1415. IKE_SA and a CHILD_SA, the IRAC MUST request the IRAS-controlled
  1416. address (and optionally other information concerning the protected
  1417. network) in the IKE_AUTH exchange. The IRAS may procure an address
  1418. for the IRAC from any number of sources such as a DHCP/BOOTP server
  1419. or its own address pool.
  1420. Initiator Responder
  1421. ----------------------------- ---------------------------
  1422. HDR, SK {IDi, [CERT,] [CERTREQ,]
  1423. [IDr,] AUTH, CP(CFG_REQUEST),
  1424. SAi2, TSi, TSr} -->
  1425. <-- HDR, SK {IDr, [CERT,] AUTH,
  1426. CP(CFG_REPLY), SAr2,
  1427. TSi, TSr}
  1428. Kaufman Standards Track [Page 34]
  1429. RFC 4306 IKEv2 December 2005
  1430. In all cases, the CP payload MUST be inserted before the SA payload.
  1431. In variations of the protocol where there are multiple IKE_AUTH
  1432. exchanges, the CP payloads MUST be inserted in the messages
  1433. containing the SA payloads.
  1434. CP(CFG_REQUEST) MUST contain at least an INTERNAL_ADDRESS attribute
  1435. (either IPv4 or IPv6) but MAY contain any number of additional
  1436. attributes the initiator wants returned in the response.
  1437. For example, message from initiator to responder:
  1438. CP(CFG_REQUEST)=
  1439. INTERNAL_ADDRESS(0.0.0.0)
  1440. INTERNAL_NETMASK(0.0.0.0)
  1441. INTERNAL_DNS(0.0.0.0)
  1442. TSi = (0, 0-65535,0.0.0.0-255.255.255.255)
  1443. TSr = (0, 0-65535,0.0.0.0-255.255.255.255)
  1444. NOTE: Traffic Selectors contain (protocol, port range, address
  1445. range).
  1446. Message from responder to initiator:
  1447. CP(CFG_REPLY)=
  1448. INTERNAL_ADDRESS(192.0.2.202)
  1449. INTERNAL_NETMASK(255.255.255.0)
  1450. INTERNAL_SUBNET(192.0.2.0/255.255.255.0)
  1451. TSi = (0, 0-65535,192.0.2.202-192.0.2.202)
  1452. TSr = (0, 0-65535,192.0.2.0-192.0.2.255)
  1453. All returned values will be implementation dependent. As can be seen
  1454. in the above example, the IRAS MAY also send other attributes that
  1455. were not included in CP(CFG_REQUEST) and MAY ignore the non-mandatory
  1456. attributes that it does not support.
  1457. The responder MUST NOT send a CFG_REPLY without having first received
  1458. a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS
  1459. to perform an unnecessary configuration lookup if the IRAC cannot
  1460. process the REPLY. In the case where the IRAS's configuration
  1461. requires that CP be used for a given identity IDi, but IRAC has
  1462. failed to send a CP(CFG_REQUEST), IRAS MUST fail the request, and
  1463. terminate the IKE exchange with a FAILED_CP_REQUIRED error.
  1464. 2.20. Requesting the Peer's Version
  1465. An IKE peer wishing to inquire about the other peer's IKE software
  1466. version information MAY use the method below. This is an example of
  1467. a configuration request within an INFORMATIONAL exchange, after the
  1468. IKE_SA and first CHILD_SA have been created.
  1469. Kaufman Standards Track [Page 35]
  1470. RFC 4306 IKEv2 December 2005
  1471. An IKE implementation MAY decline to give out version information
  1472. prior to authentication or even after authentication to prevent
  1473. trolling in case some implementation is known to have some security
  1474. weakness. In that case, it MUST either return an empty string or no
  1475. CP payload if CP is not supported.
  1476. Initiator Responder
  1477. ----------------------------- --------------------------
  1478. HDR, SK{CP(CFG_REQUEST)} -->
  1479. <-- HDR, SK{CP(CFG_REPLY)}
  1480. CP(CFG_REQUEST)=
  1481. APPLICATION_VERSION("")
  1482. CP(CFG_REPLY) APPLICATION_VERSION("foobar v1.3beta, (c) Foo Bar
  1483. Inc.")
  1484. 2.21. Error Handling
  1485. There are many kinds of errors that can occur during IKE processing.
  1486. If a request is received that is badly formatted or unacceptable for
  1487. reasons of policy (e.g., no matching cryptographic algorithms), the
  1488. response MUST contain a Notify payload indicating the error. If an
  1489. error occurs outside the context of an IKE request (e.g., the node is
  1490. getting ESP messages on a nonexistent SPI), the node SHOULD initiate
  1491. an INFORMATIONAL exchange with a Notify payload describing the
  1492. problem.
  1493. Errors that occur before a cryptographically protected IKE_SA is
  1494. established must be handled very carefully. There is a trade-off
  1495. between wanting to be helpful in diagnosing a problem and responding
  1496. to it and wanting to avoid being a dupe in a denial of service attack
  1497. based on forged messages.
  1498. If a node receives a message on UDP port 500 or 4500 outside the
  1499. context of an IKE_SA known to it (and not a request to start one), it
  1500. may be the result of a recent crash of the node. If the message is
  1501. marked as a response, the node MAY audit the suspicious event but
  1502. MUST NOT respond. If the message is marked as a request, the node
  1503. MAY audit the suspicious event and MAY send a response. If a
  1504. response is sent, the response MUST be sent to the IP address and
  1505. port from whence it came with the same IKE SPIs and the Message ID
  1506. copied. The response MUST NOT be cryptographically protected and
  1507. MUST contain a Notify payload indicating INVALID_IKE_SPI.
  1508. A node receiving such an unprotected Notify payload MUST NOT respond
  1509. and MUST NOT change the state of any existing SAs. The message might
  1510. be a forgery or might be a response the genuine correspondent was
  1511. Kaufman Standards Track [Page 36]
  1512. RFC 4306 IKEv2 December 2005
  1513. tricked into sending. A node SHOULD treat such a message (and also a
  1514. network message like ICMP destination unreachable) as a hint that
  1515. there might be problems with SAs to that IP address and SHOULD
  1516. initiate a liveness test for any such IKE_SA. An implementation
  1517. SHOULD limit the frequency of such tests to avoid being tricked into
  1518. participating in a denial of service attack.
  1519. A node receiving a suspicious message from an IP address with which
  1520. it has an IKE_SA MAY send an IKE Notify payload in an IKE
  1521. INFORMATIONAL exchange over that SA. The recipient MUST NOT change
  1522. the state of any SA's as a result but SHOULD audit the event to aid
  1523. in diagnosing malfunctions. A node MUST limit the rate at which it
  1524. will send messages in response to unprotected messages.
  1525. 2.22. IPComp
  1526. Use of IP compression [IPCOMP] can be negotiated as part of the setup
  1527. of a CHILD_SA. While IP compression involves an extra header in each
  1528. packet and a compression parameter index (CPI), the virtual
  1529. "compression association" has no life outside the ESP or AH SA that
  1530. contains it. Compression associations disappear when the
  1531. corresponding ESP or AH SA goes away. It is not explicitly mentioned
  1532. in any DELETE payload.
  1533. Negotiation of IP compression is separate from the negotiation of
  1534. cryptographic parameters associated with a CHILD_SA. A node
  1535. requesting a CHILD_SA MAY advertise its support for one or more
  1536. compression algorithms through one or more Notify payloads of type
  1537. IPCOMP_SUPPORTED. The response MAY indicate acceptance of a single
  1538. compression algorithm with a Notify payload of type IPCOMP_SUPPORTED.
  1539. These payloads MUST NOT occur in messages that do not contain SA
  1540. payloads.
  1541. Although there has been discussion of allowing multiple compression
  1542. algorithms to be accepted and to have different compression
  1543. algorithms available for the two directions of a CHILD_SA,
  1544. implementations of this specification MUST NOT accept an IPComp
  1545. algorithm that was not proposed, MUST NOT accept more than one, and
  1546. MUST NOT compress using an algorithm other than one proposed and
  1547. accepted in the setup of the CHILD_SA.
  1548. A side effect of separating the negotiation of IPComp from
  1549. cryptographic parameters is that it is not possible to propose
  1550. multiple cryptographic suites and propose IP compression with some of
  1551. them but not others.
  1552. Kaufman Standards Track [Page 37]
  1553. RFC 4306 IKEv2 December 2005
  1554. 2.23. NAT Traversal
  1555. Network Address Translation (NAT) gateways are a controversial
  1556. subject. This section briefly describes what they are and how they
  1557. are likely to act on IKE traffic. Many people believe that NATs are
  1558. evil and that we should not design our protocols so as to make them
  1559. work better. IKEv2 does specify some unintuitive processing rules in
  1560. order that NATs are more likely to work.
  1561. NATs exist primarily because of the shortage of IPv4 addresses,
  1562. though there are other rationales. IP nodes that are "behind" a NAT
  1563. have IP addresses that are not globally unique, but rather are
  1564. assigned from some space that is unique within the network behind the
  1565. NAT but that are likely to be reused by nodes behind other NATs.
  1566. Generally, nodes behind NATs can communicate with other nodes behind
  1567. the same NAT and with nodes with globally unique addresses, but not
  1568. with nodes behind other NATs. There are exceptions to that rule.
  1569. When those nodes make connections to nodes on the real Internet, the
  1570. NAT gateway "translates" the IP source address to an address that
  1571. will be routed back to the gateway. Messages to the gateway from the
  1572. Internet have their destination addresses "translated" to the
  1573. internal address that will route the packet to the correct endnode.
  1574. NATs are designed to be "transparent" to endnodes. Neither software
  1575. on the node behind the NAT nor the node on the Internet requires
  1576. modification to communicate through the NAT. Achieving this
  1577. transparency is more difficult with some protocols than with others.
  1578. Protocols that include IP addresses of the endpoints within the
  1579. payloads of the packet will fail unless the NAT gateway understands
  1580. the protocol and modifies the internal references as well as those in
  1581. the headers. Such knowledge is inherently unreliable, is a network
  1582. layer violation, and often results in subtle problems.
  1583. Opening an IPsec connection through a NAT introduces special
  1584. problems. If the connection runs in transport mode, changing the IP
  1585. addresses on packets will cause the checksums to fail and the NAT
  1586. cannot correct the checksums because they are cryptographically
  1587. protected. Even in tunnel mode, there are routing problems because
  1588. transparently translating the addresses of AH and ESP packets
  1589. requires special logic in the NAT and that logic is heuristic and
  1590. unreliable in nature. For that reason, IKEv2 can negotiate UDP
  1591. encapsulation of IKE and ESP packets. This encoding is slightly less
  1592. efficient but is easier for NATs to process. In addition, firewalls
  1593. may be configured to pass IPsec traffic over UDP but not ESP/AH or
  1594. vice versa.
  1595. Kaufman Standards Track [Page 38]
  1596. RFC 4306 IKEv2 December 2005
  1597. It is a common practice of NATs to translate TCP and UDP port numbers
  1598. as well as addresses and use the port numbers of inbound packets to
  1599. decide which internal node should get a given packet. For this
  1600. reason, even though IKE packets MUST be sent from and to UDP port
  1601. 500, they MUST be accepted coming from any port and responses MUST be
  1602. sent to the port from whence they came. This is because the ports
  1603. may be modified as the packets pass through NATs. Similarly, IP
  1604. addresses of the IKE endpoints are generally not included in the IKE
  1605. payloads because the payloads are cryptographically protected and
  1606. could not be transparently modified by NATs.
  1607. Port 4500 is reserved for UDP-encapsulated ESP and IKE. When working
  1608. through a NAT, it is generally better to pass IKE packets over port
  1609. 4500 because some older NATs handle IKE traffic on port 500 cleverly
  1610. in an attempt to transparently establish IPsec connections between
  1611. endpoints that don't handle NAT traversal themselves. Such NATs may
  1612. interfere with the straightforward NAT traversal envisioned by this
  1613. document, so an IPsec endpoint that discovers a NAT between it and
  1614. its correspondent MUST send all subsequent traffic to and from port
  1615. 4500, which NATs should not treat specially (as they might with port
  1616. 500).
  1617. The specific requirements for supporting NAT traversal [RFC3715] are
  1618. listed below. Support for NAT traversal is optional. In this
  1619. section only, requirements listed as MUST apply only to
  1620. implementations supporting NAT traversal.
  1621. IKE MUST listen on port 4500 as well as port 500. IKE MUST
  1622. respond to the IP address and port from which packets arrived.
  1623. Both IKE initiator and responder MUST include in their IKE_SA_INIT
  1624. packets Notify payloads of type NAT_DETECTION_SOURCE_IP and
  1625. NAT_DETECTION_DESTINATION_IP. Those payloads can be used to
  1626. detect if there is NAT between the hosts, and which end is behind
  1627. the NAT. The location of the payloads in the IKE_SA_INIT packets
  1628. are just after the Ni and Nr payloads (before the optional CERTREQ
  1629. payload).
  1630. If none of the NAT_DETECTION_SOURCE_IP payload(s) received matches
  1631. the hash of the source IP and port found from the IP header of the
  1632. packet containing the payload, it means that the other end is
  1633. behind NAT (i.e., someone along the route changed the source
  1634. address of the original packet to match the address of the NAT
  1635. box). In this case, this end should allow dynamic update of the
  1636. other ends IP address, as described later.
  1637. Kaufman Standards Track [Page 39]
  1638. RFC 4306 IKEv2 December 2005
  1639. If the NAT_DETECTION_DESTINATION_IP payload received does not
  1640. match the hash of the destination IP and port found from the IP
  1641. header of the packet containing the payload, it means that this
  1642. end is behind a NAT. In this case, this end SHOULD start sending
  1643. keepalive packets as explained in [Hutt05].
  1644. The IKE initiator MUST check these payloads if present and if they
  1645. do not match the addresses in the outer packet MUST tunnel all
  1646. future IKE and ESP packets associated with this IKE_SA over UDP
  1647. port 4500.
  1648. To tunnel IKE packets over UDP port 4500, the IKE header has four
  1649. octets of zero prepended and the result immediately follows the
  1650. UDP header. To tunnel ESP packets over UDP port 4500, the ESP
  1651. header immediately follows the UDP header. Since the first four
  1652. bytes of the ESP header contain the SPI, and the SPI cannot
  1653. validly be zero, it is always possible to distinguish ESP and IKE
  1654. messages.
  1655. The original source and destination IP address required for the
  1656. transport mode TCP and UDP packet checksum fixup (see [Hutt05])
  1657. are obtained from the Traffic Selectors associated with the
  1658. exchange. In the case of NAT traversal, the Traffic Selectors
  1659. MUST contain exactly one IP address, which is then used as the
  1660. original IP address.
  1661. There are cases where a NAT box decides to remove mappings that
  1662. are still alive (for example, the keepalive interval is too long,
  1663. or the NAT box is rebooted). To recover in these cases, hosts
  1664. that are not behind a NAT SHOULD send all packets (including
  1665. retransmission packets) to the IP address and port from the last
  1666. valid authenticated packet from the other end (i.e., dynamically
  1667. update the address). A host behind a NAT SHOULD NOT do this
  1668. because it opens a DoS attack possibility. Any authenticated IKE
  1669. packet or any authenticated UDP-encapsulated ESP packet can be
  1670. used to detect that the IP address or the port has changed.
  1671. Note that similar but probably not identical actions will likely
  1672. be needed to make IKE work with Mobile IP, but such processing is
  1673. not addressed by this document.
  1674. 2.24. Explicit Congestion Notification (ECN)
  1675. When IPsec tunnels behave as originally specified in [RFC2401], ECN
  1676. usage is not appropriate for the outer IP headers because tunnel
  1677. decapsulation processing discards ECN congestion indications to the
  1678. detriment of the network. ECN support for IPsec tunnels for IKEv1-
  1679. based IPsec requires multiple operating modes and negotiation (see
  1680. Kaufman Standards Track [Page 40]
  1681. RFC 4306 IKEv2 December 2005
  1682. [RFC3168]). IKEv2 simplifies this situation by requiring that ECN be
  1683. usable in the outer IP headers of all tunnel-mode IPsec SAs created
  1684. by IKEv2. Specifically, tunnel encapsulators and decapsulators for
  1685. all tunnel-mode SAs created by IKEv2 MUST support the ECN full-
  1686. functionality option for tunnels specified in [RFC3168] and MUST
  1687. implement the tunnel encapsulation and decapsulation processing
  1688. specified in [RFC4301] to prevent discarding of ECN congestion
  1689. indications.
  1690. 3. Header and Payload Formats
  1691. 3.1. The IKE Header
  1692. IKE messages use UDP ports 500 and/or 4500, with one IKE message per
  1693. UDP datagram. Information from the beginning of the packet through
  1694. the UDP header is largely ignored except that the IP addresses and
  1695. UDP ports from the headers are reversed and used for return packets.
  1696. When sent on UDP port 500, IKE messages begin immediately following
  1697. the UDP header. When sent on UDP port 4500, IKE messages have
  1698. prepended four octets of zero. These four octets of zero are not
  1699. part of the IKE message and are not included in any of the length
  1700. fields or checksums defined by IKE. Each IKE message begins with the
  1701. IKE header, denoted HDR in this memo. Following the header are one
  1702. or more IKE payloads each identified by a "Next Payload" field in the
  1703. preceding payload. Payloads are processed in the order in which they
  1704. appear in an IKE message by invoking the appropriate processing
  1705. routine according to the "Next Payload" field in the IKE header and
  1706. subsequently according to the "Next Payload" field in the IKE payload
  1707. itself until a "Next Payload" field of zero indicates that no
  1708. payloads follow. If a payload of type "Encrypted" is found, that
  1709. payload is decrypted and its contents parsed as additional payloads.
  1710. An Encrypted payload MUST be the last payload in a packet and an
  1711. Encrypted payload MUST NOT contain another Encrypted payload.
  1712. The Recipient SPI in the header identifies an instance of an IKE
  1713. security association. It is therefore possible for a single instance
  1714. of IKE to multiplex distinct sessions with multiple peers.
  1715. All multi-octet fields representing integers are laid out in big
  1716. endian order (aka most significant byte first, or network byte
  1717. order).
  1718. The format of the IKE header is shown in Figure 4.
  1719. Kaufman Standards Track [Page 41]
  1720. RFC 4306 IKEv2 December 2005
  1721. 1 2 3
  1722. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1723. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1724. ! IKE_SA Initiator's SPI !
  1725. ! !
  1726. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1727. ! IKE_SA Responder's SPI !
  1728. ! !
  1729. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1730. ! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags !
  1731. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1732. ! Message ID !
  1733. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1734. ! Length !
  1735. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1736. Figure 4: IKE Header Format
  1737. o Initiator's SPI (8 octets) - A value chosen by the
  1738. initiator to identify a unique IKE security association. This
  1739. value MUST NOT be zero.
  1740. o Responder's SPI (8 octets) - A value chosen by the
  1741. responder to identify a unique IKE security association. This
  1742. value MUST be zero in the first message of an IKE Initial
  1743. Exchange (including repeats of that message including a
  1744. cookie) and MUST NOT be zero in any other message.
  1745. o Next Payload (1 octet) - Indicates the type of payload that
  1746. immediately follows the header. The format and value of each
  1747. payload are defined below.
  1748. o Major Version (4 bits) - Indicates the major version of the IKE
  1749. protocol in use. Implementations based on this version of IKE
  1750. MUST set the Major Version to 2. Implementations based on
  1751. previous versions of IKE and ISAKMP MUST set the Major Version
  1752. to 1. Implementations based on this version of IKE MUST reject
  1753. or ignore messages containing a version number greater than
  1754. 2.
  1755. o Minor Version (4 bits) - Indicates the minor version of the
  1756. IKE protocol in use. Implementations based on this version of
  1757. IKE MUST set the Minor Version to 0. They MUST ignore the
  1758. minor version number of received messages.
  1759. o Exchange Type (1 octet) - Indicates the type of exchange being
  1760. used. This constrains the payloads sent in each message and
  1761. orderings of messages in an exchange.
  1762. Kaufman Standards Track [Page 42]
  1763. RFC 4306 IKEv2 December 2005
  1764. Exchange Type Value
  1765. RESERVED 0-33
  1766. IKE_SA_INIT 34
  1767. IKE_AUTH 35
  1768. CREATE_CHILD_SA 36
  1769. INFORMATIONAL 37
  1770. RESERVED TO IANA 38-239
  1771. Reserved for private use 240-255
  1772. o Flags (1 octet) - Indicates specific options that are set
  1773. for the message. Presence of options are indicated by the
  1774. appropriate bit in the flags field being set. The bits are
  1775. defined LSB first, so bit 0 would be the least significant
  1776. bit of the Flags octet. In the description below, a bit
  1777. being 'set' means its value is '1', while 'cleared' means
  1778. its value is '0'.
  1779. -- X(reserved) (bits 0-2) - These bits MUST be cleared
  1780. when sending and MUST be ignored on receipt.
  1781. -- I(nitiator) (bit 3 of Flags) - This bit MUST be set in
  1782. messages sent by the original initiator of the IKE_SA
  1783. and MUST be cleared in messages sent by the original
  1784. responder. It is used by the recipient to determine
  1785. which eight octets of the SPI were generated by the
  1786. recipient.
  1787. -- V(ersion) (bit 4 of Flags) - This bit indicates that
  1788. the transmitter is capable of speaking a higher major
  1789. version number of the protocol than the one indicated
  1790. in the major version number field. Implementations of
  1791. IKEv2 must clear this bit when sending and MUST ignore
  1792. it in incoming messages.
  1793. -- R(esponse) (bit 5 of Flags) - This bit indicates that
  1794. this message is a response to a message containing
  1795. the same message ID. This bit MUST be cleared in all
  1796. request messages and MUST be set in all responses.
  1797. An IKE endpoint MUST NOT generate a response to a
  1798. message that is marked as being a response.
  1799. -- X(reserved) (bits 6-7 of Flags) - These bits MUST be
  1800. cleared when sending and MUST be ignored on receipt.
  1801. Kaufman Standards Track [Page 43]
  1802. RFC 4306 IKEv2 December 2005
  1803. o Message ID (4 octets) - Message identifier used to control
  1804. retransmission of lost packets and matching of requests and
  1805. responses. It is essential to the security of the protocol
  1806. because it is used to prevent message replay attacks.
  1807. See sections 2.1 and 2.2.
  1808. o Length (4 octets) - Length of total message (header + payloads)
  1809. in octets.
  1810. 3.2. Generic Payload Header
  1811. Each IKE payload defined in sections 3.3 through 3.16 begins with a
  1812. generic payload header, shown in Figure 5. Figures for each payload
  1813. below will include the generic payload header, but for brevity the
  1814. description of each field will be omitted.
  1815. 1 2 3
  1816. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1817. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1818. ! Next Payload !C! RESERVED ! Payload Length !
  1819. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1820. Figure 5: Generic Payload Header
  1821. The Generic Payload Header fields are defined as follows:
  1822. o Next Payload (1 octet) - Identifier for the payload type of the
  1823. next payload in the message. If the current payload is the last
  1824. in the message, then this field will be 0. This field provides a
  1825. "chaining" capability whereby additional payloads can be added to
  1826. a message by appending it to the end of the message and setting
  1827. the "Next Payload" field of the preceding payload to indicate the
  1828. new payload's type. An Encrypted payload, which must always be
  1829. the last payload of a message, is an exception. It contains data
  1830. structures in the format of additional payloads. In the header of
  1831. an Encrypted payload, the Next Payload field is set to the payload
  1832. type of the first contained payload (instead of 0).
  1833. Payload Type Values
  1834. Next Payload Type Notation Value
  1835. No Next Payload 0
  1836. RESERVED 1-32
  1837. Security Association SA 33
  1838. Key Exchange KE 34
  1839. Identification - Initiator IDi 35
  1840. Kaufman Standards Track [Page 44]
  1841. RFC 4306 IKEv2 December 2005
  1842. Identification - Responder IDr 36
  1843. Certificate CERT 37
  1844. Certificate Request CERTREQ 38
  1845. Authentication AUTH 39
  1846. Nonce Ni, Nr 40
  1847. Notify N 41
  1848. Delete D 42
  1849. Vendor ID V 43
  1850. Traffic Selector - Initiator TSi 44
  1851. Traffic Selector - Responder TSr 45
  1852. Encrypted E 46
  1853. Configuration CP 47
  1854. Extensible Authentication EAP 48
  1855. RESERVED TO IANA 49-127
  1856. PRIVATE USE 128-255
  1857. Payload type values 1-32 should not be used so that there is no
  1858. overlap with the code assignments for IKEv1. Payload type values
  1859. 49-127 are reserved to IANA for future assignment in IKEv2 (see
  1860. section 6). Payload type values 128-255 are for private use among
  1861. mutually consenting parties.
  1862. o Critical (1 bit) - MUST be set to zero if the sender wants the
  1863. recipient to skip this payload if it does not understand the
  1864. payload type code in the Next Payload field of the previous
  1865. payload. MUST be set to one if the sender wants the recipient to
  1866. reject this entire message if it does not understand the payload
  1867. type. MUST be ignored by the recipient if the recipient
  1868. understands the payload type code. MUST be set to zero for
  1869. payload types defined in this document. Note that the critical
  1870. bit applies to the current payload rather than the "next" payload
  1871. whose type code appears in the first octet. The reasoning behind
  1872. not setting the critical bit for payloads defined in this document
  1873. is that all implementations MUST understand all payload types
  1874. defined in this document and therefore must ignore the Critical
  1875. bit's value. Skipped payloads are expected to have valid Next
  1876. Payload and Payload Length fields.
  1877. o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored on
  1878. receipt.
  1879. o Payload Length (2 octets) - Length in octets of the current
  1880. payload, including the generic payload header.
  1881. Kaufman Standards Track [Page 45]
  1882. RFC 4306 IKEv2 December 2005
  1883. 3.3. Security Association Payload
  1884. The Security Association Payload, denoted SA in this memo, is used to
  1885. negotiate attributes of a security association. Assembly of Security
  1886. Association Payloads requires great peace of mind. An SA payload MAY
  1887. contain multiple proposals. If there is more than one, they MUST be
  1888. ordered from most preferred to least preferred. Each proposal may
  1889. contain multiple IPsec protocols (where a protocol is IKE, ESP, or
  1890. AH), each protocol MAY contain multiple transforms, and each
  1891. transform MAY contain multiple attributes. When parsing an SA, an
  1892. implementation MUST check that the total Payload Length is consistent
  1893. with the payload's internal lengths and counts. Proposals,
  1894. Transforms, and Attributes each have their own variable length
  1895. encodings. They are nested such that the Payload Length of an SA
  1896. includes the combined contents of the SA, Proposal, Transform, and
  1897. Attribute information. The length of a Proposal includes the lengths
  1898. of all Transforms and Attributes it contains. The length of a
  1899. Transform includes the lengths of all Attributes it contains.
  1900. The syntax of Security Associations, Proposals, Transforms, and
  1901. Attributes is based on ISAKMP; however, the semantics are somewhat
  1902. different. The reason for the complexity and the hierarchy is to
  1903. allow for multiple possible combinations of algorithms to be encoded
  1904. in a single SA. Sometimes there is a choice of multiple algorithms,
  1905. whereas other times there is a combination of algorithms. For
  1906. example, an initiator might want to propose using (AH w/MD5 and ESP
  1907. w/3DES) OR (ESP w/MD5 and 3DES).
  1908. One of the reasons the semantics of the SA payload has changed from
  1909. ISAKMP and IKEv1 is to make the encodings more compact in common
  1910. cases.
  1911. The Proposal structure contains within it a Proposal # and an IPsec
  1912. protocol ID. Each structure MUST have the same Proposal # as the
  1913. previous one or be one (1) greater. The first Proposal MUST have a
  1914. Proposal # of one (1). If two successive structures have the same
  1915. Proposal number, it means that the proposal consists of the first
  1916. structure AND the second. So a proposal of AH AND ESP would have two
  1917. proposal structures, one for AH and one for ESP and both would have
  1918. Proposal #1. A proposal of AH OR ESP would have two proposal
  1919. structures, one for AH with Proposal #1 and one for ESP with Proposal
  1920. #2.
  1921. Each Proposal/Protocol structure is followed by one or more transform
  1922. structures. The number of different transforms is generally
  1923. determined by the Protocol. AH generally has a single transform: an
  1924. integrity check algorithm. ESP generally has two: an encryption
  1925. algorithm and an integrity check algorithm. IKE generally has four
  1926. Kaufman Standards Track [Page 46]
  1927. RFC 4306 IKEv2 December 2005
  1928. transforms: a Diffie-Hellman group, an integrity check algorithm, a
  1929. prf algorithm, and an encryption algorithm. If an algorithm that
  1930. combines encryption and integrity protection is proposed, it MUST be
  1931. proposed as an encryption algorithm and an integrity protection
  1932. algorithm MUST NOT be proposed. For each Protocol, the set of
  1933. permissible transforms is assigned transform ID numbers, which appear
  1934. in the header of each transform.
  1935. If there are multiple transforms with the same Transform Type, the
  1936. proposal is an OR of those transforms. If there are multiple
  1937. Transforms with different Transform Types, the proposal is an AND of
  1938. the different groups. For example, to propose ESP with (3DES or
  1939. IDEA) and (HMAC_MD5 or HMAC_SHA), the ESP proposal would contain two
  1940. Transform Type 1 candidates (one for 3DES and one for IDEA) and two
  1941. Transform Type 2 candidates (one for HMAC_MD5 and one for HMAC_SHA).
  1942. This effectively proposes four combinations of algorithms. If the
  1943. initiator wanted to propose only a subset of those, for example (3DES
  1944. and HMAC_MD5) or (IDEA and HMAC_SHA), there is no way to encode that
  1945. as multiple transforms within a single Proposal. Instead, the
  1946. initiator would have to construct two different Proposals, each with
  1947. two transforms.
  1948. A given transform MAY have one or more Attributes. Attributes are
  1949. necessary when the transform can be used in more than one way, as
  1950. when an encryption algorithm has a variable key size. The transform
  1951. would specify the algorithm and the attribute would specify the key
  1952. size. Most transforms do not have attributes. A transform MUST NOT
  1953. have multiple attributes of the same type. To propose alternate
  1954. values for an attribute (for example, multiple key sizes for the AES
  1955. encryption algorithm), and implementation MUST include multiple
  1956. Transforms with the same Transform Type each with a single Attribute.
  1957. Note that the semantics of Transforms and Attributes are quite
  1958. different from those in IKEv1. In IKEv1, a single Transform carried
  1959. multiple algorithms for a protocol with one carried in the Transform
  1960. and the others carried in the Attributes.
  1961. 1 2 3
  1962. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1963. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1964. ! Next Payload !C! RESERVED ! Payload Length !
  1965. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1966. ! !
  1967. ~ <Proposals> ~
  1968. ! !
  1969. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1970. Figure 6: Security Association Payload
  1971. Kaufman Standards Track [Page 47]
  1972. RFC 4306 IKEv2 December 2005
  1973. o Proposals (variable) - One or more proposal substructures.
  1974. The payload type for the Security Association Payload is thirty
  1975. three (33).
  1976. 3.3.1. Proposal Substructure
  1977. 1 2 3
  1978. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1979. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1980. ! 0 (last) or 2 ! RESERVED ! Proposal Length !
  1981. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1982. ! Proposal # ! Protocol ID ! SPI Size !# of Transforms!
  1983. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1984. ~ SPI (variable) ~
  1985. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1986. ! !
  1987. ~ <Transforms> ~
  1988. ! !
  1989. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1990. Figure 7: Proposal Substructure
  1991. o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the
  1992. last Proposal Substructure in the SA. This syntax is inherited
  1993. from ISAKMP, but is unnecessary because the last Proposal could
  1994. be identified from the length of the SA. The value (2)
  1995. corresponds to a Payload Type of Proposal in IKEv1, and the
  1996. first 4 octets of the Proposal structure are designed to look
  1997. somewhat like the header of a Payload.
  1998. o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored on
  1999. receipt.
  2000. o Proposal Length (2 octets) - Length of this proposal, including
  2001. all transforms and attributes that follow.
  2002. o Proposal # (1 octet) - When a proposal is made, the first
  2003. proposal in an SA payload MUST be #1, and subsequent proposals
  2004. MUST either be the same as the previous proposal (indicating an
  2005. AND of the two proposals) or one more than the previous
  2006. proposal (indicating an OR of the two proposals). When a
  2007. proposal is accepted, all of the proposal numbers in the SA
  2008. payload MUST be the same and MUST match the number on the
  2009. proposal sent that was accepted.
  2010. Kaufman Standards Track [Page 48]
  2011. RFC 4306 IKEv2 December 2005
  2012. o Protocol ID (1 octet) - Specifies the IPsec protocol identifier
  2013. for the current negotiation. The defined values are:
  2014. Protocol Protocol ID
  2015. RESERVED 0
  2016. IKE 1
  2017. AH 2
  2018. ESP 3
  2019. RESERVED TO IANA 4-200
  2020. PRIVATE USE 201-255
  2021. o SPI Size (1 octet) - For an initial IKE_SA negotiation, this
  2022. field MUST be zero; the SPI is obtained from the outer header.
  2023. During subsequent negotiations, it is equal to the size, in
  2024. octets, of the SPI of the corresponding protocol (8 for IKE, 4
  2025. for ESP and AH).
  2026. o # of Transforms (1 octet) - Specifies the number of transforms
  2027. in this proposal.
  2028. o SPI (variable) - The sending entity's SPI. Even if the SPI Size
  2029. is not a multiple of 4 octets, there is no padding applied to
  2030. the payload. When the SPI Size field is zero, this field is
  2031. not present in the Security Association payload.
  2032. o Transforms (variable) - One or more transform substructures.
  2033. 3.3.2. Transform Substructure
  2034. 1 2 3
  2035. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2036. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2037. ! 0 (last) or 3 ! RESERVED ! Transform Length !
  2038. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2039. !Transform Type ! RESERVED ! Transform ID !
  2040. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2041. ! !
  2042. ~ Transform Attributes ~
  2043. ! !
  2044. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2045. Figure 8: Transform Substructure
  2046. o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the
  2047. last Transform Substructure in the Proposal. This syntax is
  2048. inherited from ISAKMP, but is unnecessary because the last
  2049. Proposal could be identified from the length of the SA. The
  2050. Kaufman Standards Track [Page 49]
  2051. RFC 4306 IKEv2 December 2005
  2052. value (3) corresponds to a Payload Type of Transform in IKEv1,
  2053. and the first 4 octets of the Transform structure are designed
  2054. to look somewhat like the header of a Payload.
  2055. o RESERVED - MUST be sent as zero; MUST be ignored on receipt.
  2056. o Transform Length - The length (in octets) of the Transform
  2057. Substructure including Header and Attributes.
  2058. o Transform Type (1 octet) - The type of transform being
  2059. specified in this transform. Different protocols support
  2060. different transform types. For some protocols, some of the
  2061. transforms may be optional. If a transform is optional and the
  2062. initiator wishes to propose that the transform be omitted, no
  2063. transform of the given type is included in the proposal. If
  2064. the initiator wishes to make use of the transform optional to
  2065. the responder, it includes a transform substructure with
  2066. transform ID = 0 as one of the options.
  2067. o Transform ID (2 octets) - The specific instance of the
  2068. transform type being proposed.
  2069. Transform Type Values
  2070. Transform Used In
  2071. Type
  2072. RESERVED 0
  2073. Encryption Algorithm (ENCR) 1 (IKE and ESP)
  2074. Pseudo-random Function (PRF) 2 (IKE)
  2075. Integrity Algorithm (INTEG) 3 (IKE, AH, optional in ESP)
  2076. Diffie-Hellman Group (D-H) 4 (IKE, optional in AH & ESP)
  2077. Extended Sequence Numbers (ESN) 5 (AH and ESP)
  2078. RESERVED TO IANA 6-240
  2079. PRIVATE USE 241-255
  2080. For Transform Type 1 (Encryption Algorithm), defined Transform IDs
  2081. are:
  2082. Name Number Defined In
  2083. RESERVED 0
  2084. ENCR_DES_IV64 1 (RFC1827)
  2085. ENCR_DES 2 (RFC2405), [DES]
  2086. ENCR_3DES 3 (RFC2451)
  2087. ENCR_RC5 4 (RFC2451)
  2088. ENCR_IDEA 5 (RFC2451), [IDEA]
  2089. ENCR_CAST 6 (RFC2451)
  2090. ENCR_BLOWFISH 7 (RFC2451)
  2091. ENCR_3IDEA 8 (RFC2451)
  2092. Kaufman Standards Track [Page 50]
  2093. RFC 4306 IKEv2 December 2005
  2094. ENCR_DES_IV32 9
  2095. RESERVED 10
  2096. ENCR_NULL 11 (RFC2410)
  2097. ENCR_AES_CBC 12 (RFC3602)
  2098. ENCR_AES_CTR 13 (RFC3664)
  2099. values 14-1023 are reserved to IANA. Values 1024-65535 are
  2100. for private use among mutually consenting parties.
  2101. For Transform Type 2 (Pseudo-random Function), defined Transform IDs
  2102. are:
  2103. Name Number Defined In
  2104. RESERVED 0
  2105. PRF_HMAC_MD5 1 (RFC2104), [MD5]
  2106. PRF_HMAC_SHA1 2 (RFC2104), [SHA]
  2107. PRF_HMAC_TIGER 3 (RFC2104)
  2108. PRF_AES128_XCBC 4 (RFC3664)
  2109. values 5-1023 are reserved to IANA. Values 1024-65535 are for
  2110. private use among mutually consenting parties.
  2111. For Transform Type 3 (Integrity Algorithm), defined Transform IDs
  2112. are:
  2113. Name Number Defined In
  2114. NONE 0
  2115. AUTH_HMAC_MD5_96 1 (RFC2403)
  2116. AUTH_HMAC_SHA1_96 2 (RFC2404)
  2117. AUTH_DES_MAC 3
  2118. AUTH_KPDK_MD5 4 (RFC1826)
  2119. AUTH_AES_XCBC_96 5 (RFC3566)
  2120. values 6-1023 are reserved to IANA. Values 1024-65535 are for
  2121. private use among mutually consenting parties.
  2122. For Transform Type 4 (Diffie-Hellman Group), defined Transform IDs
  2123. are:
  2124. Name Number
  2125. NONE 0
  2126. Defined in Appendix B 1 - 2
  2127. RESERVED 3 - 4
  2128. Defined in [ADDGROUP] 5
  2129. RESERVED TO IANA 6 - 13
  2130. Defined in [ADDGROUP] 14 - 18
  2131. RESERVED TO IANA 19 - 1023
  2132. PRIVATE USE 1024-65535
  2133. Kaufman Standards Track [Page 51]
  2134. RFC 4306 IKEv2 December 2005
  2135. For Transform Type 5 (Extended Sequence Numbers), defined Transform
  2136. IDs are:
  2137. Name Number
  2138. No Extended Sequence Numbers 0
  2139. Extended Sequence Numbers 1
  2140. RESERVED 2 - 65535
  2141. 3.3.3. Valid Transform Types by Protocol
  2142. The number and type of transforms that accompany an SA payload are
  2143. dependent on the protocol in the SA itself. An SA payload proposing
  2144. the establishment of an SA has the following mandatory and optional
  2145. transform types. A compliant implementation MUST understand all
  2146. mandatory and optional types for each protocol it supports (though it
  2147. need not accept proposals with unacceptable suites). A proposal MAY
  2148. omit the optional types if the only value for them it will accept is
  2149. NONE.
  2150. Protocol Mandatory Types Optional Types
  2151. IKE ENCR, PRF, INTEG, D-H
  2152. ESP ENCR, ESN INTEG, D-H
  2153. AH INTEG, ESN D-H
  2154. 3.3.4. Mandatory Transform IDs
  2155. The specification of suites that MUST and SHOULD be supported for
  2156. interoperability has been removed from this document because they are
  2157. likely to change more rapidly than this document evolves.
  2158. An important lesson learned from IKEv1 is that no system should only
  2159. implement the mandatory algorithms and expect them to be the best
  2160. choice for all customers. For example, at the time that this
  2161. document was written, many IKEv1 implementers were starting to
  2162. migrate to AES in Cipher Block Chaining (CBC) mode for Virtual
  2163. Private Network (VPN) applications. Many IPsec systems based on
  2164. IKEv2 will implement AES, additional Diffie-Hellman groups, and
  2165. additional hash algorithms, and some IPsec customers already require
  2166. these algorithms in addition to the ones listed above.
  2167. It is likely that IANA will add additional transforms in the future,
  2168. and some users may want to use private suites, especially for IKE
  2169. where implementations should be capable of supporting different
  2170. parameters, up to certain size limits. In support of this goal, all
  2171. implementations of IKEv2 SHOULD include a management facility that
  2172. allows specification (by a user or system administrator) of Diffie-
  2173. Hellman (DH) parameters (the generator, modulus, and exponent lengths
  2174. and values) for new DH groups. Implementations SHOULD provide a
  2175. Kaufman Standards Track [Page 52]
  2176. RFC 4306 IKEv2 December 2005
  2177. management interface via which these parameters and the associated
  2178. transform IDs may be entered (by a user or system administrator), to
  2179. enable negotiating such groups.
  2180. All implementations of IKEv2 MUST include a management facility that
  2181. enables a user or system administrator to specify the suites that are
  2182. acceptable for use with IKE. Upon receipt of a payload with a set of
  2183. transform IDs, the implementation MUST compare the transmitted
  2184. transform IDs against those locally configured via the management
  2185. controls, to verify that the proposed suite is acceptable based on
  2186. local policy. The implementation MUST reject SA proposals that are
  2187. not authorized by these IKE suite controls. Note that cryptographic
  2188. suites that MUST be implemented need not be configured as acceptable
  2189. to local policy.
  2190. 3.3.5. Transform Attributes
  2191. Each transform in a Security Association payload may include
  2192. attributes that modify or complete the specification of the
  2193. transform. These attributes are type/value pairs and are defined
  2194. below. For example, if an encryption algorithm has a variable-length
  2195. key, the key length to be used may be specified as an attribute.
  2196. Attributes can have a value with a fixed two octet length or a
  2197. variable-length value. For the latter, the attribute is encoded as
  2198. type/length/value.
  2199. 1 2 3
  2200. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2201. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2202. !A! Attribute Type ! AF=0 Attribute Length !
  2203. !F! ! AF=1 Attribute Value !
  2204. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2205. ! AF=0 Attribute Value !
  2206. ! AF=1 Not Transmitted !
  2207. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2208. Figure 9: Data Attributes
  2209. o Attribute Type (2 octets) - Unique identifier for each type of
  2210. attribute (see below).
  2211. The most significant bit of this field is the Attribute Format
  2212. bit (AF). It indicates whether the data attributes follow the
  2213. Type/Length/Value (TLV) format or a shortened Type/Value (TV)
  2214. format. If the AF bit is zero (0), then the Data Attributes
  2215. are of the Type/Length/Value (TLV) form. If the AF bit is a
  2216. one (1), then the Data Attributes are of the Type/Value form.
  2217. Kaufman Standards Track [Page 53]
  2218. RFC 4306 IKEv2 December 2005
  2219. o Attribute Length (2 octets) - Length in octets of the Attribute
  2220. Value. When the AF bit is a one (1), the Attribute Value is
  2221. only 2 octets and the Attribute Length field is not present.
  2222. o Attribute Value (variable length) - Value of the Attribute
  2223. associated with the Attribute Type. If the AF bit is a zero
  2224. (0), this field has a variable length defined by the Attribute
  2225. Length field. If the AF bit is a one (1), the Attribute Value
  2226. has a length of 2 octets.
  2227. Note that only a single attribute type (Key Length) is defined, and
  2228. it is fixed length. The variable-length encoding specification is
  2229. included only for future extensions. The only algorithms defined in
  2230. this document that accept attributes are the AES-based encryption,
  2231. integrity, and pseudo-random functions, which require a single
  2232. attribute specifying key width.
  2233. Attributes described as basic MUST NOT be encoded using the
  2234. variable-length encoding. Variable-length attributes MUST NOT be
  2235. encoded as basic even if their value can fit into two octets. NOTE:
  2236. This is a change from IKEv1, where increased flexibility may have
  2237. simplified the composer of messages but certainly complicated the
  2238. parser.
  2239. Attribute Type Value Attribute Format
  2240. --------------------------------------------------------------
  2241. RESERVED 0-13 Key Length (in bits)
  2242. 14 TV RESERVED 15-17
  2243. RESERVED TO IANA 18-16383 PRIVATE USE
  2244. 16384-32767
  2245. Values 0-13 and 15-17 were used in a similar context in IKEv1 and
  2246. should not be assigned except to matching values. Values 18-16383
  2247. are reserved to IANA. Values 16384-32767 are for private use among
  2248. mutually consenting parties.
  2249. - Key Length
  2250. When using an Encryption Algorithm that has a variable-length key,
  2251. this attribute specifies the key length in bits (MUST use network
  2252. byte order). This attribute MUST NOT be used when the specified
  2253. Encryption Algorithm uses a fixed-length key.
  2254. Kaufman Standards Track [Page 54]
  2255. RFC 4306 IKEv2 December 2005
  2256. 3.3.6. Attribute Negotiation
  2257. During security association negotiation, initiators present offers to
  2258. responders. Responders MUST select a single complete set of
  2259. parameters from the offers (or reject all offers if none are
  2260. acceptable). If there are multiple proposals, the responder MUST
  2261. choose a single proposal number and return all of the Proposal
  2262. substructures with that Proposal number. If there are multiple
  2263. Transforms with the same type, the responder MUST choose a single
  2264. one. Any attributes of a selected transform MUST be returned
  2265. unmodified. The initiator of an exchange MUST check that the
  2266. accepted offer is consistent with one of its proposals, and if not
  2267. that response MUST be rejected.
  2268. Negotiating Diffie-Hellman groups presents some special challenges.
  2269. SA offers include proposed attributes and a Diffie-Hellman public
  2270. number (KE) in the same message. If in the initial exchange the
  2271. initiator offers to use one of several Diffie-Hellman groups, it
  2272. SHOULD pick the one the responder is most likely to accept and
  2273. include a KE corresponding to that group. If the guess turns out to
  2274. be wrong, the responder will indicate the correct group in the
  2275. response and the initiator SHOULD pick an element of that group for
  2276. its KE value when retrying the first message. It SHOULD, however,
  2277. continue to propose its full supported set of groups in order to
  2278. prevent a man-in-the-middle downgrade attack.
  2279. Implementation Note:
  2280. Certain negotiable attributes can have ranges or could have
  2281. multiple acceptable values. These include the key length of a
  2282. variable key length symmetric cipher. To further interoperability
  2283. and to support upgrading endpoints independently, implementers of
  2284. this protocol SHOULD accept values that they deem to supply
  2285. greater security. For instance, if a peer is configured to accept
  2286. a variable-length cipher with a key length of X bits and is
  2287. offered that cipher with a larger key length, the implementation
  2288. SHOULD accept the offer if it supports use of the longer key.
  2289. Support of this capability allows an implementation to express a
  2290. concept of "at least" a certain level of security -- "a key length of
  2291. _at least_ X bits for cipher Y".
  2292. Kaufman Standards Track [Page 55]
  2293. RFC 4306 IKEv2 December 2005
  2294. 3.4. Key Exchange Payload
  2295. The Key Exchange Payload, denoted KE in this memo, is used to
  2296. exchange Diffie-Hellman public numbers as part of a Diffie-Hellman
  2297. key exchange. The Key Exchange Payload consists of the IKE generic
  2298. payload header followed by the Diffie-Hellman public value itself.
  2299. 1 2 3
  2300. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2301. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2302. ! Next Payload !C! RESERVED ! Payload Length !
  2303. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2304. ! DH Group # ! RESERVED !
  2305. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2306. ! !
  2307. ~ Key Exchange Data ~
  2308. ! !
  2309. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2310. Figure 10: Key Exchange Payload Format
  2311. A key exchange payload is constructed by copying one's Diffie-Hellman
  2312. public value into the "Key Exchange Data" portion of the payload.
  2313. The length of the Diffie-Hellman public value MUST be equal to the
  2314. length of the prime modulus over which the exponentiation was
  2315. performed, prepending zero bits to the value if necessary.
  2316. The DH Group # identifies the Diffie-Hellman group in which the Key
  2317. Exchange Data was computed (see section 3.3.2). If the selected
  2318. proposal uses a different Diffie-Hellman group, the message MUST be
  2319. rejected with a Notify payload of type INVALID_KE_PAYLOAD.
  2320. The payload type for the Key Exchange payload is thirty four (34).
  2321. 3.5. Identification Payloads
  2322. The Identification Payloads, denoted IDi and IDr in this memo, allow
  2323. peers to assert an identity to one another. This identity may be
  2324. used for policy lookup, but does not necessarily have to match
  2325. anything in the CERT payload; both fields may be used by an
  2326. implementation to perform access control decisions.
  2327. NOTE: In IKEv1, two ID payloads were used in each direction to hold
  2328. Traffic Selector (TS) information for data passing over the SA. In
  2329. IKEv2, this information is carried in TS payloads (see section 3.13).
  2330. Kaufman Standards Track [Page 56]
  2331. RFC 4306 IKEv2 December 2005
  2332. The Identification Payload consists of the IKE generic payload header
  2333. followed by identification fields as follows:
  2334. 1 2 3
  2335. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2336. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2337. ! Next Payload !C! RESERVED ! Payload Length !
  2338. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2339. ! ID Type ! RESERVED |
  2340. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2341. ! !
  2342. ~ Identification Data ~
  2343. ! !
  2344. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2345. Figure 11: Identification Payload Format
  2346. o ID Type (1 octet) - Specifies the type of Identification being
  2347. used.
  2348. o RESERVED - MUST be sent as zero; MUST be ignored on receipt.
  2349. o Identification Data (variable length) - Value, as indicated by the
  2350. Identification Type. The length of the Identification Data is
  2351. computed from the size in the ID payload header.
  2352. The payload types for the Identification Payload are thirty five (35)
  2353. for IDi and thirty six (36) for IDr.
  2354. The following table lists the assigned values for the Identification
  2355. Type field, followed by a description of the Identification Data
  2356. which follows:
  2357. ID Type Value
  2358. ------- -----
  2359. RESERVED 0
  2360. ID_IPV4_ADDR 1
  2361. A single four (4) octet IPv4 address.
  2362. ID_FQDN 2
  2363. A fully-qualified domain name string. An example of a
  2364. ID_FQDN is, "example.com". The string MUST not contain any
  2365. terminators (e.g., NULL, CR, etc.).
  2366. Kaufman Standards Track [Page 57]
  2367. RFC 4306 IKEv2 December 2005
  2368. ID_RFC822_ADDR 3
  2369. A fully-qualified RFC822 email address string, An example of
  2370. a ID_RFC822_ADDR is, "jsmith@example.com". The string MUST
  2371. not contain any terminators.
  2372. Reserved to IANA 4
  2373. ID_IPV6_ADDR 5
  2374. A single sixteen (16) octet IPv6 address.
  2375. Reserved to IANA 6 - 8
  2376. ID_DER_ASN1_DN 9
  2377. The binary Distinguished Encoding Rules (DER) encoding of an
  2378. ASN.1 X.500 Distinguished Name [X.501].
  2379. ID_DER_ASN1_GN 10
  2380. The binary DER encoding of an ASN.1 X.500 GeneralName
  2381. [X.509].
  2382. ID_KEY_ID 11
  2383. An opaque octet stream which may be used to pass vendor-
  2384. specific information necessary to do certain proprietary
  2385. types of identification.
  2386. Reserved to IANA 12-200
  2387. Reserved for private use 201-255
  2388. Two implementations will interoperate only if each can generate a
  2389. type of ID acceptable to the other. To assure maximum
  2390. interoperability, implementations MUST be configurable to send at
  2391. least one of ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, or ID_KEY_ID, and
  2392. MUST be configurable to accept all of these types. Implementations
  2393. SHOULD be capable of generating and accepting all of these types.
  2394. IPv6-capable implementations MUST additionally be configurable to
  2395. accept ID_IPV6_ADDR. IPv6-only implementations MAY be configurable
  2396. to send only ID_IPV6_ADDR.
  2397. Kaufman Standards Track [Page 58]
  2398. RFC 4306 IKEv2 December 2005
  2399. 3.6. Certificate Payload
  2400. The Certificate Payload, denoted CERT in this memo, provides a means
  2401. to transport certificates or other authentication-related information
  2402. via IKE. Certificate payloads SHOULD be included in an exchange if
  2403. certificates are available to the sender unless the peer has
  2404. indicated an ability to retrieve this information from elsewhere
  2405. using an HTTP_CERT_LOOKUP_SUPPORTED Notify payload. Note that the
  2406. term "Certificate Payload" is somewhat misleading, because not all
  2407. authentication mechanisms use certificates and data other than
  2408. certificates may be passed in this payload.
  2409. The Certificate Payload is defined as follows:
  2410. 1 2 3
  2411. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2412. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2413. ! Next Payload !C! RESERVED ! Payload Length !
  2414. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2415. ! Cert Encoding ! !
  2416. +-+-+-+-+-+-+-+-+ !
  2417. ~ Certificate Data ~
  2418. ! !
  2419. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2420. Figure 12: Certificate Payload Format
  2421. o Certificate Encoding (1 octet) - This field indicates the type
  2422. of certificate or certificate-related information contained in
  2423. the Certificate Data field.
  2424. Certificate Encoding Value
  2425. -------------------- -----
  2426. RESERVED 0
  2427. PKCS #7 wrapped X.509 certificate 1
  2428. PGP Certificate 2
  2429. DNS Signed Key 3
  2430. X.509 Certificate - Signature 4
  2431. Kerberos Token 6
  2432. Certificate Revocation List (CRL) 7
  2433. Authority Revocation List (ARL) 8
  2434. SPKI Certificate 9
  2435. X.509 Certificate - Attribute 10
  2436. Raw RSA Key 11
  2437. Hash and URL of X.509 certificate 12
  2438. Hash and URL of X.509 bundle 13
  2439. RESERVED to IANA 14 - 200
  2440. PRIVATE USE 201 - 255
  2441. Kaufman Standards Track [Page 59]
  2442. RFC 4306 IKEv2 December 2005
  2443. o Certificate Data (variable length) - Actual encoding of
  2444. certificate data. The type of certificate is indicated by the
  2445. Certificate Encoding field.
  2446. The payload type for the Certificate Payload is thirty seven (37).
  2447. Specific syntax is for some of the certificate type codes above is
  2448. not defined in this document. The types whose syntax is defined in
  2449. this document are:
  2450. X.509 Certificate - Signature (4) contains a DER encoded X.509
  2451. certificate whose public key is used to validate the sender's AUTH
  2452. payload.
  2453. Certificate Revocation List (7) contains a DER encoded X.509
  2454. certificate revocation list.
  2455. Raw RSA Key (11) contains a PKCS #1 encoded RSA key (see [RSA] and
  2456. [PKCS1]).
  2457. Hash and URL encodings (12-13) allow IKE messages to remain short
  2458. by replacing long data structures with a 20 octet SHA-1 hash (see
  2459. [SHA]) of the replaced value followed by a variable-length URL
  2460. that resolves to the DER encoded data structure itself. This
  2461. improves efficiency when the endpoints have certificate data
  2462. cached and makes IKE less subject to denial of service attacks
  2463. that become easier to mount when IKE messages are large enough to
  2464. require IP fragmentation [KPS03].
  2465. Use the following ASN.1 definition for an X.509 bundle:
  2466. CertBundle
  2467. { iso(1) identified-organization(3) dod(6) internet(1)
  2468. security(5) mechanisms(5) pkix(7) id-mod(0)
  2469. id-mod-cert-bundle(34) }
  2470. DEFINITIONS EXPLICIT TAGS ::=
  2471. BEGIN
  2472. IMPORTS
  2473. Certificate, CertificateList
  2474. FROM PKIX1Explicit88
  2475. { iso(1) identified-organization(3) dod(6)
  2476. internet(1) security(5) mechanisms(5) pkix(7)
  2477. id-mod(0) id-pkix1-explicit(18) } ;
  2478. Kaufman Standards Track [Page 60]
  2479. RFC 4306 IKEv2 December 2005
  2480. CertificateOrCRL ::= CHOICE {
  2481. cert [0] Certificate,
  2482. crl [1] CertificateList }
  2483. CertificateBundle ::= SEQUENCE OF CertificateOrCRL
  2484. END
  2485. Implementations MUST be capable of being configured to send and
  2486. accept up to four X.509 certificates in support of authentication,
  2487. and also MUST be capable of being configured to send and accept the
  2488. first two Hash and URL formats (with HTTP URLs). Implementations
  2489. SHOULD be capable of being configured to send and accept Raw RSA
  2490. keys. If multiple certificates are sent, the first certificate MUST
  2491. contain the public key used to sign the AUTH payload. The other
  2492. certificates may be sent in any order.
  2493. 3.7. Certificate Request Payload
  2494. The Certificate Request Payload, denoted CERTREQ in this memo,
  2495. provides a means to request preferred certificates via IKE and can
  2496. appear in the IKE_INIT_SA response and/or the IKE_AUTH request.
  2497. Certificate Request payloads MAY be included in an exchange when the
  2498. sender needs to get the certificate of the receiver. If multiple CAs
  2499. are trusted and the cert encoding does not allow a list, then
  2500. multiple Certificate Request payloads SHOULD be transmitted.
  2501. The Certificate Request Payload is defined as follows:
  2502. 1 2 3
  2503. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2504. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2505. ! Next Payload !C! RESERVED ! Payload Length !
  2506. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2507. ! Cert Encoding ! !
  2508. +-+-+-+-+-+-+-+-+ !
  2509. ~ Certification Authority ~
  2510. ! !
  2511. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2512. Figure 13: Certificate Request Payload Format
  2513. o Certificate Encoding (1 octet) - Contains an encoding of the type
  2514. or format of certificate requested. Values are listed in section
  2515. 3.6.
  2516. Kaufman Standards Track [Page 61]
  2517. RFC 4306 IKEv2 December 2005
  2518. o Certification Authority (variable length) - Contains an encoding
  2519. of an acceptable certification authority for the type of
  2520. certificate requested.
  2521. The payload type for the Certificate Request Payload is thirty eight
  2522. (38).
  2523. The Certificate Encoding field has the same values as those defined
  2524. in section 3.6. The Certification Authority field contains an
  2525. indicator of trusted authorities for this certificate type. The
  2526. Certification Authority value is a concatenated list of SHA-1 hashes
  2527. of the public keys of trusted Certification Authorities (CAs). Each
  2528. is encoded as the SHA-1 hash of the Subject Public Key Info element
  2529. (see section 4.1.2.7 of [RFC3280]) from each Trust Anchor
  2530. certificate. The twenty-octet hashes are concatenated and included
  2531. with no other formatting.
  2532. Note that the term "Certificate Request" is somewhat misleading, in
  2533. that values other than certificates are defined in a "Certificate"
  2534. payload and requests for those values can be present in a Certificate
  2535. Request Payload. The syntax of the Certificate Request payload in
  2536. such cases is not defined in this document.
  2537. The Certificate Request Payload is processed by inspecting the "Cert
  2538. Encoding" field to determine whether the processor has any
  2539. certificates of this type. If so, the "Certification Authority"
  2540. field is inspected to determine if the processor has any certificates
  2541. that can be validated up to one of the specified certification
  2542. authorities. This can be a chain of certificates.
  2543. If an end-entity certificate exists that satisfies the criteria
  2544. specified in the CERTREQ, a certificate or certificate chain SHOULD
  2545. be sent back to the certificate requestor if the recipient of the
  2546. CERTREQ:
  2547. - is configured to use certificate authentication,
  2548. - is allowed to send a CERT payload,
  2549. - has matching CA trust policy governing the current negotiation, and
  2550. - has at least one time-wise and usage appropriate end-entity
  2551. certificate chaining to a CA provided in the CERTREQ.
  2552. Certificate revocation checking must be considered during the
  2553. chaining process used to select a certificate. Note that even if two
  2554. peers are configured to use two different CAs, cross-certification
  2555. relationships should be supported by appropriate selection logic.
  2556. Kaufman Standards Track [Page 62]
  2557. RFC 4306 IKEv2 December 2005
  2558. The intent is not to prevent communication through the strict
  2559. adherence of selection of a certificate based on CERTREQ, when an
  2560. alternate certificate could be selected by the sender that would
  2561. still enable the recipient to successfully validate and trust it
  2562. through trust conveyed by cross-certification, CRLs, or other out-
  2563. of-band configured means. Thus, the processing of a CERTREQ should
  2564. be seen as a suggestion for a certificate to select, not a mandated
  2565. one. If no certificates exist, then the CERTREQ is ignored. This is
  2566. not an error condition of the protocol. There may be cases where
  2567. there is a preferred CA sent in the CERTREQ, but an alternate might
  2568. be acceptable (perhaps after prompting a human operator).
  2569. 3.8. Authentication Payload
  2570. The Authentication Payload, denoted AUTH in this memo, contains data
  2571. used for authentication purposes. The syntax of the Authentication
  2572. data varies according to the Auth Method as specified below.
  2573. The Authentication Payload is defined as follows:
  2574. 1 2 3
  2575. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2576. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2577. ! Next Payload !C! RESERVED ! Payload Length !
  2578. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2579. ! Auth Method ! RESERVED !
  2580. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2581. ! !
  2582. ~ Authentication Data ~
  2583. ! !
  2584. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2585. Figure 14: Authentication Payload Format
  2586. o Auth Method (1 octet) - Specifies the method of authentication
  2587. used. Values defined are:
  2588. RSA Digital Signature (1) - Computed as specified in section
  2589. 2.15 using an RSA private key over a PKCS#1 padded hash (see
  2590. [RSA] and [PKCS1]).
  2591. Shared Key Message Integrity Code (2) - Computed as specified in
  2592. section 2.15 using the shared key associated with the identity
  2593. in the ID payload and the negotiated prf function
  2594. DSS Digital Signature (3) - Computed as specified in section
  2595. 2.15 using a DSS private key (see [DSS]) over a SHA-1 hash.
  2596. Kaufman Standards Track [Page 63]
  2597. RFC 4306 IKEv2 December 2005
  2598. The values 0 and 4-200 are reserved to IANA. The values 201-255
  2599. are available for private use.
  2600. o Authentication Data (variable length) - see section 2.15.
  2601. The payload type for the Authentication Payload is thirty nine (39).
  2602. 3.9. Nonce Payload
  2603. The Nonce Payload, denoted Ni and Nr in this memo for the initiator's
  2604. and responder's nonce respectively, contains random data used to
  2605. guarantee liveness during an exchange and protect against replay
  2606. attacks.
  2607. The Nonce Payload is defined as follows:
  2608. 1 2 3
  2609. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2610. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2611. ! Next Payload !C! RESERVED ! Payload Length !
  2612. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2613. ! !
  2614. ~ Nonce Data ~
  2615. ! !
  2616. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2617. Figure 15: Nonce Payload Format
  2618. o Nonce Data (variable length) - Contains the random data generated
  2619. by the transmitting entity.
  2620. The payload type for the Nonce Payload is forty (40).
  2621. The size of a Nonce MUST be between 16 and 256 octets inclusive.
  2622. Nonce values MUST NOT be reused.
  2623. 3.10. Notify Payload
  2624. The Notify Payload, denoted N in this document, is used to transmit
  2625. informational data, such as error conditions and state transitions,
  2626. to an IKE peer. A Notify Payload may appear in a response message
  2627. (usually specifying why a request was rejected), in an INFORMATIONAL
  2628. Exchange (to report an error not in an IKE request), or in any other
  2629. message to indicate sender capabilities or to modify the meaning of
  2630. the request.
  2631. Kaufman Standards Track [Page 64]
  2632. RFC 4306 IKEv2 December 2005
  2633. The Notify Payload is defined as follows:
  2634. 1 2 3
  2635. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2636. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2637. ! Next Payload !C! RESERVED ! Payload Length !
  2638. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2639. ! Protocol ID ! SPI Size ! Notify Message Type !
  2640. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2641. ! !
  2642. ~ Security Parameter Index (SPI) ~
  2643. ! !
  2644. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2645. ! !
  2646. ~ Notification Data ~
  2647. ! !
  2648. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2649. Figure 16: Notify Payload Format
  2650. o Protocol ID (1 octet) - If this notification concerns an existing
  2651. SA, this field indicates the type of that SA. For IKE_SA
  2652. notifications, this field MUST be one (1). For notifications
  2653. concerning IPsec SAs this field MUST contain either (2) to
  2654. indicate AH or (3) to indicate ESP. For notifications that do not
  2655. relate to an existing SA, this field MUST be sent as zero and MUST
  2656. be ignored on receipt. All other values for this field are
  2657. reserved to IANA for future assignment.
  2658. o SPI Size (1 octet) - Length in octets of the SPI as defined by the
  2659. IPsec protocol ID or zero if no SPI is applicable. For a
  2660. notification concerning the IKE_SA, the SPI Size MUST be zero.
  2661. o Notify Message Type (2 octets) - Specifies the type of
  2662. notification message.
  2663. o SPI (variable length) - Security Parameter Index.
  2664. o Notification Data (variable length) - Informational or error data
  2665. transmitted in addition to the Notify Message Type. Values for
  2666. this field are type specific (see below).
  2667. The payload type for the Notify Payload is forty one (41).
  2668. Kaufman Standards Track [Page 65]
  2669. RFC 4306 IKEv2 December 2005
  2670. 3.10.1. Notify Message Types
  2671. Notification information can be error messages specifying why an SA
  2672. could not be established. It can also be status data that a process
  2673. managing an SA database wishes to communicate with a peer process.
  2674. The table below lists the Notification messages and their
  2675. corresponding values. The number of different error statuses was
  2676. greatly reduced from IKEv1 both for simplification and to avoid
  2677. giving configuration information to probers.
  2678. Types in the range 0 - 16383 are intended for reporting errors. An
  2679. implementation receiving a Notify payload with one of these types
  2680. that it does not recognize in a response MUST assume that the
  2681. corresponding request has failed entirely. Unrecognized error types
  2682. in a request and status types in a request or response MUST be
  2683. ignored except that they SHOULD be logged.
  2684. Notify payloads with status types MAY be added to any message and
  2685. MUST be ignored if not recognized. They are intended to indicate
  2686. capabilities, and as part of SA negotiation are used to negotiate
  2687. non-cryptographic parameters.
  2688. NOTIFY MESSAGES - ERROR TYPES Value
  2689. ----------------------------- -----
  2690. RESERVED 0
  2691. UNSUPPORTED_CRITICAL_PAYLOAD 1
  2692. Sent if the payload has the "critical" bit set and the
  2693. payload type is not recognized. Notification Data contains
  2694. the one-octet payload type.
  2695. INVALID_IKE_SPI 4
  2696. Indicates an IKE message was received with an unrecognized
  2697. destination SPI. This usually indicates that the recipient
  2698. has rebooted and forgotten the existence of an IKE_SA.
  2699. INVALID_MAJOR_VERSION 5
  2700. Indicates the recipient cannot handle the version of IKE
  2701. specified in the header. The closest version number that
  2702. the recipient can support will be in the reply header.
  2703. INVALID_SYNTAX 7
  2704. Indicates the IKE message that was received was invalid
  2705. because some type, length, or value was out of range or
  2706. Kaufman Standards Track [Page 66]
  2707. RFC 4306 IKEv2 December 2005
  2708. because the request was rejected for policy reasons. To
  2709. avoid a denial of service attack using forged messages, this
  2710. status may only be returned for and in an encrypted packet
  2711. if the message ID and cryptographic checksum were valid. To
  2712. avoid leaking information to someone probing a node, this
  2713. status MUST be sent in response to any error not covered by
  2714. one of the other status types. To aid debugging, more
  2715. detailed error information SHOULD be written to a console or
  2716. log.
  2717. INVALID_MESSAGE_ID 9
  2718. Sent when an IKE message ID outside the supported window is
  2719. received. This Notify MUST NOT be sent in a response; the
  2720. invalid request MUST NOT be acknowledged. Instead, inform
  2721. the other side by initiating an INFORMATIONAL exchange with
  2722. Notification data containing the four octet invalid message
  2723. ID. Sending this notification is optional, and
  2724. notifications of this type MUST be rate limited.
  2725. INVALID_SPI 11
  2726. MAY be sent in an IKE INFORMATIONAL exchange when a node
  2727. receives an ESP or AH packet with an invalid SPI. The
  2728. Notification Data contains the SPI of the invalid packet.
  2729. This usually indicates a node has rebooted and forgotten an
  2730. SA. If this Informational Message is sent outside the
  2731. context of an IKE_SA, it should be used by the recipient
  2732. only as a "hint" that something might be wrong (because it
  2733. could easily be forged).
  2734. NO_PROPOSAL_CHOSEN 14
  2735. None of the proposed crypto suites was acceptable.
  2736. INVALID_KE_PAYLOAD 17
  2737. The D-H Group # field in the KE payload is not the group #
  2738. selected by the responder for this exchange. There are two
  2739. octets of data associated with this notification: the
  2740. accepted D-H Group # in big endian order.
  2741. AUTHENTICATION_FAILED 24
  2742. Sent in the response to an IKE_AUTH message when for some
  2743. reason the authentication failed. There is no associated
  2744. data.
  2745. Kaufman Standards Track [Page 67]
  2746. RFC 4306 IKEv2 December 2005
  2747. SINGLE_PAIR_REQUIRED 34
  2748. This error indicates that a CREATE_CHILD_SA request is
  2749. unacceptable because its sender is only willing to accept
  2750. traffic selectors specifying a single pair of addresses. The
  2751. requestor is expected to respond by requesting an SA for only
  2752. the specific traffic it is trying to forward.
  2753. NO_ADDITIONAL_SAS 35
  2754. This error indicates that a CREATE_CHILD_SA request is
  2755. unacceptable because the responder is unwilling to accept any
  2756. more CHILD_SAs on this IKE_SA. Some minimal implementations may
  2757. only accept a single CHILD_SA setup in the context of an initial
  2758. IKE exchange and reject any subsequent attempts to add more.
  2759. INTERNAL_ADDRESS_FAILURE 36
  2760. Indicates an error assigning an internal address (i.e.,
  2761. INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS) during the
  2762. processing of a Configuration Payload by a responder. If this
  2763. error is generated within an IKE_AUTH exchange, no CHILD_SA will
  2764. be created.
  2765. FAILED_CP_REQUIRED 37
  2766. Sent by responder in the case where CP(CFG_REQUEST) was expected
  2767. but not received, and so is a conflict with locally configured
  2768. policy. There is no associated data.
  2769. TS_UNACCEPTABLE 38
  2770. Indicates that none of the addresses/protocols/ports in the
  2771. supplied traffic selectors is acceptable.
  2772. INVALID_SELECTORS 39
  2773. MAY be sent in an IKE INFORMATIONAL exchange when a node
  2774. receives an ESP or AH packet whose selectors do not match
  2775. those of the SA on which it was delivered (and that caused
  2776. the packet to be dropped). The Notification Data contains
  2777. the start of the offending packet (as in ICMP messages) and
  2778. the SPI field of the notification is set to match the SPI of
  2779. the IPsec SA.
  2780. RESERVED TO IANA - Error types 40 - 8191
  2781. Private Use - Errors 8192 - 16383
  2782. Kaufman Standards Track [Page 68]
  2783. RFC 4306 IKEv2 December 2005
  2784. NOTIFY MESSAGES - STATUS TYPES Value
  2785. ------------------------------ -----
  2786. INITIAL_CONTACT 16384
  2787. This notification asserts that this IKE_SA is the only
  2788. IKE_SA currently active between the authenticated
  2789. identities. It MAY be sent when an IKE_SA is established
  2790. after a crash, and the recipient MAY use this information to
  2791. delete any other IKE_SAs it has to the same authenticated
  2792. identity without waiting for a timeout. This notification
  2793. MUST NOT be sent by an entity that may be replicated (e.g.,
  2794. a roaming user's credentials where the user is allowed to
  2795. connect to the corporate firewall from two remote systems at
  2796. the same time).
  2797. SET_WINDOW_SIZE 16385
  2798. This notification asserts that the sending endpoint is
  2799. capable of keeping state for multiple outstanding exchanges,
  2800. permitting the recipient to send multiple requests before
  2801. getting a response to the first. The data associated with a
  2802. SET_WINDOW_SIZE notification MUST be 4 octets long and
  2803. contain the big endian representation of the number of
  2804. messages the sender promises to keep. Window size is always
  2805. one until the initial exchanges complete.
  2806. ADDITIONAL_TS_POSSIBLE 16386
  2807. This notification asserts that the sending endpoint narrowed
  2808. the proposed traffic selectors but that other traffic
  2809. selectors would also have been acceptable, though only in a
  2810. separate SA (see section 2.9). There is no data associated
  2811. with this Notify type. It may be sent only as an additional
  2812. payload in a message including accepted TSs.
  2813. IPCOMP_SUPPORTED 16387
  2814. This notification may be included only in a message
  2815. containing an SA payload negotiating a CHILD_SA and
  2816. indicates a willingness by its sender to use IPComp on this
  2817. SA. The data associated with this notification includes a
  2818. two-octet IPComp CPI followed by a one-octet transform ID
  2819. optionally followed by attributes whose length and format
  2820. are defined by that transform ID. A message proposing an SA
  2821. may contain multiple IPCOMP_SUPPORTED notifications to
  2822. indicate multiple supported algorithms. A message accepting
  2823. an SA may contain at most one.
  2824. Kaufman Standards Track [Page 69]
  2825. RFC 4306 IKEv2 December 2005
  2826. The transform IDs currently defined are:
  2827. NAME NUMBER DEFINED IN
  2828. ----------- ------ -----------
  2829. RESERVED 0
  2830. IPCOMP_OUI 1
  2831. IPCOMP_DEFLATE 2 RFC 2394
  2832. IPCOMP_LZS 3 RFC 2395
  2833. IPCOMP_LZJH 4 RFC 3051
  2834. values 5-240 are reserved to IANA. Values 241-255 are
  2835. for private use among mutually consenting parties.
  2836. NAT_DETECTION_SOURCE_IP 16388
  2837. This notification is used by its recipient to determine
  2838. whether the source is behind a NAT box. The data associated
  2839. with this notification is a SHA-1 digest of the SPIs (in the
  2840. order they appear in the header), IP address, and port on
  2841. which this packet was sent. There MAY be multiple Notify
  2842. payloads of this type in a message if the sender does not
  2843. know which of several network attachments will be used to
  2844. send the packet. The recipient of this notification MAY
  2845. compare the supplied value to a SHA-1 hash of the SPIs,
  2846. source IP address, and port, and if they don't match it
  2847. SHOULD enable NAT traversal (see section 2.23).
  2848. Alternately, it MAY reject the connection attempt if NAT
  2849. traversal is not supported.
  2850. NAT_DETECTION_DESTINATION_IP 16389
  2851. This notification is used by its recipient to determine
  2852. whether it is behind a NAT box. The data associated with
  2853. this notification is a SHA-1 digest of the SPIs (in the
  2854. order they appear in the header), IP address, and port to
  2855. which this packet was sent. The recipient of this
  2856. notification MAY compare the supplied value to a hash of the
  2857. SPIs, destination IP address, and port, and if they don't
  2858. match it SHOULD invoke NAT traversal (see section 2.23). If
  2859. they don't match, it means that this end is behind a NAT and
  2860. this end SHOULD start sending keepalive packets as defined
  2861. in [Hutt05]. Alternately, it MAY reject the connection
  2862. attempt if NAT traversal is not supported.
  2863. Kaufman Standards Track [Page 70]
  2864. RFC 4306 IKEv2 December 2005
  2865. COOKIE 16390
  2866. This notification MAY be included in an IKE_SA_INIT
  2867. response. It indicates that the request should be retried
  2868. with a copy of this notification as the first payload. This
  2869. notification MUST be included in an IKE_SA_INIT request
  2870. retry if a COOKIE notification was included in the initial
  2871. response. The data associated with this notification MUST
  2872. be between 1 and 64 octets in length (inclusive).
  2873. USE_TRANSPORT_MODE 16391
  2874. This notification MAY be included in a request message that
  2875. also includes an SA payload requesting a CHILD_SA. It
  2876. requests that the CHILD_SA use transport mode rather than
  2877. tunnel mode for the SA created. If the request is accepted,
  2878. the response MUST also include a notification of type
  2879. USE_TRANSPORT_MODE. If the responder declines the request,
  2880. the CHILD_SA will be established in tunnel mode. If this is
  2881. unacceptable to the initiator, the initiator MUST delete the
  2882. SA. Note: Except when using this option to negotiate
  2883. transport mode, all CHILD_SAs will use tunnel mode.
  2884. Note: The ECN decapsulation modifications specified in
  2885. [RFC4301] MUST be performed for every tunnel mode SA created
  2886. by IKEv2.
  2887. HTTP_CERT_LOOKUP_SUPPORTED 16392
  2888. This notification MAY be included in any message that can
  2889. include a CERTREQ payload and indicates that the sender is
  2890. capable of looking up certificates based on an HTTP-based
  2891. URL (and hence presumably would prefer to receive
  2892. certificate specifications in that format).
  2893. REKEY_SA 16393
  2894. This notification MUST be included in a CREATE_CHILD_SA
  2895. exchange if the purpose of the exchange is to replace an
  2896. existing ESP or AH SA. The SPI field identifies the SA
  2897. being rekeyed. There is no data.
  2898. ESP_TFC_PADDING_NOT_SUPPORTED 16394
  2899. This notification asserts that the sending endpoint will NOT
  2900. accept packets that contain Flow Confidentiality (TFC)
  2901. padding.
  2902. Kaufman Standards Track [Page 71]
  2903. RFC 4306 IKEv2 December 2005
  2904. NON_FIRST_FRAGMENTS_ALSO 16395
  2905. Used for fragmentation control. See [RFC4301] for
  2906. explanation.
  2907. RESERVED TO IANA - STATUS TYPES 16396 - 40959
  2908. Private Use - STATUS TYPES 40960 - 65535
  2909. 3.11. Delete Payload
  2910. The Delete Payload, denoted D in this memo, contains a protocol-
  2911. specific security association identifier that the sender has removed
  2912. from its security association database and is, therefore, no longer
  2913. valid. Figure 17 shows the format of the Delete Payload. It is
  2914. possible to send multiple SPIs in a Delete payload; however, each SPI
  2915. MUST be for the same protocol. Mixing of protocol identifiers MUST
  2916. NOT be performed in a Delete payload. It is permitted, however, to
  2917. include multiple Delete payloads in a single INFORMATIONAL exchange
  2918. where each Delete payload lists SPIs for a different protocol.
  2919. Deletion of the IKE_SA is indicated by a protocol ID of 1 (IKE) but
  2920. no SPIs. Deletion of a CHILD_SA, such as ESP or AH, will contain the
  2921. IPsec protocol ID of that protocol (2 for AH, 3 for ESP), and the SPI
  2922. is the SPI the sending endpoint would expect in inbound ESP or AH
  2923. packets.
  2924. The Delete Payload is defined as follows:
  2925. 1 2 3
  2926. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2927. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2928. ! Next Payload !C! RESERVED ! Payload Length !
  2929. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2930. ! Protocol ID ! SPI Size ! # of SPIs !
  2931. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2932. ! !
  2933. ~ Security Parameter Index(es) (SPI) ~
  2934. ! !
  2935. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2936. Figure 17: Delete Payload Format
  2937. o Protocol ID (1 octet) - Must be 1 for an IKE_SA, 2 for AH, or 3
  2938. for ESP.
  2939. Kaufman Standards Track [Page 72]
  2940. RFC 4306 IKEv2 December 2005
  2941. o SPI Size (1 octet) - Length in octets of the SPI as defined by the
  2942. protocol ID. It MUST be zero for IKE (SPI is in message header)
  2943. or four for AH and ESP.
  2944. o # of SPIs (2 octets) - The number of SPIs contained in the Delete
  2945. payload. The size of each SPI is defined by the SPI Size field.
  2946. o Security Parameter Index(es) (variable length) - Identifies the
  2947. specific security association(s) to delete. The length of this
  2948. field is determined by the SPI Size and # of SPIs fields.
  2949. The payload type for the Delete Payload is forty two (42).
  2950. 3.12. Vendor ID Payload
  2951. The Vendor ID Payload, denoted V in this memo, contains a vendor
  2952. defined constant. The constant is used by vendors to identify and
  2953. recognize remote instances of their implementations. This mechanism
  2954. allows a vendor to experiment with new features while maintaining
  2955. backward compatibility.
  2956. A Vendor ID payload MAY announce that the sender is capable to
  2957. accepting certain extensions to the protocol, or it MAY simply
  2958. identify the implementation as an aid in debugging. A Vendor ID
  2959. payload MUST NOT change the interpretation of any information defined
  2960. in this specification (i.e., the critical bit MUST be set to 0).
  2961. Multiple Vendor ID payloads MAY be sent. An implementation is NOT
  2962. REQUIRED to send any Vendor ID payload at all.
  2963. A Vendor ID payload may be sent as part of any message. Reception of
  2964. a familiar Vendor ID payload allows an implementation to make use of
  2965. Private USE numbers described throughout this memo -- private
  2966. payloads, private exchanges, private notifications, etc. Unfamiliar
  2967. Vendor IDs MUST be ignored.
  2968. Writers of Internet-Drafts who wish to extend this protocol MUST
  2969. define a Vendor ID payload to announce the ability to implement the
  2970. extension in the Internet-Draft. It is expected that Internet-Drafts
  2971. that gain acceptance and are standardized will be given "magic
  2972. numbers" out of the Future Use range by IANA, and the requirement to
  2973. use a Vendor ID will go away.
  2974. Kaufman Standards Track [Page 73]
  2975. RFC 4306 IKEv2 December 2005
  2976. The Vendor ID Payload fields are defined as follows:
  2977. 1 2 3
  2978. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2979. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2980. ! Next Payload !C! RESERVED ! Payload Length !
  2981. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2982. ! !
  2983. ~ Vendor ID (VID) ~
  2984. ! !
  2985. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2986. Figure 18: Vendor ID Payload Format
  2987. o Vendor ID (variable length) - It is the responsibility of the
  2988. person choosing the Vendor ID to assure its uniqueness in spite of
  2989. the absence of any central registry for IDs. Good practice is to
  2990. include a company name, a person name, or some such. If you want
  2991. to show off, you might include the latitude and longitude and time
  2992. where you were when you chose the ID and some random input. A
  2993. message digest of a long unique string is preferable to the long
  2994. unique string itself.
  2995. The payload type for the Vendor ID Payload is forty three (43).
  2996. 3.13. Traffic Selector Payload
  2997. The Traffic Selector Payload, denoted TS in this memo, allows peers
  2998. to identify packet flows for processing by IPsec security services.
  2999. The Traffic Selector Payload consists of the IKE generic payload
  3000. header followed by individual traffic selectors as follows:
  3001. 1 2 3
  3002. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3003. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3004. ! Next Payload !C! RESERVED ! Payload Length !
  3005. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3006. ! Number of TSs ! RESERVED !
  3007. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3008. ! !
  3009. ~ <Traffic Selectors> ~
  3010. ! !
  3011. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3012. Figure 19: Traffic Selectors Payload Format
  3013. o Number of TSs (1 octet) - Number of traffic selectors being
  3014. provided.
  3015. Kaufman Standards Track [Page 74]
  3016. RFC 4306 IKEv2 December 2005
  3017. o RESERVED - This field MUST be sent as zero and MUST be ignored on
  3018. receipt.
  3019. o Traffic Selectors (variable length) - One or more individual
  3020. traffic selectors.
  3021. The length of the Traffic Selector payload includes the TS header and
  3022. all the traffic selectors.
  3023. The payload type for the Traffic Selector payload is forty four (44)
  3024. for addresses at the initiator's end of the SA and forty five (45)
  3025. for addresses at the responder's end.
  3026. 3.13.1. Traffic Selector
  3027. 1 2 3
  3028. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3029. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3030. ! TS Type !IP Protocol ID*| Selector Length |
  3031. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3032. | Start Port* | End Port* |
  3033. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3034. ! !
  3035. ~ Starting Address* ~
  3036. ! !
  3037. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3038. ! !
  3039. ~ Ending Address* ~
  3040. ! !
  3041. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3042. Figure 20: Traffic Selector
  3043. * Note: All fields other than TS Type and Selector Length depend on
  3044. the TS Type. The fields shown are for TS Types 7 and 8, the only two
  3045. values currently defined.
  3046. o TS Type (one octet) - Specifies the type of traffic selector.
  3047. o IP protocol ID (1 octet) - Value specifying an associated IP
  3048. protocol ID (e.g., UDP/TCP/ICMP). A value of zero means that the
  3049. protocol ID is not relevant to this traffic selector -- the SA can
  3050. carry all protocols.
  3051. o Selector Length - Specifies the length of this Traffic Selector
  3052. Substructure including the header.
  3053. Kaufman Standards Track [Page 75]
  3054. RFC 4306 IKEv2 December 2005
  3055. o Start Port (2 octets) - Value specifying the smallest port number
  3056. allowed by this Traffic Selector. For protocols for which port is
  3057. undefined, or if all ports are allowed, this field MUST be zero.
  3058. For the ICMP protocol, the two one-octet fields Type and Code are
  3059. treated as a single 16-bit integer (with Type in the most
  3060. significant eight bits and Code in the least significant eight
  3061. bits) port number for the purposes of filtering based on this
  3062. field.
  3063. o End Port (2 octets) - Value specifying the largest port number
  3064. allowed by this Traffic Selector. For protocols for which port is
  3065. undefined, or if all ports are allowed, this field MUST be 65535.
  3066. For the ICMP protocol, the two one-octet fields Type and Code are
  3067. treated as a single 16-bit integer (with Type in the most
  3068. significant eight bits and Code in the least significant eight
  3069. bits) port number for the purposed of filtering based on this
  3070. field.
  3071. o Starting Address - The smallest address included in this Traffic
  3072. Selector (length determined by TS type).
  3073. o Ending Address - The largest address included in this Traffic
  3074. Selector (length determined by TS type).
  3075. Systems that are complying with [RFC4301] that wish to indicate "ANY"
  3076. ports MUST set the start port to 0 and the end port to 65535; note
  3077. that according to [RFC4301], "ANY" includes "OPAQUE". Systems
  3078. working with [RFC4301] that wish to indicate "OPAQUE" ports, but not
  3079. "ANY" ports, MUST set the start port to 65535 and the end port to 0.
  3080. The following table lists the assigned values for the Traffic
  3081. Selector Type field and the corresponding Address Selector Data.
  3082. TS Type Value
  3083. ------- -----
  3084. RESERVED 0-6
  3085. TS_IPV4_ADDR_RANGE 7
  3086. A range of IPv4 addresses, represented by two four-octet
  3087. values. The first value is the beginning IPv4 address
  3088. (inclusive) and the second value is the ending IPv4 address
  3089. (inclusive). All addresses falling between the two
  3090. specified addresses are considered to be within the list.
  3091. Kaufman Standards Track [Page 76]
  3092. RFC 4306 IKEv2 December 2005
  3093. TS_IPV6_ADDR_RANGE 8
  3094. A range of IPv6 addresses, represented by two sixteen-octet
  3095. values. The first value is the beginning IPv6 address
  3096. (inclusive) and the second value is the ending IPv6 address
  3097. (inclusive). All addresses falling between the two
  3098. specified addresses are considered to be within the list.
  3099. RESERVED TO IANA 9-240
  3100. PRIVATE USE 241-255
  3101. 3.14. Encrypted Payload
  3102. The Encrypted Payload, denoted SK{...} or E in this memo, contains
  3103. other payloads in encrypted form. The Encrypted Payload, if present
  3104. in a message, MUST be the last payload in the message. Often, it is
  3105. the only payload in the message.
  3106. The algorithms for encryption and integrity protection are negotiated
  3107. during IKE_SA setup, and the keys are computed as specified in
  3108. sections 2.14 and 2.18.
  3109. The encryption and integrity protection algorithms are modeled after
  3110. the ESP algorithms described in RFCs 2104 [KBC96], 4303 [RFC4303],
  3111. and 2451 [ESPCBC]. This document completely specifies the
  3112. cryptographic processing of IKE data, but those documents should be
  3113. consulted for design rationale. We require a block cipher with a
  3114. fixed block size and an integrity check algorithm that computes a
  3115. fixed-length checksum over a variable size message.
  3116. The payload type for an Encrypted payload is forty six (46). The
  3117. Encrypted Payload consists of the IKE generic payload header followed
  3118. by individual fields as follows:
  3119. Kaufman Standards Track [Page 77]
  3120. RFC 4306 IKEv2 December 2005
  3121. 1 2 3
  3122. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3123. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3124. ! Next Payload !C! RESERVED ! Payload Length !
  3125. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3126. ! Initialization Vector !
  3127. ! (length is block size for encryption algorithm) !
  3128. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3129. ~ Encrypted IKE Payloads ~
  3130. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3131. ! ! Padding (0-255 octets) !
  3132. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  3133. ! ! Pad Length !
  3134. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3135. ~ Integrity Checksum Data ~
  3136. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3137. Figure 21: Encrypted Payload Format
  3138. o Next Payload - The payload type of the first embedded payload.
  3139. Note that this is an exception in the standard header format,
  3140. since the Encrypted payload is the last payload in the message and
  3141. therefore the Next Payload field would normally be zero. But
  3142. because the content of this payload is embedded payloads and there
  3143. was no natural place to put the type of the first one, that type
  3144. is placed here.
  3145. o Payload Length - Includes the lengths of the header, IV, Encrypted
  3146. IKE Payloads, Padding, Pad Length, and Integrity Checksum Data.
  3147. o Initialization Vector - A randomly chosen value whose length is
  3148. equal to the block length of the underlying encryption algorithm.
  3149. Recipients MUST accept any value. Senders SHOULD either pick this
  3150. value pseudo-randomly and independently for each message or use
  3151. the final ciphertext block of the previous message sent. Senders
  3152. MUST NOT use the same value for each message, use a sequence of
  3153. values with low hamming distance (e.g., a sequence number), or use
  3154. ciphertext from a received message.
  3155. o IKE Payloads are as specified earlier in this section. This field
  3156. is encrypted with the negotiated cipher.
  3157. o Padding MAY contain any value chosen by the sender, and MUST have
  3158. a length that makes the combination of the Payloads, the Padding,
  3159. and the Pad Length to be a multiple of the encryption block size.
  3160. This field is encrypted with the negotiated cipher.
  3161. Kaufman Standards Track [Page 78]
  3162. RFC 4306 IKEv2 December 2005
  3163. o Pad Length is the length of the Padding field. The sender SHOULD
  3164. set the Pad Length to the minimum value that makes the combination
  3165. of the Payloads, the Padding, and the Pad Length a multiple of the
  3166. block size, but the recipient MUST accept any length that results
  3167. in proper alignment. This field is encrypted with the negotiated
  3168. cipher.
  3169. o Integrity Checksum Data is the cryptographic checksum of the
  3170. entire message starting with the Fixed IKE Header through the Pad
  3171. Length. The checksum MUST be computed over the encrypted message.
  3172. Its length is determined by the integrity algorithm negotiated.
  3173. 3.15. Configuration Payload
  3174. The Configuration payload, denoted CP in this document, is used to
  3175. exchange configuration information between IKE peers. The exchange
  3176. is for an IRAC to request an internal IP address from an IRAS and to
  3177. exchange other information of the sort that one would acquire with
  3178. Dynamic Host Configuration Protocol (DHCP) if the IRAC were directly
  3179. connected to a LAN.
  3180. Configuration payloads are of type CFG_REQUEST/CFG_REPLY or
  3181. CFG_SET/CFG_ACK (see CFG Type in the payload description below).
  3182. CFG_REQUEST and CFG_SET payloads may optionally be added to any IKE
  3183. request. The IKE response MUST include either a corresponding
  3184. CFG_REPLY or CFG_ACK or a Notify payload with an error type
  3185. indicating why the request could not be honored. An exception is
  3186. that a minimal implementation MAY ignore all CFG_REQUEST and CFG_SET
  3187. payloads, so a response message without a corresponding CFG_REPLY or
  3188. CFG_ACK MUST be accepted as an indication that the request was not
  3189. supported.
  3190. "CFG_REQUEST/CFG_REPLY" allows an IKE endpoint to request information
  3191. from its peer. If an attribute in the CFG_REQUEST Configuration
  3192. Payload is not zero-length, it is taken as a suggestion for that
  3193. attribute. The CFG_REPLY Configuration Payload MAY return that
  3194. value, or a new one. It MAY also add new attributes and not include
  3195. some requested ones. Requestors MUST ignore returned attributes that
  3196. they do not recognize.
  3197. Some attributes MAY be multi-valued, in which case multiple attribute
  3198. values of the same type are sent and/or returned. Generally, all
  3199. values of an attribute are returned when the attribute is requested.
  3200. For some attributes (in this version of the specification only
  3201. internal addresses), multiple requests indicates a request that
  3202. multiple values be assigned. For these attributes, the number of
  3203. values returned SHOULD NOT exceed the number requested.
  3204. Kaufman Standards Track [Page 79]
  3205. RFC 4306 IKEv2 December 2005
  3206. If the data type requested in a CFG_REQUEST is not recognized or not
  3207. supported, the responder MUST NOT return an error type but rather
  3208. MUST either send a CFG_REPLY that MAY be empty or a reply not
  3209. containing a CFG_REPLY payload at all. Error returns are reserved
  3210. for cases where the request is recognized but cannot be performed as
  3211. requested or the request is badly formatted.
  3212. "CFG_SET/CFG_ACK" allows an IKE endpoint to push configuration data
  3213. to its peer. In this case, the CFG_SET Configuration Payload
  3214. contains attributes the initiator wants its peer to alter. The
  3215. responder MUST return a Configuration Payload if it accepted any of
  3216. the configuration data and it MUST contain the attributes that the
  3217. responder accepted with zero-length data. Those attributes that it
  3218. did not accept MUST NOT be in the CFG_ACK Configuration Payload. If
  3219. no attributes were accepted, the responder MUST return either an
  3220. empty CFG_ACK payload or a response message without a CFG_ACK
  3221. payload. There are currently no defined uses for the CFG_SET/CFG_ACK
  3222. exchange, though they may be used in connection with extensions based
  3223. on Vendor IDs. An minimal implementation of this specification MAY
  3224. ignore CFG_SET payloads.
  3225. Extensions via the CP payload SHOULD NOT be used for general purpose
  3226. management. Its main intent is to provide a bootstrap mechanism to
  3227. exchange information within IPsec from IRAS to IRAC. While it MAY be
  3228. useful to use such a method to exchange information between some
  3229. Security Gateways (SGW) or small networks, existing management
  3230. protocols such as DHCP [DHCP], RADIUS [RADIUS], SNMP, or LDAP [LDAP]
  3231. should be preferred for enterprise management as well as subsequent
  3232. information exchanges.
  3233. The Configuration Payload is defined as follows:
  3234. 1 2 3
  3235. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3236. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3237. ! Next Payload !C! RESERVED ! Payload Length !
  3238. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3239. ! CFG Type ! RESERVED !
  3240. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3241. ! !
  3242. ~ Configuration Attributes ~
  3243. ! !
  3244. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3245. Figure 22: Configuration Payload Format
  3246. The payload type for the Configuration Payload is forty seven (47).
  3247. Kaufman Standards Track [Page 80]
  3248. RFC 4306 IKEv2 December 2005
  3249. o CFG Type (1 octet) - The type of exchange represented by the
  3250. Configuration Attributes.
  3251. CFG Type Value
  3252. =========== =====
  3253. RESERVED 0
  3254. CFG_REQUEST 1
  3255. CFG_REPLY 2
  3256. CFG_SET 3
  3257. CFG_ACK 4
  3258. values 5-127 are reserved to IANA. Values 128-255 are for private
  3259. use among mutually consenting parties.
  3260. o RESERVED (3 octets) - MUST be sent as zero; MUST be ignored on
  3261. receipt.
  3262. o Configuration Attributes (variable length) - These are type length
  3263. values specific to the Configuration Payload and are defined
  3264. below. There may be zero or more Configuration Attributes in this
  3265. payload.
  3266. 3.15.1. Configuration Attributes
  3267. 1 2 3
  3268. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3269. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3270. !R| Attribute Type ! Length |
  3271. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3272. | |
  3273. ~ Value ~
  3274. | |
  3275. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3276. Figure 23: Configuration Attribute Format
  3277. o Reserved (1 bit) - This bit MUST be set to zero and MUST be
  3278. ignored on receipt.
  3279. o Attribute Type (15 bits) - A unique identifier for each of the
  3280. Configuration Attribute Types.
  3281. o Length (2 octets) - Length in octets of Value.
  3282. o Value (0 or more octets) - The variable-length value of this
  3283. Configuration Attribute.
  3284. Kaufman Standards Track [Page 81]
  3285. RFC 4306 IKEv2 December 2005
  3286. The following attribute types have been defined:
  3287. Multi-
  3288. Attribute Type Value Valued Length
  3289. ======================= ===== ====== ==================
  3290. RESERVED 0
  3291. INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets
  3292. INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets
  3293. INTERNAL_IP4_DNS 3 YES 0 or 4 octets
  3294. INTERNAL_IP4_NBNS 4 YES 0 or 4 octets
  3295. INTERNAL_ADDRESS_EXPIRY 5 NO 0 or 4 octets
  3296. INTERNAL_IP4_DHCP 6 YES 0 or 4 octets
  3297. APPLICATION_VERSION 7 NO 0 or more
  3298. INTERNAL_IP6_ADDRESS 8 YES* 0 or 17 octets
  3299. RESERVED 9
  3300. INTERNAL_IP6_DNS 10 YES 0 or 16 octets
  3301. INTERNAL_IP6_NBNS 11 YES 0 or 16 octets
  3302. INTERNAL_IP6_DHCP 12 YES 0 or 16 octets
  3303. INTERNAL_IP4_SUBNET 13 YES 0 or 8 octets
  3304. SUPPORTED_ATTRIBUTES 14 NO Multiple of 2
  3305. INTERNAL_IP6_SUBNET 15 YES 17 octets
  3306. * These attributes may be multi-valued on return only if multiple
  3307. values were requested.
  3308. Types 16-16383 are reserved to IANA. Values 16384-32767 are for
  3309. private use among mutually consenting parties.
  3310. o INTERNAL_IP4_ADDRESS, INTERNAL_IP6_ADDRESS - An address on the
  3311. internal network, sometimes called a red node address or
  3312. private address and MAY be a private address on the Internet.
  3313. In a request message, the address specified is a requested
  3314. address (or zero if no specific address is requested). If a
  3315. specific address is requested, it likely indicates that a
  3316. previous connection existed with this address and the requestor
  3317. would like to reuse that address. With IPv6, a requestor MAY
  3318. supply the low-order address bytes it wants to use. Multiple
  3319. internal addresses MAY be requested by requesting multiple
  3320. internal address attributes. The responder MAY only send up to
  3321. the number of addresses requested. The INTERNAL_IP6_ADDRESS is
  3322. made up of two fields: the first is a sixteen-octet IPv6
  3323. address and the second is a one-octet prefix-length as defined
  3324. in [ADDRIPV6].
  3325. The requested address is valid until the expiry time defined
  3326. with the INTERNAL_ADDRESS EXPIRY attribute or there are no
  3327. IKE_SAs between the peers.
  3328. Kaufman Standards Track [Page 82]
  3329. RFC 4306 IKEv2 December 2005
  3330. o INTERNAL_IP4_NETMASK - The internal network's netmask. Only
  3331. one netmask is allowed in the request and reply messages (e.g.,
  3332. 255.255.255.0), and it MUST be used only with an
  3333. INTERNAL_IP4_ADDRESS attribute.
  3334. o INTERNAL_IP4_DNS, INTERNAL_IP6_DNS - Specifies an address of a
  3335. DNS server within the network. Multiple DNS servers MAY be
  3336. requested. The responder MAY respond with zero or more DNS
  3337. server attributes.
  3338. o INTERNAL_IP4_NBNS, INTERNAL_IP6_NBNS - Specifies an address of
  3339. a NetBios Name Server (WINS) within the network. Multiple NBNS
  3340. servers MAY be requested. The responder MAY respond with zero
  3341. or more NBNS server attributes.
  3342. o INTERNAL_ADDRESS_EXPIRY - Specifies the number of seconds that
  3343. the host can use the internal IP address. The host MUST renew
  3344. the IP address before this expiry time. Only one of these
  3345. attributes MAY be present in the reply.
  3346. o INTERNAL_IP4_DHCP, INTERNAL_IP6_DHCP - Instructs the host to
  3347. send any internal DHCP requests to the address contained within
  3348. the attribute. Multiple DHCP servers MAY be requested. The
  3349. responder MAY respond with zero or more DHCP server attributes.
  3350. o APPLICATION_VERSION - The version or application information of
  3351. the IPsec host. This is a string of printable ASCII characters
  3352. that is NOT null terminated.
  3353. o INTERNAL_IP4_SUBNET - The protected sub-networks that this
  3354. edge-device protects. This attribute is made up of two fields:
  3355. the first is an IP address and the second is a netmask.
  3356. Multiple sub-networks MAY be requested. The responder MAY
  3357. respond with zero or more sub-network attributes.
  3358. o SUPPORTED_ATTRIBUTES - When used within a Request, this
  3359. attribute MUST be zero-length and specifies a query to the
  3360. responder to reply back with all of the attributes that it
  3361. supports. The response contains an attribute that contains a
  3362. set of attribute identifiers each in 2 octets. The length
  3363. divided by 2 (octets) would state the number of supported
  3364. attributes contained in the response.
  3365. Kaufman Standards Track [Page 83]
  3366. RFC 4306 IKEv2 December 2005
  3367. o INTERNAL_IP6_SUBNET - The protected sub-networks that this
  3368. edge-device protects. This attribute is made up of two fields:
  3369. the first is a sixteen-octet IPv6 address and the second is a
  3370. one-octet prefix-length as defined in [ADDRIPV6]. Multiple
  3371. sub-networks MAY be requested. The responder MAY respond with
  3372. zero or more sub-network attributes.
  3373. Note that no recommendations are made in this document as to how
  3374. an implementation actually figures out what information to send in
  3375. a reply. That is, we do not recommend any specific method of an
  3376. IRAS determining which DNS server should be returned to a
  3377. requesting IRAC.
  3378. 3.16. Extensible Authentication Protocol (EAP) Payload
  3379. The Extensible Authentication Protocol Payload, denoted EAP in this
  3380. memo, allows IKE_SAs to be authenticated using the protocol defined
  3381. in RFC 3748 [EAP] and subsequent extensions to that protocol. The
  3382. full set of acceptable values for the payload is defined elsewhere,
  3383. but a short summary of RFC 3748 is included here to make this
  3384. document stand alone in the common cases.
  3385. 1 2 3
  3386. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3387. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3388. ! Next Payload !C! RESERVED ! Payload Length !
  3389. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3390. ! !
  3391. ~ EAP Message ~
  3392. ! !
  3393. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3394. Figure 24: EAP Payload Format
  3395. The payload type for an EAP Payload is forty eight (48).
  3396. 1 2 3
  3397. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  3398. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3399. ! Code ! Identifier ! Length !
  3400. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3401. ! Type ! Type_Data...
  3402. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  3403. Figure 25: EAP Message Format
  3404. o Code (1 octet) indicates whether this message is a Request (1),
  3405. Response (2), Success (3), or Failure (4).
  3406. Kaufman Standards Track [Page 84]
  3407. RFC 4306 IKEv2 December 2005
  3408. o Identifier (1 octet) is used in PPP to distinguish replayed
  3409. messages from repeated ones. Since in IKE, EAP runs over a
  3410. reliable protocol, it serves no function here. In a response
  3411. message, this octet MUST be set to match the identifier in the
  3412. corresponding request. In other messages, this field MAY be set
  3413. to any value.
  3414. o Length (2 octets) is the length of the EAP message and MUST be
  3415. four less than the Payload Length of the encapsulating payload.
  3416. o Type (1 octet) is present only if the Code field is Request (1) or
  3417. Response (2). For other codes, the EAP message length MUST be
  3418. four octets and the Type and Type_Data fields MUST NOT be present.
  3419. In a Request (1) message, Type indicates the data being requested.
  3420. In a Response (2) message, Type MUST either be Nak or match the
  3421. type of the data requested. The following types are defined in
  3422. RFC 3748:
  3423. 1 Identity
  3424. 2 Notification
  3425. 3 Nak (Response Only)
  3426. 4 MD5-Challenge
  3427. 5 One-Time Password (OTP)
  3428. 6 Generic Token Card
  3429. o Type_Data (Variable Length) varies with the Type of Request and
  3430. the associated Response. For the documentation of the EAP
  3431. methods, see [EAP].
  3432. Note that since IKE passes an indication of initiator identity in
  3433. message 3 of the protocol, the responder SHOULD NOT send EAP Identity
  3434. requests. The initiator SHOULD, however, respond to such requests if
  3435. it receives them.
  3436. 4. Conformance Requirements
  3437. In order to assure that all implementations of IKEv2 can
  3438. interoperate, there are "MUST support" requirements in addition to
  3439. those listed elsewhere. Of course, IKEv2 is a security protocol, and
  3440. one of its major functions is to allow only authorized parties to
  3441. successfully complete establishment of SAs. So a particular
  3442. implementation may be configured with any of a number of restrictions
  3443. concerning algorithms and trusted authorities that will prevent
  3444. universal interoperability.
  3445. Kaufman Standards Track [Page 85]
  3446. RFC 4306 IKEv2 December 2005
  3447. IKEv2 is designed to permit minimal implementations that can
  3448. interoperate with all compliant implementations. There are a series
  3449. of optional features that can easily be ignored by a particular
  3450. implementation if it does not support that feature. Those features
  3451. include:
  3452. Ability to negotiate SAs through a NAT and tunnel the resulting
  3453. ESP SA over UDP.
  3454. Ability to request (and respond to a request for) a temporary IP
  3455. address on the remote end of a tunnel.
  3456. Ability to support various types of legacy authentication.
  3457. Ability to support window sizes greater than one.
  3458. Ability to establish multiple ESP and/or AH SAs within a single
  3459. IKE_SA.
  3460. Ability to rekey SAs.
  3461. To assure interoperability, all implementations MUST be capable of
  3462. parsing all payload types (if only to skip over them) and to ignore
  3463. payload types that it does not support unless the critical bit is set
  3464. in the payload header. If the critical bit is set in an unsupported
  3465. payload header, all implementations MUST reject the messages
  3466. containing those payloads.
  3467. Every implementation MUST be capable of doing four-message
  3468. IKE_SA_INIT and IKE_AUTH exchanges establishing two SAs (one for IKE,
  3469. one for ESP and/or AH). Implementations MAY be initiate-only or
  3470. respond-only if appropriate for their platform. Every implementation
  3471. MUST be capable of responding to an INFORMATIONAL exchange, but a
  3472. minimal implementation MAY respond to any INFORMATIONAL message with
  3473. an empty INFORMATIONAL reply (note that within the context of an
  3474. IKE_SA, an "empty" message consists of an IKE header followed by an
  3475. Encrypted payload with no payloads contained in it). A minimal
  3476. implementation MAY support the CREATE_CHILD_SA exchange only in so
  3477. far as to recognize requests and reject them with a Notify payload of
  3478. type NO_ADDITIONAL_SAS. A minimal implementation need not be able to
  3479. initiate CREATE_CHILD_SA or INFORMATIONAL exchanges. When an SA
  3480. expires (based on locally configured values of either lifetime or
  3481. octets passed), and implementation MAY either try to renew it with a
  3482. CREATE_CHILD_SA exchange or it MAY delete (close) the old SA and
  3483. create a new one. If the responder rejects the CREATE_CHILD_SA
  3484. request with a NO_ADDITIONAL_SAS notification, the implementation
  3485. MUST be capable of instead closing the old SA and creating a new one.
  3486. Kaufman Standards Track [Page 86]
  3487. RFC 4306 IKEv2 December 2005
  3488. Implementations are not required to support requesting temporary IP
  3489. addresses or responding to such requests. If an implementation does
  3490. support issuing such requests, it MUST include a CP payload in
  3491. message 3 containing at least a field of type INTERNAL_IP4_ADDRESS or
  3492. INTERNAL_IP6_ADDRESS. All other fields are optional. If an
  3493. implementation supports responding to such requests, it MUST parse
  3494. the CP payload of type CFG_REQUEST in message 3 and recognize a field
  3495. of type INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. If it supports
  3496. leasing an address of the appropriate type, it MUST return a CP
  3497. payload of type CFG_REPLY containing an address of the requested
  3498. type. The responder SHOULD include all of the other related
  3499. attributes if it has them.
  3500. A minimal IPv4 responder implementation will ignore the contents of
  3501. the CP payload except to determine that it includes an
  3502. INTERNAL_IP4_ADDRESS attribute and will respond with the address and
  3503. other related attributes regardless of whether the initiator
  3504. requested them.
  3505. A minimal IPv4 initiator will generate a CP payload containing only
  3506. an INTERNAL_IP4_ADDRESS attribute and will parse the response
  3507. ignoring attributes it does not know how to use. The only attribute
  3508. it MUST be able to process is INTERNAL_ADDRESS_EXPIRY, which it must
  3509. use to bound the lifetime of the SA unless it successfully renews the
  3510. lease before it expires. Minimal initiators need not be able to
  3511. request lease renewals and minimal responders need not respond to
  3512. them.
  3513. For an implementation to be called conforming to this specification,
  3514. it MUST be possible to configure it to accept the following:
  3515. PKIX Certificates containing and signed by RSA keys of size 1024 or
  3516. 2048 bits, where the ID passed is any of ID_KEY_ID, ID_FQDN,
  3517. ID_RFC822_ADDR, or ID_DER_ASN1_DN.
  3518. Shared key authentication where the ID passes is any of ID_KEY_ID,
  3519. ID_FQDN, or ID_RFC822_ADDR.
  3520. Authentication where the responder is authenticated using PKIX
  3521. Certificates and the initiator is authenticated using shared key
  3522. authentication.
  3523. Kaufman Standards Track [Page 87]
  3524. RFC 4306 IKEv2 December 2005
  3525. 5. Security Considerations
  3526. While this protocol is designed to minimize disclosure of
  3527. configuration information to unauthenticated peers, some such
  3528. disclosure is unavoidable. One peer or the other must identify
  3529. itself first and prove its identity first. To avoid probing, the
  3530. initiator of an exchange is required to identify itself first, and
  3531. usually is required to authenticate itself first. The initiator can,
  3532. however, learn that the responder supports IKE and what cryptographic
  3533. protocols it supports. The responder (or someone impersonating the
  3534. responder) can probe the initiator not only for its identity, but
  3535. using CERTREQ payloads may be able to determine what certificates the
  3536. initiator is willing to use.
  3537. Use of EAP authentication changes the probing possibilities somewhat.
  3538. When EAP authentication is used, the responder proves its identity
  3539. before the initiator does, so an initiator that knew the name of a
  3540. valid initiator could probe the responder for both its name and
  3541. certificates.
  3542. Repeated rekeying using CREATE_CHILD_SA without additional Diffie-
  3543. Hellman exchanges leaves all SAs vulnerable to cryptanalysis of a
  3544. single key or overrun of either endpoint. Implementers should take
  3545. note of this fact and set a limit on CREATE_CHILD_SA exchanges
  3546. between exponentiations. This memo does not prescribe such a limit.
  3547. The strength of a key derived from a Diffie-Hellman exchange using
  3548. any of the groups defined here depends on the inherent strength of
  3549. the group, the size of the exponent used, and the entropy provided by
  3550. the random number generator used. Due to these inputs, it is
  3551. difficult to determine the strength of a key for any of the defined
  3552. groups. Diffie-Hellman group number two, when used with a strong
  3553. random number generator and an exponent no less than 200 bits, is
  3554. common for use with 3DES. Group five provides greater security than
  3555. group two. Group one is for historic purposes only and does not
  3556. provide sufficient strength except for use with DES, which is also
  3557. for historic use only. Implementations should make note of these
  3558. estimates when establishing policy and negotiating security
  3559. parameters.
  3560. Note that these limitations are on the Diffie-Hellman groups
  3561. themselves. There is nothing in IKE that prohibits using stronger
  3562. groups nor is there anything that will dilute the strength obtained
  3563. from stronger groups (limited by the strength of the other algorithms
  3564. negotiated including the prf function). In fact, the extensible
  3565. framework of IKE encourages the definition of more groups; use of
  3566. elliptical curve groups may greatly increase strength using much
  3567. smaller numbers.
  3568. Kaufman Standards Track [Page 88]
  3569. RFC 4306 IKEv2 December 2005
  3570. It is assumed that all Diffie-Hellman exponents are erased from
  3571. memory after use. In particular, these exponents MUST NOT be derived
  3572. from long-lived secrets like the seed to a pseudo-random generator
  3573. that is not erased after use.
  3574. The strength of all keys is limited by the size of the output of the
  3575. negotiated prf function. For this reason, a prf function whose
  3576. output is less than 128 bits (e.g., 3DES-CBC) MUST NOT be used with
  3577. this protocol.
  3578. The security of this protocol is critically dependent on the
  3579. randomness of the randomly chosen parameters. These should be
  3580. generated by a strong random or properly seeded pseudo-random source
  3581. (see [RFC4086]). Implementers should take care to ensure that use of
  3582. random numbers for both keys and nonces is engineered in a fashion
  3583. that does not undermine the security of the keys.
  3584. For information on the rationale of many of the cryptographic design
  3585. choices in this protocol, see [SIGMA] and [SKEME]. Though the
  3586. security of negotiated CHILD_SAs does not depend on the strength of
  3587. the encryption and integrity protection negotiated in the IKE_SA,
  3588. implementations MUST NOT negotiate NONE as the IKE integrity
  3589. protection algorithm or ENCR_NULL as the IKE encryption algorithm.
  3590. When using pre-shared keys, a critical consideration is how to assure
  3591. the randomness of these secrets. The strongest practice is to ensure
  3592. that any pre-shared key contain as much randomness as the strongest
  3593. key being negotiated. Deriving a shared secret from a password,
  3594. name, or other low-entropy source is not secure. These sources are
  3595. subject to dictionary and social engineering attacks, among others.
  3596. The NAT_DETECTION_*_IP notifications contain a hash of the addresses
  3597. and ports in an attempt to hide internal IP addresses behind a NAT.
  3598. Since the IPv4 address space is only 32 bits, and it is usually very
  3599. sparse, it would be possible for an attacker to find out the internal
  3600. address used behind the NAT box by trying all possible IP addresses
  3601. and trying to find the matching hash. The port numbers are normally
  3602. fixed to 500, and the SPIs can be extracted from the packet. This
  3603. reduces the number of hash calculations to 2^32. With an educated
  3604. guess of the use of private address space, the number of hash
  3605. calculations is much smaller. Designers should therefore not assume
  3606. that use of IKE will not leak internal address information.
  3607. When using an EAP authentication method that does not generate a
  3608. shared key for protecting a subsequent AUTH payload, certain man-in-
  3609. the-middle and server impersonation attacks are possible [EAPMITM].
  3610. These vulnerabilities occur when EAP is also used in protocols that
  3611. are not protected with a secure tunnel. Since EAP is a general-
  3612. Kaufman Standards Track [Page 89]
  3613. RFC 4306 IKEv2 December 2005
  3614. purpose authentication protocol, which is often used to provide
  3615. single-signon facilities, a deployed IPsec solution that relies on an
  3616. EAP authentication method that does not generate a shared key (also
  3617. known as a non-key-generating EAP method) can become compromised due
  3618. to the deployment of an entirely unrelated application that also
  3619. happens to use the same non-key-generating EAP method, but in an
  3620. unprotected fashion. Note that this vulnerability is not limited to
  3621. just EAP, but can occur in other scenarios where an authentication
  3622. infrastructure is reused. For example, if the EAP mechanism used by
  3623. IKEv2 utilizes a token authenticator, a man-in-the-middle attacker
  3624. could impersonate the web server, intercept the token authentication
  3625. exchange, and use it to initiate an IKEv2 connection. For this
  3626. reason, use of non-key-generating EAP methods SHOULD be avoided where
  3627. possible. Where they are used, it is extremely important that all
  3628. usages of these EAP methods SHOULD utilize a protected tunnel, where
  3629. the initiator validates the responder's certificate before initiating
  3630. the EAP exchange. Implementers SHOULD describe the vulnerabilities
  3631. of using non-key-generating EAP methods in the documentation of their
  3632. implementations so that the administrators deploying IPsec solutions
  3633. are aware of these dangers.
  3634. An implementation using EAP MUST also use a public-key-based
  3635. authentication of the server to the client before the EAP exchange
  3636. begins, even if the EAP method offers mutual authentication. This
  3637. avoids having additional IKEv2 protocol variations and protects the
  3638. EAP data from active attackers.
  3639. If the messages of IKEv2 are long enough that IP-level fragmentation
  3640. is necessary, it is possible that attackers could prevent the
  3641. exchange from completing by exhausting the reassembly buffers. The
  3642. chances of this can be minimized by using the Hash and URL encodings
  3643. instead of sending certificates (see section 3.6). Additional
  3644. mitigations are discussed in [KPS03].
  3645. 6. IANA Considerations
  3646. This document defines a number of new field types and values where
  3647. future assignments will be managed by the IANA.
  3648. The following registries have been created by the IANA:
  3649. IKEv2 Exchange Types (section 3.1)
  3650. IKEv2 Payload Types (section 3.2)
  3651. IKEv2 Transform Types (section 3.3.2)
  3652. IKEv2 Transform Attribute Types (section 3.3.2)
  3653. IKEv2 Encryption Transform IDs (section 3.3.2)
  3654. IKEv2 Pseudo-random Function Transform IDs (section 3.3.2)
  3655. IKEv2 Integrity Algorithm Transform IDs (section 3.3.2)
  3656. Kaufman Standards Track [Page 90]
  3657. RFC 4306 IKEv2 December 2005
  3658. IKEv2 Diffie-Hellman Transform IDs (section 3.3.2)
  3659. IKEv2 Identification Payload ID Types (section 3.5)
  3660. IKEv2 Certificate Encodings (section 3.6)
  3661. IKEv2 Authentication Method (section 3.8)
  3662. IKEv2 Notify Message Types (section 3.10.1)
  3663. IKEv2 Notification IPCOMP Transform IDs (section 3.10.1)
  3664. IKEv2 Security Protocol Identifiers (section 3.3.1)
  3665. IKEv2 Traffic Selector Types (section 3.13.1)
  3666. IKEv2 Configuration Payload CFG Types (section 3.15)
  3667. IKEv2 Configuration Payload Attribute Types (section 3.15.1)
  3668. Note: When creating a new Transform Type, a new registry for it must
  3669. be created.
  3670. Changes and additions to any of those registries are by expert
  3671. review.
  3672. 7. Acknowledgements
  3673. This document is a collaborative effort of the entire IPsec WG. If
  3674. there were no limit to the number of authors that could appear on an
  3675. RFC, the following, in alphabetical order, would have been listed:
  3676. Bill Aiello, Stephane Beaulieu, Steve Bellovin, Sara Bitan, Matt
  3677. Blaze, Ran Canetti, Darren Dukes, Dan Harkins, Paul Hoffman, John
  3678. Ioannidis, Charlie Kaufman, Steve Kent, Angelos Keromytis, Tero
  3679. Kivinen, Hugo Krawczyk, Andrew Krywaniuk, Radia Perlman, Omer
  3680. Reingold, and Michael Richardson. Many other people contributed to
  3681. the design. It is an evolution of IKEv1, ISAKMP, and the IPsec DOI,
  3682. each of which has its own list of authors. Hugh Daniel suggested the
  3683. feature of having the initiator, in message 3, specify a name for the
  3684. responder, and gave the feature the cute name "You Tarzan, Me Jane".
  3685. David Faucher and Valery Smyzlov helped refine the design of the
  3686. traffic selector negotiation.
  3687. 8. References
  3688. 8.1. Normative References
  3689. [ADDGROUP] Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
  3690. Diffie-Hellman groups for Internet Key Exchange (IKE)",
  3691. RFC 3526, May 2003.
  3692. [ADDRIPV6] Hinden, R. and S. Deering, "Internet Protocol Version 6
  3693. (IPv6) Addressing Architecture", RFC 3513, April 2003.
  3694. [Bra97] Bradner, S., "Key Words for use in RFCs to indicate
  3695. Requirement Levels", BCP 14, RFC 2119, March 1997.
  3696. Kaufman Standards Track [Page 91]
  3697. RFC 4306 IKEv2 December 2005
  3698. [EAP] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H.
  3699. Levkowetz, "Extensible Authentication Protocol (EAP)", RFC
  3700. 3748, June 2004.
  3701. [ESPCBC] Pereira, R. and R. Adams, "The ESP CBC-Mode Cipher
  3702. Algorithms", RFC 2451, November 1998.
  3703. [Hutt05] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M.
  3704. Stenberg, "UDP Encapsulation of IPsec ESP Packets", RFC
  3705. 3948, January 2005.
  3706. [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
  3707. IANA Considerations Section in RFCs", BCP 26, RFC 2434,
  3708. October 1998.
  3709. [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition
  3710. of Explicit Congestion Notification (ECN) to IP", RFC
  3711. 3168, September 2001.
  3712. [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet
  3713. X.509 Public Key Infrastructure Certificate and
  3714. Certificate Revocation List (CRL) Profile", RFC 3280,
  3715. April 2002.
  3716. [RFC4301] Kent, S. and K. Seo, "Security Architecture for the
  3717. Internet Protocol", RFC 4301, December 2005.
  3718. 8.2. Informative References
  3719. [DES] ANSI X3.106, "American National Standard for Information
  3720. Systems-Data Link Encryption", American National Standards
  3721. Institute, 1983.
  3722. [DH] Diffie, W., and Hellman M., "New Directions in
  3723. Cryptography", IEEE Transactions on Information Theory, V.
  3724. IT-22, n. 6, June 1977.
  3725. [DHCP] Droms, R., "Dynamic Host Configuration Protocol", RFC
  3726. 2131, March 1997.
  3727. [DSS] NIST, "Digital Signature Standard", FIPS 186, National
  3728. Institute of Standards and Technology, U.S. Department of
  3729. Commerce, May, 1994.
  3730. [EAPMITM] Asokan, N., Nierni, V., and Nyberg, K., "Man-in-the-Middle
  3731. in Tunneled Authentication Protocols",
  3732. http://eprint.iacr.org/2002/163, November 2002.
  3733. Kaufman Standards Track [Page 92]
  3734. RFC 4306 IKEv2 December 2005
  3735. [HC98] Harkins, D. and D. Carrel, "The Internet Key Exchange
  3736. (IKE)", RFC 2409, November 1998.
  3737. [IDEA] Lai, X., "On the Design and Security of Block Ciphers,"
  3738. ETH Series in Information Processing, v. 1, Konstanz:
  3739. Hartung-Gorre Verlag, 1992.
  3740. [IPCOMP] Shacham, A., Monsour, B., Pereira, R., and M. Thomas, "IP
  3741. Payload Compression Protocol (IPComp)", RFC 3173,
  3742. September 2001.
  3743. [KPS03] Kaufman, C., Perlman, R., and Sommerfeld, B., "DoS
  3744. protection for UDP-based protocols", ACM Conference on
  3745. Computer and Communications Security, October 2003.
  3746. [KBC96] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
  3747. Hashing for Message Authentication", RFC 2104, February
  3748. 1997.
  3749. [LDAP] Wahl, M., Howes, T., and S Kille, "Lightweight Directory
  3750. Access Protocol (v3)", RFC 2251, December 1997.
  3751. [MD5] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
  3752. April 1992.
  3753. [MSST98] Maughan, D., Schertler, M., Schneider, M., and J. Turner,
  3754. "Internet Security Association and Key Management Protocol
  3755. (ISAKMP)", RFC 2408, November 1998.
  3756. [Orm96] Orman, H., "The OAKLEY Key Determination Protocol", RFC
  3757. 2412, November 1998.
  3758. [PFKEY] McDonald, D., Metz, C., and B. Phan, "PF_KEY Key
  3759. Management API, Version 2", RFC 2367, July 1998.
  3760. [PKCS1] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
  3761. Standards (PKCS) #1: RSA Cryptography Specifications
  3762. Version 2.1", RFC 3447, February 2003.
  3763. [PK01] Perlman, R., and Kaufman, C., "Analysis of the IPsec key
  3764. exchange Standard", WET-ICE Security Conference, MIT,2001,
  3765. http://sec.femto.org/wetice-2001/papers/radia-paper.pdf.
  3766. [Pip98] Piper, D., "The Internet IP Security Domain Of
  3767. Interpretation for ISAKMP", RFC 2407, November 1998.
  3768. Kaufman Standards Track [Page 93]
  3769. RFC 4306 IKEv2 December 2005
  3770. [RADIUS] Rigney, C., Willens, S., Rubens, A., and W. Simpson,
  3771. "Remote Authentication Dial In User Service (RADIUS)", RFC
  3772. 2865, June 2000.
  3773. [RFC4086] Eastlake, D., 3rd, Schiller, J., and S. Crocker,
  3774. "Randomness Requirements for Security", BCP 106, RFC 4086,
  3775. June 2005.
  3776. [RFC1958] Carpenter, B., "Architectural Principles of the Internet",
  3777. RFC 1958, June 1996.
  3778. [RFC2401] Kent, S. and R. Atkinson, "Security Architecture for the
  3779. Internet Protocol", RFC 2401, November 1998.
  3780. [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black,
  3781. "Definition of the Differentiated Services Field (DS
  3782. Field) in the IPv4 and IPv6 Headers", RFC 2474, December
  3783. 1998.
  3784. [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z.,
  3785. and W. Weiss, "An Architecture for Differentiated
  3786. Service", RFC 2475, December 1998.
  3787. [RFC2522] Karn, P. and W. Simpson, "Photuris: Session-Key Management
  3788. Protocol", RFC 2522, March 1999.
  3789. [RFC2775] Carpenter, B., "Internet Transparency", RFC 2775, February
  3790. 2000.
  3791. [RFC2983] Black, D., "Differentiated Services and Tunnels", RFC
  3792. 2983, October 2000.
  3793. [RFC3439] Bush, R. and D. Meyer, "Some Internet Architectural
  3794. Guidelines and Philosophy", RFC 3439, December 2002.
  3795. [RFC3715] Aboba, B. and W. Dixon, "IPsec-Network Address Translation
  3796. (NAT) Compatibility Requirements", RFC 3715, March 2004.
  3797. [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, December
  3798. 2005.
  3799. [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC
  3800. 4303, December 2005.
  3801. [RSA] Rivest, R., Shamir, A., and Adleman, L., "A Method for
  3802. Obtaining Digital Signatures and Public-Key
  3803. Cryptosystems", Communications of the ACM, v. 21, n. 2,
  3804. February 1978.
  3805. Kaufman Standards Track [Page 94]
  3806. RFC 4306 IKEv2 December 2005
  3807. [SHA] NIST, "Secure Hash Standard", FIPS 180-1, National
  3808. Institute of Standards and Technology, U.S. Department of
  3809. Commerce, May 1994.
  3810. [SIGMA] Krawczyk, H., "SIGMA: the `SIGn-and-MAc' Approach to
  3811. Authenticated Diffie-Hellman and its Use in the IKE
  3812. Protocols", in Advances in Cryptography - CRYPTO 2003
  3813. Proceedings, LNCS 2729, Springer, 2003. Available at:
  3814. http://www.informatik.uni-trier.de/~ley/db/conf/
  3815. crypto/crypto2003.html.
  3816. [SKEME] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange
  3817. Mechanism for Internet", from IEEE Proceedings of the 1996
  3818. Symposium on Network and Distributed Systems Security.
  3819. [X.501] ITU-T Recommendation X.501: Information Technology - Open
  3820. Systems Interconnection - The Directory: Models, 1993.
  3821. [X.509] ITU-T Recommendation X.509 (1997 E): Information
  3822. Technology - Open Systems Interconnection - The Directory:
  3823. Authentication Framework, June 1997.
  3824. Kaufman Standards Track [Page 95]
  3825. RFC 4306 IKEv2 December 2005
  3826. Appendix A: Summary of changes from IKEv1
  3827. The goals of this revision to IKE are:
  3828. 1) To define the entire IKE protocol in a single document, replacing
  3829. RFCs 2407, 2408, and 2409 and incorporating subsequent changes to
  3830. support NAT Traversal, Extensible Authentication, and Remote Address
  3831. acquisition;
  3832. 2) To simplify IKE by replacing the eight different initial exchanges
  3833. with a single four-message exchange (with changes in authentication
  3834. mechanisms affecting only a single AUTH payload rather than
  3835. restructuring the entire exchange) see [PK01];
  3836. 3) To remove the Domain of Interpretation (DOI), Situation (SIT), and
  3837. Labeled Domain Identifier fields, and the Commit and Authentication
  3838. only bits;
  3839. 4) To decrease IKE's latency in the common case by making the initial
  3840. exchange be 2 round trips (4 messages), and allowing the ability to
  3841. piggyback setup of a CHILD_SA on that exchange;
  3842. 5) To replace the cryptographic syntax for protecting the IKE
  3843. messages themselves with one based closely on ESP to simplify
  3844. implementation and security analysis;
  3845. 6) To reduce the number of possible error states by making the
  3846. protocol reliable (all messages are acknowledged) and sequenced.
  3847. This allows shortening CREATE_CHILD_SA exchanges from 3 messages to
  3848. 2;
  3849. 7) To increase robustness by allowing the responder to not do
  3850. significant processing until it receives a message proving that the
  3851. initiator can receive messages at its claimed IP address, and not
  3852. commit any state to an exchange until the initiator can be
  3853. cryptographically authenticated;
  3854. 8) To fix cryptographic weaknesses such as the problem with
  3855. symmetries in hashes used for authentication documented by Tero
  3856. Kivinen;
  3857. 9) To specify Traffic Selectors in their own payloads type rather
  3858. than overloading ID payloads, and making more flexible the Traffic
  3859. Selectors that may be specified;
  3860. 10) To specify required behavior under certain error conditions or
  3861. when data that is not understood is received, to make it easier to
  3862. make future revisions that do not break backward compatibility;
  3863. Kaufman Standards Track [Page 96]
  3864. RFC 4306 IKEv2 December 2005
  3865. 11) To simplify and clarify how shared state is maintained in the
  3866. presence of network failures and Denial of Service attacks; and
  3867. 12) To maintain existing syntax and magic numbers to the extent
  3868. possible to make it likely that implementations of IKEv1 can be
  3869. enhanced to support IKEv2 with minimum effort.
  3870. Appendix B: Diffie-Hellman Groups
  3871. There are two Diffie-Hellman groups defined here for use in IKE.
  3872. These groups were generated by Richard Schroeppel at the University
  3873. of Arizona. Properties of these primes are described in [Orm96].
  3874. The strength supplied by group one may not be sufficient for the
  3875. mandatory-to-implement encryption algorithm and is here for historic
  3876. reasons.
  3877. Additional Diffie-Hellman groups have been defined in [ADDGROUP].
  3878. B.1. Group 1 - 768 Bit MODP
  3879. This group is assigned id 1 (one).
  3880. The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } Its
  3881. hexadecimal value is:
  3882. FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08
  3883. 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B
  3884. 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9
  3885. A63A3620 FFFFFFFF FFFFFFFF
  3886. The generator is 2.
  3887. B.2. Group 2 - 1024 Bit MODP
  3888. This group is assigned id 2 (two).
  3889. The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
  3890. Its hexadecimal value is:
  3891. FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08
  3892. 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B
  3893. 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9
  3894. A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6
  3895. 49286651 ECE65381 FFFFFFFF FFFFFFFF
  3896. The generator is 2.
  3897. Kaufman Standards Track [Page 97]
  3898. RFC 4306 IKEv2 December 2005
  3899. Editor's Address
  3900. Charlie Kaufman
  3901. Microsoft Corporation
  3902. 1 Microsoft Way
  3903. Redmond, WA 98052
  3904. Phone: 1-425-707-3335
  3905. EMail: charliek@microsoft.com
  3906. Kaufman Standards Track [Page 98]
  3907. RFC 4306 IKEv2 December 2005
  3908. Full Copyright Statement
  3909. Copyright (C) The Internet Society (2005).
  3910. This document is subject to the rights, licenses and restrictions
  3911. contained in BCP 78, and except as set forth therein, the authors
  3912. retain all their rights.
  3913. This document and the information contained herein are provided on an
  3914. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  3915. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  3916. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  3917. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  3918. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  3919. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  3920. Intellectual Property
  3921. The IETF takes no position regarding the validity or scope of any
  3922. Intellectual Property Rights or other rights that might be claimed to
  3923. pertain to the implementation or use of the technology described in
  3924. this document or the extent to which any license under such rights
  3925. might or might not be available; nor does it represent that it has
  3926. made any independent effort to identify any such rights. Information
  3927. on the procedures with respect to rights in RFC documents can be
  3928. found in BCP 78 and BCP 79.
  3929. Copies of IPR disclosures made to the IETF Secretariat and any
  3930. assurances of licenses to be made available, or the result of an
  3931. attempt made to obtain a general license or permission for the use of
  3932. such proprietary rights by implementers or users of this
  3933. specification can be obtained from the IETF on-line IPR repository at
  3934. http://www.ietf.org/ipr.
  3935. The IETF invites any interested party to bring to its attention any
  3936. copyrights, patents or patent applications, or other proprietary
  3937. rights that may cover technology that may be required to implement
  3938. this standard. Please address the information to the IETF at ietf-
  3939. ipr@ietf.org.
  3940. Acknowledgement
  3941. Funding for the RFC Editor function is currently provided by the
  3942. Internet Society.
  3943. Kaufman Standards Track [Page 99]