rfc5996.txt 338 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731
  1. Internet Engineering Task Force (IETF) C. Kaufman
  2. Request for Comments: 5996 Microsoft
  3. Obsoletes: 4306, 4718 P. Hoffman
  4. Category: Standards Track VPN Consortium
  5. ISSN: 2070-1721 Y. Nir
  6. Check Point
  7. P. Eronen
  8. Independent
  9. September 2010
  10. Internet Key Exchange Protocol Version 2 (IKEv2)
  11. Abstract
  12. This document describes version 2 of the Internet Key Exchange (IKE)
  13. protocol. IKE is a component of IPsec used for performing mutual
  14. authentication and establishing and maintaining Security Associations
  15. (SAs). This document replaces and updates RFC 4306, and includes all
  16. of the clarifications from RFC 4718.
  17. Status of This Memo
  18. This is an Internet Standards Track document.
  19. This document is a product of the Internet Engineering Task Force
  20. (IETF). It represents the consensus of the IETF community. It has
  21. received public review and has been approved for publication by the
  22. Internet Engineering Steering Group (IESG). Further information on
  23. Internet Standards is available in Section 2 of RFC 5741.
  24. Information about the current status of this document, any errata,
  25. and how to provide feedback on it may be obtained at
  26. http://www.rfc-editor.org/info/rfc5996.
  27. Kaufman, et al. Standards Track [Page 1]
  28. RFC 5996 IKEv2bis September 2010
  29. Copyright Notice
  30. Copyright (c) 2010 IETF Trust and the persons identified as the
  31. document authors. All rights reserved.
  32. This document is subject to BCP 78 and the IETF Trust's Legal
  33. Provisions Relating to IETF Documents
  34. (http://trustee.ietf.org/license-info) in effect on the date of
  35. publication of this document. Please review these documents
  36. carefully, as they describe your rights and restrictions with respect
  37. to this document. Code Components extracted from this document must
  38. include Simplified BSD License text as described in Section 4.e of
  39. the Trust Legal Provisions and are provided without warranty as
  40. described in the Simplified BSD License.
  41. This document may contain material from IETF Documents or IETF
  42. Contributions published or made publicly available before November
  43. 10, 2008. The person(s) controlling the copyright in some of this
  44. material may not have granted the IETF Trust the right to allow
  45. modifications of such material outside the IETF Standards Process.
  46. Without obtaining an adequate license from the person(s) controlling
  47. the copyright in such materials, this document may not be modified
  48. outside the IETF Standards Process, and derivative works of it may
  49. not be created outside the IETF Standards Process, except to format
  50. it for publication as an RFC or to translate it into languages other
  51. than English.
  52. Table of Contents
  53. 1. Introduction ....................................................5
  54. 1.1. Usage Scenarios ............................................6
  55. 1.1.1. Security Gateway to Security Gateway in
  56. Tunnel Mode .........................................7
  57. 1.1.2. Endpoint-to-Endpoint Transport Mode .................7
  58. 1.1.3. Endpoint to Security Gateway in Tunnel Mode .........8
  59. 1.1.4. Other Scenarios .....................................9
  60. 1.2. The Initial Exchanges ......................................9
  61. 1.3. The CREATE_CHILD_SA Exchange ..............................13
  62. 1.3.1. Creating New Child SAs with the
  63. CREATE_CHILD_SA Exchange ...........................14
  64. 1.3.2. Rekeying IKE SAs with the CREATE_CHILD_SA
  65. Exchange ...........................................15
  66. 1.3.3. Rekeying Child SAs with the CREATE_CHILD_SA
  67. Exchange ...........................................16
  68. 1.4. The INFORMATIONAL Exchange ................................17
  69. 1.4.1. Deleting an SA with INFORMATIONAL Exchanges ........17
  70. 1.5. Informational Messages outside of an IKE SA ...............18
  71. 1.6. Requirements Terminology ..................................19
  72. Kaufman, et al. Standards Track [Page 2]
  73. RFC 5996 IKEv2bis September 2010
  74. 1.7. Significant Differences between RFC 4306 and This
  75. Document ..................................................20
  76. 2. IKE Protocol Details and Variations ............................22
  77. 2.1. Use of Retransmission Timers ..............................23
  78. 2.2. Use of Sequence Numbers for Message ID ....................24
  79. 2.3. Window Size for Overlapping Requests ......................25
  80. 2.4. State Synchronization and Connection Timeouts .............26
  81. 2.5. Version Numbers and Forward Compatibility .................28
  82. 2.6. IKE SA SPIs and Cookies ...................................30
  83. 2.6.1. Interaction of COOKIE and INVALID_KE_PAYLOAD .......33
  84. 2.7. Cryptographic Algorithm Negotiation .......................34
  85. 2.8. Rekeying ..................................................34
  86. 2.8.1. Simultaneous Child SA Rekeying .....................36
  87. 2.8.2. Simultaneous IKE SA Rekeying .......................39
  88. 2.8.3. Rekeying the IKE SA versus Reauthentication ........40
  89. 2.9. Traffic Selector Negotiation ..............................40
  90. 2.9.1. Traffic Selectors Violating Own Policy .............43
  91. 2.10. Nonces ...................................................44
  92. 2.11. Address and Port Agility .................................44
  93. 2.12. Reuse of Diffie-Hellman Exponentials .....................44
  94. 2.13. Generating Keying Material ...............................45
  95. 2.14. Generating Keying Material for the IKE SA ................46
  96. 2.15. Authentication of the IKE SA .............................47
  97. 2.16. Extensible Authentication Protocol Methods ...............50
  98. 2.17. Generating Keying Material for Child SAs .................52
  99. 2.18. Rekeying IKE SAs Using a CREATE_CHILD_SA Exchange ........53
  100. 2.19. Requesting an Internal Address on a Remote Network .......53
  101. 2.20. Requesting the Peer's Version ............................55
  102. 2.21. Error Handling ...........................................56
  103. 2.21.1. Error Handling in IKE_SA_INIT .....................56
  104. 2.21.2. Error Handling in IKE_AUTH ........................57
  105. 2.21.3. Error Handling after IKE SA is Authenticated ......58
  106. 2.21.4. Error Handling Outside IKE SA .....................58
  107. 2.22. IPComp ...................................................59
  108. 2.23. NAT Traversal ............................................60
  109. 2.23.1. Transport Mode NAT Traversal ......................64
  110. 2.24. Explicit Congestion Notification (ECN) ...................68
  111. 2.25. Exchange Collisions ......................................68
  112. 2.25.1. Collisions while Rekeying or Closing Child SAs ....69
  113. 2.25.2. Collisions while Rekeying or Closing IKE SAs ......69
  114. 3. Header and Payload Formats .....................................69
  115. 3.1. The IKE Header ............................................70
  116. 3.2. Generic Payload Header ....................................73
  117. 3.3. Security Association Payload ..............................75
  118. 3.3.1. Proposal Substructure ..............................78
  119. 3.3.2. Transform Substructure .............................79
  120. 3.3.3. Valid Transform Types by Protocol ..................82
  121. 3.3.4. Mandatory Transform IDs ............................83
  122. Kaufman, et al. Standards Track [Page 3]
  123. RFC 5996 IKEv2bis September 2010
  124. 3.3.5. Transform Attributes ...............................84
  125. 3.3.6. Attribute Negotiation ..............................86
  126. 3.4. Key Exchange Payload ......................................87
  127. 3.5. Identification Payloads ...................................87
  128. 3.6. Certificate Payload .......................................90
  129. 3.7. Certificate Request Payload ...............................93
  130. 3.8. Authentication Payload ....................................95
  131. 3.9. Nonce Payload .............................................96
  132. 3.10. Notify Payload ...........................................97
  133. 3.10.1. Notify Message Types ..............................98
  134. 3.11. Delete Payload ..........................................101
  135. 3.12. Vendor ID Payload .......................................102
  136. 3.13. Traffic Selector Payload ................................103
  137. 3.13.1. Traffic Selector .................................105
  138. 3.14. Encrypted Payload .......................................107
  139. 3.15. Configuration Payload ...................................109
  140. 3.15.1. Configuration Attributes .........................110
  141. 3.15.2. Meaning of INTERNAL_IP4_SUBNET and
  142. INTERNAL_IP6_SUBNET ..............................113
  143. 3.15.3. Configuration Payloads for IPv6 ..................115
  144. 3.15.4. Address Assignment Failures ......................116
  145. 3.16. Extensible Authentication Protocol (EAP) Payload ........117
  146. 4. Conformance Requirements ......................................118
  147. 5. Security Considerations .......................................120
  148. 5.1. Traffic Selector Authorization ...........................123
  149. 6. IANA Considerations ...........................................124
  150. 7. Acknowledgements ..............................................125
  151. 8. References ....................................................126
  152. 8.1. Normative References .....................................126
  153. 8.2. Informative References ...................................127
  154. Appendix A. Summary of Changes from IKEv1 ........................132
  155. Appendix B. Diffie-Hellman Groups ................................133
  156. B.1. Group 1 - 768-bit MODP ....................................133
  157. B.2. Group 2 - 1024-bit MODP ...................................133
  158. Appendix C. Exchanges and Payloads ..............................134
  159. C.1. IKE_SA_INIT Exchange .....................................134
  160. C.2. IKE_AUTH Exchange without EAP .............................135
  161. C.3. IKE_AUTH Exchange with EAP ...............................136
  162. C.4. CREATE_CHILD_SA Exchange for Creating or Rekeying
  163. Child SAs .................................................137
  164. C.5. CREATE_CHILD_SA Exchange for Rekeying the IKE SA ..........137
  165. C.6. INFORMATIONAL Exchange ....................................137
  166. Kaufman, et al. Standards Track [Page 4]
  167. RFC 5996 IKEv2bis September 2010
  168. 1. Introduction
  169. IP Security (IPsec) provides confidentiality, data integrity, access
  170. control, and data source authentication to IP datagrams. These
  171. services are provided by maintaining shared state between the source
  172. and the sink of an IP datagram. This state defines, among other
  173. things, the specific services provided to the datagram, which
  174. cryptographic algorithms will be used to provide the services, and
  175. the keys used as input to the cryptographic algorithms.
  176. Establishing this shared state in a manual fashion does not scale
  177. well. Therefore, a protocol to establish this state dynamically is
  178. needed. This document describes such a protocol -- the Internet Key
  179. Exchange (IKE). Version 1 of IKE was defined in RFCs 2407 [DOI],
  180. 2408 [ISAKMP], and 2409 [IKEV1]. IKEv2 replaced all of those RFCs.
  181. IKEv2 was defined in [IKEV2] (RFC 4306) and was clarified in [Clarif]
  182. (RFC 4718). This document replaces and updates RFC 4306 and RFC
  183. 4718. IKEv2 was a change to the IKE protocol that was not backward
  184. compatible. In contrast, the current document not only provides a
  185. clarification of IKEv2, but makes minimum changes to the IKE
  186. protocol. A list of the significant differences between RFC 4306 and
  187. this document is given in Section 1.7.
  188. IKE performs mutual authentication between two parties and
  189. establishes an IKE security association (SA) that includes shared
  190. secret information that can be used to efficiently establish SAs for
  191. Encapsulating Security Payload (ESP) [ESP] or Authentication Header
  192. (AH) [AH] and a set of cryptographic algorithms to be used by the SAs
  193. to protect the traffic that they carry. In this document, the term
  194. "suite" or "cryptographic suite" refers to a complete set of
  195. algorithms used to protect an SA. An initiator proposes one or more
  196. suites by listing supported algorithms that can be combined into
  197. suites in a mix-and-match fashion. IKE can also negotiate use of IP
  198. Compression (IPComp) [IP-COMP] in connection with an ESP or AH SA.
  199. The SAs for ESP or AH that get set up through that IKE SA we call
  200. "Child SAs".
  201. All IKE communications consist of pairs of messages: a request and a
  202. response. The pair is called an "exchange", and is sometimes called
  203. a "request/response pair". The first exchange of messages
  204. establishing an IKE SA are called the IKE_SA_INIT and IKE_AUTH
  205. exchanges; subsequent IKE exchanges are called the CREATE_CHILD_SA or
  206. INFORMATIONAL exchanges. In the common case, there is a single
  207. IKE_SA_INIT exchange and a single IKE_AUTH exchange (a total of four
  208. messages) to establish the IKE SA and the first Child SA. In
  209. exceptional cases, there may be more than one of each of these
  210. exchanges. In all cases, all IKE_SA_INIT exchanges MUST complete
  211. before any other exchange type, then all IKE_AUTH exchanges MUST
  212. Kaufman, et al. Standards Track [Page 5]
  213. RFC 5996 IKEv2bis September 2010
  214. complete, and following that, any number of CREATE_CHILD_SA and
  215. INFORMATIONAL exchanges may occur in any order. In some scenarios,
  216. only a single Child SA is needed between the IPsec endpoints, and
  217. therefore there would be no additional exchanges. Subsequent
  218. exchanges MAY be used to establish additional Child SAs between the
  219. same authenticated pair of endpoints and to perform housekeeping
  220. functions.
  221. An IKE message flow always consists of a request followed by a
  222. response. It is the responsibility of the requester to ensure
  223. reliability. If the response is not received within a timeout
  224. interval, the requester needs to retransmit the request (or abandon
  225. the connection).
  226. The first exchange of an IKE session, IKE_SA_INIT, negotiates
  227. security parameters for the IKE SA, sends nonces, and sends Diffie-
  228. Hellman values.
  229. The second exchange, IKE_AUTH, transmits identities, proves knowledge
  230. of the secrets corresponding to the two identities, and sets up an SA
  231. for the first (and often only) AH or ESP Child SA (unless there is
  232. failure setting up the AH or ESP Child SA, in which case the IKE SA
  233. is still established without the Child SA).
  234. The types of subsequent exchanges are CREATE_CHILD_SA (which creates
  235. a Child SA) and INFORMATIONAL (which deletes an SA, reports error
  236. conditions, or does other housekeeping). Every request requires a
  237. response. An INFORMATIONAL request with no payloads (other than the
  238. empty Encrypted payload required by the syntax) is commonly used as a
  239. check for liveness. These subsequent exchanges cannot be used until
  240. the initial exchanges have completed.
  241. In the description that follows, we assume that no errors occur.
  242. Modifications to the flow when errors occur are described in
  243. Section 2.21.
  244. 1.1. Usage Scenarios
  245. IKE is used to negotiate ESP or AH SAs in a number of different
  246. scenarios, each with its own special requirements.
  247. Kaufman, et al. Standards Track [Page 6]
  248. RFC 5996 IKEv2bis September 2010
  249. 1.1.1. Security Gateway to Security Gateway in Tunnel Mode
  250. +-+-+-+-+-+ +-+-+-+-+-+
  251. | | IPsec | |
  252. Protected |Tunnel | tunnel |Tunnel | Protected
  253. Subnet <-->|Endpoint |<---------->|Endpoint |<--> Subnet
  254. | | | |
  255. +-+-+-+-+-+ +-+-+-+-+-+
  256. Figure 1: Security Gateway to Security Gateway Tunnel
  257. In this scenario, neither endpoint of the IP connection implements
  258. IPsec, but network nodes between them protect traffic for part of the
  259. way. Protection is transparent to the endpoints, and depends on
  260. ordinary routing to send packets through the tunnel endpoints for
  261. processing. Each endpoint would announce the set of addresses
  262. "behind" it, and packets would be sent in tunnel mode where the inner
  263. IP header would contain the IP addresses of the actual endpoints.
  264. 1.1.2. Endpoint-to-Endpoint Transport Mode
  265. +-+-+-+-+-+ +-+-+-+-+-+
  266. | | IPsec transport | |
  267. |Protected| or tunnel mode SA |Protected|
  268. |Endpoint |<---------------------------------------->|Endpoint |
  269. | | | |
  270. +-+-+-+-+-+ +-+-+-+-+-+
  271. Figure 2: Endpoint to Endpoint
  272. In this scenario, both endpoints of the IP connection implement
  273. IPsec, as required of hosts in [IPSECARCH]. Transport mode will
  274. commonly be used with no inner IP header. A single pair of addresses
  275. will be negotiated for packets to be protected by this SA. These
  276. endpoints MAY implement application-layer access controls based on
  277. the IPsec authenticated identities of the participants. This
  278. scenario enables the end-to-end security that has been a guiding
  279. principle for the Internet since [ARCHPRINC], [TRANSPARENCY], and a
  280. method of limiting the inherent problems with complexity in networks
  281. noted by [ARCHGUIDEPHIL]. Although this scenario may not be fully
  282. applicable to the IPv4 Internet, it has been deployed successfully in
  283. specific scenarios within intranets using IKEv1. It should be more
  284. broadly enabled during the transition to IPv6 and with the adoption
  285. of IKEv2.
  286. Kaufman, et al. Standards Track [Page 7]
  287. RFC 5996 IKEv2bis September 2010
  288. It is possible in this scenario that one or both of the protected
  289. endpoints will be behind a network address translation (NAT) node, in
  290. which case the tunneled packets will have to be UDP encapsulated so
  291. that port numbers in the UDP headers can be used to identify
  292. individual endpoints "behind" the NAT (see Section 2.23).
  293. 1.1.3. Endpoint to Security Gateway in Tunnel Mode
  294. +-+-+-+-+-+ +-+-+-+-+-+
  295. | | IPsec | | Protected
  296. |Protected| tunnel |Tunnel | Subnet
  297. |Endpoint |<------------------------>|Endpoint |<--- and/or
  298. | | | | Internet
  299. +-+-+-+-+-+ +-+-+-+-+-+
  300. Figure 3: Endpoint to Security Gateway Tunnel
  301. In this scenario, a protected endpoint (typically a portable roaming
  302. computer) connects back to its corporate network through an IPsec-
  303. protected tunnel. It might use this tunnel only to access
  304. information on the corporate network, or it might tunnel all of its
  305. traffic back through the corporate network in order to take advantage
  306. of protection provided by a corporate firewall against Internet-based
  307. attacks. In either case, the protected endpoint will want an IP
  308. address associated with the security gateway so that packets returned
  309. to it will go to the security gateway and be tunneled back. This IP
  310. address may be static or may be dynamically allocated by the security
  311. gateway. In support of the latter case, IKEv2 includes a mechanism
  312. (namely, configuration payloads) for the initiator to request an IP
  313. address owned by the security gateway for use for the duration of its
  314. SA.
  315. In this scenario, packets will use tunnel mode. On each packet from
  316. the protected endpoint, the outer IP header will contain the source
  317. IP address associated with its current location (i.e., the address
  318. that will get traffic routed to the endpoint directly), while the
  319. inner IP header will contain the source IP address assigned by the
  320. security gateway (i.e., the address that will get traffic routed to
  321. the security gateway for forwarding to the endpoint). The outer
  322. destination address will always be that of the security gateway,
  323. while the inner destination address will be the ultimate destination
  324. for the packet.
  325. In this scenario, it is possible that the protected endpoint will be
  326. behind a NAT. In that case, the IP address as seen by the security
  327. gateway will not be the same as the IP address sent by the protected
  328. Kaufman, et al. Standards Track [Page 8]
  329. RFC 5996 IKEv2bis September 2010
  330. endpoint, and packets will have to be UDP encapsulated in order to be
  331. routed properly. Interaction with NATs is covered in detail in
  332. Section 2.23.
  333. 1.1.4. Other Scenarios
  334. Other scenarios are possible, as are nested combinations of the
  335. above. One notable example combines aspects of Sections 1.1.1 and
  336. 1.1.3. A subnet may make all external accesses through a remote
  337. security gateway using an IPsec tunnel, where the addresses on the
  338. subnet are routed to the security gateway by the rest of the
  339. Internet. An example would be someone's home network being virtually
  340. on the Internet with static IP addresses even though connectivity is
  341. provided by an ISP that assigns a single dynamically assigned IP
  342. address to the user's security gateway (where the static IP addresses
  343. and an IPsec relay are provided by a third party located elsewhere).
  344. 1.2. The Initial Exchanges
  345. Communication using IKE always begins with IKE_SA_INIT and IKE_AUTH
  346. exchanges (known in IKEv1 as Phase 1). These initial exchanges
  347. normally consist of four messages, though in some scenarios that
  348. number can grow. All communications using IKE consist of request/
  349. response pairs. We'll describe the base exchange first, followed by
  350. variations. The first pair of messages (IKE_SA_INIT) negotiate
  351. cryptographic algorithms, exchange nonces, and do a Diffie-Hellman
  352. exchange [DH].
  353. The second pair of messages (IKE_AUTH) authenticate the previous
  354. messages, exchange identities and certificates, and establish the
  355. first Child SA. Parts of these messages are encrypted and integrity
  356. protected with keys established through the IKE_SA_INIT exchange, so
  357. the identities are hidden from eavesdroppers and all fields in all
  358. the messages are authenticated. See Section 2.14 for information on
  359. how the encryption keys are generated. (A man-in-the-middle attacker
  360. who cannot complete the IKE_AUTH exchange can nonetheless see the
  361. identity of the initiator.)
  362. All messages following the initial exchange are cryptographically
  363. protected using the cryptographic algorithms and keys negotiated in
  364. the IKE_SA_INIT exchange. These subsequent messages use the syntax
  365. of the Encrypted payload described in Section 3.14, encrypted with
  366. keys that are derived as described in Section 2.14. All subsequent
  367. messages include an Encrypted payload, even if they are referred to
  368. in the text as "empty". For the CREATE_CHILD_SA, IKE_AUTH, or
  369. INFORMATIONAL exchanges, the message following the header is
  370. encrypted and the message including the header is integrity protected
  371. using the cryptographic algorithms negotiated for the IKE SA.
  372. Kaufman, et al. Standards Track [Page 9]
  373. RFC 5996 IKEv2bis September 2010
  374. Every IKE message contains a Message ID as part of its fixed header.
  375. This Message ID is used to match up requests and responses, and to
  376. identify retransmissions of messages.
  377. In the following descriptions, the payloads contained in the message
  378. are indicated by names as listed below.
  379. Notation Payload
  380. -----------------------------------------
  381. AUTH Authentication
  382. CERT Certificate
  383. CERTREQ Certificate Request
  384. CP Configuration
  385. D Delete
  386. EAP Extensible Authentication
  387. HDR IKE header (not a payload)
  388. IDi Identification - Initiator
  389. IDr Identification - Responder
  390. KE Key Exchange
  391. Ni, Nr Nonce
  392. N Notify
  393. SA Security Association
  394. SK Encrypted and Authenticated
  395. TSi Traffic Selector - Initiator
  396. TSr Traffic Selector - Responder
  397. V Vendor ID
  398. The details of the contents of each payload are described in section
  399. 3. Payloads that may optionally appear will be shown in brackets,
  400. such as [CERTREQ]; this indicates that a Certificate Request payload
  401. can optionally be included.
  402. The initial exchanges are as follows:
  403. Initiator Responder
  404. -------------------------------------------------------------------
  405. HDR, SAi1, KEi, Ni -->
  406. HDR contains the Security Parameter Indexes (SPIs), version numbers,
  407. and flags of various sorts. The SAi1 payload states the
  408. cryptographic algorithms the initiator supports for the IKE SA. The
  409. KE payload sends the initiator's Diffie-Hellman value. Ni is the
  410. initiator's nonce.
  411. <-- HDR, SAr1, KEr, Nr, [CERTREQ]
  412. Kaufman, et al. Standards Track [Page 10]
  413. RFC 5996 IKEv2bis September 2010
  414. The responder chooses a cryptographic suite from the initiator's
  415. offered choices and expresses that choice in the SAr1 payload,
  416. completes the Diffie-Hellman exchange with the KEr payload, and sends
  417. its nonce in the Nr payload.
  418. At this point in the negotiation, each party can generate SKEYSEED,
  419. from which all keys are derived for that IKE SA. The messages that
  420. follow are encrypted and integrity protected in their entirety, with
  421. the exception of the message headers. The keys used for the
  422. encryption and integrity protection are derived from SKEYSEED and are
  423. known as SK_e (encryption) and SK_a (authentication, a.k.a. integrity
  424. protection); see Sections 2.13 and 2.14 for details on the key
  425. derivation. A separate SK_e and SK_a is computed for each direction.
  426. In addition to the keys SK_e and SK_a derived from the Diffie-Hellman
  427. value for protection of the IKE SA, another quantity SK_d is derived
  428. and used for derivation of further keying material for Child SAs.
  429. The notation SK { ... } indicates that these payloads are encrypted
  430. and integrity protected using that direction's SK_e and SK_a.
  431. HDR, SK {IDi, [CERT,] [CERTREQ,]
  432. [IDr,] AUTH, SAi2,
  433. TSi, TSr} -->
  434. The initiator asserts its identity with the IDi payload, proves
  435. knowledge of the secret corresponding to IDi and integrity protects
  436. the contents of the first message using the AUTH payload (see
  437. Section 2.15). It might also send its certificate(s) in CERT
  438. payload(s) and a list of its trust anchors in CERTREQ payload(s). If
  439. any CERT payloads are included, the first certificate provided MUST
  440. contain the public key used to verify the AUTH field.
  441. The optional payload IDr enables the initiator to specify to which of
  442. the responder's identities it wants to talk. This is useful when the
  443. machine on which the responder is running is hosting multiple
  444. identities at the same IP address. If the IDr proposed by the
  445. initiator is not acceptable to the responder, the responder might use
  446. some other IDr to finish the exchange. If the initiator then does
  447. not accept the fact that responder used an IDr different than the one
  448. that was requested, the initiator can close the SA after noticing the
  449. fact.
  450. The Traffic Selectors (TSi and TSr) are discussed in Section 2.9.
  451. The initiator begins negotiation of a Child SA using the SAi2
  452. payload. The final fields (starting with SAi2) are described in the
  453. description of the CREATE_CHILD_SA exchange.
  454. Kaufman, et al. Standards Track [Page 11]
  455. RFC 5996 IKEv2bis September 2010
  456. <-- HDR, SK {IDr, [CERT,] AUTH,
  457. SAr2, TSi, TSr}
  458. The responder asserts its identity with the IDr payload, optionally
  459. sends one or more certificates (again with the certificate containing
  460. the public key used to verify AUTH listed first), authenticates its
  461. identity and protects the integrity of the second message with the
  462. AUTH payload, and completes negotiation of a Child SA with the
  463. additional fields described below in the CREATE_CHILD_SA exchange.
  464. Both parties in the IKE_AUTH exchange MUST verify that all signatures
  465. and Message Authentication Codes (MACs) are computed correctly. If
  466. either side uses a shared secret for authentication, the names in the
  467. ID payload MUST correspond to the key used to generate the AUTH
  468. payload.
  469. Because the initiator sends its Diffie-Hellman value in the
  470. IKE_SA_INIT, it must guess the Diffie-Hellman group that the
  471. responder will select from its list of supported groups. If the
  472. initiator guesses wrong, the responder will respond with a Notify
  473. payload of type INVALID_KE_PAYLOAD indicating the selected group. In
  474. this case, the initiator MUST retry the IKE_SA_INIT with the
  475. corrected Diffie-Hellman group. The initiator MUST again propose its
  476. full set of acceptable cryptographic suites because the rejection
  477. message was unauthenticated and otherwise an active attacker could
  478. trick the endpoints into negotiating a weaker suite than a stronger
  479. one that they both prefer.
  480. If creating the Child SA during the IKE_AUTH exchange fails for some
  481. reason, the IKE SA is still created as usual. The list of Notify
  482. message types in the IKE_AUTH exchange that do not prevent an IKE SA
  483. from being set up include at least the following: NO_PROPOSAL_CHOSEN,
  484. TS_UNACCEPTABLE, SINGLE_PAIR_REQUIRED, INTERNAL_ADDRESS_FAILURE, and
  485. FAILED_CP_REQUIRED.
  486. If the failure is related to creating the IKE SA (for example, an
  487. AUTHENTICATION_FAILED Notify error message is returned), the IKE SA
  488. is not created. Note that although the IKE_AUTH messages are
  489. encrypted and integrity protected, if the peer receiving this Notify
  490. error message has not yet authenticated the other end (or if the peer
  491. fails to authenticate the other end for some reason), the information
  492. needs to be treated with caution. More precisely, assuming that the
  493. MAC verifies correctly, the sender of the error Notify message is
  494. known to be the responder of the IKE_SA_INIT exchange, but the
  495. sender's identity cannot be assured.
  496. Kaufman, et al. Standards Track [Page 12]
  497. RFC 5996 IKEv2bis September 2010
  498. Note that IKE_AUTH messages do not contain KEi/KEr or Ni/Nr payloads.
  499. Thus, the SA payloads in the IKE_AUTH exchange cannot contain
  500. Transform Type 4 (Diffie-Hellman group) with any value other than
  501. NONE. Implementations SHOULD omit the whole transform substructure
  502. instead of sending value NONE.
  503. 1.3. The CREATE_CHILD_SA Exchange
  504. The CREATE_CHILD_SA exchange is used to create new Child SAs and to
  505. rekey both IKE SAs and Child SAs. This exchange consists of a single
  506. request/response pair, and some of its function was referred to as a
  507. Phase 2 exchange in IKEv1. It MAY be initiated by either end of the
  508. IKE SA after the initial exchanges are completed.
  509. An SA is rekeyed by creating a new SA and then deleting the old one.
  510. This section describes the first part of rekeying, the creation of
  511. new SAs; Section 2.8 covers the mechanics of rekeying, including
  512. moving traffic from old to new SAs and the deletion of the old SAs.
  513. The two sections must be read together to understand the entire
  514. process of rekeying.
  515. Either endpoint may initiate a CREATE_CHILD_SA exchange, so in this
  516. section the term initiator refers to the endpoint initiating this
  517. exchange. An implementation MAY refuse all CREATE_CHILD_SA requests
  518. within an IKE SA.
  519. The CREATE_CHILD_SA request MAY optionally contain a KE payload for
  520. an additional Diffie-Hellman exchange to enable stronger guarantees
  521. of forward secrecy for the Child SA. The keying material for the
  522. Child SA is a function of SK_d established during the establishment
  523. of the IKE SA, the nonces exchanged during the CREATE_CHILD_SA
  524. exchange, and the Diffie-Hellman value (if KE payloads are included
  525. in the CREATE_CHILD_SA exchange).
  526. If a CREATE_CHILD_SA exchange includes a KEi payload, at least one of
  527. the SA offers MUST include the Diffie-Hellman group of the KEi. The
  528. Diffie-Hellman group of the KEi MUST be an element of the group the
  529. initiator expects the responder to accept (additional Diffie-Hellman
  530. groups can be proposed). If the responder selects a proposal using a
  531. different Diffie-Hellman group (other than NONE), the responder MUST
  532. reject the request and indicate its preferred Diffie-Hellman group in
  533. the INVALID_KE_PAYLOAD Notify payload. There are two octets of data
  534. associated with this notification: the accepted Diffie-Hellman group
  535. number in big endian order. In the case of such a rejection, the
  536. CREATE_CHILD_SA exchange fails, and the initiator will probably retry
  537. the exchange with a Diffie-Hellman proposal and KEi in the group that
  538. the responder gave in the INVALID_KE_PAYLOAD Notify payload.
  539. Kaufman, et al. Standards Track [Page 13]
  540. RFC 5996 IKEv2bis September 2010
  541. The responder sends a NO_ADDITIONAL_SAS notification to indicate that
  542. a CREATE_CHILD_SA request is unacceptable because the responder is
  543. unwilling to accept any more Child SAs on this IKE SA. This
  544. notification can also be used to reject IKE SA rekey. Some minimal
  545. implementations may only accept a single Child SA setup in the
  546. context of an initial IKE exchange and reject any subsequent attempts
  547. to add more.
  548. 1.3.1. Creating New Child SAs with the CREATE_CHILD_SA Exchange
  549. A Child SA may be created by sending a CREATE_CHILD_SA request. The
  550. CREATE_CHILD_SA request for creating a new Child SA is:
  551. Initiator Responder
  552. -------------------------------------------------------------------
  553. HDR, SK {SA, Ni, [KEi],
  554. TSi, TSr} -->
  555. The initiator sends SA offer(s) in the SA payload, a nonce in the Ni
  556. payload, optionally a Diffie-Hellman value in the KEi payload, and
  557. the proposed Traffic Selectors for the proposed Child SA in the TSi
  558. and TSr payloads.
  559. The CREATE_CHILD_SA response for creating a new Child SA is:
  560. <-- HDR, SK {SA, Nr, [KEr],
  561. TSi, TSr}
  562. The responder replies (using the same Message ID to respond) with the
  563. accepted offer in an SA payload, and a Diffie-Hellman value in the
  564. KEr payload if KEi was included in the request and the selected
  565. cryptographic suite includes that group.
  566. The Traffic Selectors for traffic to be sent on that SA are specified
  567. in the TS payloads in the response, which may be a subset of what the
  568. initiator of the Child SA proposed.
  569. The USE_TRANSPORT_MODE notification MAY be included in a request
  570. message that also includes an SA payload requesting a Child SA. It
  571. requests that the Child SA use transport mode rather than tunnel mode
  572. for the SA created. If the request is accepted, the response MUST
  573. also include a notification of type USE_TRANSPORT_MODE. If the
  574. responder declines the request, the Child SA will be established in
  575. tunnel mode. If this is unacceptable to the initiator, the initiator
  576. MUST delete the SA. Note: Except when using this option to negotiate
  577. transport mode, all Child SAs will use tunnel mode.
  578. Kaufman, et al. Standards Track [Page 14]
  579. RFC 5996 IKEv2bis September 2010
  580. The ESP_TFC_PADDING_NOT_SUPPORTED notification asserts that the
  581. sending endpoint will not accept packets that contain Traffic Flow
  582. Confidentiality (TFC) padding over the Child SA being negotiated. If
  583. neither endpoint accepts TFC padding, this notification is included
  584. in both the request and the response. If this notification is
  585. included in only one of the messages, TFC padding can still be sent
  586. in the other direction.
  587. The NON_FIRST_FRAGMENTS_ALSO notification is used for fragmentation
  588. control. See [IPSECARCH] for a fuller explanation. Both parties
  589. need to agree to sending non-first fragments before either party does
  590. so. It is enabled only if NON_FIRST_FRAGMENTS_ALSO notification is
  591. included in both the request proposing an SA and the response
  592. accepting it. If the responder does not want to send or receive non-
  593. first fragments, it only omits NON_FIRST_FRAGMENTS_ALSO notification
  594. from its response, but does not reject the whole Child SA creation.
  595. An IPCOMP_SUPPORTED notification, covered in Section 2.22, can also
  596. be included in the exchange.
  597. A failed attempt to create a Child SA SHOULD NOT tear down the IKE
  598. SA: there is no reason to lose the work done to set up the IKE SA.
  599. See Section 2.21 for a list of error messages that might occur if
  600. creating a Child SA fails.
  601. 1.3.2. Rekeying IKE SAs with the CREATE_CHILD_SA Exchange
  602. The CREATE_CHILD_SA request for rekeying an IKE SA is:
  603. Initiator Responder
  604. -------------------------------------------------------------------
  605. HDR, SK {SA, Ni, KEi} -->
  606. The initiator sends SA offer(s) in the SA payload, a nonce in the Ni
  607. payload, and a Diffie-Hellman value in the KEi payload. The KEi
  608. payload MUST be included. A new initiator SPI is supplied in the SPI
  609. field of the SA payload. Once a peer receives a request to rekey an
  610. IKE SA or sends a request to rekey an IKE SA, it SHOULD NOT start any
  611. new CREATE_CHILD_SA exchanges on the IKE SA that is being rekeyed.
  612. The CREATE_CHILD_SA response for rekeying an IKE SA is:
  613. <-- HDR, SK {SA, Nr, KEr}
  614. The responder replies (using the same Message ID to respond) with the
  615. accepted offer in an SA payload, and a Diffie-Hellman value in the
  616. KEr payload if the selected cryptographic suite includes that group.
  617. A new responder SPI is supplied in the SPI field of the SA payload.
  618. Kaufman, et al. Standards Track [Page 15]
  619. RFC 5996 IKEv2bis September 2010
  620. The new IKE SA has its message counters set to 0, regardless of what
  621. they were in the earlier IKE SA. The first IKE requests from both
  622. sides on the new IKE SA will have Message ID 0. The old IKE SA
  623. retains its numbering, so any further requests (for example, to
  624. delete the IKE SA) will have consecutive numbering. The new IKE SA
  625. also has its window size reset to 1, and the initiator in this rekey
  626. exchange is the new "original initiator" of the new IKE SA.
  627. Section 2.18 also covers IKE SA rekeying in detail.
  628. 1.3.3. Rekeying Child SAs with the CREATE_CHILD_SA Exchange
  629. The CREATE_CHILD_SA request for rekeying a Child SA is:
  630. Initiator Responder
  631. -------------------------------------------------------------------
  632. HDR, SK {N(REKEY_SA), SA, Ni, [KEi],
  633. TSi, TSr} -->
  634. The initiator sends SA offer(s) in the SA payload, a nonce in the Ni
  635. payload, optionally a Diffie-Hellman value in the KEi payload, and
  636. the proposed Traffic Selectors for the proposed Child SA in the TSi
  637. and TSr payloads.
  638. The notifications described in Section 1.3.1 may also be sent in a
  639. rekeying exchange. Usually, these will be the same notifications
  640. that were used in the original exchange; for example, when rekeying a
  641. transport mode SA, the USE_TRANSPORT_MODE notification will be used.
  642. The REKEY_SA notification MUST be included in a CREATE_CHILD_SA
  643. exchange if the purpose of the exchange is to replace an existing ESP
  644. or AH SA. The SA being rekeyed is identified by the SPI field in the
  645. Notify payload; this is the SPI the exchange initiator would expect
  646. in inbound ESP or AH packets. There is no data associated with this
  647. Notify message type. The Protocol ID field of the REKEY_SA
  648. notification is set to match the protocol of the SA we are rekeying,
  649. for example, 3 for ESP and 2 for AH.
  650. The CREATE_CHILD_SA response for rekeying a Child SA is:
  651. <-- HDR, SK {SA, Nr, [KEr],
  652. TSi, TSr}
  653. The responder replies (using the same Message ID to respond) with the
  654. accepted offer in an SA payload, and a Diffie-Hellman value in the
  655. KEr payload if KEi was included in the request and the selected
  656. cryptographic suite includes that group.
  657. Kaufman, et al. Standards Track [Page 16]
  658. RFC 5996 IKEv2bis September 2010
  659. The Traffic Selectors for traffic to be sent on that SA are specified
  660. in the TS payloads in the response, which may be a subset of what the
  661. initiator of the Child SA proposed.
  662. 1.4. The INFORMATIONAL Exchange
  663. At various points during the operation of an IKE SA, peers may desire
  664. to convey control messages to each other regarding errors or
  665. notifications of certain events. To accomplish this, IKE defines an
  666. INFORMATIONAL exchange. INFORMATIONAL exchanges MUST ONLY occur
  667. after the initial exchanges and are cryptographically protected with
  668. the negotiated keys. Note that some informational messages, not
  669. exchanges, can be sent outside the context of an IKE SA. Section
  670. 2.21 also covers error messages in great detail.
  671. Control messages that pertain to an IKE SA MUST be sent under that
  672. IKE SA. Control messages that pertain to Child SAs MUST be sent
  673. under the protection of the IKE SA that generated them (or its
  674. successor if the IKE SA was rekeyed).
  675. Messages in an INFORMATIONAL exchange contain zero or more
  676. Notification, Delete, and Configuration payloads. The recipient of
  677. an INFORMATIONAL exchange request MUST send some response; otherwise,
  678. the sender will assume the message was lost in the network and will
  679. retransmit it. That response MAY be an empty message. The request
  680. message in an INFORMATIONAL exchange MAY also contain no payloads.
  681. This is the expected way an endpoint can ask the other endpoint to
  682. verify that it is alive.
  683. The INFORMATIONAL exchange is defined as:
  684. Initiator Responder
  685. -------------------------------------------------------------------
  686. HDR, SK {[N,] [D,]
  687. [CP,] ...} -->
  688. <-- HDR, SK {[N,] [D,]
  689. [CP], ...}
  690. The processing of an INFORMATIONAL exchange is determined by its
  691. component payloads.
  692. 1.4.1. Deleting an SA with INFORMATIONAL Exchanges
  693. ESP and AH SAs always exist in pairs, with one SA in each direction.
  694. When an SA is closed, both members of the pair MUST be closed (that
  695. is, deleted). Each endpoint MUST close its incoming SAs and allow
  696. the other endpoint to close the other SA in each pair. To delete an
  697. SA, an INFORMATIONAL exchange with one or more Delete payloads is
  698. Kaufman, et al. Standards Track [Page 17]
  699. RFC 5996 IKEv2bis September 2010
  700. sent listing the SPIs (as they would be expected in the headers of
  701. inbound packets) of the SAs to be deleted. The recipient MUST close
  702. the designated SAs. Note that one never sends Delete payloads for
  703. the two sides of an SA in a single message. If there are many SAs to
  704. delete at the same time, one includes Delete payloads for the inbound
  705. half of each SA pair in the INFORMATIONAL exchange.
  706. Normally, the response in the INFORMATIONAL exchange will contain
  707. Delete payloads for the paired SAs going in the other direction.
  708. There is one exception. If, by chance, both ends of a set of SAs
  709. independently decide to close them, each may send a Delete payload
  710. and the two requests may cross in the network. If a node receives a
  711. delete request for SAs for which it has already issued a delete
  712. request, it MUST delete the outgoing SAs while processing the request
  713. and the incoming SAs while processing the response. In that case,
  714. the responses MUST NOT include Delete payloads for the deleted SAs,
  715. since that would result in duplicate deletion and could in theory
  716. delete the wrong SA.
  717. Similar to ESP and AH SAs, IKE SAs are also deleted by sending an
  718. Informational exchange. Deleting an IKE SA implicitly closes any
  719. remaining Child SAs negotiated under it. The response to a request
  720. that deletes the IKE SA is an empty INFORMATIONAL response.
  721. Half-closed ESP or AH connections are anomalous, and a node with
  722. auditing capability should probably audit their existence if they
  723. persist. Note that this specification does not specify time periods,
  724. so it is up to individual endpoints to decide how long to wait. A
  725. node MAY refuse to accept incoming data on half-closed connections
  726. but MUST NOT unilaterally close them and reuse the SPIs. If
  727. connection state becomes sufficiently messed up, a node MAY close the
  728. IKE SA, as described above. It can then rebuild the SAs it needs on
  729. a clean base under a new IKE SA.
  730. 1.5. Informational Messages outside of an IKE SA
  731. There are some cases in which a node receives a packet that it cannot
  732. process, but it may want to notify the sender about this situation.
  733. o If an ESP or AH packet arrives with an unrecognized SPI. This
  734. might be due to the receiving node having recently crashed and
  735. lost state, or because of some other system malfunction or attack.
  736. o If an encrypted IKE request packet arrives on port 500 or 4500
  737. with an unrecognized IKE SPI. This might be due to the receiving
  738. node having recently crashed and lost state, or because of some
  739. other system malfunction or attack.
  740. Kaufman, et al. Standards Track [Page 18]
  741. RFC 5996 IKEv2bis September 2010
  742. o If an IKE request packet arrives with a higher major version
  743. number than the implementation supports.
  744. In the first case, if the receiving node has an active IKE SA to the
  745. IP address from whence the packet came, it MAY send an INVALID_SPI
  746. notification of the wayward packet over that IKE SA in an
  747. INFORMATIONAL exchange. The Notification Data contains the SPI of
  748. the invalid packet. The recipient of this notification cannot tell
  749. whether the SPI is for AH or ESP, but this is not important because
  750. the SPIs are supposed to be different for the two. If no suitable
  751. IKE SA exists, the node MAY send an informational message without
  752. cryptographic protection to the source IP address, using the source
  753. UDP port as the destination port if the packet was UDP (UDP-
  754. encapsulated ESP or AH). In this case, it should only be used by the
  755. recipient as a hint that something might be wrong (because it could
  756. easily be forged). This message is not part of an INFORMATIONAL
  757. exchange, and the receiving node MUST NOT respond to it because doing
  758. so could cause a message loop. The message is constructed as
  759. follows: there are no IKE SPI values that would be meaningful to the
  760. recipient of such a notification; using zero values or random values
  761. are both acceptable, this being the exception to the rule in
  762. Section 3.1 that prohibits zero IKE Initiator SPIs. The Initiator
  763. flag is set to 1, the Response flag is set to 0, and the version
  764. flags are set in the normal fashion; these flags are described in
  765. Section 3.1.
  766. In the second and third cases, the message is always sent without
  767. cryptographic protection (outside of an IKE SA), and includes either
  768. an INVALID_IKE_SPI or an INVALID_MAJOR_VERSION notification (with no
  769. notification data). The message is a response message, and thus it
  770. is sent to the IP address and port from whence it came with the same
  771. IKE SPIs and the Message ID and Exchange Type are copied from the
  772. request. The Response flag is set to 1, and the version flags are
  773. set in the normal fashion.
  774. 1.6. Requirements Terminology
  775. Definitions of the primitive terms in this document (such as Security
  776. Association or SA) can be found in [IPSECARCH]. It should be noted
  777. that parts of IKEv2 rely on some of the processing rules in
  778. [IPSECARCH], as described in various sections of this document.
  779. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  780. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  781. document are to be interpreted as described in [MUSTSHOULD].
  782. Kaufman, et al. Standards Track [Page 19]
  783. RFC 5996 IKEv2bis September 2010
  784. 1.7. Significant Differences between RFC 4306 and This Document
  785. This document contains clarifications and amplifications to IKEv2
  786. [IKEV2]. Many of the clarifications are based on [Clarif]. The
  787. changes listed in that document were discussed in the IPsec Working
  788. Group and, after the Working Group was disbanded, on the IPsec
  789. mailing list. That document contains detailed explanations of areas
  790. that were unclear in IKEv2, and is thus useful to implementers of
  791. IKEv2.
  792. The protocol described in this document retains the same major
  793. version number (2) and minor version number (0) as was used in RFC
  794. 4306. That is, the version number is *not* changed from RFC 4306.
  795. The small number of technical changes listed here are not expected to
  796. affect RFC 4306 implementations that have already been deployed at
  797. the time of publication of this document.
  798. This document makes the figures and references a bit more consistent
  799. than they were in [IKEV2].
  800. IKEv2 developers have noted that the SHOULD-level requirements in RFC
  801. 4306 are often unclear in that they don't say when it is OK to not
  802. obey the requirements. They also have noted that there are MUST-
  803. level requirements that are not related to interoperability. This
  804. document has more explanation of some of these requirements. All
  805. non-capitalized uses of the words SHOULD and MUST now mean their
  806. normal English sense, not the interoperability sense of [MUSTSHOULD].
  807. IKEv2 (and IKEv1) developers have noted that there is a great deal of
  808. material in the tables of codes in Section 3.10.1 in RFC 4306. This
  809. leads to implementers not having all the needed information in the
  810. main body of the document. Much of the material from those tables
  811. has been moved into the associated parts of the main body of the
  812. document.
  813. This document removes discussion of nesting AH and ESP. This was a
  814. mistake in RFC 4306 caused by the lag between finishing RFC 4306 and
  815. RFC 4301. Basically, IKEv2 is based on RFC 4301, which does not
  816. include "SA bundles" that were part of RFC 2401. While a single
  817. packet can go through IPsec processing multiple times, each of these
  818. passes uses a separate SA, and the passes are coordinated by the
  819. forwarding tables. In IKEv2, each of these SAs has to be created
  820. using a separate CREATE_CHILD_SA exchange.
  821. This document removes discussion of the INTERNAL_ADDRESS_EXPIRY
  822. configuration attribute because its implementation was very
  823. problematic. Implementations that conform to this document MUST
  824. Kaufman, et al. Standards Track [Page 20]
  825. RFC 5996 IKEv2bis September 2010
  826. ignore proposals that have configuration attribute type 5, the old
  827. value for INTERNAL_ADDRESS_EXPIRY. This document also removed
  828. INTERNAL_IP6_NBNS as a configuration attribute.
  829. This document removes the allowance for rejecting messages in which
  830. the payloads were not in the "right" order; now implementations MUST
  831. NOT reject them. This is due to the lack of clarity where the orders
  832. for the payloads are described.
  833. The lists of items from RFC 4306 that ended up in the IANA registry
  834. were trimmed to only include items that were actually defined in RFC
  835. 4306. Also, many of those lists are now preceded with the very
  836. important instruction to developers that they really should look at
  837. the IANA registry at the time of development because new items have
  838. been added since RFC 4306.
  839. This document adds clarification on when notifications are and are
  840. not sent encrypted, depending on the state of the negotiation at the
  841. time.
  842. This document discusses more about how to negotiate combined-mode
  843. ciphers.
  844. In Section 1.3.2, "The KEi payload SHOULD be included" was changed to
  845. be "The KEi payload MUST be included". This also led to changes in
  846. Section 2.18.
  847. In Section 2.1, there is new material covering how the initiator's
  848. SPI and/or IP is used to differentiate if this is a "half-open" IKE
  849. SA or a new request.
  850. This document clarifies the use of the critical flag in Section 2.5.
  851. In Section 2.8, "Note that, when rekeying, the new Child SA MAY have
  852. different Traffic Selectors and algorithms than the old one" was
  853. changed to "Note that, when rekeying, the new Child SA SHOULD NOT
  854. have different Traffic Selectors and algorithms than the old one".
  855. The new Section 2.8.2 covers simultaneous IKE SA rekeying.
  856. The new Section 2.9.2 covers Traffic Selectors in rekeying.
  857. This document adds the restriction in Section 2.13 that all
  858. pseudorandom functions (PRFs) used with IKEv2 MUST take variable-
  859. sized keys. This should not affect any implementations because there
  860. were no standardized PRFs that have fixed-size keys.
  861. Kaufman, et al. Standards Track [Page 21]
  862. RFC 5996 IKEv2bis September 2010
  863. Section 2.18 requires doing a Diffie-Hellman exchange when rekeying
  864. the IKE_SA. In theory, RFC 4306 allowed a policy where the Diffie-
  865. Hellman exchange was optional, but this was not useful (or
  866. appropriate) when rekeying the IKE_SA.
  867. Section 2.21 has been greatly expanded to cover the different cases
  868. where error responses are needed and the appropriate responses to
  869. them.
  870. Section 2.23 clarified that, in NAT traversal, now both UDP-
  871. encapsulated IPsec packets and non-UDP-encapsulated IPsec packets
  872. need to be understood when receiving.
  873. Added Section 2.23.1 to describe NAT traversal when transport mode is
  874. requested.
  875. Added Section 2.25 to explain how to act when there are timing
  876. collisions when deleting and/or rekeying SAs, and two new error
  877. notifications (TEMPORARY_FAILURE and CHILD_SA_NOT_FOUND) were
  878. defined.
  879. In Section 3.6, "Implementations MUST support the HTTP method for
  880. hash-and-URL lookup. The behavior of other URL methods is not
  881. currently specified, and such methods SHOULD NOT be used in the
  882. absence of a document specifying them" was added.
  883. In Section 3.15.3, a pointer to a new document that is related to
  884. configuration of IPv6 addresses was added.
  885. Appendix C was expanded and clarified.
  886. 2. IKE Protocol Details and Variations
  887. IKE normally listens and sends on UDP port 500, though IKE messages
  888. may also be received on UDP port 4500 with a slightly different
  889. format (see Section 2.23). Since UDP is a datagram (unreliable)
  890. protocol, IKE includes in its definition recovery from transmission
  891. errors, including packet loss, packet replay, and packet forgery.
  892. IKE is designed to function so long as (1) at least one of a series
  893. of retransmitted packets reaches its destination before timing out;
  894. and (2) the channel is not so full of forged and replayed packets so
  895. as to exhaust the network or CPU capacities of either endpoint. Even
  896. in the absence of those minimum performance requirements, IKE is
  897. designed to fail cleanly (as though the network were broken).
  898. Although IKEv2 messages are intended to be short, they contain
  899. structures with no hard upper bound on size (in particular, digital
  900. certificates), and IKEv2 itself does not have a mechanism for
  901. Kaufman, et al. Standards Track [Page 22]
  902. RFC 5996 IKEv2bis September 2010
  903. fragmenting large messages. IP defines a mechanism for fragmentation
  904. of oversized UDP messages, but implementations vary in the maximum
  905. message size supported. Furthermore, use of IP fragmentation opens
  906. an implementation to denial-of-service (DoS) attacks [DOSUDPPROT].
  907. Finally, some NAT and/or firewall implementations may block IP
  908. fragments.
  909. All IKEv2 implementations MUST be able to send, receive, and process
  910. IKE messages that are up to 1280 octets long, and they SHOULD be able
  911. to send, receive, and process messages that are up to 3000 octets
  912. long. IKEv2 implementations need to be aware of the maximum UDP
  913. message size supported and MAY shorten messages by leaving out some
  914. certificates or cryptographic suite proposals if that will keep
  915. messages below the maximum. Use of the "Hash and URL" formats rather
  916. than including certificates in exchanges where possible can avoid
  917. most problems. Implementations and configuration need to keep in
  918. mind, however, that if the URL lookups are possible only after the
  919. Child SA is established, recursion issues could prevent this
  920. technique from working.
  921. The UDP payload of all packets containing IKE messages sent on port
  922. 4500 MUST begin with the prefix of four zeros; otherwise, the
  923. receiver won't know how to handle them.
  924. 2.1. Use of Retransmission Timers
  925. All messages in IKE exist in pairs: a request and a response. The
  926. setup of an IKE SA normally consists of two exchanges. Once the IKE
  927. SA is set up, either end of the Security Association may initiate
  928. requests at any time, and there can be many requests and responses
  929. "in flight" at any given moment. But each message is labeled as
  930. either a request or a response, and for each exchange, one end of the
  931. Security Association is the initiator and the other is the responder.
  932. For every pair of IKE messages, the initiator is responsible for
  933. retransmission in the event of a timeout. The responder MUST never
  934. retransmit a response unless it receives a retransmission of the
  935. request. In that event, the responder MUST ignore the retransmitted
  936. request except insofar as it causes a retransmission of the response.
  937. The initiator MUST remember each request until it receives the
  938. corresponding response. The responder MUST remember each response
  939. until it receives a request whose sequence number is larger than or
  940. equal to the sequence number in the response plus its window size
  941. (see Section 2.3). In order to allow saving memory, responders are
  942. allowed to forget the response after a timeout of several minutes.
  943. If the responder receives a retransmitted request for which it has
  944. already forgotten the response, it MUST ignore the request (and not,
  945. for example, attempt constructing a new response).
  946. Kaufman, et al. Standards Track [Page 23]
  947. RFC 5996 IKEv2bis September 2010
  948. IKE is a reliable protocol: the initiator MUST retransmit a request
  949. until it either receives a corresponding response or deems the IKE SA
  950. to have failed. In the latter case, the initiator discards all state
  951. associated with the IKE SA and any Child SAs that were negotiated
  952. using that IKE SA. A retransmission from the initiator MUST be
  953. bitwise identical to the original request. That is, everything
  954. starting from the IKE header (the IKE SA initiator's SPI onwards)
  955. must be bitwise identical; items before it (such as the IP and UDP
  956. headers) do not have to be identical.
  957. Retransmissions of the IKE_SA_INIT request require some special
  958. handling. When a responder receives an IKE_SA_INIT request, it has
  959. to determine whether the packet is a retransmission belonging to an
  960. existing "half-open" IKE SA (in which case the responder retransmits
  961. the same response), or a new request (in which case the responder
  962. creates a new IKE SA and sends a fresh response), or it belongs to an
  963. existing IKE SA where the IKE_AUTH request has been already received
  964. (in which case the responder ignores it).
  965. It is not sufficient to use the initiator's SPI and/or IP address to
  966. differentiate between these three cases because two different peers
  967. behind a single NAT could choose the same initiator SPI. Instead, a
  968. robust responder will do the IKE SA lookup using the whole packet,
  969. its hash, or the Ni payload.
  970. The retransmission policy for one-way messages is somewhat different
  971. from that for regular messages. Because no acknowledgement is ever
  972. sent, there is no reason to gratuitously retransmit one-way messages.
  973. Given that all these messages are errors, it makes sense to send them
  974. only once per "offending" packet, and only retransmit if further
  975. offending packets are received. Still, it also makes sense to limit
  976. retransmissions of such error messages.
  977. 2.2. Use of Sequence Numbers for Message ID
  978. Every IKE message contains a Message ID as part of its fixed header.
  979. This Message ID is used to match up requests and responses and to
  980. identify retransmissions of messages. Retransmission of a message
  981. MUST use the same Message ID as the original message.
  982. The Message ID is a 32-bit quantity, which is zero for the
  983. IKE_SA_INIT messages (including retries of the message due to
  984. responses such as COOKIE and INVALID_KE_PAYLOAD), and incremented for
  985. each subsequent exchange. Thus, the first pair of IKE_AUTH messages
  986. will have an ID of 1, the second (when EAP is used) will be 2, and so
  987. on. The Message ID is reset to zero in the new IKE SA after the IKE
  988. SA is rekeyed.
  989. Kaufman, et al. Standards Track [Page 24]
  990. RFC 5996 IKEv2bis September 2010
  991. Each endpoint in the IKE Security Association maintains two "current"
  992. Message IDs: the next one to be used for a request it initiates and
  993. the next one it expects to see in a request from the other end.
  994. These counters increment as requests are generated and received.
  995. Responses always contain the same Message ID as the corresponding
  996. request. That means that after the initial exchange, each integer n
  997. may appear as the Message ID in four distinct messages: the nth
  998. request from the original IKE initiator, the corresponding response,
  999. the nth request from the original IKE responder, and the
  1000. corresponding response. If the two ends make a very different number
  1001. of requests, the Message IDs in the two directions can be very
  1002. different. There is no ambiguity in the messages, however, because
  1003. the Initiator and Response flags in the message header specify which
  1004. of the four messages a particular one is.
  1005. Throughout this document, "initiator" refers to the party who
  1006. initiated the exchange being described. The "original initiator"
  1007. always refers to the party who initiated the exchange that resulted
  1008. in the current IKE SA. In other words, if the "original responder"
  1009. starts rekeying the IKE SA, that party becomes the "original
  1010. initiator" of the new IKE SA.
  1011. Note that Message IDs are cryptographically protected and provide
  1012. protection against message replays. In the unlikely event that
  1013. Message IDs grow too large to fit in 32 bits, the IKE SA MUST be
  1014. closed or rekeyed.
  1015. 2.3. Window Size for Overlapping Requests
  1016. The SET_WINDOW_SIZE notification asserts that the sending endpoint is
  1017. capable of keeping state for multiple outstanding exchanges,
  1018. permitting the recipient to send multiple requests before getting a
  1019. response to the first. The data associated with a SET_WINDOW_SIZE
  1020. notification MUST be 4 octets long and contain the big endian
  1021. representation of the number of messages the sender promises to keep.
  1022. The window size is always one until the initial exchanges complete.
  1023. An IKE endpoint MUST wait for a response to each of its messages
  1024. before sending a subsequent message unless it has received a
  1025. SET_WINDOW_SIZE Notify message from its peer informing it that the
  1026. peer is prepared to maintain state for multiple outstanding messages
  1027. in order to allow greater throughput.
  1028. After an IKE SA is set up, in order to maximize IKE throughput, an
  1029. IKE endpoint MAY issue multiple requests before getting a response to
  1030. any of them, up to the limit set by its peer's SET_WINDOW_SIZE.
  1031. These requests may pass one another over the network. An IKE
  1032. endpoint MUST be prepared to accept and process a request while it
  1033. Kaufman, et al. Standards Track [Page 25]
  1034. RFC 5996 IKEv2bis September 2010
  1035. has a request outstanding in order to avoid a deadlock in this
  1036. situation. An IKE endpoint may also accept and process multiple
  1037. requests while it has a request outstanding.
  1038. An IKE endpoint MUST NOT exceed the peer's stated window size for
  1039. transmitted IKE requests. In other words, if the responder stated
  1040. its window size is N, then when the initiator needs to make a request
  1041. X, it MUST wait until it has received responses to all requests up
  1042. through request X-N. An IKE endpoint MUST keep a copy of (or be able
  1043. to regenerate exactly) each request it has sent until it receives the
  1044. corresponding response. An IKE endpoint MUST keep a copy of (or be
  1045. able to regenerate exactly) the number of previous responses equal to
  1046. its declared window size in case its response was lost and the
  1047. initiator requests its retransmission by retransmitting the request.
  1048. An IKE endpoint supporting a window size greater than one ought to be
  1049. capable of processing incoming requests out of order to maximize
  1050. performance in the event of network failures or packet reordering.
  1051. The window size is normally a (possibly configurable) property of a
  1052. particular implementation, and is not related to congestion control
  1053. (unlike the window size in TCP, for example). In particular, what
  1054. the responder should do when it receives a SET_WINDOW_SIZE
  1055. notification containing a smaller value than is currently in effect
  1056. is not defined. Thus, there is currently no way to reduce the window
  1057. size of an existing IKE SA; you can only increase it. When rekeying
  1058. an IKE SA, the new IKE SA starts with window size 1 until it is
  1059. explicitly increased by sending a new SET_WINDOW_SIZE notification.
  1060. The INVALID_MESSAGE_ID notification is sent when an IKE Message ID
  1061. outside the supported window is received. This Notify message MUST
  1062. NOT be sent in a response; the invalid request MUST NOT be
  1063. acknowledged. Instead, inform the other side by initiating an
  1064. INFORMATIONAL exchange with Notification data containing the four-
  1065. octet invalid Message ID. Sending this notification is OPTIONAL, and
  1066. notifications of this type MUST be rate limited.
  1067. 2.4. State Synchronization and Connection Timeouts
  1068. An IKE endpoint is allowed to forget all of its state associated with
  1069. an IKE SA and the collection of corresponding Child SAs at any time.
  1070. This is the anticipated behavior in the event of an endpoint crash
  1071. and restart. It is important when an endpoint either fails or
  1072. reinitializes its state that the other endpoint detect those
  1073. conditions and not continue to waste network bandwidth by sending
  1074. packets over discarded SAs and having them fall into a black hole.
  1075. Kaufman, et al. Standards Track [Page 26]
  1076. RFC 5996 IKEv2bis September 2010
  1077. The INITIAL_CONTACT notification asserts that this IKE SA is the only
  1078. IKE SA currently active between the authenticated identities. It MAY
  1079. be sent when an IKE SA is established after a crash, and the
  1080. recipient MAY use this information to delete any other IKE SAs it has
  1081. to the same authenticated identity without waiting for a timeout.
  1082. This notification MUST NOT be sent by an entity that may be
  1083. replicated (e.g., a roaming user's credentials where the user is
  1084. allowed to connect to the corporate firewall from two remote systems
  1085. at the same time). The INITIAL_CONTACT notification, if sent, MUST
  1086. be in the first IKE_AUTH request or response, not as a separate
  1087. exchange afterwards; receiving parties MAY ignore it in other
  1088. messages.
  1089. Since IKE is designed to operate in spite of DoS attacks from the
  1090. network, an endpoint MUST NOT conclude that the other endpoint has
  1091. failed based on any routing information (e.g., ICMP messages) or IKE
  1092. messages that arrive without cryptographic protection (e.g., Notify
  1093. messages complaining about unknown SPIs). An endpoint MUST conclude
  1094. that the other endpoint has failed only when repeated attempts to
  1095. contact it have gone unanswered for a timeout period or when a
  1096. cryptographically protected INITIAL_CONTACT notification is received
  1097. on a different IKE SA to the same authenticated identity. An
  1098. endpoint should suspect that the other endpoint has failed based on
  1099. routing information and initiate a request to see whether the other
  1100. endpoint is alive. To check whether the other side is alive, IKE
  1101. specifies an empty INFORMATIONAL message that (like all IKE requests)
  1102. requires an acknowledgement (note that within the context of an IKE
  1103. SA, an "empty" message consists of an IKE header followed by an
  1104. Encrypted payload that contains no payloads). If a cryptographically
  1105. protected (fresh, i.e., not retransmitted) message has been received
  1106. from the other side recently, unprotected Notify messages MAY be
  1107. ignored. Implementations MUST limit the rate at which they take
  1108. actions based on unprotected messages.
  1109. The number of retries and length of timeouts are not covered in this
  1110. specification because they do not affect interoperability. It is
  1111. suggested that messages be retransmitted at least a dozen times over
  1112. a period of at least several minutes before giving up on an SA, but
  1113. different environments may require different rules. To be a good
  1114. network citizen, retransmission times MUST increase exponentially to
  1115. avoid flooding the network and making an existing congestion
  1116. situation worse. If there has only been outgoing traffic on all of
  1117. the SAs associated with an IKE SA, it is essential to confirm
  1118. liveness of the other endpoint to avoid black holes. If no
  1119. cryptographically protected messages have been received on an IKE SA
  1120. or any of its Child SAs recently, the system needs to perform a
  1121. liveness check in order to prevent sending messages to a dead peer.
  1122. (This is sometimes called "dead peer detection" or "DPD", although it
  1123. Kaufman, et al. Standards Track [Page 27]
  1124. RFC 5996 IKEv2bis September 2010
  1125. is really detecting live peers, not dead ones.) Receipt of a fresh
  1126. cryptographically protected message on an IKE SA or any of its Child
  1127. SAs ensures liveness of the IKE SA and all of its Child SAs. Note
  1128. that this places requirements on the failure modes of an IKE
  1129. endpoint. An implementation needs to stop sending over any SA if
  1130. some failure prevents it from receiving on all of the associated SAs.
  1131. If a system creates Child SAs that can fail independently from one
  1132. another without the associated IKE SA being able to send a delete
  1133. message, then the system MUST negotiate such Child SAs using separate
  1134. IKE SAs.
  1135. There is a DoS attack on the initiator of an IKE SA that can be
  1136. avoided if the initiator takes the proper care. Since the first two
  1137. messages of an SA setup are not cryptographically protected, an
  1138. attacker could respond to the initiator's message before the genuine
  1139. responder and poison the connection setup attempt. To prevent this,
  1140. the initiator MAY be willing to accept multiple responses to its
  1141. first message, treat each as potentially legitimate, respond to it,
  1142. and then discard all the invalid half-open connections when it
  1143. receives a valid cryptographically protected response to any one of
  1144. its requests. Once a cryptographically valid response is received,
  1145. all subsequent responses should be ignored whether or not they are
  1146. cryptographically valid.
  1147. Note that with these rules, there is no reason to negotiate and agree
  1148. upon an SA lifetime. If IKE presumes the partner is dead, based on
  1149. repeated lack of acknowledgement to an IKE message, then the IKE SA
  1150. and all Child SAs set up through that IKE SA are deleted.
  1151. An IKE endpoint may at any time delete inactive Child SAs to recover
  1152. resources used to hold their state. If an IKE endpoint chooses to
  1153. delete Child SAs, it MUST send Delete payloads to the other end
  1154. notifying it of the deletion. It MAY similarly time out the IKE SA.
  1155. Closing the IKE SA implicitly closes all associated Child SAs. In
  1156. this case, an IKE endpoint SHOULD send a Delete payload indicating
  1157. that it has closed the IKE SA unless the other endpoint is no longer
  1158. responding.
  1159. 2.5. Version Numbers and Forward Compatibility
  1160. This document describes version 2.0 of IKE, meaning the major version
  1161. number is 2 and the minor version number is 0. This document is a
  1162. replacement for [IKEV2]. It is likely that some implementations will
  1163. want to support version 1.0 and version 2.0, and in the future, other
  1164. versions.
  1165. Kaufman, et al. Standards Track [Page 28]
  1166. RFC 5996 IKEv2bis September 2010
  1167. The major version number should be incremented only if the packet
  1168. formats or required actions have changed so dramatically that an
  1169. older version node would not be able to interoperate with a newer
  1170. version node if it simply ignored the fields it did not understand
  1171. and took the actions specified in the older specification. The minor
  1172. version number indicates new capabilities, and MUST be ignored by a
  1173. node with a smaller minor version number, but used for informational
  1174. purposes by the node with the larger minor version number. For
  1175. example, it might indicate the ability to process a newly defined
  1176. Notify message type. The node with the larger minor version number
  1177. would simply note that its correspondent would not be able to
  1178. understand that message and therefore would not send it.
  1179. If an endpoint receives a message with a higher major version number,
  1180. it MUST drop the message and SHOULD send an unauthenticated Notify
  1181. message of type INVALID_MAJOR_VERSION containing the highest
  1182. (closest) version number it supports. If an endpoint supports major
  1183. version n, and major version m, it MUST support all versions between
  1184. n and m. If it receives a message with a major version that it
  1185. supports, it MUST respond with that version number. In order to
  1186. prevent two nodes from being tricked into corresponding with a lower
  1187. major version number than the maximum that they both support, IKE has
  1188. a flag that indicates that the node is capable of speaking a higher
  1189. major version number.
  1190. Thus, the major version number in the IKE header indicates the
  1191. version number of the message, not the highest version number that
  1192. the transmitter supports. If the initiator is capable of speaking
  1193. versions n, n+1, and n+2, and the responder is capable of speaking
  1194. versions n and n+1, then they will negotiate speaking n+1, where the
  1195. initiator will set a flag indicating its ability to speak a higher
  1196. version. If they mistakenly (perhaps through an active attacker
  1197. sending error messages) negotiate to version n, then both will notice
  1198. that the other side can support a higher version number, and they
  1199. MUST break the connection and reconnect using version n+1.
  1200. Note that IKEv1 does not follow these rules, because there is no way
  1201. in v1 of noting that you are capable of speaking a higher version
  1202. number. So an active attacker can trick two v2-capable nodes into
  1203. speaking v1. When a v2-capable node negotiates down to v1, it should
  1204. note that fact in its logs.
  1205. Also, for forward compatibility, all fields marked RESERVED MUST be
  1206. set to zero by an implementation running version 2.0, and their
  1207. content MUST be ignored by an implementation running version 2.0 ("Be
  1208. conservative in what you send and liberal in what you receive" [IP]).
  1209. In this way, future versions of the protocol can use those fields in
  1210. a way that is guaranteed to be ignored by implementations that do not
  1211. Kaufman, et al. Standards Track [Page 29]
  1212. RFC 5996 IKEv2bis September 2010
  1213. understand them. Similarly, payload types that are not defined are
  1214. reserved for future use; implementations of a version where they are
  1215. undefined MUST skip over those payloads and ignore their contents.
  1216. IKEv2 adds a "critical" flag to each payload header for further
  1217. flexibility for forward compatibility. If the critical flag is set
  1218. and the payload type is unrecognized, the message MUST be rejected
  1219. and the response to the IKE request containing that payload MUST
  1220. include a Notify payload UNSUPPORTED_CRITICAL_PAYLOAD, indicating an
  1221. unsupported critical payload was included. In that Notify payload,
  1222. the notification data contains the one-octet payload type. If the
  1223. critical flag is not set and the payload type is unsupported, that
  1224. payload MUST be ignored. Payloads sent in IKE response messages MUST
  1225. NOT have the critical flag set. Note that the critical flag applies
  1226. only to the payload type, not the contents. If the payload type is
  1227. recognized, but the payload contains something that is not (such as
  1228. an unknown transform inside an SA payload, or an unknown Notify
  1229. Message Type inside a Notify payload), the critical flag is ignored.
  1230. Although new payload types may be added in the future and may appear
  1231. interleaved with the fields defined in this specification,
  1232. implementations SHOULD send the payloads defined in this
  1233. specification in the order shown in the figures in Sections 1 and 2;
  1234. implementations MUST NOT reject as invalid a message with those
  1235. payloads in any other order.
  1236. 2.6. IKE SA SPIs and Cookies
  1237. The initial two eight-octet fields in the header, called the "IKE
  1238. SPIs", are used as a connection identifier at the beginning of IKE
  1239. packets. Each endpoint chooses one of the two SPIs and MUST choose
  1240. them so as to be unique identifiers of an IKE SA. An SPI value of
  1241. zero is special: it indicates that the remote SPI value is not yet
  1242. known by the sender.
  1243. Incoming IKE packets are mapped to an IKE SA only using the packet's
  1244. SPI, not using (for example) the source IP address of the packet.
  1245. Unlike ESP and AH where only the recipient's SPI appears in the
  1246. header of a message, in IKE the sender's SPI is also sent in every
  1247. message. Since the SPI chosen by the original initiator of the IKE
  1248. SA is always sent first, an endpoint with multiple IKE SAs open that
  1249. wants to find the appropriate IKE SA using the SPI it assigned must
  1250. look at the Initiator flag in the header to determine whether it
  1251. assigned the first or the second eight octets.
  1252. Kaufman, et al. Standards Track [Page 30]
  1253. RFC 5996 IKEv2bis September 2010
  1254. In the first message of an initial IKE exchange, the initiator will
  1255. not know the responder's SPI value and will therefore set that field
  1256. to zero. When the IKE_SA_INIT exchange does not result in the
  1257. creation of an IKE SA due to INVALID_KE_PAYLOAD, NO_PROPOSAL_CHOSEN,
  1258. or COOKIE (see Section 2.6), the responder's SPI will be zero also in
  1259. the response message. However, if the responder sends a non-zero
  1260. responder SPI, the initiator should not reject the response for only
  1261. that reason.
  1262. Two expected attacks against IKE are state and CPU exhaustion, where
  1263. the target is flooded with session initiation requests from forged IP
  1264. addresses. These attacks can be made less effective if a responder
  1265. uses minimal CPU and commits no state to an SA until it knows the
  1266. initiator can receive packets at the address from which it claims to
  1267. be sending them.
  1268. When a responder detects a large number of half-open IKE SAs, it
  1269. SHOULD reply to IKE_SA_INIT requests with a response containing the
  1270. COOKIE notification. The data associated with this notification MUST
  1271. be between 1 and 64 octets in length (inclusive), and its generation
  1272. is described later in this section. If the IKE_SA_INIT response
  1273. includes the COOKIE notification, the initiator MUST then retry the
  1274. IKE_SA_INIT request, and include the COOKIE notification containing
  1275. the received data as the first payload, and all other payloads
  1276. unchanged. The initial exchange will then be as follows:
  1277. Initiator Responder
  1278. -------------------------------------------------------------------
  1279. HDR(A,0), SAi1, KEi, Ni -->
  1280. <-- HDR(A,0), N(COOKIE)
  1281. HDR(A,0), N(COOKIE), SAi1,
  1282. KEi, Ni -->
  1283. <-- HDR(A,B), SAr1, KEr,
  1284. Nr, [CERTREQ]
  1285. HDR(A,B), SK {IDi, [CERT,]
  1286. [CERTREQ,] [IDr,] AUTH,
  1287. SAi2, TSi, TSr} -->
  1288. <-- HDR(A,B), SK {IDr, [CERT,]
  1289. AUTH, SAr2, TSi, TSr}
  1290. The first two messages do not affect any initiator or responder state
  1291. except for communicating the cookie. In particular, the message
  1292. sequence numbers in the first four messages will all be zero and the
  1293. message sequence numbers in the last two messages will be one. 'A'
  1294. is the SPI assigned by the initiator, while 'B' is the SPI assigned
  1295. by the responder.
  1296. Kaufman, et al. Standards Track [Page 31]
  1297. RFC 5996 IKEv2bis September 2010
  1298. An IKE implementation can implement its responder cookie generation
  1299. in such a way as to not require any saved state to recognize its
  1300. valid cookie when the second IKE_SA_INIT message arrives. The exact
  1301. algorithms and syntax used to generate cookies do not affect
  1302. interoperability and hence are not specified here. The following is
  1303. an example of how an endpoint could use cookies to implement limited
  1304. DoS protection.
  1305. A good way to do this is to set the responder cookie to be:
  1306. Cookie = <VersionIDofSecret> | Hash(Ni | IPi | SPIi | <secret>)
  1307. where <secret> is a randomly generated secret known only to the
  1308. responder and periodically changed and | indicates concatenation.
  1309. <VersionIDofSecret> should be changed whenever <secret> is
  1310. regenerated. The cookie can be recomputed when the IKE_SA_INIT
  1311. arrives the second time and compared to the cookie in the received
  1312. message. If it matches, the responder knows that the cookie was
  1313. generated since the last change to <secret> and that IPi must be the
  1314. same as the source address it saw the first time. Incorporating SPIi
  1315. into the calculation ensures that if multiple IKE SAs are being set
  1316. up in parallel they will all get different cookies (assuming the
  1317. initiator chooses unique SPIi's). Incorporating Ni in the hash
  1318. ensures that an attacker who sees only message 2 can't successfully
  1319. forge a message 3. Also, incorporating SPIi in the hash prevents an
  1320. attacker from fetching one cookie from the other end, and then
  1321. initiating many IKE_SA_INIT exchanges all with different initiator
  1322. SPIs (and perhaps port numbers) so that the responder thinks that
  1323. there are a lot of machines behind one NAT box that are all trying to
  1324. connect.
  1325. If a new value for <secret> is chosen while there are connections in
  1326. the process of being initialized, an IKE_SA_INIT might be returned
  1327. with other than the current <VersionIDofSecret>. The responder in
  1328. that case MAY reject the message by sending another response with a
  1329. new cookie or it MAY keep the old value of <secret> around for a
  1330. short time and accept cookies computed from either one. The
  1331. responder should not accept cookies indefinitely after <secret> is
  1332. changed, since that would defeat part of the DoS protection. The
  1333. responder should change the value of <secret> frequently, especially
  1334. if under attack.
  1335. When one party receives an IKE_SA_INIT request containing a cookie
  1336. whose contents do not match the value expected, that party MUST
  1337. ignore the cookie and process the message as if no cookie had been
  1338. included; usually this means sending a response containing a new
  1339. cookie. The initiator should limit the number of cookie exchanges it
  1340. tries before giving up, possibly using exponential back-off. An
  1341. Kaufman, et al. Standards Track [Page 32]
  1342. RFC 5996 IKEv2bis September 2010
  1343. attacker can forge multiple cookie responses to the initiator's
  1344. IKE_SA_INIT message, and each of those forged cookie replies will
  1345. cause two packets to be sent: one packet from the initiator to the
  1346. responder (which will reject those cookies), and one response from
  1347. responder to initiator that includes the correct cookie.
  1348. A note on terminology: the term "cookies" originates with Karn and
  1349. Simpson [PHOTURIS] in Photuris, an early proposal for key management
  1350. with IPsec, and it has persisted. The Internet Security Association
  1351. and Key Management Protocol (ISAKMP) [ISAKMP] fixed message header
  1352. includes two eight-octet fields called "cookies", and that syntax is
  1353. used by both IKEv1 and IKEv2, although in IKEv2 they are referred to
  1354. as the "IKE SPI" and there is a new separate field in a Notify
  1355. payload holding the cookie.
  1356. 2.6.1. Interaction of COOKIE and INVALID_KE_PAYLOAD
  1357. There are two common reasons why the initiator may have to retry the
  1358. IKE_SA_INIT exchange: the responder requests a cookie or wants a
  1359. different Diffie-Hellman group than was included in the KEi payload.
  1360. If the initiator receives a cookie from the responder, the initiator
  1361. needs to decide whether or not to include the cookie in only the next
  1362. retry of the IKE_SA_INIT request, or in all subsequent retries as
  1363. well.
  1364. If the initiator includes the cookie only in the next retry, one
  1365. additional round trip may be needed in some cases. An additional
  1366. round trip is needed also if the initiator includes the cookie in all
  1367. retries, but the responder does not support this. For instance, if
  1368. the responder includes the KEi payloads in cookie calculation, it
  1369. will reject the request by sending a new cookie.
  1370. If both peers support including the cookie in all retries, a slightly
  1371. shorter exchange can happen.
  1372. Initiator Responder
  1373. -----------------------------------------------------------
  1374. HDR(A,0), SAi1, KEi, Ni -->
  1375. <-- HDR(A,0), N(COOKIE)
  1376. HDR(A,0), N(COOKIE), SAi1, KEi, Ni -->
  1377. <-- HDR(A,0), N(INVALID_KE_PAYLOAD)
  1378. HDR(A,0), N(COOKIE), SAi1, KEi', Ni -->
  1379. <-- HDR(A,B), SAr1, KEr, Nr
  1380. Implementations SHOULD support this shorter exchange, but MUST NOT
  1381. fail if other implementations do not support this shorter exchange.
  1382. Kaufman, et al. Standards Track [Page 33]
  1383. RFC 5996 IKEv2bis September 2010
  1384. 2.7. Cryptographic Algorithm Negotiation
  1385. The payload type known as "SA" indicates a proposal for a set of
  1386. choices of IPsec protocols (IKE, ESP, or AH) for the SA as well as
  1387. cryptographic algorithms associated with each protocol.
  1388. An SA payload consists of one or more proposals. Each proposal
  1389. includes one protocol. Each protocol contains one or more transforms
  1390. -- each specifying a cryptographic algorithm. Each transform
  1391. contains zero or more attributes (attributes are needed only if the
  1392. Transform ID does not completely specify the cryptographic
  1393. algorithm).
  1394. This hierarchical structure was designed to efficiently encode
  1395. proposals for cryptographic suites when the number of supported
  1396. suites is large because multiple values are acceptable for multiple
  1397. transforms. The responder MUST choose a single suite, which may be
  1398. any subset of the SA proposal following the rules below.
  1399. Each proposal contains one protocol. If a proposal is accepted, the
  1400. SA response MUST contain the same protocol. The responder MUST
  1401. accept a single proposal or reject them all and return an error. The
  1402. error is given in a notification of type NO_PROPOSAL_CHOSEN.
  1403. Each IPsec protocol proposal contains one or more transforms. Each
  1404. transform contains a Transform Type. The accepted cryptographic
  1405. suite MUST contain exactly one transform of each type included in the
  1406. proposal. For example: if an ESP proposal includes transforms
  1407. ENCR_3DES, ENCR_AES w/keysize 128, ENCR_AES w/keysize 256,
  1408. AUTH_HMAC_MD5, and AUTH_HMAC_SHA, the accepted suite MUST contain one
  1409. of the ENCR_ transforms and one of the AUTH_ transforms. Thus, six
  1410. combinations are acceptable.
  1411. If an initiator proposes both normal ciphers with integrity
  1412. protection as well as combined-mode ciphers, then two proposals are
  1413. needed. One of the proposals includes the normal ciphers with the
  1414. integrity algorithms for them, and the other proposal includes all
  1415. the combined-mode ciphers without the integrity algorithms (because
  1416. combined-mode ciphers are not allowed to have any integrity algorithm
  1417. other than "none").
  1418. 2.8. Rekeying
  1419. IKE, ESP, and AH Security Associations use secret keys that should be
  1420. used only for a limited amount of time and to protect a limited
  1421. amount of data. This limits the lifetime of the entire Security
  1422. Association. When the lifetime of a Security Association expires,
  1423. the Security Association MUST NOT be used. If there is demand, new
  1424. Kaufman, et al. Standards Track [Page 34]
  1425. RFC 5996 IKEv2bis September 2010
  1426. Security Associations MAY be established. Reestablishment of
  1427. Security Associations to take the place of ones that expire is
  1428. referred to as "rekeying".
  1429. To allow for minimal IPsec implementations, the ability to rekey SAs
  1430. without restarting the entire IKE SA is optional. An implementation
  1431. MAY refuse all CREATE_CHILD_SA requests within an IKE SA. If an SA
  1432. has expired or is about to expire and rekeying attempts using the
  1433. mechanisms described here fail, an implementation MUST close the IKE
  1434. SA and any associated Child SAs and then MAY start new ones.
  1435. Implementations may wish to support in-place rekeying of SAs, since
  1436. doing so offers better performance and is likely to reduce the number
  1437. of packets lost during the transition.
  1438. To rekey a Child SA within an existing IKE SA, create a new,
  1439. equivalent SA (see Section 2.17 below), and when the new one is
  1440. established, delete the old one. Note that, when rekeying, the new
  1441. Child SA SHOULD NOT have different Traffic Selectors and algorithms
  1442. than the old one.
  1443. To rekey an IKE SA, establish a new equivalent IKE SA (see
  1444. Section 2.18 below) with the peer to whom the old IKE SA is shared
  1445. using a CREATE_CHILD_SA within the existing IKE SA. An IKE SA so
  1446. created inherits all of the original IKE SA's Child SAs, and the new
  1447. IKE SA is used for all control messages needed to maintain those
  1448. Child SAs. After the new equivalent IKE SA is created, the initiator
  1449. deletes the old IKE SA, and the Delete payload to delete itself MUST
  1450. be the last request sent over the old IKE SA.
  1451. SAs should be rekeyed proactively, i.e., the new SA should be
  1452. established before the old one expires and becomes unusable. Enough
  1453. time should elapse between the time the new SA is established and the
  1454. old one becomes unusable so that traffic can be switched over to the
  1455. new SA.
  1456. A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes
  1457. were negotiated. In IKEv2, each end of the SA is responsible for
  1458. enforcing its own lifetime policy on the SA and rekeying the SA when
  1459. necessary. If the two ends have different lifetime policies, the end
  1460. with the shorter lifetime will end up always being the one to request
  1461. the rekeying. If an SA has been inactive for a long time and if an
  1462. endpoint would not initiate the SA in the absence of traffic, the
  1463. endpoint MAY choose to close the SA instead of rekeying it when its
  1464. lifetime expires. It can also do so if there has been no traffic
  1465. since the last time the SA was rekeyed.
  1466. Kaufman, et al. Standards Track [Page 35]
  1467. RFC 5996 IKEv2bis September 2010
  1468. Note that IKEv2 deliberately allows parallel SAs with the same
  1469. Traffic Selectors between common endpoints. One of the purposes of
  1470. this is to support traffic quality of service (QoS) differences among
  1471. the SAs (see [DIFFSERVFIELD], [DIFFSERVARCH], and Section 4.1 of
  1472. [DIFFTUNNEL]). Hence unlike IKEv1, the combination of the endpoints
  1473. and the Traffic Selectors may not uniquely identify an SA between
  1474. those endpoints, so the IKEv1 rekeying heuristic of deleting SAs on
  1475. the basis of duplicate Traffic Selectors SHOULD NOT be used.
  1476. There are timing windows -- particularly in the presence of lost
  1477. packets -- where endpoints may not agree on the state of an SA. The
  1478. responder to a CREATE_CHILD_SA MUST be prepared to accept messages on
  1479. an SA before sending its response to the creation request, so there
  1480. is no ambiguity for the initiator. The initiator MAY begin sending
  1481. on an SA as soon as it processes the response. The initiator,
  1482. however, cannot receive on a newly created SA until it receives and
  1483. processes the response to its CREATE_CHILD_SA request. How, then, is
  1484. the responder to know when it is OK to send on the newly created SA?
  1485. From a technical correctness and interoperability perspective, the
  1486. responder MAY begin sending on an SA as soon as it sends its response
  1487. to the CREATE_CHILD_SA request. In some situations, however, this
  1488. could result in packets unnecessarily being dropped, so an
  1489. implementation MAY defer such sending.
  1490. The responder can be assured that the initiator is prepared to
  1491. receive messages on an SA if either (1) it has received a
  1492. cryptographically valid message on the other half of the SA pair, or
  1493. (2) the new SA rekeys an existing SA and it receives an IKE request
  1494. to close the replaced SA. When rekeying an SA, the responder
  1495. continues to send traffic on the old SA until one of those events
  1496. occurs. When establishing a new SA, the responder MAY defer sending
  1497. messages on a new SA until either it receives one or a timeout has
  1498. occurred. If an initiator receives a message on an SA for which it
  1499. has not received a response to its CREATE_CHILD_SA request, it
  1500. interprets that as a likely packet loss and retransmits the
  1501. CREATE_CHILD_SA request. An initiator MAY send a dummy ESP message
  1502. on a newly created ESP SA if it has no messages queued in order to
  1503. assure the responder that the initiator is ready to receive messages.
  1504. 2.8.1. Simultaneous Child SA Rekeying
  1505. If the two ends have the same lifetime policies, it is possible that
  1506. both will initiate a rekeying at the same time (which will result in
  1507. redundant SAs). To reduce the probability of this happening, the
  1508. timing of rekeying requests SHOULD be jittered (delayed by a random
  1509. amount of time after the need for rekeying is noticed).
  1510. Kaufman, et al. Standards Track [Page 36]
  1511. RFC 5996 IKEv2bis September 2010
  1512. This form of rekeying may temporarily result in multiple similar SAs
  1513. between the same pairs of nodes. When there are two SAs eligible to
  1514. receive packets, a node MUST accept incoming packets through either
  1515. SA. If redundant SAs are created though such a collision, the SA
  1516. created with the lowest of the four nonces used in the two exchanges
  1517. SHOULD be closed by the endpoint that created it. "Lowest" means an
  1518. octet-by-octet comparison (instead of, for instance, comparing the
  1519. nonces as large integers). In other words, start by comparing the
  1520. first octet; if they're equal, move to the next octet, and so on. If
  1521. you reach the end of one nonce, that nonce is the lower one. The
  1522. node that initiated the surviving rekeyed SA should delete the
  1523. replaced SA after the new one is established.
  1524. The following is an explanation on the impact this has on
  1525. implementations. Assume that hosts A and B have an existing Child SA
  1526. pair with SPIs (SPIa1,SPIb1), and both start rekeying it at the same
  1527. time:
  1528. Host A Host B
  1529. -------------------------------------------------------------------
  1530. send req1: N(REKEY_SA,SPIa1),
  1531. SA(..,SPIa2,..),Ni1,.. -->
  1532. <-- send req2: N(REKEY_SA,SPIb1),
  1533. SA(..,SPIb2,..),Ni2
  1534. recv req2 <--
  1535. At this point, A knows there is a simultaneous rekeying happening.
  1536. However, it cannot yet know which of the exchanges will have the
  1537. lowest nonce, so it will just note the situation and respond as
  1538. usual.
  1539. send resp2: SA(..,SPIa3,..),
  1540. Nr1,.. -->
  1541. --> recv req1
  1542. Now B also knows that simultaneous rekeying is going on. It responds
  1543. as usual.
  1544. <-- send resp1: SA(..,SPIb3,..),
  1545. Nr2,..
  1546. recv resp1 <--
  1547. --> recv resp2
  1548. At this point, there are three Child SA pairs between A and B (the
  1549. old one and two new ones). A and B can now compare the nonces.
  1550. Suppose that the lowest nonce was Nr1 in message resp2; in this case,
  1551. B (the sender of req2) deletes the redundant new SA, and A (the node
  1552. that initiated the surviving rekeyed SA), deletes the old one.
  1553. Kaufman, et al. Standards Track [Page 37]
  1554. RFC 5996 IKEv2bis September 2010
  1555. send req3: D(SPIa1) -->
  1556. <-- send req4: D(SPIb2)
  1557. --> recv req3
  1558. <-- send resp3: D(SPIb1)
  1559. recv req4 <--
  1560. send resp4: D(SPIa3) -->
  1561. The rekeying is now finished.
  1562. However, there is a second possible sequence of events that can
  1563. happen if some packets are lost in the network, resulting in
  1564. retransmissions. The rekeying begins as usual, but A's first packet
  1565. (req1) is lost.
  1566. Host A Host B
  1567. -------------------------------------------------------------------
  1568. send req1: N(REKEY_SA,SPIa1),
  1569. SA(..,SPIa2,..),
  1570. Ni1,.. --> (lost)
  1571. <-- send req2: N(REKEY_SA,SPIb1),
  1572. SA(..,SPIb2,..),Ni2
  1573. recv req2 <--
  1574. send resp2: SA(..,SPIa3,..),
  1575. Nr1,.. -->
  1576. --> recv resp2
  1577. <-- send req3: D(SPIb1)
  1578. recv req3 <--
  1579. send resp3: D(SPIa1) -->
  1580. --> recv resp3
  1581. From B's point of view, the rekeying is now completed, and since it
  1582. has not yet received A's req1, it does not even know that there was
  1583. simultaneous rekeying. However, A will continue retransmitting the
  1584. message, and eventually it will reach B.
  1585. resend req1 -->
  1586. --> recv req1
  1587. To B, it looks like A is trying to rekey an SA that no longer exists;
  1588. thus, B responds to the request with something non-fatal such as
  1589. CHILD_SA_NOT_FOUND.
  1590. <-- send resp1: N(CHILD_SA_NOT_FOUND)
  1591. recv resp1 <--
  1592. When A receives this error, it already knows there was simultaneous
  1593. rekeying, so it can ignore the error message.
  1594. Kaufman, et al. Standards Track [Page 38]
  1595. RFC 5996 IKEv2bis September 2010
  1596. 2.8.2. Simultaneous IKE SA Rekeying
  1597. Probably the most complex case occurs when both peers try to rekey
  1598. the IKE_SA at the same time. Basically, the text in Section 2.8
  1599. applies to this case as well; however, it is important to ensure that
  1600. the Child SAs are inherited by the correct IKE_SA.
  1601. The case where both endpoints notice the simultaneous rekeying works
  1602. the same way as with Child SAs. After the CREATE_CHILD_SA exchanges,
  1603. three IKE SAs exist between A and B: the old IKE SA and two new IKE
  1604. SAs. The new IKE SA containing the lowest nonce SHOULD be deleted by
  1605. the node that created it, and the other surviving new IKE SA MUST
  1606. inherit all the Child SAs.
  1607. In addition to normal simultaneous rekeying cases, there is a special
  1608. case where one peer finishes its rekey before it even notices that
  1609. other peer is doing a rekey. If only one peer detects a simultaneous
  1610. rekey, redundant SAs are not created. In this case, when the peer
  1611. that did not notice the simultaneous rekey gets the request to rekey
  1612. the IKE SA that it has already successfully rekeyed, it SHOULD return
  1613. TEMPORARY_FAILURE because it is an IKE SA that it is currently trying
  1614. to close (whether or not it has already sent the delete notification
  1615. for the SA). If the peer that did notice the simultaneous rekey gets
  1616. the delete request from the other peer for the old IKE SA, it knows
  1617. that the other peer did not detect the simultaneous rekey, and the
  1618. first peer can forget its own rekey attempt.
  1619. Host A Host B
  1620. -------------------------------------------------------------------
  1621. send req1:
  1622. SA(..,SPIa1,..),Ni1,.. -->
  1623. <-- send req2: SA(..,SPIb1,..),Ni2,..
  1624. --> recv req1
  1625. <-- send resp1: SA(..,SPIb2,..),Nr2,..
  1626. recv resp1 <--
  1627. send req3: D() -->
  1628. --> recv req3
  1629. At this point, host B sees a request to close the IKE_SA. There's
  1630. not much more to do than to reply as usual. However, at this point
  1631. host B should stop retransmitting req2, since once host A receives
  1632. resp3, it will delete all the state associated with the old IKE_SA
  1633. and will not be able to reply to it.
  1634. <-- send resp3: ()
  1635. The TEMPORARY_FAILURE notification was not included in RFC 4306, and
  1636. support of the TEMPORARY_FAILURE notification is not negotiated.
  1637. Kaufman, et al. Standards Track [Page 39]
  1638. RFC 5996 IKEv2bis September 2010
  1639. Thus, older peers that implement RFC 4306 but not this document may
  1640. receive these notifications. In that case, they will treat it the
  1641. same as any other unknown error notification, and will stop the
  1642. exchange. Because the other peer has already rekeyed the exchange,
  1643. doing so does not have any ill effects.
  1644. 2.8.3. Rekeying the IKE SA versus Reauthentication
  1645. Rekeying the IKE SA and reauthentication are different concepts in
  1646. IKEv2. Rekeying the IKE SA establishes new keys for the IKE SA and
  1647. resets the Message ID counters, but it does not authenticate the
  1648. parties again (no AUTH or EAP payloads are involved).
  1649. Although rekeying the IKE SA may be important in some environments,
  1650. reauthentication (the verification that the parties still have access
  1651. to the long-term credentials) is often more important.
  1652. IKEv2 does not have any special support for reauthentication.
  1653. Reauthentication is done by creating a new IKE SA from scratch (using
  1654. IKE_SA_INIT/IKE_AUTH exchanges, without any REKEY_SA Notify
  1655. payloads), creating new Child SAs within the new IKE SA (without
  1656. REKEY_SA Notify payloads), and finally deleting the old IKE SA (which
  1657. deletes the old Child SAs as well).
  1658. This means that reauthentication also establishes new keys for the
  1659. IKE SA and Child SAs. Therefore, while rekeying can be performed
  1660. more often than reauthentication, the situation where "authentication
  1661. lifetime" is shorter than "key lifetime" does not make sense.
  1662. While creation of a new IKE SA can be initiated by either party
  1663. (initiator or responder in the original IKE SA), the use of EAP
  1664. and/or Configuration payloads means in practice that reauthentication
  1665. has to be initiated by the same party as the original IKE SA. IKEv2
  1666. does not currently allow the responder to request reauthentication in
  1667. this case; however, there are extensions that add this functionality
  1668. such as [REAUTH].
  1669. 2.9. Traffic Selector Negotiation
  1670. When an RFC4301-compliant IPsec subsystem receives an IP packet that
  1671. matches a "protect" selector in its Security Policy Database (SPD),
  1672. the subsystem protects that packet with IPsec. When no SA exists
  1673. yet, it is the task of IKE to create it. Maintenance of a system's
  1674. SPD is outside the scope of IKE, although some implementations might
  1675. update their SPD in connection with the running of IKE (for an
  1676. example scenario, see Section 1.1.3).
  1677. Kaufman, et al. Standards Track [Page 40]
  1678. RFC 5996 IKEv2bis September 2010
  1679. Traffic Selector (TS) payloads allow endpoints to communicate some of
  1680. the information from their SPD to their peers. These must be
  1681. communicated to IKE from the SPD (for example, the PF_KEY API [PFKEY]
  1682. uses the SADB_ACQUIRE message). TS payloads specify the selection
  1683. criteria for packets that will be forwarded over the newly set up SA.
  1684. This can serve as a consistency check in some scenarios to assure
  1685. that the SPDs are consistent. In others, it guides the dynamic
  1686. update of the SPD.
  1687. Two TS payloads appear in each of the messages in the exchange that
  1688. creates a Child SA pair. Each TS payload contains one or more
  1689. Traffic Selectors. Each Traffic Selector consists of an address
  1690. range (IPv4 or IPv6), a port range, and an IP protocol ID.
  1691. The first of the two TS payloads is known as TSi (Traffic Selector-
  1692. initiator). The second is known as TSr (Traffic Selector-responder).
  1693. TSi specifies the source address of traffic forwarded from (or the
  1694. destination address of traffic forwarded to) the initiator of the
  1695. Child SA pair. TSr specifies the destination address of the traffic
  1696. forwarded to (or the source address of the traffic forwarded from)
  1697. the responder of the Child SA pair. For example, if the original
  1698. initiator requests the creation of a Child SA pair, and wishes to
  1699. tunnel all traffic from subnet 198.51.100.* on the initiator's side
  1700. to subnet 192.0.2.* on the responder's side, the initiator would
  1701. include a single Traffic Selector in each TS payload. TSi would
  1702. specify the address range (198.51.100.0 - 198.51.100.255) and TSr
  1703. would specify the address range (192.0.2.0 - 192.0.2.255). Assuming
  1704. that proposal was acceptable to the responder, it would send
  1705. identical TS payloads back.
  1706. IKEv2 allows the responder to choose a subset of the traffic proposed
  1707. by the initiator. This could happen when the configurations of the
  1708. two endpoints are being updated but only one end has received the new
  1709. information. Since the two endpoints may be configured by different
  1710. people, the incompatibility may persist for an extended period even
  1711. in the absence of errors. It also allows for intentionally different
  1712. configurations, as when one end is configured to tunnel all addresses
  1713. and depends on the other end to have the up-to-date list.
  1714. When the responder chooses a subset of the traffic proposed by the
  1715. initiator, it narrows the Traffic Selectors to some subset of the
  1716. initiator's proposal (provided the set does not become the null set).
  1717. If the type of Traffic Selector proposed is unknown, the responder
  1718. ignores that Traffic Selector, so that the unknown type is not
  1719. returned in the narrowed set.
  1720. Kaufman, et al. Standards Track [Page 41]
  1721. RFC 5996 IKEv2bis September 2010
  1722. To enable the responder to choose the appropriate range in this case,
  1723. if the initiator has requested the SA due to a data packet, the
  1724. initiator SHOULD include as the first Traffic Selector in each of TSi
  1725. and TSr a very specific Traffic Selector including the addresses in
  1726. the packet triggering the request. In the example, the initiator
  1727. would include in TSi two Traffic Selectors: the first containing the
  1728. address range (198.51.100.43 - 198.51.100.43) and the source port and
  1729. IP protocol from the packet and the second containing (198.51.100.0 -
  1730. 198.51.100.255) with all ports and IP protocols. The initiator would
  1731. similarly include two Traffic Selectors in TSr. If the initiator
  1732. creates the Child SA pair not in response to an arriving packet, but
  1733. rather, say, upon startup, then there may be no specific addresses
  1734. the initiator prefers for the initial tunnel over any other. In that
  1735. case, the first values in TSi and TSr can be ranges rather than
  1736. specific values.
  1737. The responder performs the narrowing as follows:
  1738. o If the responder's policy does not allow it to accept any part of
  1739. the proposed Traffic Selectors, it responds with a TS_UNACCEPTABLE
  1740. Notify message.
  1741. o If the responder's policy allows the entire set of traffic covered
  1742. by TSi and TSr, no narrowing is necessary, and the responder can
  1743. return the same TSi and TSr values.
  1744. o If the responder's policy allows it to accept the first selector
  1745. of TSi and TSr, then the responder MUST narrow the Traffic
  1746. Selectors to a subset that includes the initiator's first choices.
  1747. In this example above, the responder might respond with TSi being
  1748. (198.51.100.43 - 198.51.100.43) with all ports and IP protocols.
  1749. o If the responder's policy does not allow it to accept the first
  1750. selector of TSi and TSr, the responder narrows to an acceptable
  1751. subset of TSi and TSr.
  1752. When narrowing is done, there may be several subsets that are
  1753. acceptable but their union is not. In this case, the responder
  1754. arbitrarily chooses one of them, and MAY include an
  1755. ADDITIONAL_TS_POSSIBLE notification in the response. The
  1756. ADDITIONAL_TS_POSSIBLE notification asserts that the responder
  1757. narrowed the proposed Traffic Selectors but that other Traffic
  1758. Selectors would also have been acceptable, though only in a separate
  1759. SA. There is no data associated with this Notify type. This case
  1760. will occur only when the initiator and responder are configured
  1761. differently from one another. If the initiator and responder agree
  1762. on the granularity of tunnels, the initiator will never request a
  1763. tunnel wider than the responder will accept.
  1764. Kaufman, et al. Standards Track [Page 42]
  1765. RFC 5996 IKEv2bis September 2010
  1766. It is possible for the responder's policy to contain multiple smaller
  1767. ranges, all encompassed by the initiator's Traffic Selector, and with
  1768. the responder's policy being that each of those ranges should be sent
  1769. over a different SA. Continuing the example above, the responder
  1770. might have a policy of being willing to tunnel those addresses to and
  1771. from the initiator, but might require that each address pair be on a
  1772. separately negotiated Child SA. If the initiator didn't generate its
  1773. request based on the packet, but (for example) upon startup, there
  1774. would not be the very specific first Traffic Selectors helping the
  1775. responder to select the correct range. There would be no way for the
  1776. responder to determine which pair of addresses should be included in
  1777. this tunnel, and it would have to make a guess or reject the request
  1778. with a SINGLE_PAIR_REQUIRED Notify message.
  1779. The SINGLE_PAIR_REQUIRED error indicates that a CREATE_CHILD_SA
  1780. request is unacceptable because its sender is only willing to accept
  1781. Traffic Selectors specifying a single pair of addresses. The
  1782. requestor is expected to respond by requesting an SA for only the
  1783. specific traffic it is trying to forward.
  1784. Few implementations will have policies that require separate SAs for
  1785. each address pair. Because of this, if only some parts of the TSi
  1786. and TSr proposed by the initiator are acceptable to the responder,
  1787. responders SHOULD narrow the selectors to an acceptable subset rather
  1788. than use SINGLE_PAIR_REQUIRED.
  1789. 2.9.1. Traffic Selectors Violating Own Policy
  1790. When creating a new SA, the initiator needs to avoid proposing
  1791. Traffic Selectors that violate its own policy. If this rule is not
  1792. followed, valid traffic may be dropped. If you use decorrelated
  1793. policies from [IPSECARCH], this kind of policy violations cannot
  1794. happen.
  1795. This is best illustrated by an example. Suppose that host A has a
  1796. policy whose effect is that traffic to 198.51.100.66 is sent via host
  1797. B encrypted using AES, and traffic to all other hosts in
  1798. 198.51.100.0/24 is also sent via B, but must use 3DES. Suppose also
  1799. that host B accepts any combination of AES and 3DES.
  1800. If host A now proposes an SA that uses 3DES, and includes TSr
  1801. containing (198.51.100.0-198.51.100.255), this will be accepted by
  1802. host B. Now, host B can also use this SA to send traffic from
  1803. 198.51.100.66, but those packets will be dropped by A since it
  1804. requires the use of AES for this traffic. Even if host A creates a
  1805. new SA only for 198.51.100.66 that uses AES, host B may freely
  1806. continue to use the first SA for the traffic. In this situation,
  1807. Kaufman, et al. Standards Track [Page 43]
  1808. RFC 5996 IKEv2bis September 2010
  1809. when proposing the SA, host A should have followed its own policy,
  1810. and included a TSr containing ((198.51.100.0-
  1811. 198.51.100.65),(198.51.100.67-198.51.100.255)) instead.
  1812. In general, if (1) the initiator makes a proposal "for traffic X
  1813. (TSi/TSr), do SA", and (2) for some subset X' of X, the initiator
  1814. does not actually accept traffic X' with SA, and (3) the initiator
  1815. would be willing to accept traffic X' with some SA' (!=SA), valid
  1816. traffic can be unnecessarily dropped since the responder can apply
  1817. either SA or SA' to traffic X'.
  1818. 2.10. Nonces
  1819. The IKE_SA_INIT messages each contain a nonce. These nonces are used
  1820. as inputs to cryptographic functions. The CREATE_CHILD_SA request
  1821. and the CREATE_CHILD_SA response also contain nonces. These nonces
  1822. are used to add freshness to the key derivation technique used to
  1823. obtain keys for Child SA, and to ensure creation of strong
  1824. pseudorandom bits from the Diffie-Hellman key. Nonces used in IKEv2
  1825. MUST be randomly chosen, MUST be at least 128 bits in size, and MUST
  1826. be at least half the key size of the negotiated pseudorandom function
  1827. (PRF). However, the initiator chooses the nonce before the outcome
  1828. of the negotiation is known. Because of that, the nonce has to be
  1829. long enough for all the PRFs being proposed. If the same random
  1830. number source is used for both keys and nonces, care must be taken to
  1831. ensure that the latter use does not compromise the former.
  1832. 2.11. Address and Port Agility
  1833. IKE runs over UDP ports 500 and 4500, and implicitly sets up ESP and
  1834. AH associations for the same IP addresses over which it runs. The IP
  1835. addresses and ports in the outer header are, however, not themselves
  1836. cryptographically protected, and IKE is designed to work even through
  1837. Network Address Translation (NAT) boxes. An implementation MUST
  1838. accept incoming requests even if the source port is not 500 or 4500,
  1839. and MUST respond to the address and port from which the request was
  1840. received. It MUST specify the address and port at which the request
  1841. was received as the source address and port in the response. IKE
  1842. functions identically over IPv4 or IPv6.
  1843. 2.12. Reuse of Diffie-Hellman Exponentials
  1844. IKE generates keying material using an ephemeral Diffie-Hellman
  1845. exchange in order to gain the property of "perfect forward secrecy".
  1846. This means that once a connection is closed and its corresponding
  1847. keys are forgotten, even someone who has recorded all of the data
  1848. from the connection and gets access to all of the long-term keys of
  1849. Kaufman, et al. Standards Track [Page 44]
  1850. RFC 5996 IKEv2bis September 2010
  1851. the two endpoints cannot reconstruct the keys used to protect the
  1852. conversation without doing a brute force search of the session key
  1853. space.
  1854. Achieving perfect forward secrecy requires that when a connection is
  1855. closed, each endpoint MUST forget not only the keys used by the
  1856. connection but also any information that could be used to recompute
  1857. those keys.
  1858. Because computing Diffie-Hellman exponentials is computationally
  1859. expensive, an endpoint may find it advantageous to reuse those
  1860. exponentials for multiple connection setups. There are several
  1861. reasonable strategies for doing this. An endpoint could choose a new
  1862. exponential only periodically though this could result in less-than-
  1863. perfect forward secrecy if some connection lasts for less than the
  1864. lifetime of the exponential. Or it could keep track of which
  1865. exponential was used for each connection and delete the information
  1866. associated with the exponential only when some corresponding
  1867. connection was closed. This would allow the exponential to be reused
  1868. without losing perfect forward secrecy at the cost of maintaining
  1869. more state.
  1870. Whether and when to reuse Diffie-Hellman exponentials are private
  1871. decisions in the sense that they will not affect interoperability.
  1872. An implementation that reuses exponentials MAY choose to remember the
  1873. exponential used by the other endpoint on past exchanges and if one
  1874. is reused to avoid the second half of the calculation. See [REUSE]
  1875. for a security analysis of this practice and for additional security
  1876. considerations when reusing ephemeral Diffie-Hellman keys.
  1877. 2.13. Generating Keying Material
  1878. In the context of the IKE SA, four cryptographic algorithms are
  1879. negotiated: an encryption algorithm, an integrity protection
  1880. algorithm, a Diffie-Hellman group, and a pseudorandom function (PRF).
  1881. The PRF is used for the construction of keying material for all of
  1882. the cryptographic algorithms used in both the IKE SA and the Child
  1883. SAs.
  1884. We assume that each encryption algorithm and integrity protection
  1885. algorithm uses a fixed-size key and that any randomly chosen value of
  1886. that fixed size can serve as an appropriate key. For algorithms that
  1887. accept a variable-length key, a fixed key size MUST be specified as
  1888. part of the cryptographic transform negotiated (see Section 3.3.5 for
  1889. the definition of the Key Length transform attribute). For
  1890. algorithms for which not all values are valid keys (such as DES or
  1891. 3DES with key parity), the algorithm by which keys are derived from
  1892. arbitrary values MUST be specified by the cryptographic transform.
  1893. Kaufman, et al. Standards Track [Page 45]
  1894. RFC 5996 IKEv2bis September 2010
  1895. For integrity protection functions based on Hashed Message
  1896. Authentication Code (HMAC), the fixed key size is the size of the
  1897. output of the underlying hash function.
  1898. It is assumed that PRFs accept keys of any length, but have a
  1899. preferred key size. The preferred key size MUST be used as the
  1900. length of SK_d, SK_pi, and SK_pr (see Section 2.14). For PRFs based
  1901. on the HMAC construction, the preferred key size is equal to the
  1902. length of the output of the underlying hash function. Other types of
  1903. PRFs MUST specify their preferred key size.
  1904. Keying material will always be derived as the output of the
  1905. negotiated PRF algorithm. Since the amount of keying material needed
  1906. may be greater than the size of the output of the PRF, the PRF is
  1907. used iteratively. The term "prf+" describes a function that outputs
  1908. a pseudorandom stream based on the inputs to a pseudorandom function
  1909. called "prf".
  1910. In the following, | indicates concatenation. prf+ is defined as:
  1911. prf+ (K,S) = T1 | T2 | T3 | T4 | ...
  1912. where:
  1913. T1 = prf (K, S | 0x01)
  1914. T2 = prf (K, T1 | S | 0x02)
  1915. T3 = prf (K, T2 | S | 0x03)
  1916. T4 = prf (K, T3 | S | 0x04)
  1917. ...
  1918. This continues until all the material needed to compute all required
  1919. keys has been output from prf+. The keys are taken from the output
  1920. string without regard to boundaries (e.g., if the required keys are a
  1921. 256-bit Advanced Encryption Standard (AES) key and a 160-bit HMAC
  1922. key, and the prf function generates 160 bits, the AES key will come
  1923. from T1 and the beginning of T2, while the HMAC key will come from
  1924. the rest of T2 and the beginning of T3).
  1925. The constant concatenated to the end of each prf function is a single
  1926. octet. The prf+ function is not defined beyond 255 times the size of
  1927. the prf function output.
  1928. 2.14. Generating Keying Material for the IKE SA
  1929. The shared keys are computed as follows. A quantity called SKEYSEED
  1930. is calculated from the nonces exchanged during the IKE_SA_INIT
  1931. exchange and the Diffie-Hellman shared secret established during that
  1932. exchange. SKEYSEED is used to calculate seven other secrets: SK_d
  1933. used for deriving new keys for the Child SAs established with this
  1934. Kaufman, et al. Standards Track [Page 46]
  1935. RFC 5996 IKEv2bis September 2010
  1936. IKE SA; SK_ai and SK_ar used as a key to the integrity protection
  1937. algorithm for authenticating the component messages of subsequent
  1938. exchanges; SK_ei and SK_er used for encrypting (and of course
  1939. decrypting) all subsequent exchanges; and SK_pi and SK_pr, which are
  1940. used when generating an AUTH payload. The lengths of SK_d, SK_pi,
  1941. and SK_pr MUST be the preferred key length of the PRF agreed upon.
  1942. SKEYSEED and its derivatives are computed as follows:
  1943. SKEYSEED = prf(Ni | Nr, g^ir)
  1944. {SK_d | SK_ai | SK_ar | SK_ei | SK_er | SK_pi | SK_pr }
  1945. = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr )
  1946. (indicating that the quantities SK_d, SK_ai, SK_ar, SK_ei, SK_er,
  1947. SK_pi, and SK_pr are taken in order from the generated bits of the
  1948. prf+). g^ir is the shared secret from the ephemeral Diffie-Hellman
  1949. exchange. g^ir is represented as a string of octets in big endian
  1950. order padded with zeros if necessary to make it the length of the
  1951. modulus. Ni and Nr are the nonces, stripped of any headers. For
  1952. historical backward-compatibility reasons, there are two PRFs that
  1953. are treated specially in this calculation. If the negotiated PRF is
  1954. AES-XCBC-PRF-128 [AESXCBCPRF128] or AES-CMAC-PRF-128 [AESCMACPRF128],
  1955. only the first 64 bits of Ni and the first 64 bits of Nr are used in
  1956. calculating SKEYSEED, but all the bits are used for input to the prf+
  1957. function.
  1958. The two directions of traffic flow use different keys. The keys used
  1959. to protect messages from the original initiator are SK_ai and SK_ei.
  1960. The keys used to protect messages in the other direction are SK_ar
  1961. and SK_er.
  1962. 2.15. Authentication of the IKE SA
  1963. When not using extensible authentication (see Section 2.16), the
  1964. peers are authenticated by having each sign (or MAC using a padded
  1965. shared secret as the key, as described later in this section) a block
  1966. of data. In these calculations, IDi' and IDr' are the entire ID
  1967. payloads excluding the fixed header. For the responder, the octets
  1968. to be signed start with the first octet of the first SPI in the
  1969. header of the second message (IKE_SA_INIT response) and end with the
  1970. last octet of the last payload in the second message. Appended to
  1971. this (for the purposes of computing the signature) are the
  1972. initiator's nonce Ni (just the value, not the payload containing it),
  1973. and the value prf(SK_pr, IDr'). Note that neither the nonce Ni nor
  1974. the value prf(SK_pr, IDr') are transmitted. Similarly, the initiator
  1975. signs the first message (IKE_SA_INIT request), starting with the
  1976. first octet of the first SPI in the header and ending with the last
  1977. Kaufman, et al. Standards Track [Page 47]
  1978. RFC 5996 IKEv2bis September 2010
  1979. octet of the last payload. Appended to this (for purposes of
  1980. computing the signature) are the responder's nonce Nr, and the value
  1981. prf(SK_pi, IDi'). It is critical to the security of the exchange
  1982. that each side sign the other side's nonce.
  1983. The initiator's signed octets can be described as:
  1984. InitiatorSignedOctets = RealMessage1 | NonceRData | MACedIDForI
  1985. GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR
  1986. RealIKEHDR = SPIi | SPIr | . . . | Length
  1987. RealMessage1 = RealIKEHDR | RestOfMessage1
  1988. NonceRPayload = PayloadHeader | NonceRData
  1989. InitiatorIDPayload = PayloadHeader | RestOfInitIDPayload
  1990. RestOfInitIDPayload = IDType | RESERVED | InitIDData
  1991. MACedIDForI = prf(SK_pi, RestOfInitIDPayload)
  1992. The responder's signed octets can be described as:
  1993. ResponderSignedOctets = RealMessage2 | NonceIData | MACedIDForR
  1994. GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR
  1995. RealIKEHDR = SPIi | SPIr | . . . | Length
  1996. RealMessage2 = RealIKEHDR | RestOfMessage2
  1997. NonceIPayload = PayloadHeader | NonceIData
  1998. ResponderIDPayload = PayloadHeader | RestOfRespIDPayload
  1999. RestOfRespIDPayload = IDType | RESERVED | RespIDData
  2000. MACedIDForR = prf(SK_pr, RestOfRespIDPayload)
  2001. Note that all of the payloads are included under the signature,
  2002. including any payload types not defined in this document. If the
  2003. first message of the exchange is sent multiple times (such as with a
  2004. responder cookie and/or a different Diffie-Hellman group), it is the
  2005. latest version of the message that is signed.
  2006. Optionally, messages 3 and 4 MAY include a certificate, or
  2007. certificate chain providing evidence that the key used to compute a
  2008. digital signature belongs to the name in the ID payload. The
  2009. signature or MAC will be computed using algorithms dictated by the
  2010. type of key used by the signer, and specified by the Auth Method
  2011. field in the Authentication payload. There is no requirement that
  2012. the initiator and responder sign with the same cryptographic
  2013. algorithms. The choice of cryptographic algorithms depends on the
  2014. type of key each has. In particular, the initiator may be using a
  2015. shared key while the responder may have a public signature key and
  2016. certificate. It will commonly be the case (but it is not required)
  2017. that, if a shared secret is used for authentication, the same key is
  2018. used in both directions.
  2019. Kaufman, et al. Standards Track [Page 48]
  2020. RFC 5996 IKEv2bis September 2010
  2021. Note that it is a common but typically insecure practice to have a
  2022. shared key derived solely from a user-chosen password without
  2023. incorporating another source of randomness. This is typically
  2024. insecure because user-chosen passwords are unlikely to have
  2025. sufficient unpredictability to resist dictionary attacks and these
  2026. attacks are not prevented in this authentication method.
  2027. (Applications using password-based authentication for bootstrapping
  2028. and IKE SA should use the authentication method in Section 2.16,
  2029. which is designed to prevent off-line dictionary attacks.) The pre-
  2030. shared key needs to contain as much unpredictability as the strongest
  2031. key being negotiated. In the case of a pre-shared key, the AUTH
  2032. value is computed as:
  2033. For the initiator:
  2034. AUTH = prf( prf(Shared Secret, "Key Pad for IKEv2"),
  2035. <InitiatorSignedOctets>)
  2036. For the responder:
  2037. AUTH = prf( prf(Shared Secret, "Key Pad for IKEv2"),
  2038. <ResponderSignedOctets>)
  2039. where the string "Key Pad for IKEv2" is 17 ASCII characters without
  2040. null termination. The shared secret can be variable length. The pad
  2041. string is added so that if the shared secret is derived from a
  2042. password, the IKE implementation need not store the password in
  2043. cleartext, but rather can store the value prf(Shared Secret,"Key Pad
  2044. for IKEv2"), which could not be used as a password equivalent for
  2045. protocols other than IKEv2. As noted above, deriving the shared
  2046. secret from a password is not secure. This construction is used
  2047. because it is anticipated that people will do it anyway. The
  2048. management interface by which the shared secret is provided MUST
  2049. accept ASCII strings of at least 64 octets and MUST NOT add a null
  2050. terminator before using them as shared secrets. It MUST also accept
  2051. a hex encoding of the shared secret. The management interface MAY
  2052. accept other encodings if the algorithm for translating the encoding
  2053. to a binary string is specified.
  2054. There are two types of EAP authentication (described in
  2055. Section 2.16), and each type uses different values in the AUTH
  2056. computations shown above. If the EAP method is key-generating,
  2057. substitute master session key (MSK) for the shared secret in the
  2058. computation. For non-key-generating methods, substitute SK_pi and
  2059. SK_pr, respectively, for the shared secret in the two AUTH
  2060. computations.
  2061. Kaufman, et al. Standards Track [Page 49]
  2062. RFC 5996 IKEv2bis September 2010
  2063. 2.16. Extensible Authentication Protocol Methods
  2064. In addition to authentication using public key signatures and shared
  2065. secrets, IKE supports authentication using methods defined in RFC
  2066. 3748 [EAP]. Typically, these methods are asymmetric (designed for a
  2067. user authenticating to a server), and they may not be mutual. For
  2068. this reason, these protocols are typically used to authenticate the
  2069. initiator to the responder and MUST be used in conjunction with a
  2070. public-key-signature-based authentication of the responder to the
  2071. initiator. These methods are often associated with mechanisms
  2072. referred to as "Legacy Authentication" mechanisms.
  2073. While this document references [EAP] with the intent that new methods
  2074. can be added in the future without updating this specification, some
  2075. simpler variations are documented here. [EAP] defines an
  2076. authentication protocol requiring a variable number of messages.
  2077. Extensible Authentication is implemented in IKE as additional
  2078. IKE_AUTH exchanges that MUST be completed in order to initialize the
  2079. IKE SA.
  2080. An initiator indicates a desire to use EAP by leaving out the AUTH
  2081. payload from the first message in the IKE_AUTH exchange. (Note that
  2082. the AUTH payload is required for non-EAP authentication, and is thus
  2083. not marked as optional in the rest of this document.) By including
  2084. an IDi payload but not an AUTH payload, the initiator has declared an
  2085. identity but has not proven it. If the responder is willing to use
  2086. an EAP method, it will place an Extensible Authentication Protocol
  2087. (EAP) payload in the response of the IKE_AUTH exchange and defer
  2088. sending SAr2, TSi, and TSr until initiator authentication is complete
  2089. in a subsequent IKE_AUTH exchange. In the case of a minimal EAP
  2090. method, the initial SA establishment will appear as follows:
  2091. Initiator Responder
  2092. -------------------------------------------------------------------
  2093. HDR, SAi1, KEi, Ni -->
  2094. <-- HDR, SAr1, KEr, Nr, [CERTREQ]
  2095. HDR, SK {IDi, [CERTREQ,]
  2096. [IDr,] SAi2,
  2097. TSi, TSr} -->
  2098. <-- HDR, SK {IDr, [CERT,] AUTH,
  2099. EAP }
  2100. HDR, SK {EAP} -->
  2101. <-- HDR, SK {EAP (success)}
  2102. HDR, SK {AUTH} -->
  2103. <-- HDR, SK {AUTH, SAr2, TSi, TSr }
  2104. Kaufman, et al. Standards Track [Page 50]
  2105. RFC 5996 IKEv2bis September 2010
  2106. As described in Section 2.2, when EAP is used, each pair of IKE SA
  2107. initial setup messages will have their message numbers incremented;
  2108. the first pair of AUTH messages will have an ID of 1, the second will
  2109. be 2, and so on.
  2110. For EAP methods that create a shared key as a side effect of
  2111. authentication, that shared key MUST be used by both the initiator
  2112. and responder to generate AUTH payloads in messages 7 and 8 using the
  2113. syntax for shared secrets specified in Section 2.15. The shared key
  2114. from EAP is the field from the EAP specification named MSK. This
  2115. shared key generated during an IKE exchange MUST NOT be used for any
  2116. other purpose.
  2117. EAP methods that do not establish a shared key SHOULD NOT be used, as
  2118. they are subject to a number of man-in-the-middle attacks [EAPMITM]
  2119. if these EAP methods are used in other protocols that do not use a
  2120. server-authenticated tunnel. Please see the Security Considerations
  2121. section for more details. If EAP methods that do not generate a
  2122. shared key are used, the AUTH payloads in messages 7 and 8 MUST be
  2123. generated using SK_pi and SK_pr, respectively.
  2124. The initiator of an IKE SA using EAP needs to be capable of extending
  2125. the initial protocol exchange to at least ten IKE_AUTH exchanges in
  2126. the event the responder sends notification messages and/or retries
  2127. the authentication prompt. Once the protocol exchange defined by the
  2128. chosen EAP authentication method has successfully terminated, the
  2129. responder MUST send an EAP payload containing the Success message.
  2130. Similarly, if the authentication method has failed, the responder
  2131. MUST send an EAP payload containing the Failure message. The
  2132. responder MAY at any time terminate the IKE exchange by sending an
  2133. EAP payload containing the Failure message.
  2134. Following such an extended exchange, the EAP AUTH payloads MUST be
  2135. included in the two messages following the one containing the EAP
  2136. Success message.
  2137. When the initiator authentication uses EAP, it is possible that the
  2138. contents of the IDi payload is used only for Authentication,
  2139. Authorization, and Accounting (AAA) routing purposes and selecting
  2140. which EAP method to use. This value may be different from the
  2141. identity authenticated by the EAP method. It is important that
  2142. policy lookups and access control decisions use the actual
  2143. authenticated identity. Often the EAP server is implemented in a
  2144. separate AAA server that communicates with the IKEv2 responder. In
  2145. this case, the authenticated identity, if different from that in the
  2146. IDi payload, has to be sent from the AAA server to the IKEv2
  2147. responder.
  2148. Kaufman, et al. Standards Track [Page 51]
  2149. RFC 5996 IKEv2bis September 2010
  2150. 2.17. Generating Keying Material for Child SAs
  2151. A single Child SA is created by the IKE_AUTH exchange, and additional
  2152. Child SAs can optionally be created in CREATE_CHILD_SA exchanges.
  2153. Keying material for them is generated as follows:
  2154. KEYMAT = prf+(SK_d, Ni | Nr)
  2155. Where Ni and Nr are the nonces from the IKE_SA_INIT exchange if this
  2156. request is the first Child SA created or the fresh Ni and Nr from the
  2157. CREATE_CHILD_SA exchange if this is a subsequent creation.
  2158. For CREATE_CHILD_SA exchanges including an optional Diffie-Hellman
  2159. exchange, the keying material is defined as:
  2160. KEYMAT = prf+(SK_d, g^ir (new) | Ni | Nr )
  2161. where g^ir (new) is the shared secret from the ephemeral Diffie-
  2162. Hellman exchange of this CREATE_CHILD_SA exchange (represented as an
  2163. octet string in big endian order padded with zeros in the high-order
  2164. bits if necessary to make it the length of the modulus).
  2165. A single CHILD_SA negotiation may result in multiple Security
  2166. Associations. ESP and AH SAs exist in pairs (one in each direction),
  2167. so two SAs are created in a single Child SA negotiation for them.
  2168. Furthermore, Child SA negotiation may include some future IPsec
  2169. protocol(s) in addition to, or instead of, ESP or AH (for example,
  2170. ROHC_INTEG as described in [ROHCV2]). In any case, keying material
  2171. for each Child SA MUST be taken from the expanded KEYMAT using the
  2172. following rules:
  2173. o All keys for SAs carrying data from the initiator to the responder
  2174. are taken before SAs going from the responder to the initiator.
  2175. o If multiple IPsec protocols are negotiated, keying material for
  2176. each Child SA is taken in the order in which the protocol headers
  2177. will appear in the encapsulated packet.
  2178. o If an IPsec protocol requires multiple keys, the order in which
  2179. they are taken from the SA's keying material needs to be described
  2180. in the protocol's specification. For ESP and AH, [IPSECARCH]
  2181. defines the order, namely: the encryption key (if any) MUST be
  2182. taken from the first bits and the integrity key (if any) MUST be
  2183. taken from the remaining bits.
  2184. Kaufman, et al. Standards Track [Page 52]
  2185. RFC 5996 IKEv2bis September 2010
  2186. Each cryptographic algorithm takes a fixed number of bits of keying
  2187. material specified as part of the algorithm, or negotiated in SA
  2188. payloads (see Section 2.13 for description of key lengths, and
  2189. Section 3.3.5 for the definition of the Key Length transform
  2190. attribute).
  2191. 2.18. Rekeying IKE SAs Using a CREATE_CHILD_SA Exchange
  2192. The CREATE_CHILD_SA exchange can be used to rekey an existing IKE SA
  2193. (see Sections 1.3.2 and 2.8). New initiator and responder SPIs are
  2194. supplied in the SPI fields in the Proposal structures inside the
  2195. Security Association (SA) payloads (not the SPI fields in the IKE
  2196. header). The TS payloads are omitted when rekeying an IKE SA.
  2197. SKEYSEED for the new IKE SA is computed using SK_d from the existing
  2198. IKE SA as follows:
  2199. SKEYSEED = prf(SK_d (old), g^ir (new) | Ni | Nr)
  2200. where g^ir (new) is the shared secret from the ephemeral Diffie-
  2201. Hellman exchange of this CREATE_CHILD_SA exchange (represented as an
  2202. octet string in big endian order padded with zeros if necessary to
  2203. make it the length of the modulus) and Ni and Nr are the two nonces
  2204. stripped of any headers.
  2205. The old and new IKE SA may have selected a different PRF. Because
  2206. the rekeying exchange belongs to the old IKE SA, it is the old IKE
  2207. SA's PRF that is used to generate SKEYSEED.
  2208. The main reason for rekeying the IKE SA is to ensure that the
  2209. compromise of old keying material does not provide information about
  2210. the current keys, or vice versa. Therefore, implementations MUST
  2211. perform a new Diffie-Hellman exchange when rekeying the IKE SA. In
  2212. other words, an initiator MUST NOT propose the value "NONE" for the
  2213. Diffie-Hellman transform, and a responder MUST NOT accept such a
  2214. proposal. This means that a successful exchange rekeying the IKE SA
  2215. always includes the KEi/KEr payloads.
  2216. The new IKE SA MUST reset its message counters to 0.
  2217. SK_d, SK_ai, SK_ar, SK_ei, and SK_er are computed from SKEYSEED as
  2218. specified in Section 2.14, using SPIi, SPIr, Ni, and Nr from the new
  2219. exchange, and using the new IKE SA's PRF.
  2220. 2.19. Requesting an Internal Address on a Remote Network
  2221. Most commonly occurring in the endpoint-to-security-gateway scenario,
  2222. an endpoint may need an IP address in the network protected by the
  2223. security gateway and may need to have that address dynamically
  2224. Kaufman, et al. Standards Track [Page 53]
  2225. RFC 5996 IKEv2bis September 2010
  2226. assigned. A request for such a temporary address can be included in
  2227. any request to create a Child SA (including the implicit request in
  2228. message 3) by including a CP payload. Note, however, it is usual to
  2229. only assign one IP address during the IKE_AUTH exchange. That
  2230. address persists at least until the deletion of the IKE SA.
  2231. This function provides address allocation to an IPsec Remote Access
  2232. Client (IRAC) trying to tunnel into a network protected by an IPsec
  2233. Remote Access Server (IRAS). Since the IKE_AUTH exchange creates an
  2234. IKE SA and a Child SA, the IRAC MUST request the IRAS-controlled
  2235. address (and optionally other information concerning the protected
  2236. network) in the IKE_AUTH exchange. The IRAS may procure an address
  2237. for the IRAC from any number of sources such as a DHCP/BOOTP
  2238. (Bootstrap Protocol) server or its own address pool.
  2239. Initiator Responder
  2240. -------------------------------------------------------------------
  2241. HDR, SK {IDi, [CERT,]
  2242. [CERTREQ,] [IDr,] AUTH,
  2243. CP(CFG_REQUEST), SAi2,
  2244. TSi, TSr} -->
  2245. <-- HDR, SK {IDr, [CERT,] AUTH,
  2246. CP(CFG_REPLY), SAr2,
  2247. TSi, TSr}
  2248. In all cases, the CP payload MUST be inserted before the SA payload.
  2249. In variations of the protocol where there are multiple IKE_AUTH
  2250. exchanges, the CP payloads MUST be inserted in the messages
  2251. containing the SA payloads.
  2252. CP(CFG_REQUEST) MUST contain at least an INTERNAL_ADDRESS attribute
  2253. (either IPv4 or IPv6) but MAY contain any number of additional
  2254. attributes the initiator wants returned in the response.
  2255. Kaufman, et al. Standards Track [Page 54]
  2256. RFC 5996 IKEv2bis September 2010
  2257. For example, message from initiator to responder:
  2258. CP(CFG_REQUEST)=
  2259. INTERNAL_ADDRESS()
  2260. TSi = (0, 0-65535,0.0.0.0-255.255.255.255)
  2261. TSr = (0, 0-65535,0.0.0.0-255.255.255.255)
  2262. NOTE: Traffic Selectors contain (protocol, port range, address
  2263. range).
  2264. Message from responder to initiator:
  2265. CP(CFG_REPLY)=
  2266. INTERNAL_ADDRESS(192.0.2.202)
  2267. INTERNAL_NETMASK(255.255.255.0)
  2268. INTERNAL_SUBNET(192.0.2.0/255.255.255.0)
  2269. TSi = (0, 0-65535,192.0.2.202-192.0.2.202)
  2270. TSr = (0, 0-65535,192.0.2.0-192.0.2.255)
  2271. All returned values will be implementation dependent. As can be seen
  2272. in the above example, the IRAS MAY also send other attributes that
  2273. were not included in CP(CFG_REQUEST) and MAY ignore the non-
  2274. mandatory attributes that it does not support.
  2275. The responder MUST NOT send a CFG_REPLY without having first received
  2276. a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS
  2277. to perform an unnecessary configuration lookup if the IRAC cannot
  2278. process the REPLY.
  2279. In the case where the IRAS's configuration requires that CP be used
  2280. for a given identity IDi, but IRAC has failed to send a
  2281. CP(CFG_REQUEST), IRAS MUST fail the request, and terminate the Child
  2282. SA creation with a FAILED_CP_REQUIRED error. The FAILED_CP_REQUIRED
  2283. is not fatal to the IKE SA; it simply causes the Child SA creation to
  2284. fail. The initiator can fix this by later starting a new
  2285. Configuration payload request. There is no associated data in the
  2286. FAILED_CP_REQUIRED error.
  2287. 2.20. Requesting the Peer's Version
  2288. An IKE peer wishing to inquire about the other peer's IKE software
  2289. version information MAY use the method below. This is an example of
  2290. a configuration request within an INFORMATIONAL exchange, after the
  2291. IKE SA and first Child SA have been created.
  2292. Kaufman, et al. Standards Track [Page 55]
  2293. RFC 5996 IKEv2bis September 2010
  2294. An IKE implementation MAY decline to give out version information
  2295. prior to authentication or even after authentication in case some
  2296. implementation is known to have some security weakness. In that
  2297. case, it MUST either return an empty string or no CP payload if CP is
  2298. not supported.
  2299. Initiator Responder
  2300. -------------------------------------------------------------------
  2301. HDR, SK{CP(CFG_REQUEST)} -->
  2302. <-- HDR, SK{CP(CFG_REPLY)}
  2303. CP(CFG_REQUEST)=
  2304. APPLICATION_VERSION("")
  2305. CP(CFG_REPLY) APPLICATION_VERSION("foobar v1.3beta, (c) Foo Bar
  2306. Inc.")
  2307. 2.21. Error Handling
  2308. There are many kinds of errors that can occur during IKE processing.
  2309. The general rule is that if a request is received that is badly
  2310. formatted, or unacceptable for reasons of policy (such as no matching
  2311. cryptographic algorithms), the response contains a Notify payload
  2312. indicating the error. The decision whether or not to send such a
  2313. response depends whether or not there is an authenticated IKE SA.
  2314. If there is an error parsing or processing a response packet, the
  2315. general rule is to not send back any error message because responses
  2316. should not generate new requests (and a new request would be the only
  2317. way to send back an error message). Such errors in parsing or
  2318. processing response packets should still cause the recipient to clean
  2319. up the IKE state (for example, by sending a Delete for a bad SA).
  2320. Only authentication failures (AUTHENTICATION_FAILED and EAP failure)
  2321. and malformed messages (INVALID_SYNTAX) lead to a deletion of the IKE
  2322. SA without requiring an explicit INFORMATIONAL exchange carrying a
  2323. Delete payload. Other error conditions MAY require such an exchange
  2324. if policy dictates that this is needed. If the exchange is
  2325. terminated with EAP Failure, an AUTHENTICATION_FAILED notification is
  2326. not sent.
  2327. 2.21.1. Error Handling in IKE_SA_INIT
  2328. Errors that occur before a cryptographically protected IKE SA is
  2329. established need to be handled very carefully. There is a trade-off
  2330. between wanting to help the peer to diagnose a problem and thus
  2331. responding to the error and wanting to avoid being part of a DoS
  2332. attack based on forged messages.
  2333. Kaufman, et al. Standards Track [Page 56]
  2334. RFC 5996 IKEv2bis September 2010
  2335. In an IKE_SA_INIT exchange, any error notification causes the
  2336. exchange to fail. Note that some error notifications such as COOKIE,
  2337. INVALID_KE_PAYLOAD or INVALID_MAJOR_VERSION may lead to a subsequent
  2338. successful exchange. Because all error notifications are completely
  2339. unauthenticated, the recipient should continue trying for some time
  2340. before giving up. The recipient should not immediately act based on
  2341. the error notification unless corrective actions are defined in this
  2342. specification, such as for COOKIE, INVALID_KE_PAYLOAD, and
  2343. INVALID_MAJOR_VERSION.
  2344. 2.21.2. Error Handling in IKE_AUTH
  2345. All errors that occur in an IKE_AUTH exchange, causing the
  2346. authentication to fail for whatever reason (invalid shared secret,
  2347. invalid ID, untrusted certificate issuer, revoked or expired
  2348. certificate, etc.) SHOULD result in an AUTHENTICATION_FAILED
  2349. notification. If the error occurred on the responder, the
  2350. notification is returned in the protected response, and is usually
  2351. the only payload in that response. Although the IKE_AUTH messages
  2352. are encrypted and integrity protected, if the peer receiving this
  2353. notification has not authenticated the other end yet, that peer needs
  2354. to treat the information with caution.
  2355. If the error occurs on the initiator, the notification MAY be
  2356. returned in a separate INFORMATIONAL exchange, usually with no other
  2357. payloads. This is an exception for the general rule of not starting
  2358. new exchanges based on errors in responses.
  2359. Note, however, that request messages that contain an unsupported
  2360. critical payload, or where the whole message is malformed (rather
  2361. than just bad payload contents), MUST be rejected in their entirety,
  2362. and MUST only lead to an UNSUPPORTED_CRITICAL_PAYLOAD or
  2363. INVALID_SYNTAX Notification sent as a response. The receiver should
  2364. not verify the payloads related to authentication in this case.
  2365. If authentication has succeeded in the IKE_AUTH exchange, the IKE SA
  2366. is established; however, establishing the Child SA or requesting
  2367. configuration information may still fail. This failure does not
  2368. automatically cause the IKE SA to be deleted. Specifically, a
  2369. responder may include all the payloads associated with authentication
  2370. (IDr, CERT, and AUTH) while sending error notifications for the
  2371. piggybacked exchanges (FAILED_CP_REQUIRED, NO_PROPOSAL_CHOSEN, and so
  2372. on), and the initiator MUST NOT fail the authentication because of
  2373. this. The initiator MAY, of course, for reasons of policy later
  2374. delete such an IKE SA.
  2375. Kaufman, et al. Standards Track [Page 57]
  2376. RFC 5996 IKEv2bis September 2010
  2377. In an IKE_AUTH exchange, or in the INFORMATIONAL exchange immediately
  2378. following it (in case an error happened when processing a response to
  2379. IKE_AUTH), the UNSUPPORTED_CRITICAL_PAYLOAD, INVALID_SYNTAX, and
  2380. AUTHENTICATION_FAILED notifications are the only ones to cause the
  2381. IKE SA to be deleted or not created, without a Delete payload.
  2382. Extension documents may define new error notifications with these
  2383. semantics, but MUST NOT use them unless the peer has been shown to
  2384. understand them, such as by using the Vendor ID payload.
  2385. 2.21.3. Error Handling after IKE SA is Authenticated
  2386. After the IKE SA is authenticated, all requests having errors MUST
  2387. result in a response notifying about the error.
  2388. In normal situations, there should not be cases where a valid
  2389. response from one peer results in an error situation in the other
  2390. peer, so there should not be any reason for a peer to send error
  2391. messages to the other end except as a response. Because sending such
  2392. error messages as an INFORMATIONAL exchange might lead to further
  2393. errors that could cause loops, such errors SHOULD NOT be sent. If
  2394. errors are seen that indicate that the peers do not have the same
  2395. state, it might be good to delete the IKE SA to clean up state and
  2396. start over.
  2397. If a peer parsing a request notices that it is badly formatted (after
  2398. it has passed the message authentication code checks and window
  2399. checks) and it returns an INVALID_SYNTAX notification, then this
  2400. error notification is considered fatal in both peers, meaning that
  2401. the IKE SA is deleted without needing an explicit Delete payload.
  2402. 2.21.4. Error Handling Outside IKE SA
  2403. A node needs to limit the rate at which it will send messages in
  2404. response to unprotected messages.
  2405. If a node receives a message on UDP port 500 or 4500 outside the
  2406. context of an IKE SA known to it (and the message is not a request to
  2407. start an IKE SA), this may be the result of a recent crash of the
  2408. node. If the message is marked as a response, the node can audit the
  2409. suspicious event but MUST NOT respond. If the message is marked as a
  2410. request, the node can audit the suspicious event and MAY send a
  2411. response. If a response is sent, the response MUST be sent to the IP
  2412. address and port from where it came with the same IKE SPIs and the
  2413. Message ID copied. The response MUST NOT be cryptographically
  2414. protected and MUST contain an INVALID_IKE_SPI Notify payload. The
  2415. INVALID_IKE_SPI notification indicates an IKE message was received
  2416. with an unrecognized destination SPI; this usually indicates that the
  2417. recipient has rebooted and forgotten the existence of an IKE SA.
  2418. Kaufman, et al. Standards Track [Page 58]
  2419. RFC 5996 IKEv2bis September 2010
  2420. A peer receiving such an unprotected Notify payload MUST NOT respond
  2421. and MUST NOT change the state of any existing SAs. The message might
  2422. be a forgery or might be a response that a genuine correspondent was
  2423. tricked into sending. A node should treat such a message (and also a
  2424. network message like ICMP destination unreachable) as a hint that
  2425. there might be problems with SAs to that IP address and should
  2426. initiate a liveness check for any such IKE SA. An implementation
  2427. SHOULD limit the frequency of such tests to avoid being tricked into
  2428. participating in a DoS attack.
  2429. If an error occurs outside the context of an IKE request (e.g., the
  2430. node is getting ESP messages on a nonexistent SPI), the node SHOULD
  2431. initiate an INFORMATIONAL exchange with a Notify payload describing
  2432. the problem.
  2433. A node receiving a suspicious message from an IP address (and port,
  2434. if NAT traversal is used) with which it has an IKE SA SHOULD send an
  2435. IKE Notify payload in an IKE INFORMATIONAL exchange over that SA.
  2436. The recipient MUST NOT change the state of any SAs as a result, but
  2437. may wish to audit the event to aid in diagnosing malfunctions.
  2438. 2.22. IPComp
  2439. Use of IP Compression [IP-COMP] can be negotiated as part of the
  2440. setup of a Child SA. While IP Compression involves an extra header
  2441. in each packet and a compression parameter index (CPI), the virtual
  2442. "compression association" has no life outside the ESP or AH SA that
  2443. contains it. Compression associations disappear when the
  2444. corresponding ESP or AH SA goes away. It is not explicitly mentioned
  2445. in any Delete payload.
  2446. Negotiation of IP Compression is separate from the negotiation of
  2447. cryptographic parameters associated with a Child SA. A node
  2448. requesting a Child SA MAY advertise its support for one or more
  2449. compression algorithms through one or more Notify payloads of type
  2450. IPCOMP_SUPPORTED. This Notify message may be included only in a
  2451. message containing an SA payload negotiating a Child SA and indicates
  2452. a willingness by its sender to use IPComp on this SA. The response
  2453. MAY indicate acceptance of a single compression algorithm with a
  2454. Notify payload of type IPCOMP_SUPPORTED. These payloads MUST NOT
  2455. occur in messages that do not contain SA payloads.
  2456. The data associated with this Notify message includes a two-octet
  2457. IPComp CPI followed by a one-octet Transform ID optionally followed
  2458. by attributes whose length and format are defined by that Transform
  2459. ID. A message proposing an SA may contain multiple IPCOMP_SUPPORTED
  2460. notifications to indicate multiple supported algorithms. A message
  2461. accepting an SA may contain at most one.
  2462. Kaufman, et al. Standards Track [Page 59]
  2463. RFC 5996 IKEv2bis September 2010
  2464. The Transform IDs are listed here. The values in the following table
  2465. are only current as of the publication date of RFC 4306. Other
  2466. values may have been added since then or will be added after the
  2467. publication of this document. Readers should refer to [IKEV2IANA]
  2468. for the latest values.
  2469. Name Number Defined In
  2470. -------------------------------------
  2471. IPCOMP_OUI 1
  2472. IPCOMP_DEFLATE 2 RFC 2394
  2473. IPCOMP_LZS 3 RFC 2395
  2474. IPCOMP_LZJH 4 RFC 3051
  2475. Although there has been discussion of allowing multiple compression
  2476. algorithms to be accepted and to have different compression
  2477. algorithms available for the two directions of a Child SA,
  2478. implementations of this specification MUST NOT accept an IPComp
  2479. algorithm that was not proposed, MUST NOT accept more than one, and
  2480. MUST NOT compress using an algorithm other than one proposed and
  2481. accepted in the setup of the Child SA.
  2482. A side effect of separating the negotiation of IPComp from
  2483. cryptographic parameters is that it is not possible to propose
  2484. multiple cryptographic suites and propose IP Compression with some of
  2485. them but not others.
  2486. In some cases, Robust Header Compression (ROHC) may be more
  2487. appropriate than IP Compression. [ROHCV2] defines the use of ROHC
  2488. with IKEv2 and IPsec.
  2489. 2.23. NAT Traversal
  2490. Network Address Translation (NAT) gateways are a controversial
  2491. subject. This section briefly describes what they are and how they
  2492. are likely to act on IKE traffic. Many people believe that NATs are
  2493. evil and that we should not design our protocols so as to make them
  2494. work better. IKEv2 does specify some unintuitive processing rules in
  2495. order that NATs are more likely to work.
  2496. NATs exist primarily because of the shortage of IPv4 addresses,
  2497. though there are other rationales. IP nodes that are "behind" a NAT
  2498. have IP addresses that are not globally unique, but rather are
  2499. assigned from some space that is unique within the network behind the
  2500. NAT but that are likely to be reused by nodes behind other NATs.
  2501. Generally, nodes behind NATs can communicate with other nodes behind
  2502. the same NAT and with nodes with globally unique addresses, but not
  2503. with nodes behind other NATs. There are exceptions to that rule.
  2504. When those nodes make connections to nodes on the real Internet, the
  2505. Kaufman, et al. Standards Track [Page 60]
  2506. RFC 5996 IKEv2bis September 2010
  2507. NAT gateway "translates" the IP source address to an address that
  2508. will be routed back to the gateway. Messages to the gateway from the
  2509. Internet have their destination addresses "translated" to the
  2510. internal address that will route the packet to the correct endnode.
  2511. NATs are designed to be "transparent" to endnodes. Neither software
  2512. on the node behind the NAT nor the node on the Internet requires
  2513. modification to communicate through the NAT. Achieving this
  2514. transparency is more difficult with some protocols than with others.
  2515. Protocols that include IP addresses of the endpoints within the
  2516. payloads of the packet will fail unless the NAT gateway understands
  2517. the protocol and modifies the internal references as well as those in
  2518. the headers. Such knowledge is inherently unreliable, is a network
  2519. layer violation, and often results in subtle problems.
  2520. Opening an IPsec connection through a NAT introduces special
  2521. problems. If the connection runs in transport mode, changing the IP
  2522. addresses on packets will cause the checksums to fail and the NAT
  2523. cannot correct the checksums because they are cryptographically
  2524. protected. Even in tunnel mode, there are routing problems because
  2525. transparently translating the addresses of AH and ESP packets
  2526. requires special logic in the NAT and that logic is heuristic and
  2527. unreliable in nature. For that reason, IKEv2 will use UDP
  2528. encapsulation of IKE and ESP packets. This encoding is slightly less
  2529. efficient but is easier for NATs to process. In addition, firewalls
  2530. may be configured to pass UDP-encapsulated IPsec traffic but not
  2531. plain, unencapsulated ESP/AH or vice versa.
  2532. It is a common practice of NATs to translate TCP and UDP port numbers
  2533. as well as addresses and use the port numbers of inbound packets to
  2534. decide which internal node should get a given packet. For this
  2535. reason, even though IKE packets MUST be sent to and from UDP port 500
  2536. or 4500, they MUST be accepted coming from any port and responses
  2537. MUST be sent to the port from whence they came. This is because the
  2538. ports may be modified as the packets pass through NATs. Similarly,
  2539. IP addresses of the IKE endpoints are generally not included in the
  2540. IKE payloads because the payloads are cryptographically protected and
  2541. could not be transparently modified by NATs.
  2542. Port 4500 is reserved for UDP-encapsulated ESP and IKE. An IPsec
  2543. endpoint that discovers a NAT between it and its correspondent (as
  2544. described below) MUST send all subsequent traffic from port 4500,
  2545. which NATs should not treat specially (as they might with port 500).
  2546. An initiator can use port 4500 for both IKE and ESP, regardless of
  2547. whether or not there is a NAT, even at the beginning of IKE. When
  2548. either side is using port 4500, sending ESP with UDP encapsulation is
  2549. not required, but understanding received UDP-encapsulated ESP packets
  2550. Kaufman, et al. Standards Track [Page 61]
  2551. RFC 5996 IKEv2bis September 2010
  2552. is required. UDP encapsulation MUST NOT be done on port 500. If
  2553. Network Address Translation Traversal (NAT-T) is supported (that is,
  2554. if NAT_DETECTION_*_IP payloads were exchanged during IKE_SA_INIT),
  2555. all devices MUST be able to receive and process both UDP-encapsulated
  2556. ESP and non-UDP-encapsulated ESP packets at any time. Either side
  2557. can decide whether or not to use UDP encapsulation for ESP
  2558. irrespective of the choice made by the other side. However, if a NAT
  2559. is detected, both devices MUST use UDP encapsulation for ESP.
  2560. The specific requirements for supporting NAT traversal [NATREQ] are
  2561. listed below. Support for NAT traversal is optional. In this
  2562. section only, requirements listed as MUST apply only to
  2563. implementations supporting NAT traversal.
  2564. o Both the IKE initiator and responder MUST include in their
  2565. IKE_SA_INIT packets Notify payloads of type
  2566. NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP. Those
  2567. payloads can be used to detect if there is NAT between the hosts,
  2568. and which end is behind the NAT. The location of the payloads in
  2569. the IKE_SA_INIT packets is just after the Ni and Nr payloads
  2570. (before the optional CERTREQ payload).
  2571. o The data associated with the NAT_DETECTION_SOURCE_IP notification
  2572. is a SHA-1 digest of the SPIs (in the order they appear in the
  2573. header), IP address, and port from which this packet was sent.
  2574. There MAY be multiple NAT_DETECTION_SOURCE_IP payloads in a
  2575. message if the sender does not know which of several network
  2576. attachments will be used to send the packet.
  2577. o The data associated with the NAT_DETECTION_DESTINATION_IP
  2578. notification is a SHA-1 digest of the SPIs (in the order they
  2579. appear in the header), IP address, and port to which this packet
  2580. was sent.
  2581. o The recipient of either the NAT_DETECTION_SOURCE_IP or
  2582. NAT_DETECTION_DESTINATION_IP notification MAY compare the supplied
  2583. value to a SHA-1 hash of the SPIs, source or recipient IP address
  2584. (respectively), address, and port, and if they don't match, it
  2585. SHOULD enable NAT traversal. In the case there is a mismatch of
  2586. the NAT_DETECTION_SOURCE_IP hash with all of the
  2587. NAT_DETECTION_SOURCE_IP payloads received, the recipient MAY
  2588. reject the connection attempt if NAT traversal is not supported.
  2589. In the case of a mismatching NAT_DETECTION_DESTINATION_IP hash, it
  2590. means that the system receiving the NAT_DETECTION_DESTINATION_IP
  2591. payload is behind a NAT and that system SHOULD start sending
  2592. keepalive packets as defined in [UDPENCAPS]; alternately, it MAY
  2593. reject the connection attempt if NAT traversal is not supported.
  2594. Kaufman, et al. Standards Track [Page 62]
  2595. RFC 5996 IKEv2bis September 2010
  2596. o If none of the NAT_DETECTION_SOURCE_IP payload(s) received matches
  2597. the expected value of the source IP and port found from the IP
  2598. header of the packet containing the payload, it means that the
  2599. system sending those payloads is behind a NAT (i.e., someone along
  2600. the route changed the source address of the original packet to
  2601. match the address of the NAT box). In this case, the system
  2602. receiving the payloads should allow dynamic updates of the other
  2603. systems' IP address, as described later.
  2604. o The IKE initiator MUST check the NAT_DETECTION_SOURCE_IP or
  2605. NAT_DETECTION_DESTINATION_IP payloads if present, and if they do
  2606. not match the addresses in the outer packet, MUST tunnel all
  2607. future IKE and ESP packets associated with this IKE SA over UDP
  2608. port 4500.
  2609. o To tunnel IKE packets over UDP port 4500, the IKE header has four
  2610. octets of zero prepended and the result immediately follows the
  2611. UDP header. To tunnel ESP packets over UDP port 4500, the ESP
  2612. header immediately follows the UDP header. Since the first four
  2613. octets of the ESP header contain the SPI, and the SPI cannot
  2614. validly be zero, it is always possible to distinguish ESP and IKE
  2615. messages.
  2616. o Implementations MUST process received UDP-encapsulated ESP packets
  2617. even when no NAT was detected.
  2618. o The original source and destination IP address required for the
  2619. transport mode TCP and UDP packet checksum fixup (see [UDPENCAPS])
  2620. are obtained from the Traffic Selectors associated with the
  2621. exchange. In the case of transport mode NAT traversal, the
  2622. Traffic Selectors MUST contain exactly one IP address, which is
  2623. then used as the original IP address. This is covered in greater
  2624. detail in Section 2.23.1.
  2625. o There are cases where a NAT box decides to remove mappings that
  2626. are still alive (for example, the keepalive interval is too long,
  2627. or the NAT box is rebooted). This will be apparent to a host if
  2628. it receives a packet whose integrity protection validates, but has
  2629. a different port, address, or both from the one that was
  2630. associated with the SA in the validated packet. When such a
  2631. validated packet is found, a host that does not support other
  2632. methods of recovery such as IKEv2 Mobility and Multihoming
  2633. (MOBIKE) [MOBIKE], and that is not behind a NAT, SHOULD send all
  2634. packets (including retransmission packets) to the IP address and
  2635. port in the validated packet, and SHOULD store this as the new
  2636. address and port combination for the SA (that is, they SHOULD
  2637. dynamically update the address). A host behind a NAT SHOULD NOT
  2638. do this type of dynamic address update if a validated packet has
  2639. Kaufman, et al. Standards Track [Page 63]
  2640. RFC 5996 IKEv2bis September 2010
  2641. different port and/or address values because it opens a possible
  2642. DoS attack (such as allowing an attacker to break the connection
  2643. with a single packet). Also, dynamic address update should only
  2644. be done in response to a new packet; otherwise, an attacker can
  2645. revert the addresses with old replayed packets. Because of this,
  2646. dynamic updates can only be done safely if replay protection is
  2647. enabled. When IKEv2 is used with MOBIKE, dynamically updating the
  2648. addresses described above interferes with MOBIKE's way of
  2649. recovering from the same situation. See Section 3.8 of [MOBIKE]
  2650. for more information.
  2651. 2.23.1. Transport Mode NAT Traversal
  2652. Transport mode used with NAT Traversal requires special handling of
  2653. the Traffic Selectors used in the IKEv2. The complete scenario looks
  2654. like:
  2655. +------+ +------+ +------+ +------+
  2656. |Client| IP1 | NAT | IPN1 IPN2 | NAT | IP2 |Server|
  2657. |node |<------>| A |<---------->| B |<------->| |
  2658. +------+ +------+ +------+ +------+
  2659. (Other scenarios are simplifications of this complex case, so this
  2660. discussion uses the complete scenario.)
  2661. In this scenario, there are two address translating NATs: NAT A and
  2662. NAT B. NAT A is a dynamic NAT that maps the client's source address
  2663. IP1 to IPN1. NAT B is a static NAT configured so that connections
  2664. coming to IPN2 address are mapped to the gateway's address IP2, that
  2665. is, IPN2 destination address is mapped to IP2. This allows the
  2666. client to connect to a server by connecting to the IPN2. NAT B does
  2667. not necessarily need to be a static NAT, but the client needs to know
  2668. how to connect to the server, and it can only do that if it somehow
  2669. knows the outer address of the NAT B, that is, the IPN2 address. If
  2670. NAT B is a static NAT, then its address can be configured to the
  2671. client's configuration. Another option would be to find it using
  2672. some other protocol (like DNS), but that is outside of scope of
  2673. IKEv2.
  2674. In this scenario, both the client and server are configured to use
  2675. transport mode for the traffic originating from the client node and
  2676. destined to the server.
  2677. When the client starts creating the IKEv2 SA and Child SA for sending
  2678. traffic to the server, it may have a triggering packet with source IP
  2679. address of IP1, and a destination IP address of IPN2. Its Peer
  2680. Authorization Database (PAD) and SPD needs to have a configuration
  2681. matching those addresses (or wildcard entries covering them).
  2682. Kaufman, et al. Standards Track [Page 64]
  2683. RFC 5996 IKEv2bis September 2010
  2684. Because this is transport mode, it uses exactly same addresses as the
  2685. Traffic Selectors and outer IP address of the IKE packets. For
  2686. transport mode, it MUST use exactly one IP address in the TSi and TSr
  2687. payloads. It can have multiple Traffic Selectors if it has, for
  2688. example, multiple port ranges that it wants to negotiate, but all TSi
  2689. entries must use the IP1-IP1 range as the IP addresses, and all TSr
  2690. entries must have the IPN2-IPN2 range as IP addresses. The first
  2691. Traffic Selector of TSi and TSr SHOULD have very specific Traffic
  2692. Selectors including protocol and port numbers, such as from the
  2693. packet triggering the request.
  2694. NAT A will then replace the source address of the IKE packet from IP1
  2695. to IPN1, and NAT B will replace the destination address of the IKE
  2696. packet from IPN2 to IP2, so when the packet arrives to the server it
  2697. will still have the exactly same Traffic Selectors that were sent by
  2698. the client, but the IP address of the IKE packet has been replaced by
  2699. IPN1 and IP2.
  2700. When the server receives this packet, it normally looks in the Peer
  2701. Authorization Database (PAD) described in RFC 4301 [IPSECARCH] based
  2702. on the ID and then searches the SPD based on the Traffic Selectors.
  2703. Because IP1 does not really mean anything to the server (it is the
  2704. address client has behind the NAT), it is useless to do a lookup
  2705. based on that if transport mode is used. On the other hand, the
  2706. server cannot know whether transport mode is allowed by its policy
  2707. before it finds the matching SPD entry.
  2708. In this case, the server should first check that the initiator
  2709. requested transport mode, and then do address substitution on the
  2710. Traffic Selectors. It needs to first store the old Traffic Selector
  2711. IP addresses to be used later for the incremental checksum fixup (the
  2712. IP address in the TSi can be stored as the original source address
  2713. and the IP address in the TSr can be stored as the original
  2714. destination address). After that, if the other end was detected as
  2715. being behind a NAT, the server replaces the IP address in TSi
  2716. payloads with the IP address obtained from the source address of the
  2717. IKE packet received (that is, it replaces IP1 in TSi with IPN1). If
  2718. the server's end was detected to be behind NAT, it replaces the IP
  2719. address in the TSr payloads with the IP address obtained from the
  2720. destination address of the IKE packet received (that is, it replaces
  2721. IPN2 in TSr with IP2).
  2722. After this address substitution, both the Traffic Selectors and the
  2723. IKE UDP source/destination addresses look the same, and the server
  2724. does SPD lookup based on those new Traffic Selectors. If an entry is
  2725. found and it allows transport mode, then that entry is used. If an
  2726. entry is found but it does not allow transport mode, then the server
  2727. MAY undo the address substitution and redo the SPD lookup using the
  2728. Kaufman, et al. Standards Track [Page 65]
  2729. RFC 5996 IKEv2bis September 2010
  2730. original Traffic Selectors. If the second lookup succeeds, the
  2731. server will create an SA in tunnel mode using real Traffic Selectors
  2732. sent by the other end.
  2733. This address substitution in transport mode is needed because the SPD
  2734. is looked up using the addresses that will be seen by the local host.
  2735. This also will make sure the Security Association Database (SAD)
  2736. entries for the tunnel exit checks and return packets is added using
  2737. the addresses as seen by the local operating system stack.
  2738. The most common case is that the server's SPD will contain wildcard
  2739. entries matching any addresses, but this also allows making different
  2740. SPD entries, for example, for different known NATs' outer addresses.
  2741. After the SPD lookup, the server will do Traffic Selector narrowing
  2742. based on the SPD entry it found. It will again use the already
  2743. substituted Traffic Selectors, and it will thus send back Traffic
  2744. Selectors having IPN1 and IP2 as their IP addresses; it can still
  2745. narrow down the protocol number or port ranges used by the Traffic
  2746. Selectors. The SAD entry created for the Child SA will have the
  2747. addresses as seen by the server, namely IPN1 and IP2.
  2748. When the client receives the server's response to the Child SA, it
  2749. will do similar processing. If the transport mode SA was created,
  2750. the client can store the original returned Traffic Selectors as
  2751. original source and destination addresses. It will replace the IP
  2752. addresses in the Traffic Selectors with the ones from the IP header
  2753. of the IKE packet: it will replace IPN1 with IP1 and IP2 with IPN2.
  2754. Then, it will use those Traffic Selectors when verifying the SA
  2755. against sent Traffic Selectors, and when installing the SAD entry.
  2756. A summary of the rules for NAT traversal in transport mode is:
  2757. For the client proposing transport mode:
  2758. - The TSi entries MUST have exactly one IP address, and that MUST
  2759. match the source address of the IKE SA.
  2760. - The TSr entries MUST have exactly one IP address, and that MUST
  2761. match the destination address of the IKE SA.
  2762. - The first TSi and TSr Traffic Selectors SHOULD have very specific
  2763. Traffic Selectors including protocol and port numbers, such as
  2764. from the packet triggering the request.
  2765. - There MAY be multiple TSi and TSr entries.
  2766. Kaufman, et al. Standards Track [Page 66]
  2767. RFC 5996 IKEv2bis September 2010
  2768. - If transport mode for the SA was selected (that is, if the server
  2769. included USE_TRANSPORT_MODE notification in its response):
  2770. - Store the original Traffic Selectors as the received source and
  2771. destination address.
  2772. - If the server is behind a NAT, substitute the IP address in the
  2773. TSr entries with the remote address of the IKE SA.
  2774. - If the client is behind a NAT, substitute the IP address in the
  2775. TSi entries with the local address of the IKE SA.
  2776. - Do address substitution before using those Traffic Selectors
  2777. for anything other than storing original content of them.
  2778. This includes verification that Traffic Selectors were narrowed
  2779. correctly by the other end, creation of the SAD entry, and so on.
  2780. For the responder, when transport mode is proposed by client:
  2781. - Store the original Traffic Selector IP addresses as received source
  2782. and destination address, in case undo address
  2783. substitution is needed, to use as the "real source and destination
  2784. address" specified by [UDPENCAPS], and for TCP/UDP checksum fixup.
  2785. - If the client is behind a NAT, substitute the IP address in the
  2786. TSi entries with the remote address of the IKE SA.
  2787. - If the server is behind a NAT, substitute the IP address in the
  2788. TSr entries with the local address of the IKE SA.
  2789. - Do PAD and SPD lookup using the ID and substituted Traffic
  2790. Selectors.
  2791. - If no SPD entry was found, or if found SPD entry does not
  2792. allow transport mode, undo the Traffic Selector substitutions.
  2793. Do PAD and SPD lookup again using the ID and original Traffic
  2794. Selectors, but also searching for tunnel mode SPD entry (that
  2795. is, fall back to tunnel mode).
  2796. - However, if a transport mode SPD entry was found, do normal
  2797. traffic selection narrowing based on the substituted Traffic
  2798. Selectors and SPD entry. Use the resulting Traffic Selectors when
  2799. creating SAD entries, and when sending Traffic Selectors back to
  2800. the client.
  2801. Kaufman, et al. Standards Track [Page 67]
  2802. RFC 5996 IKEv2bis September 2010
  2803. 2.24. Explicit Congestion Notification (ECN)
  2804. When IPsec tunnels behave as originally specified in [IPSECARCH-OLD],
  2805. ECN usage is not appropriate for the outer IP headers because tunnel
  2806. decapsulation processing discards ECN congestion indications to the
  2807. detriment of the network. ECN support for IPsec tunnels for IKEv1-
  2808. based IPsec requires multiple operating modes and negotiation (see
  2809. [ECN]). IKEv2 simplifies this situation by requiring that ECN be
  2810. usable in the outer IP headers of all tunnel mode Child SAs created
  2811. by IKEv2. Specifically, tunnel encapsulators and decapsulators for
  2812. all tunnel mode SAs created by IKEv2 MUST support the ECN full-
  2813. functionality option for tunnels specified in [ECN] and MUST
  2814. implement the tunnel encapsulation and decapsulation processing
  2815. specified in [IPSECARCH] to prevent discarding of ECN congestion
  2816. indications.
  2817. 2.25. Exchange Collisions
  2818. Because IKEv2 exchanges can be initiated by either peer, it is
  2819. possible that two exchanges affecting the same SA partly overlap.
  2820. This can lead to a situation where the SA state information is
  2821. temporarily not synchronized, and a peer can receive a request that
  2822. it cannot process in a normal fashion.
  2823. Obviously, using a window size greater than 1 leads to more complex
  2824. situations, especially if requests are processed out of order. This
  2825. section concentrates on problems that can arise even with a window
  2826. size of 1, and recommends solutions.
  2827. A TEMPORARY_FAILURE notification SHOULD be sent when a peer receives
  2828. a request that cannot be completed due to a temporary condition such
  2829. as a rekeying operation. When a peer receives a TEMPORARY_FAILURE
  2830. notification, it MUST NOT immediately retry the operation; it MUST
  2831. wait so that the sender may complete whatever operation caused the
  2832. temporary condition. The recipient MAY retry the request one or more
  2833. times over a period of several minutes. If a peer continues to
  2834. receive TEMPORARY_FAILURE on the same IKE SA after several minutes,
  2835. it SHOULD conclude that the state information is out of sync and
  2836. close the IKE SA.
  2837. A CHILD_SA_NOT_FOUND notification SHOULD be sent when a peer receives
  2838. a request to rekey a Child SA that does not exist. The SA that the
  2839. initiator attempted to rekey is indicated by the SPI field in the
  2840. Notify payload, which is copied from the SPI field in the REKEY_SA
  2841. notification. A peer that receives a CHILD_SA_NOT_FOUND notification
  2842. SHOULD silently delete the Child SA (if it still exists) and send a
  2843. request to create a new Child SA from scratch (if the Child SA does
  2844. not yet exist).
  2845. Kaufman, et al. Standards Track [Page 68]
  2846. RFC 5996 IKEv2bis September 2010
  2847. 2.25.1. Collisions while Rekeying or Closing Child SAs
  2848. If a peer receives a request to rekey a Child SA that it is currently
  2849. trying to close, it SHOULD reply with TEMPORARY_FAILURE. If a peer
  2850. receives a request to rekey a Child SA that it is currently rekeying,
  2851. it SHOULD reply as usual, and SHOULD prepare to close redundant SAs
  2852. later based on the nonces (see Section 2.8.1). If a peer receives a
  2853. request to rekey a Child SA that does not exist, it SHOULD reply with
  2854. CHILD_SA_NOT_FOUND.
  2855. If a peer receives a request to close a Child SA that it is currently
  2856. trying to close, it SHOULD reply without a Delete payload (see
  2857. Section 1.4.1). If a peer receives a request to close a Child SA
  2858. that it is currently rekeying, it SHOULD reply as usual, with a
  2859. Delete payload. If a peer receives a request to close a Child SA
  2860. that does not exist, it SHOULD reply without a Delete payload.
  2861. If a peer receives a request to rekey the IKE SA, and it is currently
  2862. creating, rekeying, or closing a Child SA of that IKE SA, it SHOULD
  2863. reply with TEMPORARY_FAILURE.
  2864. 2.25.2. Collisions while Rekeying or Closing IKE SAs
  2865. If a peer receives a request to rekey an IKE SA that it is currently
  2866. rekeying, it SHOULD reply as usual, and SHOULD prepare to close
  2867. redundant SAs and move inherited Child SAs later based on the nonces
  2868. (see Section 2.8.2). If a peer receives a request to rekey an IKE SA
  2869. that it is currently trying to close, it SHOULD reply with
  2870. TEMPORARY_FAILURE.
  2871. If a peer receives a request to close an IKE SA that it is currently
  2872. rekeying, it SHOULD reply as usual, and forget about its own rekeying
  2873. request. If a peer receives a request to close an IKE SA that it is
  2874. currently trying to close, it SHOULD reply as usual, and forget about
  2875. its own close request.
  2876. If a peer receives a request to create or rekey a Child SA when it is
  2877. currently rekeying the IKE SA, it SHOULD reply with
  2878. TEMPORARY_FAILURE. If a peer receives a request to delete a Child SA
  2879. when it is currently rekeying the IKE SA, it SHOULD reply as usual,
  2880. with a Delete payload.
  2881. 3. Header and Payload Formats
  2882. In the tables in this section, some cryptographic primitives and
  2883. configuration attributes are marked as "UNSPECIFIED". These are
  2884. items for which there are no known specifications and therefore
  2885. interoperability is currently impossible. A future specification may
  2886. Kaufman, et al. Standards Track [Page 69]
  2887. RFC 5996 IKEv2bis September 2010
  2888. describe their use, but until such specification is made,
  2889. implementations SHOULD NOT attempt to use items marked as
  2890. "UNSPECIFIED" in implementations that are meant to be interoperable.
  2891. 3.1. The IKE Header
  2892. IKE messages use UDP ports 500 and/or 4500, with one IKE message per
  2893. UDP datagram. Information from the beginning of the packet through
  2894. the UDP header is largely ignored except that the IP addresses and
  2895. UDP ports from the headers are reversed and used for return packets.
  2896. When sent on UDP port 500, IKE messages begin immediately following
  2897. the UDP header. When sent on UDP port 4500, IKE messages have
  2898. prepended four octets of zero. These four octets of zeros are not
  2899. part of the IKE message and are not included in any of the length
  2900. fields or checksums defined by IKE. Each IKE message begins with the
  2901. IKE header, denoted HDR in this document. Following the header are
  2902. one or more IKE payloads each identified by a "Next Payload" field in
  2903. the preceding payload. Payloads are identified in the order in which
  2904. they appear in an IKE message by looking in the "Next Payload" field
  2905. in the IKE header, and subsequently according to the "Next Payload"
  2906. field in the IKE payload itself until a "Next Payload" field of zero
  2907. indicates that no payloads follow. If a payload of type "Encrypted"
  2908. is found, that payload is decrypted and its contents parsed as
  2909. additional payloads. An Encrypted payload MUST be the last payload
  2910. in a packet and an Encrypted payload MUST NOT contain another
  2911. Encrypted payload.
  2912. The responder's SPI in the header identifies an instance of an IKE
  2913. Security Association. It is therefore possible for a single instance
  2914. of IKE to multiplex distinct sessions with multiple peers, including
  2915. multiple sessions per peer.
  2916. All multi-octet fields representing integers are laid out in big
  2917. endian order (also known as "most significant byte first", or
  2918. "network byte order").
  2919. Kaufman, et al. Standards Track [Page 70]
  2920. RFC 5996 IKEv2bis September 2010
  2921. The format of the IKE header is shown in Figure 4.
  2922. 1 2 3
  2923. 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
  2924. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2925. | IKE SA Initiator's SPI |
  2926. | |
  2927. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2928. | IKE SA Responder's SPI |
  2929. | |
  2930. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2931. | Next Payload | MjVer | MnVer | Exchange Type | Flags |
  2932. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2933. | Message ID |
  2934. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2935. | Length |
  2936. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2937. Figure 4: IKE Header Format
  2938. o Initiator's SPI (8 octets) - A value chosen by the initiator to
  2939. identify a unique IKE Security Association. This value MUST NOT
  2940. be zero.
  2941. o Responder's SPI (8 octets) - A value chosen by the responder to
  2942. identify a unique IKE Security Association. This value MUST be
  2943. zero in the first message of an IKE initial exchange (including
  2944. repeats of that message including a cookie).
  2945. o Next Payload (1 octet) - Indicates the type of payload that
  2946. immediately follows the header. The format and value of each
  2947. payload are defined below.
  2948. o Major Version (4 bits) - Indicates the major version of the IKE
  2949. protocol in use. Implementations based on this version of IKE
  2950. MUST set the major version to 2. Implementations based on
  2951. previous versions of IKE and ISAKMP MUST set the major version to
  2952. 1. Implementations based on this version of IKE MUST reject or
  2953. ignore messages containing a version number greater than 2 with an
  2954. INVALID_MAJOR_VERSION notification message as described in Section
  2955. 2.5.
  2956. o Minor Version (4 bits) - Indicates the minor version of the IKE
  2957. protocol in use. Implementations based on this version of IKE
  2958. MUST set the minor version to 0. They MUST ignore the minor
  2959. version number of received messages.
  2960. Kaufman, et al. Standards Track [Page 71]
  2961. RFC 5996 IKEv2bis September 2010
  2962. o Exchange Type (1 octet) - Indicates the type of exchange being
  2963. used. This constrains the payloads sent in each message in an
  2964. exchange. The values in the following table are only current as
  2965. of the publication date of RFC 4306. Other values may have been
  2966. added since then or will be added after the publication of this
  2967. document. Readers should refer to [IKEV2IANA] for the latest
  2968. values.
  2969. Exchange Type Value
  2970. ----------------------------------
  2971. IKE_SA_INIT 34
  2972. IKE_AUTH 35
  2973. CREATE_CHILD_SA 36
  2974. INFORMATIONAL 37
  2975. o Flags (1 octet) - Indicates specific options that are set for the
  2976. message. Presence of options is indicated by the appropriate bit
  2977. in the flags field being set. The bits are as follows:
  2978. +-+-+-+-+-+-+-+-+
  2979. |X|X|R|V|I|X|X|X|
  2980. +-+-+-+-+-+-+-+-+
  2981. In the description below, a bit being 'set' means its value is '1',
  2982. while 'cleared' means its value is '0'. 'X' bits MUST be cleared
  2983. when sending and MUST be ignored on receipt.
  2984. * R (Response) - This bit indicates that this message is a
  2985. response to a message containing the same Message ID. This bit
  2986. MUST be cleared in all request messages and MUST be set in all
  2987. responses. An IKE endpoint MUST NOT generate a response to a
  2988. message that is marked as being a response (with one exception;
  2989. see Section 2.21.2).
  2990. * V (Version) - This bit indicates that the transmitter is
  2991. capable of speaking a higher major version number of the
  2992. protocol than the one indicated in the major version number
  2993. field. Implementations of IKEv2 MUST clear this bit when
  2994. sending and MUST ignore it in incoming messages.
  2995. * I (Initiator) - This bit MUST be set in messages sent by the
  2996. original initiator of the IKE SA and MUST be cleared in
  2997. messages sent by the original responder. It is used by the
  2998. recipient to determine which eight octets of the SPI were
  2999. generated by the recipient. This bit changes to reflect who
  3000. initiated the last rekey of the IKE SA.
  3001. Kaufman, et al. Standards Track [Page 72]
  3002. RFC 5996 IKEv2bis September 2010
  3003. o Message ID (4 octets, unsigned integer) - Message identifier used
  3004. to control retransmission of lost packets and matching of requests
  3005. and responses. It is essential to the security of the protocol
  3006. because it is used to prevent message replay attacks. See
  3007. Sections 2.1 and 2.2.
  3008. o Length (4 octets, unsigned integer) - Length of the total message
  3009. (header + payloads) in octets.
  3010. 3.2. Generic Payload Header
  3011. Each IKE payload defined in Sections 3.3 through 3.16 begins with a
  3012. generic payload header, shown in Figure 5. Figures for each payload
  3013. below will include the generic payload header, but for brevity, the
  3014. description of each field will be omitted.
  3015. 1 2 3
  3016. 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
  3017. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3018. | Next Payload |C| RESERVED | Payload Length |
  3019. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3020. Figure 5: Generic Payload Header
  3021. The Generic Payload Header fields are defined as follows:
  3022. o Next Payload (1 octet) - Identifier for the payload type of the
  3023. next payload in the message. If the current payload is the last
  3024. in the message, then this field will be 0. This field provides a
  3025. "chaining" capability whereby additional payloads can be added to
  3026. a message by appending each one to the end of the message and
  3027. setting the "Next Payload" field of the preceding payload to
  3028. indicate the new payload's type. An Encrypted payload, which must
  3029. always be the last payload of a message, is an exception. It
  3030. contains data structures in the format of additional payloads. In
  3031. the header of an Encrypted payload, the Next Payload field is set
  3032. to the payload type of the first contained payload (instead of 0);
  3033. conversely, the Next Payload field of the last contained payload
  3034. is set to zero). The payload type values are listed here. The
  3035. values in the following table are only current as of the
  3036. publication date of RFC 4306. Other values may have been added
  3037. since then or will be added after the publication of this
  3038. document. Readers should refer to [IKEV2IANA] for the latest
  3039. values.
  3040. Kaufman, et al. Standards Track [Page 73]
  3041. RFC 5996 IKEv2bis September 2010
  3042. Next Payload Type Notation Value
  3043. --------------------------------------------------
  3044. No Next Payload 0
  3045. Security Association SA 33
  3046. Key Exchange KE 34
  3047. Identification - Initiator IDi 35
  3048. Identification - Responder IDr 36
  3049. Certificate CERT 37
  3050. Certificate Request CERTREQ 38
  3051. Authentication AUTH 39
  3052. Nonce Ni, Nr 40
  3053. Notify N 41
  3054. Delete D 42
  3055. Vendor ID V 43
  3056. Traffic Selector - Initiator TSi 44
  3057. Traffic Selector - Responder TSr 45
  3058. Encrypted and Authenticated SK 46
  3059. Configuration CP 47
  3060. Extensible Authentication EAP 48
  3061. (Payload type values 1-32 should not be assigned in the
  3062. future so that there is no overlap with the code assignments
  3063. for IKEv1.)
  3064. o Critical (1 bit) - MUST be set to zero if the sender wants the
  3065. recipient to skip this payload if it does not understand the
  3066. payload type code in the Next Payload field of the previous
  3067. payload. MUST be set to one if the sender wants the recipient to
  3068. reject this entire message if it does not understand the payload
  3069. type. MUST be ignored by the recipient if the recipient
  3070. understands the payload type code. MUST be set to zero for
  3071. payload types defined in this document. Note that the critical
  3072. bit applies to the current payload rather than the "next" payload
  3073. whose type code appears in the first octet. The reasoning behind
  3074. not setting the critical bit for payloads defined in this document
  3075. is that all implementations MUST understand all payload types
  3076. defined in this document and therefore must ignore the critical
  3077. bit's value. Skipped payloads are expected to have valid Next
  3078. Payload and Payload Length fields. See Section 2.5 for more
  3079. information on this bit.
  3080. o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored on
  3081. receipt.
  3082. o Payload Length (2 octets, unsigned integer) - Length in octets of
  3083. the current payload, including the generic payload header.
  3084. Kaufman, et al. Standards Track [Page 74]
  3085. RFC 5996 IKEv2bis September 2010
  3086. Many payloads contain fields marked as "RESERVED". Some payloads in
  3087. IKEv2 (and historically in IKEv1) are not aligned to 4-octet
  3088. boundaries.
  3089. 3.3. Security Association Payload
  3090. The Security Association payload, denoted SA in this document, is
  3091. used to negotiate attributes of a Security Association. Assembly of
  3092. Security Association payloads requires great peace of mind. An SA
  3093. payload MAY contain multiple proposals. If there is more than one,
  3094. they MUST be ordered from most preferred to least preferred. Each
  3095. proposal contains a single IPsec protocol (where a protocol is IKE,
  3096. ESP, or AH), each protocol MAY contain multiple transforms, and each
  3097. transform MAY contain multiple attributes. When parsing an SA, an
  3098. implementation MUST check that the total Payload Length is consistent
  3099. with the payload's internal lengths and counts. Proposals,
  3100. Transforms, and Attributes each have their own variable-length
  3101. encodings. They are nested such that the Payload Length of an SA
  3102. includes the combined contents of the SA, Proposal, Transform, and
  3103. Attribute information. The length of a Proposal includes the lengths
  3104. of all Transforms and Attributes it contains. The length of a
  3105. Transform includes the lengths of all Attributes it contains.
  3106. The syntax of Security Associations, Proposals, Transforms, and
  3107. Attributes is based on ISAKMP; however, the semantics are somewhat
  3108. different. The reason for the complexity and the hierarchy is to
  3109. allow for multiple possible combinations of algorithms to be encoded
  3110. in a single SA. Sometimes there is a choice of multiple algorithms,
  3111. whereas other times there is a combination of algorithms. For
  3112. example, an initiator might want to propose using ESP with either
  3113. (3DES and HMAC_MD5) or (AES and HMAC_SHA1).
  3114. One of the reasons the semantics of the SA payload have changed from
  3115. ISAKMP and IKEv1 is to make the encodings more compact in common
  3116. cases.
  3117. The Proposal structure contains within it a Proposal Num and an IPsec
  3118. protocol ID. Each structure MUST have a proposal number one (1)
  3119. greater than the previous structure. The first Proposal in the
  3120. initiator's SA payload MUST have a Proposal Num of one (1). One
  3121. reason to use multiple proposals is to propose both standard crypto
  3122. ciphers and combined-mode ciphers. Combined-mode ciphers include
  3123. both integrity and encryption in a single encryption algorithm, and
  3124. MUST either offer no integrity algorithm or a single integrity
  3125. algorithm of "none", with no integrity algorithm being the
  3126. RECOMMENDED method. If an initiator wants to propose both combined-
  3127. mode ciphers and normal ciphers, it must include two proposals: one
  3128. will have all the combined-mode ciphers, and the other will have all
  3129. Kaufman, et al. Standards Track [Page 75]
  3130. RFC 5996 IKEv2bis September 2010
  3131. the normal ciphers with the integrity algorithms. For example, one
  3132. such proposal would have two proposal structures. Proposal 1 is ESP
  3133. with AES-128, AES-192, and AES-256 bits in Cipher Block Chaining
  3134. (CBC) mode, with either HMAC-SHA1-96 or XCBC-96 as the integrity
  3135. algorithm; Proposal 2 is AES-128 or AES-256 in GCM mode with an
  3136. 8-octet Integrity Check Value (ICV). Both proposals allow but do not
  3137. require the use of ESNs (Extended Sequence Numbers). This can be
  3138. illustrated as:
  3139. SA Payload
  3140. |
  3141. +--- Proposal #1 ( Proto ID = ESP(3), SPI size = 4,
  3142. | | 7 transforms, SPI = 0x052357bb )
  3143. | |
  3144. | +-- Transform ENCR ( Name = ENCR_AES_CBC )
  3145. | | +-- Attribute ( Key Length = 128 )
  3146. | |
  3147. | +-- Transform ENCR ( Name = ENCR_AES_CBC )
  3148. | | +-- Attribute ( Key Length = 192 )
  3149. | |
  3150. | +-- Transform ENCR ( Name = ENCR_AES_CBC )
  3151. | | +-- Attribute ( Key Length = 256 )
  3152. | |
  3153. | +-- Transform INTEG ( Name = AUTH_HMAC_SHA1_96 )
  3154. | +-- Transform INTEG ( Name = AUTH_AES_XCBC_96 )
  3155. | +-- Transform ESN ( Name = ESNs )
  3156. | +-- Transform ESN ( Name = No ESNs )
  3157. |
  3158. +--- Proposal #2 ( Proto ID = ESP(3), SPI size = 4,
  3159. | 4 transforms, SPI = 0x35a1d6f2 )
  3160. |
  3161. +-- Transform ENCR ( Name = AES-GCM with a 8 octet ICV )
  3162. | +-- Attribute ( Key Length = 128 )
  3163. |
  3164. +-- Transform ENCR ( Name = AES-GCM with a 8 octet ICV )
  3165. | +-- Attribute ( Key Length = 256 )
  3166. |
  3167. +-- Transform ESN ( Name = ESNs )
  3168. +-- Transform ESN ( Name = No ESNs )
  3169. Each Proposal/Protocol structure is followed by one or more transform
  3170. structures. The number of different transforms is generally
  3171. determined by the Protocol. AH generally has two transforms:
  3172. Extended Sequence Numbers (ESNs) and an integrity check algorithm.
  3173. ESP generally has three: ESN, an encryption algorithm, and an
  3174. integrity check algorithm. IKE generally has four transforms: a
  3175. Diffie-Hellman group, an integrity check algorithm, a PRF algorithm,
  3176. Kaufman, et al. Standards Track [Page 76]
  3177. RFC 5996 IKEv2bis September 2010
  3178. and an encryption algorithm. For each Protocol, the set of
  3179. permissible transforms is assigned Transform ID numbers, which appear
  3180. in the header of each transform.
  3181. If there are multiple transforms with the same Transform Type, the
  3182. proposal is an OR of those transforms. If there are multiple
  3183. transforms with different Transform Types, the proposal is an AND of
  3184. the different groups. For example, to propose ESP with (3DES or AES-
  3185. CBC) and (HMAC_MD5 or HMAC_SHA), the ESP proposal would contain two
  3186. Transform Type 1 candidates (one for 3DES and one for AEC-CBC) and
  3187. two Transform Type 3 candidates (one for HMAC_MD5 and one for
  3188. HMAC_SHA). This effectively proposes four combinations of
  3189. algorithms. If the initiator wanted to propose only a subset of
  3190. those, for example (3DES and HMAC_MD5) or (IDEA and HMAC_SHA), there
  3191. is no way to encode that as multiple transforms within a single
  3192. Proposal. Instead, the initiator would have to construct two
  3193. different Proposals, each with two transforms.
  3194. A given transform MAY have one or more Attributes. Attributes are
  3195. necessary when the transform can be used in more than one way, as
  3196. when an encryption algorithm has a variable key size. The transform
  3197. would specify the algorithm and the attribute would specify the key
  3198. size. Most transforms do not have attributes. A transform MUST NOT
  3199. have multiple attributes of the same type. To propose alternate
  3200. values for an attribute (for example, multiple key sizes for the AES
  3201. encryption algorithm), an implementation MUST include multiple
  3202. transforms with the same Transform Type each with a single Attribute.
  3203. Note that the semantics of Transforms and Attributes are quite
  3204. different from those in IKEv1. In IKEv1, a single Transform carried
  3205. multiple algorithms for a protocol with one carried in the Transform
  3206. and the others carried in the Attributes.
  3207. 1 2 3
  3208. 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
  3209. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3210. | Next Payload |C| RESERVED | Payload Length |
  3211. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3212. | |
  3213. ~ <Proposals> ~
  3214. | |
  3215. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3216. Figure 6: Security Association Payload
  3217. o Proposals (variable) - One or more proposal substructures.
  3218. Kaufman, et al. Standards Track [Page 77]
  3219. RFC 5996 IKEv2bis September 2010
  3220. The payload type for the Security Association payload is thirty-three
  3221. (33).
  3222. 3.3.1. Proposal Substructure
  3223. 1 2 3
  3224. 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
  3225. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3226. | 0 (last) or 2 | RESERVED | Proposal Length |
  3227. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3228. | Proposal Num | Protocol ID | SPI Size |Num Transforms|
  3229. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3230. ~ SPI (variable) ~
  3231. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3232. | |
  3233. ~ <Transforms> ~
  3234. | |
  3235. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3236. Figure 7: Proposal Substructure
  3237. o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the
  3238. last Proposal Substructure in the SA. This syntax is inherited
  3239. from ISAKMP, but is unnecessary because the last Proposal could be
  3240. identified from the length of the SA. The value (2) corresponds
  3241. to a payload type of Proposal in IKEv1, and the first four octets
  3242. of the Proposal structure are designed to look somewhat like the
  3243. header of a payload.
  3244. o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored on
  3245. receipt.
  3246. o Proposal Length (2 octets, unsigned integer) - Length of this
  3247. proposal, including all transforms and attributes that follow.
  3248. o Proposal Num (1 octet) - When a proposal is made, the first
  3249. proposal in an SA payload MUST be 1, and subsequent proposals MUST
  3250. be one more than the previous proposal (indicating an OR of the
  3251. two proposals). When a proposal is accepted, the proposal number
  3252. in the SA payload MUST match the number on the proposal sent that
  3253. was accepted.
  3254. o Protocol ID (1 octet) - Specifies the IPsec protocol identifier
  3255. for the current negotiation. The values in the following table
  3256. are only current as of the publication date of RFC 4306. Other
  3257. values may have been added since then or will be added after the
  3258. publication of this document. Readers should refer to [IKEV2IANA]
  3259. for the latest values.
  3260. Kaufman, et al. Standards Track [Page 78]
  3261. RFC 5996 IKEv2bis September 2010
  3262. Protocol Protocol ID
  3263. -----------------------------------
  3264. IKE 1
  3265. AH 2
  3266. ESP 3
  3267. o SPI Size (1 octet) - For an initial IKE SA negotiation, this field
  3268. MUST be zero; the SPI is obtained from the outer header. During
  3269. subsequent negotiations, it is equal to the size, in octets, of
  3270. the SPI of the corresponding protocol (8 for IKE, 4 for ESP and
  3271. AH).
  3272. o Num Transforms (1 octet) - Specifies the number of transforms in
  3273. this proposal.
  3274. o SPI (variable) - The sending entity's SPI. Even if the SPI Size
  3275. is not a multiple of 4 octets, there is no padding applied to the
  3276. payload. When the SPI Size field is zero, this field is not
  3277. present in the Security Association payload.
  3278. o Transforms (variable) - One or more transform substructures.
  3279. 3.3.2. Transform Substructure
  3280. 1 2 3
  3281. 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
  3282. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3283. | 0 (last) or 3 | RESERVED | Transform Length |
  3284. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3285. |Transform Type | RESERVED | Transform ID |
  3286. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3287. | |
  3288. ~ Transform Attributes ~
  3289. | |
  3290. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3291. Figure 8: Transform Substructure
  3292. o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the
  3293. last Transform Substructure in the Proposal. This syntax is
  3294. inherited from ISAKMP, but is unnecessary because the last
  3295. transform could be identified from the length of the proposal.
  3296. The value (3) corresponds to a payload type of Transform in IKEv1,
  3297. and the first four octets of the Transform structure are designed
  3298. to look somewhat like the header of a payload.
  3299. o RESERVED - MUST be sent as zero; MUST be ignored on receipt.
  3300. Kaufman, et al. Standards Track [Page 79]
  3301. RFC 5996 IKEv2bis September 2010
  3302. o Transform Length - The length (in octets) of the Transform
  3303. Substructure including Header and Attributes.
  3304. o Transform Type (1 octet) - The type of transform being specified
  3305. in this transform. Different protocols support different
  3306. Transform Types. For some protocols, some of the transforms may
  3307. be optional. If a transform is optional and the initiator wishes
  3308. to propose that the transform be omitted, no transform of the
  3309. given type is included in the proposal. If the initiator wishes
  3310. to make use of the transform optional to the responder, it
  3311. includes a transform substructure with Transform ID = 0 as one of
  3312. the options.
  3313. o Transform ID (2 octets) - The specific instance of the Transform
  3314. Type being proposed.
  3315. The Transform Type values are listed below. The values in the
  3316. following table are only current as of the publication date of RFC
  3317. 4306. Other values may have been added since then or will be added
  3318. after the publication of this document. Readers should refer to
  3319. [IKEV2IANA] for the latest values.
  3320. Description Trans. Used In
  3321. Type
  3322. ------------------------------------------------------------------
  3323. Encryption Algorithm (ENCR) 1 IKE and ESP
  3324. Pseudorandom Function (PRF) 2 IKE
  3325. Integrity Algorithm (INTEG) 3 IKE*, AH, optional in ESP
  3326. Diffie-Hellman group (D-H) 4 IKE, optional in AH & ESP
  3327. Extended Sequence Numbers (ESN) 5 AH and ESP
  3328. (*) Negotiating an integrity algorithm is mandatory for the
  3329. Encrypted payload format specified in this document. For example,
  3330. [AEAD] specifies additional formats based on authenticated
  3331. encryption, in which a separate integrity algorithm is not
  3332. negotiated.
  3333. For Transform Type 1 (Encryption Algorithm), the Transform IDs are
  3334. listed below. The values in the following table are only current as
  3335. of the publication date of RFC 4306. Other values may have been
  3336. added since then or will be added after the publication of this
  3337. document. Readers should refer to [IKEV2IANA] for the latest values.
  3338. Kaufman, et al. Standards Track [Page 80]
  3339. RFC 5996 IKEv2bis September 2010
  3340. Name Number Defined In
  3341. ---------------------------------------------------
  3342. ENCR_DES_IV64 1 (UNSPECIFIED)
  3343. ENCR_DES 2 (RFC2405), [DES]
  3344. ENCR_3DES 3 (RFC2451)
  3345. ENCR_RC5 4 (RFC2451)
  3346. ENCR_IDEA 5 (RFC2451), [IDEA]
  3347. ENCR_CAST 6 (RFC2451)
  3348. ENCR_BLOWFISH 7 (RFC2451)
  3349. ENCR_3IDEA 8 (UNSPECIFIED)
  3350. ENCR_DES_IV32 9 (UNSPECIFIED)
  3351. ENCR_NULL 11 (RFC2410)
  3352. ENCR_AES_CBC 12 (RFC3602)
  3353. ENCR_AES_CTR 13 (RFC3686)
  3354. For Transform Type 2 (Pseudorandom Function), the Transform IDs are
  3355. listed below. The values in the following table are only current as
  3356. of the publication date of RFC 4306. Other values may have been
  3357. added since then or will be added after the publication of this
  3358. document. Readers should refer to [IKEV2IANA] for the latest values.
  3359. Name Number Defined In
  3360. ------------------------------------------------------
  3361. PRF_HMAC_MD5 1 (RFC2104), [MD5]
  3362. PRF_HMAC_SHA1 2 (RFC2104), [SHA]
  3363. PRF_HMAC_TIGER 3 (UNSPECIFIED)
  3364. For Transform Type 3 (Integrity Algorithm), defined Transform IDs are
  3365. listed below. The values in the following table are only current as
  3366. of the publication date of RFC 4306. Other values may have been
  3367. added since then or will be added after the publication of this
  3368. document. Readers should refer to [IKEV2IANA] for the latest values.
  3369. Name Number Defined In
  3370. ----------------------------------------
  3371. NONE 0
  3372. AUTH_HMAC_MD5_96 1 (RFC2403)
  3373. AUTH_HMAC_SHA1_96 2 (RFC2404)
  3374. AUTH_DES_MAC 3 (UNSPECIFIED)
  3375. AUTH_KPDK_MD5 4 (UNSPECIFIED)
  3376. AUTH_AES_XCBC_96 5 (RFC3566)
  3377. For Transform Type 4 (Diffie-Hellman group), defined Transform IDs
  3378. are listed below. The values in the following table are only current
  3379. as of the publication date of RFC 4306. Other values may have been
  3380. added since then or will be added after the publication of this
  3381. document. Readers should refer to [IKEV2IANA] for the latest values.
  3382. Kaufman, et al. Standards Track [Page 81]
  3383. RFC 5996 IKEv2bis September 2010
  3384. Name Number Defined In
  3385. ----------------------------------------
  3386. NONE 0
  3387. 768-bit MODP 1 Appendix B
  3388. 1024-bit MODP 2 Appendix B
  3389. 1536-bit MODP 5 [ADDGROUP]
  3390. 2048-bit MODP 14 [ADDGROUP]
  3391. 3072-bit MODP 15 [ADDGROUP]
  3392. 4096-bit MODP 16 [ADDGROUP]
  3393. 6144-bit MODP 17 [ADDGROUP]
  3394. 8192-bit MODP 18 [ADDGROUP]
  3395. Although ESP and AH do not directly include a Diffie-Hellman
  3396. exchange, a Diffie-Hellman group MAY be negotiated for the Child SA.
  3397. This allows the peers to employ Diffie-Hellman in the CREATE_CHILD_SA
  3398. exchange, providing perfect forward secrecy for the generated Child
  3399. SA keys.
  3400. For Transform Type 5 (Extended Sequence Numbers), defined Transform
  3401. IDs are listed below. The values in the following table are only
  3402. current as of the publication date of RFC 4306. Other values may
  3403. have been added since then or will be added after the publication of
  3404. this document. Readers should refer to [IKEV2IANA] for the latest
  3405. values.
  3406. Name Number
  3407. --------------------------------------------
  3408. No Extended Sequence Numbers 0
  3409. Extended Sequence Numbers 1
  3410. Note that an initiator who supports ESNs will usually include two ESN
  3411. transforms, with values "0" and "1", in its proposals. A proposal
  3412. containing a single ESN transform with value "1" means that using
  3413. normal (non-extended) sequence numbers is not acceptable.
  3414. Numerous additional Transform Types have been defined since the
  3415. publication of RFC 4306. Please refer to the IANA IKEv2 registry for
  3416. details.
  3417. 3.3.3. Valid Transform Types by Protocol
  3418. The number and type of transforms that accompany an SA payload are
  3419. dependent on the protocol in the SA itself. An SA payload proposing
  3420. the establishment of an SA has the following mandatory and optional
  3421. Transform Types. A compliant implementation MUST understand all
  3422. mandatory and optional types for each protocol it supports (though it
  3423. Kaufman, et al. Standards Track [Page 82]
  3424. RFC 5996 IKEv2bis September 2010
  3425. need not accept proposals with unacceptable suites). A proposal MAY
  3426. omit the optional types if the only value for them it will accept is
  3427. NONE.
  3428. Protocol Mandatory Types Optional Types
  3429. ---------------------------------------------------
  3430. IKE ENCR, PRF, INTEG*, D-H
  3431. ESP ENCR, ESN INTEG, D-H
  3432. AH INTEG, ESN D-H
  3433. (*) Negotiating an integrity algorithm is mandatory for the
  3434. Encrypted payload format specified in this document. For example,
  3435. [AEAD] specifies additional formats based on authenticated
  3436. encryption, in which a separate integrity algorithm is not
  3437. negotiated.
  3438. 3.3.4. Mandatory Transform IDs
  3439. The specification of suites that MUST and SHOULD be supported for
  3440. interoperability has been removed from this document because they are
  3441. likely to change more rapidly than this document evolves. At the
  3442. time of publication of this document, [RFC4307] specifies these
  3443. suites, but note that it might be updated in the future, and other
  3444. RFCs might specify different sets of suites.
  3445. An important lesson learned from IKEv1 is that no system should only
  3446. implement the mandatory algorithms and expect them to be the best
  3447. choice for all customers.
  3448. It is likely that IANA will add additional transforms in the future,
  3449. and some users may want to use private suites, especially for IKE
  3450. where implementations should be capable of supporting different
  3451. parameters, up to certain size limits. In support of this goal, all
  3452. implementations of IKEv2 SHOULD include a management facility that
  3453. allows specification (by a user or system administrator) of Diffie-
  3454. Hellman parameters (the generator, modulus, and exponent lengths and
  3455. values) for new Diffie-Hellman groups. Implementations SHOULD
  3456. provide a management interface through which these parameters and the
  3457. associated Transform IDs may be entered (by a user or system
  3458. administrator), to enable negotiating such groups.
  3459. All implementations of IKEv2 MUST include a management facility that
  3460. enables a user or system administrator to specify the suites that are
  3461. acceptable for use with IKE. Upon receipt of a payload with a set of
  3462. Transform IDs, the implementation MUST compare the transmitted
  3463. Transform IDs against those locally configured via the management
  3464. controls, to verify that the proposed suite is acceptable based on
  3465. local policy. The implementation MUST reject SA proposals that are
  3466. Kaufman, et al. Standards Track [Page 83]
  3467. RFC 5996 IKEv2bis September 2010
  3468. not authorized by these IKE suite controls. Note that cryptographic
  3469. suites that MUST be implemented need not be configured as acceptable
  3470. to local policy.
  3471. 3.3.5. Transform Attributes
  3472. Each transform in a Security Association payload may include
  3473. attributes that modify or complete the specification of the
  3474. transform. The set of valid attributes depends on the transform.
  3475. Currently, only a single attribute type is defined: the Key Length
  3476. attribute is used by certain encryption transforms with variable-
  3477. length keys (see below for details).
  3478. The attributes are type/value pairs and are defined below.
  3479. Attributes can have a value with a fixed two-octet length or a
  3480. variable-length value. For the latter, the attribute is encoded as
  3481. type/length/value.
  3482. 1 2 3
  3483. 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
  3484. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3485. |A| Attribute Type | AF=0 Attribute Length |
  3486. |F| | AF=1 Attribute Value |
  3487. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3488. | AF=0 Attribute Value |
  3489. | AF=1 Not Transmitted |
  3490. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3491. Figure 9: Data Attributes
  3492. o Attribute Format (AF) (1 bit) - Indicates whether the data
  3493. attribute follows the Type/Length/Value (TLV) format or a
  3494. shortened Type/Value (TV) format. If the AF bit is zero (0), then
  3495. the attribute uses TLV format; if the AF bit is one (1), the TV
  3496. format (with two-byte value) is used.
  3497. o Attribute Type (15 bits) - Unique identifier for each type of
  3498. attribute (see below).
  3499. o Attribute Value (variable length) - Value of the attribute
  3500. associated with the attribute type. If the AF bit is a zero (0),
  3501. this field has a variable length defined by the Attribute Length
  3502. field. If the AF bit is a one (1), the Attribute Value has a
  3503. length of 2 octets.
  3504. The only currently defined attribute type (Key Length) is fixed
  3505. length; the variable-length encoding specification is included only
  3506. for future extensions. Attributes described as fixed length MUST NOT
  3507. Kaufman, et al. Standards Track [Page 84]
  3508. RFC 5996 IKEv2bis September 2010
  3509. be encoded using the variable-length encoding unless that length
  3510. exceeds two bytes. Variable-length attributes MUST NOT be encoded as
  3511. fixed-length even if their value can fit into two octets. Note: This
  3512. is a change from IKEv1, where increased flexibility may have
  3513. simplified the composer of messages but certainly complicated the
  3514. parser.
  3515. The values in the following table are only current as of the
  3516. publication date of RFC 4306. Other values may have been added since
  3517. then or will be added after the publication of this document.
  3518. Readers should refer to [IKEV2IANA] for the latest values.
  3519. Attribute Type Value Attribute Format
  3520. ------------------------------------------------------------
  3521. Key Length (in bits) 14 TV
  3522. Values 0-13 and 15-17 were used in a similar context in IKEv1, and
  3523. should not be assigned except to matching values.
  3524. The Key Length attribute specifies the key length in bits (MUST use
  3525. network byte order) for certain transforms as follows:
  3526. o The Key Length attribute MUST NOT be used with transforms that use
  3527. a fixed-length key. For example, this includes ENCR_DES,
  3528. ENCR_IDEA, and all the Type 2 (Pseudorandom function) and Type 3
  3529. (Integrity Algorithm) transforms specified in this document. It
  3530. is recommended that future Type 2 or 3 transforms do not use this
  3531. attribute.
  3532. o Some transforms specify that the Key Length attribute MUST be
  3533. always included (omitting the attribute is not allowed, and
  3534. proposals not containing it MUST be rejected). For example, this
  3535. includes ENCR_AES_CBC and ENCR_AES_CTR.
  3536. o Some transforms allow variable-length keys, but also specify a
  3537. default key length if the attribute is not included. For example,
  3538. these transforms include ENCR_RC5 and ENCR_BLOWFISH.
  3539. Implementation note: To further interoperability and to support
  3540. upgrading endpoints independently, implementers of this protocol
  3541. SHOULD accept values that they deem to supply greater security. For
  3542. instance, if a peer is configured to accept a variable-length cipher
  3543. with a key length of X bits and is offered that cipher with a larger
  3544. key length, the implementation SHOULD accept the offer if it supports
  3545. use of the longer key.
  3546. Kaufman, et al. Standards Track [Page 85]
  3547. RFC 5996 IKEv2bis September 2010
  3548. Support for this capability allows a responder to express a concept
  3549. of "at least" a certain level of security -- "a key length of _at
  3550. least_ X bits for cipher Y". However, as the attribute is always
  3551. returned unchanged (see the next section), an initiator willing to
  3552. accept multiple key lengths has to include multiple transforms with
  3553. the same Transform Type, each with a different Key Length attribute.
  3554. 3.3.6. Attribute Negotiation
  3555. During Security Association negotiation initiators present offers to
  3556. responders. Responders MUST select a single complete set of
  3557. parameters from the offers (or reject all offers if none are
  3558. acceptable). If there are multiple proposals, the responder MUST
  3559. choose a single proposal. If the selected proposal has multiple
  3560. transforms with the same type, the responder MUST choose a single
  3561. one. Any attributes of a selected transform MUST be returned
  3562. unmodified. The initiator of an exchange MUST check that the
  3563. accepted offer is consistent with one of its proposals, and if not
  3564. MUST terminate the exchange.
  3565. If the responder receives a proposal that contains a Transform Type
  3566. it does not understand, or a proposal that is missing a mandatory
  3567. Transform Type, it MUST consider this proposal unacceptable; however,
  3568. other proposals in the same SA payload are processed as usual.
  3569. Similarly, if the responder receives a transform that it does not
  3570. understand, or one that contains a Transform Attribute it does not
  3571. understand, it MUST consider this transform unacceptable; other
  3572. transforms with the same Transform Type are processed as usual. This
  3573. allows new Transform Types and Transform Attributes to be defined in
  3574. the future.
  3575. Negotiating Diffie-Hellman groups presents some special challenges.
  3576. SA offers include proposed attributes and a Diffie-Hellman public
  3577. number (KE) in the same message. If in the initial exchange the
  3578. initiator offers to use one of several Diffie-Hellman groups, it
  3579. SHOULD pick the one the responder is most likely to accept and
  3580. include a KE corresponding to that group. If the responder selects a
  3581. proposal using a different Diffie-Hellman group (other than NONE),
  3582. the responder will indicate the correct group in the response and the
  3583. initiator SHOULD pick an element of that group for its KE value when
  3584. retrying the first message. It SHOULD, however, continue to propose
  3585. its full supported set of groups in order to prevent a man-in-the-
  3586. middle downgrade attack. If one of the proposals offered is for the
  3587. Diffie-Hellman group of NONE, and the responder selects that Diffie-
  3588. Hellman group, then it MUST ignore the initiator's KE payload and
  3589. omit the KE payload from the response.
  3590. Kaufman, et al. Standards Track [Page 86]
  3591. RFC 5996 IKEv2bis September 2010
  3592. 3.4. Key Exchange Payload
  3593. The Key Exchange payload, denoted KE in this document, is used to
  3594. exchange Diffie-Hellman public numbers as part of a Diffie-Hellman
  3595. key exchange. The Key Exchange payload consists of the IKE generic
  3596. payload header followed by the Diffie-Hellman public value itself.
  3597. 1 2 3
  3598. 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
  3599. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3600. | Next Payload |C| RESERVED | Payload Length |
  3601. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3602. | Diffie-Hellman Group Num | RESERVED |
  3603. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3604. | |
  3605. ~ Key Exchange Data ~
  3606. | |
  3607. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3608. Figure 10: Key Exchange Payload Format
  3609. A Key Exchange payload is constructed by copying one's Diffie-Hellman
  3610. public value into the "Key Exchange Data" portion of the payload.
  3611. The length of the Diffie-Hellman public value for modular
  3612. exponentiation group (MODP) groups MUST be equal to the length of the
  3613. prime modulus over which the exponentiation was performed, prepending
  3614. zero bits to the value if necessary.
  3615. The Diffie-Hellman Group Num identifies the Diffie-Hellman group in
  3616. which the Key Exchange Data was computed (see Section 3.3.2). This
  3617. Diffie-Hellman Group Num MUST match a Diffie-Hellman group specified
  3618. in a proposal in the SA payload that is sent in the same message, and
  3619. SHOULD match the Diffie-Hellman group in the first group in the first
  3620. proposal, if such exists. If none of the proposals in that SA
  3621. payload specifies a Diffie-Hellman group, the KE payload MUST NOT be
  3622. present. If the selected proposal uses a different Diffie-Hellman
  3623. group (other than NONE), the message MUST be rejected with a Notify
  3624. payload of type INVALID_KE_PAYLOAD. See also Sections 1.2 and 2.7.
  3625. The payload type for the Key Exchange payload is thirty-four (34).
  3626. 3.5. Identification Payloads
  3627. The Identification payloads, denoted IDi and IDr in this document,
  3628. allow peers to assert an identity to one another. This identity may
  3629. be used for policy lookup, but does not necessarily have to match
  3630. anything in the CERT payload; both fields may be used by an
  3631. implementation to perform access control decisions. When using the
  3632. Kaufman, et al. Standards Track [Page 87]
  3633. RFC 5996 IKEv2bis September 2010
  3634. ID_IPV4_ADDR/ID_IPV6_ADDR identity types in IDi/IDr payloads, IKEv2
  3635. does not require this address to match the address in the IP header
  3636. of IKEv2 packets, or anything in the TSi/TSr payloads. The contents
  3637. of IDi/IDr are used purely to fetch the policy and authentication
  3638. data related to the other party.
  3639. NOTE: In IKEv1, two ID payloads were used in each direction to hold
  3640. Traffic Selector (TS) information for data passing over the SA. In
  3641. IKEv2, this information is carried in TS payloads (see Section 3.13).
  3642. The Peer Authorization Database (PAD) as described in RFC 4301
  3643. [IPSECARCH] describes the use of the ID payload in IKEv2 and provides
  3644. a formal model for the binding of identity to policy in addition to
  3645. providing services that deal more specifically with the details of
  3646. policy enforcement. The PAD is intended to provide a link between
  3647. the SPD and the IKE Security Association management. See Section
  3648. 4.4.3 of RFC 4301 for more details.
  3649. The Identification payload consists of the IKE generic payload header
  3650. followed by identification fields as follows:
  3651. 1 2 3
  3652. 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
  3653. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3654. | Next Payload |C| RESERVED | Payload Length |
  3655. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3656. | ID Type | RESERVED |
  3657. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3658. | |
  3659. ~ Identification Data ~
  3660. | |
  3661. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3662. Figure 11: Identification Payload Format
  3663. o ID Type (1 octet) - Specifies the type of Identification being
  3664. used.
  3665. o RESERVED - MUST be sent as zero; MUST be ignored on receipt.
  3666. o Identification Data (variable length) - Value, as indicated by the
  3667. Identification Type. The length of the Identification Data is
  3668. computed from the size in the ID payload header.
  3669. The payload types for the Identification payload are thirty-five (35)
  3670. for IDi and thirty-six (36) for IDr.
  3671. Kaufman, et al. Standards Track [Page 88]
  3672. RFC 5996 IKEv2bis September 2010
  3673. The following table lists the assigned semantics for the
  3674. Identification Type field. The values in the following table are
  3675. only current as of the publication date of RFC 4306. Other values
  3676. may have been added since then or will be added after the publication
  3677. of this document. Readers should refer to [IKEV2IANA] for the latest
  3678. values.
  3679. ID Type Value
  3680. -------------------------------------------------------------------
  3681. ID_IPV4_ADDR 1
  3682. A single four (4) octet IPv4 address.
  3683. ID_FQDN 2
  3684. A fully-qualified domain name string. An example of an ID_FQDN
  3685. is "example.com". The string MUST NOT contain any terminators
  3686. (e.g., NULL, CR, etc.). All characters in the ID_FQDN are ASCII;
  3687. for an "internationalized domain name", the syntax is as defined
  3688. in [IDNA], for example "xn--tmonesimerkki-bfbb.example.net".
  3689. ID_RFC822_ADDR 3
  3690. A fully-qualified RFC 822 email address string. An example of a
  3691. ID_RFC822_ADDR is "jsmith@example.com". The string MUST NOT
  3692. contain any terminators. Because of [EAI], implementations would
  3693. be wise to treat this field as UTF-8 encoded text, not as
  3694. pure ASCII.
  3695. ID_IPV6_ADDR 5
  3696. A single sixteen (16) octet IPv6 address.
  3697. ID_DER_ASN1_DN 9
  3698. The binary Distinguished Encoding Rules (DER) encoding of an
  3699. ASN.1 X.500 Distinguished Name [PKIX].
  3700. ID_DER_ASN1_GN 10
  3701. The binary DER encoding of an ASN.1 X.509 GeneralName [PKIX].
  3702. ID_KEY_ID 11
  3703. An opaque octet stream that may be used to pass vendor-
  3704. specific information necessary to do certain proprietary
  3705. types of identification.
  3706. Two implementations will interoperate only if each can generate a
  3707. type of ID acceptable to the other. To assure maximum
  3708. interoperability, implementations MUST be configurable to send at
  3709. least one of ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, or ID_KEY_ID, and
  3710. MUST be configurable to accept all of these four types.
  3711. Implementations SHOULD be capable of generating and accepting all of
  3712. these types. IPv6-capable implementations MUST additionally be
  3713. Kaufman, et al. Standards Track [Page 89]
  3714. RFC 5996 IKEv2bis September 2010
  3715. configurable to accept ID_IPV6_ADDR. IPv6-only implementations MAY
  3716. be configurable to send only ID_IPV6_ADDR instead of ID_IPV4_ADDR for
  3717. IP addresses.
  3718. EAP [EAP] does not mandate the use of any particular type of
  3719. identifier, but often EAP is used with Network Access Identifiers
  3720. (NAIs) defined in [NAI]. Although NAIs look a bit like email
  3721. addresses (e.g., "joe@example.com"), the syntax is not exactly the
  3722. same as the syntax of email address in [MAILFORMAT]. For those NAIs
  3723. that include the realm component, the ID_RFC822_ADDR identification
  3724. type SHOULD be used. Responder implementations should not attempt to
  3725. verify that the contents actually conform to the exact syntax given
  3726. in [MAILFORMAT], but instead should accept any reasonable-looking
  3727. NAI. For NAIs that do not include the realm component, the ID_KEY_ID
  3728. identification type SHOULD be used.
  3729. 3.6. Certificate Payload
  3730. The Certificate payload, denoted CERT in this document, provides a
  3731. means to transport certificates or other authentication-related
  3732. information via IKE. Certificate payloads SHOULD be included in an
  3733. exchange if certificates are available to the sender. The Hash and
  3734. URL formats of the Certificate payloads should be used in case the
  3735. peer has indicated an ability to retrieve this information from
  3736. elsewhere using an HTTP_CERT_LOOKUP_SUPPORTED Notify payload. Note
  3737. that the term "Certificate payload" is somewhat misleading, because
  3738. not all authentication mechanisms use certificates and data other
  3739. than certificates may be passed in this payload.
  3740. The Certificate payload is defined as follows:
  3741. 1 2 3
  3742. 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
  3743. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3744. | Next Payload |C| RESERVED | Payload Length |
  3745. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3746. | Cert Encoding | |
  3747. +-+-+-+-+-+-+-+-+ |
  3748. ~ Certificate Data ~
  3749. | |
  3750. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3751. Figure 12: Certificate Payload Format
  3752. o Certificate Encoding (1 octet) - This field indicates the type of
  3753. certificate or certificate-related information contained in the
  3754. Certificate Data field. The values in the following table are
  3755. only current as of the publication date of RFC 4306. Other values
  3756. Kaufman, et al. Standards Track [Page 90]
  3757. RFC 5996 IKEv2bis September 2010
  3758. may have been added since then or will be added after the
  3759. publication of this document. Readers should refer to [IKEV2IANA]
  3760. for the latest values.
  3761. Certificate Encoding Value
  3762. ----------------------------------------------------
  3763. PKCS #7 wrapped X.509 certificate 1 UNSPECIFIED
  3764. PGP Certificate 2 UNSPECIFIED
  3765. DNS Signed Key 3 UNSPECIFIED
  3766. X.509 Certificate - Signature 4
  3767. Kerberos Token 6 UNSPECIFIED
  3768. Certificate Revocation List (CRL) 7
  3769. Authority Revocation List (ARL) 8 UNSPECIFIED
  3770. SPKI Certificate 9 UNSPECIFIED
  3771. X.509 Certificate - Attribute 10 UNSPECIFIED
  3772. Raw RSA Key 11
  3773. Hash and URL of X.509 certificate 12
  3774. Hash and URL of X.509 bundle 13
  3775. o Certificate Data (variable length) - Actual encoding of
  3776. certificate data. The type of certificate is indicated by the
  3777. Certificate Encoding field.
  3778. The payload type for the Certificate payload is thirty-seven (37).
  3779. Specific syntax for some of the certificate type codes above is not
  3780. defined in this document. The types whose syntax is defined in this
  3781. document are:
  3782. o "X.509 Certificate - Signature" contains a DER-encoded X.509
  3783. certificate whose public key is used to validate the sender's AUTH
  3784. payload. Note that with this encoding, if a chain of certificates
  3785. needs to be sent, multiple CERT payloads are used, only the first
  3786. of which holds the public key used to validate the sender's AUTH
  3787. payload.
  3788. o "Certificate Revocation List" contains a DER-encoded X.509
  3789. certificate revocation list.
  3790. o "Raw RSA Key" contains a PKCS #1 encoded RSA key, that is, a DER-
  3791. encoded RSAPublicKey structure (see [RSA] and [PKCS1]).
  3792. o Hash and URL encodings allow IKE messages to remain short by
  3793. replacing long data structures with a 20-octet SHA-1 hash (see
  3794. [SHA]) of the replaced value followed by a variable-length URL
  3795. that resolves to the DER-encoded data structure itself. This
  3796. improves efficiency when the endpoints have certificate data
  3797. Kaufman, et al. Standards Track [Page 91]
  3798. RFC 5996 IKEv2bis September 2010
  3799. cached and makes IKE less subject to DoS attacks that become
  3800. easier to mount when IKE messages are large enough to require IP
  3801. fragmentation [DOSUDPPROT].
  3802. The "Hash and URL of a bundle" type uses the following ASN.1
  3803. definition for the X.509 bundle:
  3804. CertBundle
  3805. { iso(1) identified-organization(3) dod(6) internet(1)
  3806. security(5) mechanisms(5) pkix(7) id-mod(0)
  3807. id-mod-cert-bundle(34) }
  3808. DEFINITIONS EXPLICIT TAGS ::=
  3809. BEGIN
  3810. IMPORTS
  3811. Certificate, CertificateList
  3812. FROM PKIX1Explicit88
  3813. { iso(1) identified-organization(3) dod(6)
  3814. internet(1) security(5) mechanisms(5) pkix(7)
  3815. id-mod(0) id-pkix1-explicit(18) } ;
  3816. CertificateOrCRL ::= CHOICE {
  3817. cert [0] Certificate,
  3818. crl [1] CertificateList }
  3819. CertificateBundle ::= SEQUENCE OF CertificateOrCRL
  3820. END
  3821. Implementations MUST be capable of being configured to send and
  3822. accept up to four X.509 certificates in support of authentication,
  3823. and also MUST be capable of being configured to send and accept the
  3824. Hash and URL format (with HTTP URLs). Implementations SHOULD be
  3825. capable of being configured to send and accept Raw RSA keys. If
  3826. multiple certificates are sent, the first certificate MUST contain
  3827. the public key used to sign the AUTH payload. The other certificates
  3828. may be sent in any order.
  3829. Implementations MUST support the HTTP [HTTP] method for hash-and-URL
  3830. lookup. The behavior of other URL methods [URLS] is not currently
  3831. specified, and such methods SHOULD NOT be used in the absence of a
  3832. document specifying them.
  3833. Kaufman, et al. Standards Track [Page 92]
  3834. RFC 5996 IKEv2bis September 2010
  3835. 3.7. Certificate Request Payload
  3836. The Certificate Request payload, denoted CERTREQ in this document,
  3837. provides a means to request preferred certificates via IKE and can
  3838. appear in the IKE_INIT_SA response and/or the IKE_AUTH request.
  3839. Certificate Request payloads MAY be included in an exchange when the
  3840. sender needs to get the certificate of the receiver.
  3841. The Certificate Request payload is defined as follows:
  3842. 1 2 3
  3843. 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
  3844. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3845. | Next Payload |C| RESERVED | Payload Length |
  3846. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3847. | Cert Encoding | |
  3848. +-+-+-+-+-+-+-+-+ |
  3849. ~ Certification Authority ~
  3850. | |
  3851. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3852. Figure 13: Certificate Request Payload Format
  3853. o Certificate Encoding (1 octet) - Contains an encoding of the type
  3854. or format of certificate requested. Values are listed in
  3855. Section 3.6.
  3856. o Certification Authority (variable length) - Contains an encoding
  3857. of an acceptable certification authority for the type of
  3858. certificate requested.
  3859. The payload type for the Certificate Request payload is thirty-eight
  3860. (38).
  3861. The Certificate Encoding field has the same values as those defined
  3862. in Section 3.6. The Certification Authority field contains an
  3863. indicator of trusted authorities for this certificate type. The
  3864. Certification Authority value is a concatenated list of SHA-1 hashes
  3865. of the public keys of trusted Certification Authorities (CAs). Each
  3866. is encoded as the SHA-1 hash of the Subject Public Key Info element
  3867. (see section 4.1.2.7 of [PKIX]) from each Trust Anchor certificate.
  3868. The 20-octet hashes are concatenated and included with no other
  3869. formatting.
  3870. The contents of the "Certification Authority" field are defined only
  3871. for X.509 certificates, which are types 4, 12, and 13. Other values
  3872. SHOULD NOT be used until Standards-Track specifications that specify
  3873. their use are published.
  3874. Kaufman, et al. Standards Track [Page 93]
  3875. RFC 5996 IKEv2bis September 2010
  3876. Note that the term "Certificate Request" is somewhat misleading, in
  3877. that values other than certificates are defined in a "Certificate"
  3878. payload and requests for those values can be present in a Certificate
  3879. Request payload. The syntax of the Certificate Request payload in
  3880. such cases is not defined in this document.
  3881. The Certificate Request payload is processed by inspecting the "Cert
  3882. Encoding" field to determine whether the processor has any
  3883. certificates of this type. If so, the "Certification Authority"
  3884. field is inspected to determine if the processor has any certificates
  3885. that can be validated up to one of the specified certification
  3886. authorities. This can be a chain of certificates.
  3887. If an end-entity certificate exists that satisfies the criteria
  3888. specified in the CERTREQ, a certificate or certificate chain SHOULD
  3889. be sent back to the certificate requestor if the recipient of the
  3890. CERTREQ:
  3891. o is configured to use certificate authentication,
  3892. o is allowed to send a CERT payload,
  3893. o has matching CA trust policy governing the current negotiation,
  3894. and
  3895. o has at least one time-wise and usage-appropriate end-entity
  3896. certificate chaining to a CA provided in the CERTREQ.
  3897. Certificate revocation checking must be considered during the
  3898. chaining process used to select a certificate. Note that even if two
  3899. peers are configured to use two different CAs, cross-certification
  3900. relationships should be supported by appropriate selection logic.
  3901. The intent is not to prevent communication through the strict
  3902. adherence of selection of a certificate based on CERTREQ, when an
  3903. alternate certificate could be selected by the sender that would
  3904. still enable the recipient to successfully validate and trust it
  3905. through trust conveyed by cross-certification, CRLs, or other out-of-
  3906. band configured means. Thus, the processing of a CERTREQ should be
  3907. seen as a suggestion for a certificate to select, not a mandated one.
  3908. If no certificates exist, then the CERTREQ is ignored. This is not
  3909. an error condition of the protocol. There may be cases where there
  3910. is a preferred CA sent in the CERTREQ, but an alternate might be
  3911. acceptable (perhaps after prompting a human operator).
  3912. Kaufman, et al. Standards Track [Page 94]
  3913. RFC 5996 IKEv2bis September 2010
  3914. The HTTP_CERT_LOOKUP_SUPPORTED notification MAY be included in any
  3915. message that can include a CERTREQ payload and indicates that the
  3916. sender is capable of looking up certificates based on an HTTP-based
  3917. URL (and hence presumably would prefer to receive certificate
  3918. specifications in that format).
  3919. 3.8. Authentication Payload
  3920. The Authentication payload, denoted AUTH in this document, contains
  3921. data used for authentication purposes. The syntax of the
  3922. Authentication data varies according to the Auth Method as specified
  3923. below.
  3924. The Authentication payload is defined as follows:
  3925. 1 2 3
  3926. 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
  3927. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3928. | Next Payload |C| RESERVED | Payload Length |
  3929. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3930. | Auth Method | RESERVED |
  3931. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3932. | |
  3933. ~ Authentication Data ~
  3934. | |
  3935. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3936. Figure 14: Authentication Payload Format
  3937. o Auth Method (1 octet) - Specifies the method of authentication
  3938. used. The types of signatures are listed here. The values in the
  3939. following table are only current as of the publication date of RFC
  3940. 4306. Other values may have been added since then or will be
  3941. added after the publication of this document. Readers should
  3942. refer to [IKEV2IANA] for the latest values.
  3943. Mechanism Value
  3944. -----------------------------------------------------------------
  3945. RSA Digital Signature 1
  3946. Computed as specified in Section 2.15 using an RSA private key
  3947. with RSASSA-PKCS1-v1_5 signature scheme specified in [PKCS1]
  3948. (implementers should note that IKEv1 used a different method for
  3949. RSA signatures). To promote interoperability, implementations
  3950. that support this type SHOULD support signatures that use SHA-1
  3951. as the hash function and SHOULD use SHA-1 as the default hash
  3952. function when generating signatures. Implementations can use the
  3953. certificates received from a given peer as a hint for selecting a
  3954. mutually understood hash function for the AUTH payload signature.
  3955. Kaufman, et al. Standards Track [Page 95]
  3956. RFC 5996 IKEv2bis September 2010
  3957. Note, however, that the hash algorithm used in the AUTH payload
  3958. signature doesn't have to be the same as any hash algorithm(s)
  3959. used in the certificate(s).
  3960. Shared Key Message Integrity Code 2
  3961. Computed as specified in Section 2.15 using the shared key
  3962. associated with the identity in the ID payload and the negotiated
  3963. PRF.
  3964. DSS Digital Signature 3
  3965. Computed as specified in Section 2.15 using a DSS private key
  3966. (see [DSS]) over a SHA-1 hash.
  3967. o Authentication Data (variable length) - see Section 2.15.
  3968. The payload type for the Authentication payload is thirty-nine (39).
  3969. 3.9. Nonce Payload
  3970. The Nonce payload, denoted as Ni and Nr in this document for the
  3971. initiator's and responder's nonce, respectively, contains random data
  3972. used to guarantee liveness during an exchange and protect against
  3973. replay attacks.
  3974. The Nonce payload is defined as follows:
  3975. 1 2 3
  3976. 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
  3977. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3978. | Next Payload |C| RESERVED | Payload Length |
  3979. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3980. | |
  3981. ~ Nonce Data ~
  3982. | |
  3983. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3984. Figure 15: Nonce Payload Format
  3985. o Nonce Data (variable length) - Contains the random data generated
  3986. by the transmitting entity.
  3987. The payload type for the Nonce payload is forty (40).
  3988. The size of the Nonce Data MUST be between 16 and 256 octets,
  3989. inclusive. Nonce values MUST NOT be reused.
  3990. Kaufman, et al. Standards Track [Page 96]
  3991. RFC 5996 IKEv2bis September 2010
  3992. 3.10. Notify Payload
  3993. The Notify payload, denoted N in this document, is used to transmit
  3994. informational data, such as error conditions and state transitions,
  3995. to an IKE peer. A Notify payload may appear in a response message
  3996. (usually specifying why a request was rejected), in an INFORMATIONAL
  3997. Exchange (to report an error not in an IKE request), or in any other
  3998. message to indicate sender capabilities or to modify the meaning of
  3999. the request.
  4000. The Notify payload is defined as follows:
  4001. 1 2 3
  4002. 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
  4003. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4004. | Next Payload |C| RESERVED | Payload Length |
  4005. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4006. | Protocol ID | SPI Size | Notify Message Type |
  4007. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4008. | |
  4009. ~ Security Parameter Index (SPI) ~
  4010. | |
  4011. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4012. | |
  4013. ~ Notification Data ~
  4014. | |
  4015. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4016. Figure 16: Notify Payload Format
  4017. o Protocol ID (1 octet) - If this notification concerns an existing
  4018. SA whose SPI is given in the SPI field, this field indicates the
  4019. type of that SA. For notifications concerning Child SAs, this
  4020. field MUST contain either (2) to indicate AH or (3) to indicate
  4021. ESP. Of the notifications defined in this document, the SPI is
  4022. included only with INVALID_SELECTORS and REKEY_SA. If the SPI
  4023. field is empty, this field MUST be sent as zero and MUST be
  4024. ignored on receipt.
  4025. o SPI Size (1 octet) - Length in octets of the SPI as defined by the
  4026. IPsec protocol ID or zero if no SPI is applicable. For a
  4027. notification concerning the IKE SA, the SPI Size MUST be zero and
  4028. the field must be empty.
  4029. o Notify Message Type (2 octets) - Specifies the type of
  4030. notification message.
  4031. o SPI (variable length) - Security Parameter Index.
  4032. Kaufman, et al. Standards Track [Page 97]
  4033. RFC 5996 IKEv2bis September 2010
  4034. o Notification Data (variable length) - Status or error data
  4035. transmitted in addition to the Notify Message Type. Values for
  4036. this field are type specific (see below).
  4037. The payload type for the Notify payload is forty-one (41).
  4038. 3.10.1. Notify Message Types
  4039. Notification information can be error messages specifying why an SA
  4040. could not be established. It can also be status data that a process
  4041. managing an SA database wishes to communicate with a peer process.
  4042. The table below lists the Notification messages and their
  4043. corresponding values. The number of different error statuses was
  4044. greatly reduced from IKEv1 both for simplification and to avoid
  4045. giving configuration information to probers.
  4046. Types in the range 0 - 16383 are intended for reporting errors. An
  4047. implementation receiving a Notify payload with one of these types
  4048. that it does not recognize in a response MUST assume that the
  4049. corresponding request has failed entirely. Unrecognized error types
  4050. in a request and status types in a request or response MUST be
  4051. ignored, and they should be logged.
  4052. Notify payloads with status types MAY be added to any message and
  4053. MUST be ignored if not recognized. They are intended to indicate
  4054. capabilities, and as part of SA negotiation, are used to negotiate
  4055. non-cryptographic parameters.
  4056. More information on error handling can be found in Section 2.21.
  4057. The values in the following table are only current as of the
  4058. publication date of RFC 4306, plus two error types added in this
  4059. document. Other values may have been added since then or will be
  4060. added after the publication of this document. Readers should refer
  4061. to [IKEV2IANA] for the latest values.
  4062. NOTIFY messages: error types Value
  4063. -------------------------------------------------------------------
  4064. UNSUPPORTED_CRITICAL_PAYLOAD 1
  4065. See Section 2.5.
  4066. INVALID_IKE_SPI 4
  4067. See Section 2.21.
  4068. INVALID_MAJOR_VERSION 5
  4069. See Section 2.5.
  4070. Kaufman, et al. Standards Track [Page 98]
  4071. RFC 5996 IKEv2bis September 2010
  4072. INVALID_SYNTAX 7
  4073. Indicates the IKE message that was received was invalid because
  4074. some type, length, or value was out of range or because the
  4075. request was rejected for policy reasons. To avoid a DoS
  4076. attack using forged messages, this status may only be
  4077. returned for and in an encrypted packet if the Message ID and
  4078. cryptographic checksum were valid. To avoid leaking information
  4079. to someone probing a node, this status MUST be sent in response
  4080. to any error not covered by one of the other status types.
  4081. To aid debugging, more detailed error information should be
  4082. written to a console or log.
  4083. INVALID_MESSAGE_ID 9
  4084. See Section 2.3.
  4085. INVALID_SPI 11
  4086. See Section 1.5.
  4087. NO_PROPOSAL_CHOSEN 14
  4088. None of the proposed crypto suites was acceptable. This can be
  4089. sent in any case where the offered proposals (including but not
  4090. limited to SA payload values, USE_TRANSPORT_MODE notify,
  4091. IPCOMP_SUPPORTED notify) are not acceptable for the responder.
  4092. This can also be used as "generic" Child SA error when Child SA
  4093. cannot be created for some other reason. See also Section 2.7.
  4094. INVALID_KE_PAYLOAD 17
  4095. See Sections 1.2 and 1.3.
  4096. AUTHENTICATION_FAILED 24
  4097. Sent in the response to an IKE_AUTH message when, for some reason,
  4098. the authentication failed. There is no associated data. See also
  4099. Section 2.21.2.
  4100. SINGLE_PAIR_REQUIRED 34
  4101. See Section 2.9.
  4102. NO_ADDITIONAL_SAS 35
  4103. See Section 1.3.
  4104. INTERNAL_ADDRESS_FAILURE 36
  4105. See Section 3.15.4.
  4106. FAILED_CP_REQUIRED 37
  4107. See Section 2.19.
  4108. TS_UNACCEPTABLE 38
  4109. See Section 2.9.
  4110. Kaufman, et al. Standards Track [Page 99]
  4111. RFC 5996 IKEv2bis September 2010
  4112. INVALID_SELECTORS 39
  4113. MAY be sent in an IKE INFORMATIONAL exchange when a node receives
  4114. an ESP or AH packet whose selectors do not match those of the SA
  4115. on which it was delivered (and that caused the packet to be
  4116. dropped). The Notification Data contains the start of the
  4117. offending packet (as in ICMP messages) and the SPI field of the
  4118. notification is set to match the SPI of the Child SA.
  4119. TEMPORARY_FAILURE 43
  4120. See section 2.25.
  4121. CHILD_SA_NOT_FOUND 44
  4122. See section 2.25.
  4123. NOTIFY messages: status types Value
  4124. -------------------------------------------------------------------
  4125. INITIAL_CONTACT 16384
  4126. See Section 2.4.
  4127. SET_WINDOW_SIZE 16385
  4128. See Section 2.3.
  4129. ADDITIONAL_TS_POSSIBLE 16386
  4130. See Section 2.9.
  4131. IPCOMP_SUPPORTED 16387
  4132. See Section 2.22.
  4133. NAT_DETECTION_SOURCE_IP 16388
  4134. See Section 2.23.
  4135. NAT_DETECTION_DESTINATION_IP 16389
  4136. See Section 2.23.
  4137. COOKIE 16390
  4138. See Section 2.6.
  4139. USE_TRANSPORT_MODE 16391
  4140. See Section 1.3.1.
  4141. HTTP_CERT_LOOKUP_SUPPORTED 16392
  4142. See Section 3.6.
  4143. REKEY_SA 16393
  4144. See Section 1.3.3.
  4145. Kaufman, et al. Standards Track [Page 100]
  4146. RFC 5996 IKEv2bis September 2010
  4147. ESP_TFC_PADDING_NOT_SUPPORTED 16394
  4148. See Section 1.3.1.
  4149. NON_FIRST_FRAGMENTS_ALSO 16395
  4150. See Section 1.3.1.
  4151. 3.11. Delete Payload
  4152. The Delete payload, denoted D in this document, contains a protocol-
  4153. specific Security Association identifier that the sender has removed
  4154. from its Security Association database and is, therefore, no longer
  4155. valid. Figure 17 shows the format of the Delete payload. It is
  4156. possible to send multiple SPIs in a Delete payload; however, each SPI
  4157. MUST be for the same protocol. Mixing of protocol identifiers MUST
  4158. NOT be performed in the Delete payload. It is permitted, however, to
  4159. include multiple Delete payloads in a single INFORMATIONAL exchange
  4160. where each Delete payload lists SPIs for a different protocol.
  4161. Deletion of the IKE SA is indicated by a protocol ID of 1 (IKE) but
  4162. no SPIs. Deletion of a Child SA, such as ESP or AH, will contain the
  4163. IPsec protocol ID of that protocol (2 for AH, 3 for ESP), and the SPI
  4164. is the SPI the sending endpoint would expect in inbound ESP or AH
  4165. packets.
  4166. The Delete payload is defined as follows:
  4167. 1 2 3
  4168. 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
  4169. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4170. | Next Payload |C| RESERVED | Payload Length |
  4171. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4172. | Protocol ID | SPI Size | Num of SPIs |
  4173. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4174. | |
  4175. ~ Security Parameter Index(es) (SPI) ~
  4176. | |
  4177. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4178. Figure 17: Delete Payload Format
  4179. o Protocol ID (1 octet) - Must be 1 for an IKE SA, 2 for AH, or 3
  4180. for ESP.
  4181. o SPI Size (1 octet) - Length in octets of the SPI as defined by the
  4182. protocol ID. It MUST be zero for IKE (SPI is in message header)
  4183. or four for AH and ESP.
  4184. Kaufman, et al. Standards Track [Page 101]
  4185. RFC 5996 IKEv2bis September 2010
  4186. o Num of SPIs (2 octets, unsigned integer) - The number of SPIs
  4187. contained in the Delete payload. The size of each SPI is defined
  4188. by the SPI Size field.
  4189. o Security Parameter Index(es) (variable length) - Identifies the
  4190. specific Security Association(s) to delete. The length of this
  4191. field is determined by the SPI Size and Num of SPIs fields.
  4192. The payload type for the Delete payload is forty-two (42).
  4193. 3.12. Vendor ID Payload
  4194. The Vendor ID payload, denoted V in this document, contains a vendor-
  4195. defined constant. The constant is used by vendors to identify and
  4196. recognize remote instances of their implementations. This mechanism
  4197. allows a vendor to experiment with new features while maintaining
  4198. backward compatibility.
  4199. A Vendor ID payload MAY announce that the sender is capable of
  4200. accepting certain extensions to the protocol, or it MAY simply
  4201. identify the implementation as an aid in debugging. A Vendor ID
  4202. payload MUST NOT change the interpretation of any information defined
  4203. in this specification (i.e., the critical bit MUST be set to 0).
  4204. Multiple Vendor ID payloads MAY be sent. An implementation is not
  4205. required to send any Vendor ID payload at all.
  4206. A Vendor ID payload may be sent as part of any message. Reception of
  4207. a familiar Vendor ID payload allows an implementation to make use of
  4208. private use numbers described throughout this document, such as
  4209. private payloads, private exchanges, private notifications, etc.
  4210. Unfamiliar Vendor IDs MUST be ignored.
  4211. Writers of documents who wish to extend this protocol MUST define a
  4212. Vendor ID payload to announce the ability to implement the extension
  4213. in the document. It is expected that documents that gain acceptance
  4214. and are standardized will be given "magic numbers" out of the Future
  4215. Use range by IANA, and the requirement to use a Vendor ID will go
  4216. away.
  4217. The Vendor ID payload fields are defined as follows:
  4218. Kaufman, et al. Standards Track [Page 102]
  4219. RFC 5996 IKEv2bis September 2010
  4220. 1 2 3
  4221. 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
  4222. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4223. | Next Payload |C| RESERVED | Payload Length |
  4224. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4225. | |
  4226. ~ Vendor ID (VID) ~
  4227. | |
  4228. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4229. Figure 18: Vendor ID Payload Format
  4230. o Vendor ID (variable length) - It is the responsibility of the
  4231. person choosing the Vendor ID to assure its uniqueness in spite of
  4232. the absence of any central registry for IDs. Good practice is to
  4233. include a company name, a person name, or some such information.
  4234. If you want to show off, you might include the latitude and
  4235. longitude and time where you were when you chose the ID and some
  4236. random input. A message digest of a long unique string is
  4237. preferable to the long unique string itself.
  4238. The payload type for the Vendor ID payload is forty-three (43).
  4239. 3.13. Traffic Selector Payload
  4240. The Traffic Selector payload, denoted TS in this document, allows
  4241. peers to identify packet flows for processing by IPsec security
  4242. services. The Traffic Selector payload consists of the IKE generic
  4243. payload header followed by individual Traffic Selectors as follows:
  4244. 1 2 3
  4245. 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
  4246. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4247. | Next Payload |C| RESERVED | Payload Length |
  4248. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4249. | Number of TSs | RESERVED |
  4250. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4251. | |
  4252. ~ <Traffic Selectors> ~
  4253. | |
  4254. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4255. Figure 19: Traffic Selectors Payload Format
  4256. o Number of TSs (1 octet) - Number of Traffic Selectors being
  4257. provided.
  4258. Kaufman, et al. Standards Track [Page 103]
  4259. RFC 5996 IKEv2bis September 2010
  4260. o RESERVED - This field MUST be sent as zero and MUST be ignored on
  4261. receipt.
  4262. o Traffic Selectors (variable length) - One or more individual
  4263. Traffic Selectors.
  4264. The length of the Traffic Selector payload includes the TS header and
  4265. all the Traffic Selectors.
  4266. The payload type for the Traffic Selector payload is forty-four (44)
  4267. for addresses at the initiator's end of the SA and forty-five (45)
  4268. for addresses at the responder's end.
  4269. There is no requirement that TSi and TSr contain the same number of
  4270. individual Traffic Selectors. Thus, they are interpreted as follows:
  4271. a packet matches a given TSi/TSr if it matches at least one of the
  4272. individual selectors in TSi, and at least one of the individual
  4273. selectors in TSr.
  4274. For instance, the following Traffic Selectors:
  4275. TSi = ((17, 100, 198.51.100.66-198.51.100.66),
  4276. (17, 200, 198.51.100.66-198.51.100.66))
  4277. TSr = ((17, 300, 0.0.0.0-255.255.255.255),
  4278. (17, 400, 0.0.0.0-255.255.255.255))
  4279. would match UDP packets from 198.51.100.66 to anywhere, with any of
  4280. the four combinations of source/destination ports (100,300),
  4281. (100,400), (200,300), and (200, 400).
  4282. Thus, some types of policies may require several Child SA pairs. For
  4283. instance, a policy matching only source/destination ports (100,300)
  4284. and (200,400), but not the other two combinations, cannot be
  4285. negotiated as a single Child SA pair.
  4286. Kaufman, et al. Standards Track [Page 104]
  4287. RFC 5996 IKEv2bis September 2010
  4288. 3.13.1. Traffic Selector
  4289. 1 2 3
  4290. 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
  4291. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4292. | TS Type |IP Protocol ID*| Selector Length |
  4293. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4294. | Start Port* | End Port* |
  4295. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4296. | |
  4297. ~ Starting Address* ~
  4298. | |
  4299. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4300. | |
  4301. ~ Ending Address* ~
  4302. | |
  4303. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4304. Figure 20: Traffic Selector
  4305. *Note: All fields other than TS Type and Selector Length depend on
  4306. the TS Type. The fields shown are for TS Types 7 and 8, the only two
  4307. values currently defined.
  4308. o TS Type (one octet) - Specifies the type of Traffic Selector.
  4309. o IP protocol ID (1 octet) - Value specifying an associated IP
  4310. protocol ID (such as UDP, TCP, and ICMP). A value of zero means
  4311. that the protocol ID is not relevant to this Traffic Selector --
  4312. the SA can carry all protocols.
  4313. o Selector Length - Specifies the length of this Traffic Selector
  4314. substructure including the header.
  4315. o Start Port (2 octets, unsigned integer) - Value specifying the
  4316. smallest port number allowed by this Traffic Selector. For
  4317. protocols for which port is undefined (including protocol 0), or
  4318. if all ports are allowed, this field MUST be zero. ICMP and
  4319. ICMPv6 Type and Code values, as well as Mobile IP version 6
  4320. (MIPv6) mobility header (MH) Type values, are represented in this
  4321. field as specified in Section 4.4.1.1 of [IPSECARCH]. ICMP Type
  4322. and Code values are treated as a single 16-bit integer port
  4323. number, with Type in the most significant eight bits and Code in
  4324. the least significant eight bits. MIPv6 MH Type values are
  4325. treated as a single 16-bit integer port number, with Type in the
  4326. most significant eight bits and the least significant eight bits
  4327. set to zero.
  4328. Kaufman, et al. Standards Track [Page 105]
  4329. RFC 5996 IKEv2bis September 2010
  4330. o End Port (2 octets, unsigned integer) - Value specifying the
  4331. largest port number allowed by this Traffic Selector. For
  4332. protocols for which port is undefined (including protocol 0), or
  4333. if all ports are allowed, this field MUST be 65535. ICMP and
  4334. ICMPv6 Type and Code values, as well as MIPv6 MH Type values, are
  4335. represented in this field as specified in Section 4.4.1.1 of
  4336. [IPSECARCH]. ICMP Type and Code values are treated as a single
  4337. 16-bit integer port number, with Type in the most significant
  4338. eight bits and Code in the least significant eight bits. MIPv6 MH
  4339. Type values are treated as a single 16-bit integer port number,
  4340. with Type in the most significant eight bits and the least
  4341. significant eight bits set to zero.
  4342. o Starting Address - The smallest address included in this Traffic
  4343. Selector (length determined by TS Type).
  4344. o Ending Address - The largest address included in this Traffic
  4345. Selector (length determined by TS Type).
  4346. Systems that are complying with [IPSECARCH] that wish to indicate
  4347. "ANY" ports MUST set the start port to 0 and the end port to 65535;
  4348. note that according to [IPSECARCH], "ANY" includes "OPAQUE". Systems
  4349. working with [IPSECARCH] that wish to indicate "OPAQUE" ports, but
  4350. not "ANY" ports, MUST set the start port to 65535 and the end port to
  4351. 0.
  4352. The Traffic Selector types 7 and 8 can also refer to ICMP or ICMPv6
  4353. type and code fields, as well as MH Type fields for the IPv6 mobility
  4354. header [MIPV6]. Note, however, that neither ICMP nor MIPv6 packets
  4355. have separate source and destination fields. The method for
  4356. specifying the Traffic Selectors for ICMP and MIPv6 is shown by
  4357. example in Section 4.4.1.3 of [IPSECARCH].
  4358. The following table lists values for the Traffic Selector Type field
  4359. and the corresponding Address Selector Data. The values in the
  4360. following table are only current as of the publication date of RFC
  4361. 4306. Other values may have been added since then or will be added
  4362. after the publication of this document. Readers should refer to
  4363. [IKEV2IANA] for the latest values.
  4364. TS Type Value
  4365. -------------------------------------------------------------------
  4366. TS_IPV4_ADDR_RANGE 7
  4367. Kaufman, et al. Standards Track [Page 106]
  4368. RFC 5996 IKEv2bis September 2010
  4369. A range of IPv4 addresses, represented by two four-octet
  4370. values. The first value is the beginning IPv4 address
  4371. (inclusive) and the second value is the ending IPv4 address
  4372. (inclusive). All addresses falling between the two specified
  4373. addresses are considered to be within the list.
  4374. TS_IPV6_ADDR_RANGE 8
  4375. A range of IPv6 addresses, represented by two sixteen-octet
  4376. values. The first value is the beginning IPv6 address
  4377. (inclusive) and the second value is the ending IPv6 address
  4378. (inclusive). All addresses falling between the two specified
  4379. addresses are considered to be within the list.
  4380. 3.14. Encrypted Payload
  4381. The Encrypted payload, denoted SK{...} in this document, contains
  4382. other payloads in encrypted form. The Encrypted payload, if present
  4383. in a message, MUST be the last payload in the message. Often, it is
  4384. the only payload in the message. This payload is also called the
  4385. "Encrypted and Authenticated" payload.
  4386. The algorithms for encryption and integrity protection are negotiated
  4387. during IKE SA setup, and the keys are computed as specified in
  4388. Sections 2.14 and 2.18.
  4389. This document specifies the cryptographic processing of Encrypted
  4390. payloads using a block cipher in CBC mode and an integrity check
  4391. algorithm that computes a fixed-length checksum over a variable size
  4392. message. The design is modeled after the ESP algorithms described in
  4393. RFCs 2104 [HMAC], 4303 [ESP], and 2451 [ESPCBC]. This document
  4394. completely specifies the cryptographic processing of IKE data, but
  4395. those documents should be consulted for design rationale. Future
  4396. documents may specify the processing of Encrypted payloads for other
  4397. types of transforms, such as counter mode encryption and
  4398. authenticated encryption algorithms. Peers MUST NOT negotiate
  4399. transforms for which no such specification exists.
  4400. When an authenticated encryption algorithm is used to protect the IKE
  4401. SA, the construction of the Encrypted payload is different than what
  4402. is described here. See [AEAD] for more information on authenticated
  4403. encryption algorithms and their use in ESP.
  4404. The payload type for an Encrypted payload is forty-six (46). The
  4405. Encrypted payload consists of the IKE generic payload header followed
  4406. by individual fields as follows:
  4407. Kaufman, et al. Standards Track [Page 107]
  4408. RFC 5996 IKEv2bis September 2010
  4409. 1 2 3
  4410. 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
  4411. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4412. | Next Payload |C| RESERVED | Payload Length |
  4413. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4414. | Initialization Vector |
  4415. | (length is block size for encryption algorithm) |
  4416. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4417. ~ Encrypted IKE Payloads ~
  4418. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4419. | | Padding (0-255 octets) |
  4420. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  4421. | | Pad Length |
  4422. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4423. ~ Integrity Checksum Data ~
  4424. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4425. Figure 21: Encrypted Payload Format
  4426. o Next Payload - The payload type of the first embedded payload.
  4427. Note that this is an exception in the standard header format,
  4428. since the Encrypted payload is the last payload in the message and
  4429. therefore the Next Payload field would normally be zero. But
  4430. because the content of this payload is embedded payloads and there
  4431. was no natural place to put the type of the first one, that type
  4432. is placed here.
  4433. o Payload Length - Includes the lengths of the header,
  4434. initialization vector (IV), Encrypted IKE payloads, Padding, Pad
  4435. Length, and Integrity Checksum Data.
  4436. o Initialization Vector - For CBC mode ciphers, the length of the
  4437. initialization vector (IV) is equal to the block length of the
  4438. underlying encryption algorithm. Senders MUST select a new
  4439. unpredictable IV for every message; recipients MUST accept any
  4440. value. The reader is encouraged to consult [MODES] for advice on
  4441. IV generation. In particular, using the final ciphertext block of
  4442. the previous message is not considered unpredictable. For modes
  4443. other than CBC, the IV format and processing is specified in the
  4444. document specifying the encryption algorithm and mode.
  4445. o IKE payloads are as specified earlier in this section. This field
  4446. is encrypted with the negotiated cipher.
  4447. o Padding MAY contain any value chosen by the sender, and MUST have
  4448. a length that makes the combination of the payloads, the Padding,
  4449. and the Pad Length to be a multiple of the encryption block size.
  4450. This field is encrypted with the negotiated cipher.
  4451. Kaufman, et al. Standards Track [Page 108]
  4452. RFC 5996 IKEv2bis September 2010
  4453. o Pad Length is the length of the Padding field. The sender SHOULD
  4454. set the Pad Length to the minimum value that makes the combination
  4455. of the payloads, the Padding, and the Pad Length a multiple of the
  4456. block size, but the recipient MUST accept any length that results
  4457. in proper alignment. This field is encrypted with the negotiated
  4458. cipher.
  4459. o Integrity Checksum Data is the cryptographic checksum of the
  4460. entire message starting with the Fixed IKE header through the Pad
  4461. Length. The checksum MUST be computed over the encrypted message.
  4462. Its length is determined by the integrity algorithm negotiated.
  4463. 3.15. Configuration Payload
  4464. The Configuration payload, denoted CP in this document, is used to
  4465. exchange configuration information between IKE peers. The exchange
  4466. is for an IRAC to request an internal IP address from an IRAS and to
  4467. exchange other information of the sort that one would acquire with
  4468. Dynamic Host Configuration Protocol (DHCP) if the IRAC were directly
  4469. connected to a LAN.
  4470. The Configuration payload is defined as follows:
  4471. 1 2 3
  4472. 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
  4473. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4474. | Next Payload |C| RESERVED | Payload Length |
  4475. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4476. | CFG Type | RESERVED |
  4477. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4478. | |
  4479. ~ Configuration Attributes ~
  4480. | |
  4481. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4482. Figure 22: Configuration Payload Format
  4483. The payload type for the Configuration payload is forty-seven (47).
  4484. o CFG Type (1 octet) - The type of exchange represented by the
  4485. Configuration Attributes. The values in the following table are
  4486. only current as of the publication date of RFC 4306. Other values
  4487. may have been added since then or will be added after the
  4488. publication of this document. Readers should refer to [IKEV2IANA]
  4489. for the latest values.
  4490. Kaufman, et al. Standards Track [Page 109]
  4491. RFC 5996 IKEv2bis September 2010
  4492. CFG Type Value
  4493. --------------------------
  4494. CFG_REQUEST 1
  4495. CFG_REPLY 2
  4496. CFG_SET 3
  4497. CFG_ACK 4
  4498. o RESERVED (3 octets) - MUST be sent as zero; MUST be ignored on
  4499. receipt.
  4500. o Configuration Attributes (variable length) - These are type length
  4501. value (TLV) structures specific to the Configuration payload and
  4502. are defined below. There may be zero or more Configuration
  4503. Attributes in this payload.
  4504. 3.15.1. Configuration Attributes
  4505. 1 2 3
  4506. 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
  4507. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4508. |R| Attribute Type | Length |
  4509. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4510. | |
  4511. ~ Value ~
  4512. | |
  4513. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4514. Figure 23: Configuration Attribute Format
  4515. o Reserved (1 bit) - This bit MUST be set to zero and MUST be
  4516. ignored on receipt.
  4517. o Attribute Type (15 bits) - A unique identifier for each of the
  4518. Configuration Attribute Types.
  4519. o Length (2 octets, unsigned integer) - Length in octets of value.
  4520. o Value (0 or more octets) - The variable-length value of this
  4521. Configuration Attribute. The following lists the attribute types.
  4522. The values in the following table are only current as of the
  4523. publication date of RFC 4306 (except INTERNAL_ADDRESS_EXPIRY and
  4524. INTERNAL_IP6_NBNS which were removed by this document). Other values
  4525. may have been added since then or will be added after the publication
  4526. of this document. Readers should refer to [IKEV2IANA] for the latest
  4527. values.
  4528. Kaufman, et al. Standards Track [Page 110]
  4529. RFC 5996 IKEv2bis September 2010
  4530. Attribute Type Value Multi-Valued Length
  4531. ------------------------------------------------------------
  4532. INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets
  4533. INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets
  4534. INTERNAL_IP4_DNS 3 YES 0 or 4 octets
  4535. INTERNAL_IP4_NBNS 4 YES 0 or 4 octets
  4536. INTERNAL_IP4_DHCP 6 YES 0 or 4 octets
  4537. APPLICATION_VERSION 7 NO 0 or more
  4538. INTERNAL_IP6_ADDRESS 8 YES* 0 or 17 octets
  4539. INTERNAL_IP6_DNS 10 YES 0 or 16 octets
  4540. INTERNAL_IP6_DHCP 12 YES 0 or 16 octets
  4541. INTERNAL_IP4_SUBNET 13 YES 0 or 8 octets
  4542. SUPPORTED_ATTRIBUTES 14 NO Multiple of 2
  4543. INTERNAL_IP6_SUBNET 15 YES 17 octets
  4544. * These attributes may be multi-valued on return only if
  4545. multiple values were requested.
  4546. o INTERNAL_IP4_ADDRESS, INTERNAL_IP6_ADDRESS - An address on the
  4547. internal network, sometimes called a red node address or private
  4548. address, and it MAY be a private address on the Internet. In a
  4549. request message, the address specified is a requested address (or
  4550. a zero-length address if no specific address is requested). If a
  4551. specific address is requested, it likely indicates that a previous
  4552. connection existed with this address and the requestor would like
  4553. to reuse that address. With IPv6, a requestor MAY supply the low-
  4554. order address octets it wants to use. Multiple internal addresses
  4555. MAY be requested by requesting multiple internal address
  4556. attributes. The responder MAY only send up to the number of
  4557. addresses requested. The INTERNAL_IP6_ADDRESS is made up of two
  4558. fields: the first is a 16-octet IPv6 address, and the second is a
  4559. one-octet prefix-length as defined in [ADDRIPV6]. The requested
  4560. address is valid as long as this IKE SA (or its rekeyed
  4561. successors) requesting the address is valid. This is described in
  4562. more detail in Section 3.15.3.
  4563. o INTERNAL_IP4_NETMASK - The internal network's netmask. Only one
  4564. netmask is allowed in the request and response messages (e.g.,
  4565. 255.255.255.0), and it MUST be used only with an
  4566. INTERNAL_IP4_ADDRESS attribute. INTERNAL_IP4_NETMASK in a
  4567. CFG_REPLY means roughly the same thing as INTERNAL_IP4_SUBNET
  4568. containing the same information ("send traffic to these addresses
  4569. through me"), but also implies a link boundary. For instance, the
  4570. client could use its own address and the netmask to calculate the
  4571. broadcast address of the link. An empty INTERNAL_IP4_NETMASK
  4572. attribute can be included in a CFG_REQUEST to request this
  4573. Kaufman, et al. Standards Track [Page 111]
  4574. RFC 5996 IKEv2bis September 2010
  4575. information (although the gateway can send the information even
  4576. when not requested). Non-empty values for this attribute in a
  4577. CFG_REQUEST do not make sense and thus MUST NOT be included.
  4578. o INTERNAL_IP4_DNS, INTERNAL_IP6_DNS - Specifies an address of a DNS
  4579. server within the network. Multiple DNS servers MAY be requested.
  4580. The responder MAY respond with zero or more DNS server attributes.
  4581. o INTERNAL_IP4_NBNS - Specifies an address of a NetBios Name Server
  4582. (WINS) within the network. Multiple NBNS servers MAY be
  4583. requested. The responder MAY respond with zero or more NBNS
  4584. server attributes.
  4585. o INTERNAL_IP4_DHCP, INTERNAL_IP6_DHCP - Instructs the host to send
  4586. any internal DHCP requests to the address contained within the
  4587. attribute. Multiple DHCP servers MAY be requested. The responder
  4588. MAY respond with zero or more DHCP server attributes.
  4589. o APPLICATION_VERSION - The version or application information of
  4590. the IPsec host. This is a string of printable ASCII characters
  4591. that is NOT null terminated.
  4592. o INTERNAL_IP4_SUBNET - The protected sub-networks that this edge-
  4593. device protects. This attribute is made up of two fields: the
  4594. first being an IP address and the second being a netmask.
  4595. Multiple sub-networks MAY be requested. The responder MAY respond
  4596. with zero or more sub-network attributes. This is discussed in
  4597. more detail in Section 3.15.2.
  4598. o SUPPORTED_ATTRIBUTES - When used within a Request, this attribute
  4599. MUST be zero-length and specifies a query to the responder to
  4600. reply back with all of the attributes that it supports. The
  4601. response contains an attribute that contains a set of attribute
  4602. identifiers each in 2 octets. The length divided by 2 (octets)
  4603. would state the number of supported attributes contained in the
  4604. response.
  4605. o INTERNAL_IP6_SUBNET - The protected sub-networks that this edge-
  4606. device protects. This attribute is made up of two fields: the
  4607. first is a 16-octet IPv6 address, and the second is a one-octet
  4608. prefix-length as defined in [ADDRIPV6]. Multiple sub-networks MAY
  4609. be requested. The responder MAY respond with zero or more sub-
  4610. network attributes. This is discussed in more detail in
  4611. Section 3.15.2.
  4612. Kaufman, et al. Standards Track [Page 112]
  4613. RFC 5996 IKEv2bis September 2010
  4614. Note that no recommendations are made in this document as to how an
  4615. implementation actually figures out what information to send in a
  4616. response. That is, we do not recommend any specific method of an
  4617. IRAS determining which DNS server should be returned to a requesting
  4618. IRAC.
  4619. The CFG_REQUEST and CFG_REPLY pair allows an IKE endpoint to request
  4620. information from its peer. If an attribute in the CFG_REQUEST
  4621. Configuration payload is not zero-length, it is taken as a suggestion
  4622. for that attribute. The CFG_REPLY Configuration payload MAY return
  4623. that value, or a new one. It MAY also add new attributes and not
  4624. include some requested ones. Unrecognized or unsupported attributes
  4625. MUST be ignored in both requests and responses.
  4626. The CFG_SET and CFG_ACK pair allows an IKE endpoint to push
  4627. configuration data to its peer. In this case, the CFG_SET
  4628. Configuration payload contains attributes the initiator wants its
  4629. peer to alter. The responder MUST return a Configuration payload if
  4630. it accepted any of the configuration data and it MUST contain the
  4631. attributes that the responder accepted with zero-length data. Those
  4632. attributes that it did not accept MUST NOT be in the CFG_ACK
  4633. Configuration payload. If no attributes were accepted, the responder
  4634. MUST return either an empty CFG_ACK payload or a response message
  4635. without a CFG_ACK payload. There are currently no defined uses for
  4636. the CFG_SET/CFG_ACK exchange, though they may be used in connection
  4637. with extensions based on Vendor IDs. An implementation of this
  4638. specification MAY ignore CFG_SET payloads.
  4639. 3.15.2. Meaning of INTERNAL_IP4_SUBNET and INTERNAL_IP6_SUBNET
  4640. INTERNAL_IP4/6_SUBNET attributes can indicate additional subnets,
  4641. ones that need one or more separate SAs, that can be reached through
  4642. the gateway that announces the attributes. INTERNAL_IP4/6_SUBNET
  4643. attributes may also express the gateway's policy about what traffic
  4644. should be sent through the gateway; the client can choose whether
  4645. other traffic (covered by TSr, but not in INTERNAL_IP4/6_SUBNET) is
  4646. sent through the gateway or directly to the destination. Thus,
  4647. traffic to the addresses listed in the INTERNAL_IP4/6_SUBNET
  4648. attributes should be sent through the gateway that announces the
  4649. attributes. If there are no existing Child SAs whose Traffic
  4650. Selectors cover the address in question, new SAs need to be created.
  4651. Kaufman, et al. Standards Track [Page 113]
  4652. RFC 5996 IKEv2bis September 2010
  4653. For instance, if there are two subnets, 198.51.100.0/26 and
  4654. 192.0.2.0/24, and the client's request contains the following:
  4655. CP(CFG_REQUEST) =
  4656. INTERNAL_IP4_ADDRESS()
  4657. TSi = (0, 0-65535, 0.0.0.0-255.255.255.255)
  4658. TSr = (0, 0-65535, 0.0.0.0-255.255.255.255)
  4659. then a valid response could be the following (in which TSr and
  4660. INTERNAL_IP4_SUBNET contain the same information):
  4661. CP(CFG_REPLY) =
  4662. INTERNAL_IP4_ADDRESS(198.51.100.234)
  4663. INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192)
  4664. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  4665. TSi = (0, 0-65535, 198.51.100.234-198.51.100.234)
  4666. TSr = ((0, 0-65535, 198.51.100.0-198.51.100.63),
  4667. (0, 0-65535, 192.0.2.0-192.0.2.255))
  4668. In these cases, the INTERNAL_IP4_SUBNET does not really carry any
  4669. useful information.
  4670. A different possible response would have been this:
  4671. CP(CFG_REPLY) =
  4672. INTERNAL_IP4_ADDRESS(198.51.100.234)
  4673. INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192)
  4674. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  4675. TSi = (0, 0-65535, 198.51.100.234-198.51.100.234)
  4676. TSr = (0, 0-65535, 0.0.0.0-255.255.255.255)
  4677. That response would mean that the client can send all its traffic
  4678. through the gateway, but the gateway does not mind if the client
  4679. sends traffic not included by INTERNAL_IP4_SUBNET directly to the
  4680. destination (without going through the gateway).
  4681. A different situation arises if the gateway has a policy that
  4682. requires the traffic for the two subnets to be carried in separate
  4683. SAs. Then a response like this would indicate to the client that if
  4684. it wants access to the second subnet, it needs to create a separate
  4685. SA:
  4686. CP(CFG_REPLY) =
  4687. INTERNAL_IP4_ADDRESS(198.51.100.234)
  4688. INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192)
  4689. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  4690. TSi = (0, 0-65535, 198.51.100.234-198.51.100.234)
  4691. TSr = (0, 0-65535, 198.51.100.0-198.51.100.63)
  4692. Kaufman, et al. Standards Track [Page 114]
  4693. RFC 5996 IKEv2bis September 2010
  4694. INTERNAL_IP4_SUBNET can also be useful if the client's TSr included
  4695. only part of the address space. For instance, if the client requests
  4696. the following:
  4697. CP(CFG_REQUEST) =
  4698. INTERNAL_IP4_ADDRESS()
  4699. TSi = (0, 0-65535, 0.0.0.0-255.255.255.255)
  4700. TSr = (0, 0-65535, 192.0.2.155-192.0.2.155)
  4701. then the gateway's response might be:
  4702. CP(CFG_REPLY) =
  4703. INTERNAL_IP4_ADDRESS(198.51.100.234)
  4704. INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192)
  4705. INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0)
  4706. TSi = (0, 0-65535, 198.51.100.234-198.51.100.234)
  4707. TSr = (0, 0-65535, 192.0.2.155-192.0.2.155)
  4708. Because the meaning of INTERNAL_IP4_SUBNET/INTERNAL_IP6_SUBNET in
  4709. CFG_REQUESTs is unclear, they cannot be used reliably in
  4710. CFG_REQUESTs.
  4711. 3.15.3. Configuration Payloads for IPv6
  4712. The Configuration payloads for IPv6 are based on the corresponding
  4713. IPv4 payloads, and do not fully follow the "normal IPv6 way of doing
  4714. things". In particular, IPv6 stateless autoconfiguration or router
  4715. advertisement messages are not used, neither is neighbor discovery.
  4716. Note that there is an additional document that discusses IPv6
  4717. configuration in IKEv2, [IPV6CONFIG]. At the present time, it is an
  4718. experimental document, but there is a hope that with more
  4719. implementation experience, it will gain the same standards treatment
  4720. as this document.
  4721. A client can be assigned an IPv6 address using the
  4722. INTERNAL_IP6_ADDRESS Configuration payload. A minimal exchange might
  4723. look like this:
  4724. CP(CFG_REQUEST) =
  4725. INTERNAL_IP6_ADDRESS()
  4726. INTERNAL_IP6_DNS()
  4727. TSi = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  4728. TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  4729. Kaufman, et al. Standards Track [Page 115]
  4730. RFC 5996 IKEv2bis September 2010
  4731. CP(CFG_REPLY) =
  4732. INTERNAL_IP6_ADDRESS(2001:DB8:0:1:2:3:4:5/64)
  4733. INTERNAL_IP6_DNS(2001:DB8:99:88:77:66:55:44)
  4734. TSi = (0, 0-65535, 2001:DB8:0:1:2:3:4:5 - 2001:DB8:0:1:2:3:4:5)
  4735. TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF)
  4736. The client MAY send a non-empty INTERNAL_IP6_ADDRESS attribute in the
  4737. CFG_REQUEST to request a specific address or interface identifier.
  4738. The gateway first checks if the specified address is acceptable, and
  4739. if it is, returns that one. If the address was not acceptable, the
  4740. gateway attempts to use the interface identifier with some other
  4741. prefix; if even that fails, the gateway selects another interface
  4742. identifier.
  4743. The INTERNAL_IP6_ADDRESS attribute also contains a prefix length
  4744. field. When used in a CFG_REPLY, this corresponds to the
  4745. INTERNAL_IP4_NETMASK attribute in the IPv4 case.
  4746. Although this approach to configuring IPv6 addresses is reasonably
  4747. simple, it has some limitations. IPsec tunnels configured using
  4748. IKEv2 are not fully featured "interfaces" in the IPv6 addressing
  4749. architecture sense [ADDRIPV6]. In particular, they do not
  4750. necessarily have link-local addresses, and this may complicate the
  4751. use of protocols that assume them, such as [MLDV2].
  4752. 3.15.4. Address Assignment Failures
  4753. If the responder encounters an error while attempting to assign an IP
  4754. address to the initiator during the processing of a Configuration
  4755. payload, it responds with an INTERNAL_ADDRESS_FAILURE notification.
  4756. The IKE SA is still created even if the initial Child SA cannot be
  4757. created because of this failure. If this error is generated within
  4758. an IKE_AUTH exchange, no Child SA will be created. However, there
  4759. are some more complex error cases.
  4760. If the responder does not support Configuration payloads at all, it
  4761. can simply ignore all Configuration payloads. This type of
  4762. implementation never sends INTERNAL_ADDRESS_FAILURE notifications.
  4763. If the initiator requires the assignment of an IP address, it will
  4764. treat a response without CFG_REPLY as an error.
  4765. The initiator may request a particular type of address (IPv4 or IPv6)
  4766. that the responder does not support, even though the responder
  4767. supports Configuration payloads. In this case, the responder simply
  4768. ignores the type of address it does not support and processes the
  4769. rest of the request as usual.
  4770. Kaufman, et al. Standards Track [Page 116]
  4771. RFC 5996 IKEv2bis September 2010
  4772. If the initiator requests multiple addresses of a type that the
  4773. responder supports, and some (but not all) of the requests fail, the
  4774. responder replies with the successful addresses only. The responder
  4775. sends INTERNAL_ADDRESS_FAILURE only if no addresses can be assigned.
  4776. If the initiator does not receive the IP address(es) required by its
  4777. policy, it MAY keep the IKE SA up and retry the Configuration payload
  4778. as separate INFORMATIONAL exchange after suitable timeout, or it MAY
  4779. tear down the IKE SA by sending a Delete payload inside a separate
  4780. INFORMATIONAL exchange and later retry IKE SA from the beginning
  4781. after some timeout. Such a timeout should not be too short
  4782. (especially if the IKE SA is started from the beginning) because
  4783. these error situations may not be able to be fixed quickly; the
  4784. timeout should likely be several minutes. For example, an address
  4785. shortage problem on the responder will probably only be fixed when
  4786. more entries are returned to the address pool when other clients
  4787. disconnect or when responder is reconfigured with larger address
  4788. pool.
  4789. 3.16. Extensible Authentication Protocol (EAP) Payload
  4790. The Extensible Authentication Protocol payload, denoted EAP in this
  4791. document, allows IKE SAs to be authenticated using the protocol
  4792. defined in RFC 3748 [EAP] and subsequent extensions to that protocol.
  4793. When using EAP, an appropriate EAP method needs to be selected. Many
  4794. of these methods have been defined, specifying the protocol's use
  4795. with various authentication mechanisms. EAP method types are listed
  4796. in [EAP-IANA]. A short summary of the EAP format is included here
  4797. for clarity.
  4798. 1 2 3
  4799. 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
  4800. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4801. | Next Payload |C| RESERVED | Payload Length |
  4802. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4803. | |
  4804. ~ EAP Message ~
  4805. | |
  4806. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4807. Figure 24: EAP Payload Format
  4808. The payload type for an EAP payload is forty-eight (48).
  4809. Kaufman, et al. Standards Track [Page 117]
  4810. RFC 5996 IKEv2bis September 2010
  4811. 1 2 3
  4812. 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
  4813. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4814. | Code | Identifier | Length |
  4815. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  4816. | Type | Type_Data...
  4817. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  4818. Figure 25: EAP Message Format
  4819. o Code (1 octet) indicates whether this message is a Request (1),
  4820. Response (2), Success (3), or Failure (4).
  4821. o Identifier (1 octet) is used in PPP to distinguish replayed
  4822. messages from repeated ones. Since in IKE, EAP runs over a
  4823. reliable protocol, it serves no function here. In a response
  4824. message, this octet MUST be set to match the identifier in the
  4825. corresponding request.
  4826. o Length (2 octets, unsigned integer) is the length of the EAP
  4827. message and MUST be four less than the Payload Length of the
  4828. encapsulating payload.
  4829. o Type (1 octet) is present only if the Code field is Request (1) or
  4830. Response (2). For other codes, the EAP message length MUST be
  4831. four octets and the Type and Type_Data fields MUST NOT be present.
  4832. In a Request (1) message, Type indicates the data being requested.
  4833. In a Response (2) message, Type MUST either be Nak or match the
  4834. type of the data requested. Note that since IKE passes an
  4835. indication of initiator identity in the first message in the
  4836. IKE_AUTH exchange, the responder SHOULD NOT send EAP Identity
  4837. requests (type 1). The initiator MAY, however, respond to such
  4838. requests if it receives them.
  4839. o Type_Data (Variable Length) varies with the Type of Request and
  4840. the associated Response. For the documentation of the EAP
  4841. methods, see [EAP].
  4842. Note that since IKE passes an indication of initiator identity in the
  4843. first message in the IKE_AUTH exchange, the responder should not send
  4844. EAP Identity requests. The initiator may, however, respond to such
  4845. requests if it receives them.
  4846. 4. Conformance Requirements
  4847. In order to assure that all implementations of IKEv2 can
  4848. interoperate, there are "MUST support" requirements in addition to
  4849. those listed elsewhere. Of course, IKEv2 is a security protocol, and
  4850. Kaufman, et al. Standards Track [Page 118]
  4851. RFC 5996 IKEv2bis September 2010
  4852. one of its major functions is to allow only authorized parties to
  4853. successfully complete establishment of SAs. So a particular
  4854. implementation may be configured with any of a number of restrictions
  4855. concerning algorithms and trusted authorities that will prevent
  4856. universal interoperability.
  4857. IKEv2 is designed to permit minimal implementations that can
  4858. interoperate with all compliant implementations. The following are
  4859. features that can be omitted in a minimal implementation:
  4860. o Ability to negotiate SAs through a NAT and tunnel the resulting
  4861. ESP SA over UDP.
  4862. o Ability to request (and respond to a request for) a temporary IP
  4863. address on the remote end of a tunnel.
  4864. o Ability to support EAP-based authentication.
  4865. o Ability to support window sizes greater than one.
  4866. o Ability to establish multiple ESP or AH SAs within a single IKE
  4867. SA.
  4868. o Ability to rekey SAs.
  4869. To assure interoperability, all implementations MUST be capable of
  4870. parsing all payload types (if only to skip over them) and to ignore
  4871. payload types that it does not support unless the critical bit is set
  4872. in the payload header. If the critical bit is set in an unsupported
  4873. payload header, all implementations MUST reject the messages
  4874. containing those payloads.
  4875. Every implementation MUST be capable of doing four-message
  4876. IKE_SA_INIT and IKE_AUTH exchanges establishing two SAs (one for IKE,
  4877. one for ESP or AH). Implementations MAY be initiate-only or respond-
  4878. only if appropriate for their platform. Every implementation MUST be
  4879. capable of responding to an INFORMATIONAL exchange, but a minimal
  4880. implementation MAY respond to any request in the INFORMATIONAL
  4881. exchange with an empty response (note that within the context of an
  4882. IKE SA, an "empty" message consists of an IKE header followed by an
  4883. Encrypted payload with no payloads contained in it). A minimal
  4884. implementation MAY support the CREATE_CHILD_SA exchange only in so
  4885. far as to recognize requests and reject them with a Notify payload of
  4886. type NO_ADDITIONAL_SAS. A minimal implementation need not be able to
  4887. initiate CREATE_CHILD_SA or INFORMATIONAL exchanges. When an SA
  4888. expires (based on locally configured values of either lifetime or
  4889. octets passed), and implementation MAY either try to renew it with a
  4890. CREATE_CHILD_SA exchange or it MAY delete (close) the old SA and
  4891. Kaufman, et al. Standards Track [Page 119]
  4892. RFC 5996 IKEv2bis September 2010
  4893. create a new one. If the responder rejects the CREATE_CHILD_SA
  4894. request with a NO_ADDITIONAL_SAS notification, the implementation
  4895. MUST be capable of instead deleting the old SA and creating a new
  4896. one.
  4897. Implementations are not required to support requesting temporary IP
  4898. addresses or responding to such requests. If an implementation does
  4899. support issuing such requests and its policy requires using temporary
  4900. IP addresses, it MUST include a CP payload in the first message in
  4901. the IKE_AUTH exchange containing at least a field of type
  4902. INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. All other fields are
  4903. optional. If an implementation supports responding to such requests,
  4904. it MUST parse the CP payload of type CFG_REQUEST in the first message
  4905. in the IKE_AUTH exchange and recognize a field of type
  4906. INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. If it supports leasing
  4907. an address of the appropriate type, it MUST return a CP payload of
  4908. type CFG_REPLY containing an address of the requested type. The
  4909. responder may include any other related attributes.
  4910. For an implementation to be called conforming to this specification,
  4911. it MUST be possible to configure it to accept the following:
  4912. o Public Key Infrastructure using X.509 (PKIX) Certificates
  4913. containing and signed by RSA keys of size 1024 or 2048 bits, where
  4914. the ID passed is any of ID_KEY_ID, ID_FQDN, ID_RFC822_ADDR, or
  4915. ID_DER_ASN1_DN.
  4916. o Shared key authentication where the ID passed is any of ID_KEY_ID,
  4917. ID_FQDN, or ID_RFC822_ADDR.
  4918. o Authentication where the responder is authenticated using PKIX
  4919. Certificates and the initiator is authenticated using shared key
  4920. authentication.
  4921. 5. Security Considerations
  4922. While this protocol is designed to minimize disclosure of
  4923. configuration information to unauthenticated peers, some such
  4924. disclosure is unavoidable. One peer or the other must identify
  4925. itself first and prove its identity first. To avoid probing, the
  4926. initiator of an exchange is required to identify itself first, and
  4927. usually is required to authenticate itself first. The initiator can,
  4928. however, learn that the responder supports IKE and what cryptographic
  4929. protocols it supports. The responder (or someone impersonating the
  4930. responder) can probe the initiator not only for its identity, but
  4931. using CERTREQ payloads may be able to determine what certificates the
  4932. initiator is willing to use.
  4933. Kaufman, et al. Standards Track [Page 120]
  4934. RFC 5996 IKEv2bis September 2010
  4935. Use of EAP authentication changes the probing possibilities somewhat.
  4936. When EAP authentication is used, the responder proves its identity
  4937. before the initiator does, so an initiator that knew the name of a
  4938. valid initiator could probe the responder for both its name and
  4939. certificates.
  4940. Repeated rekeying using CREATE_CHILD_SA without additional Diffie-
  4941. Hellman exchanges leaves all SAs vulnerable to cryptanalysis of a
  4942. single key. Implementers should take note of this fact and set a
  4943. limit on CREATE_CHILD_SA exchanges between exponentiations. This
  4944. document does not prescribe such a limit.
  4945. The strength of a key derived from a Diffie-Hellman exchange using
  4946. any of the groups defined here depends on the inherent strength of
  4947. the group, the size of the exponent used, and the entropy provided by
  4948. the random number generator used. Due to these inputs, it is
  4949. difficult to determine the strength of a key for any of the defined
  4950. groups. Diffie-Hellman group number two, when used with a strong
  4951. random number generator and an exponent no less than 200 bits, is
  4952. common for use with 3DES. Group five provides greater security than
  4953. group two. Group one is for historic purposes only and does not
  4954. provide sufficient strength except for use with DES, which is also
  4955. for historic use only. Implementations should make note of these
  4956. estimates when establishing policy and negotiating security
  4957. parameters.
  4958. Note that these limitations are on the Diffie-Hellman groups
  4959. themselves. There is nothing in IKE that prohibits using stronger
  4960. groups nor is there anything that will dilute the strength obtained
  4961. from stronger groups (limited by the strength of the other algorithms
  4962. negotiated including the PRF). In fact, the extensible framework of
  4963. IKE encourages the definition of more groups; use of elliptic curve
  4964. groups may greatly increase strength using much smaller numbers.
  4965. It is assumed that all Diffie-Hellman exponents are erased from
  4966. memory after use.
  4967. The IKE_SA_INIT and IKE_AUTH exchanges happen before the initiator
  4968. has been authenticated. As a result, an implementation of this
  4969. protocol needs to be completely robust when deployed on any insecure
  4970. network. Implementation vulnerabilities, particularly DoS attacks,
  4971. can be exploited by unauthenticated peers. This issue is
  4972. particularly worrisome because of the unlimited number of messages in
  4973. EAP-based authentication.
  4974. The strength of all keys is limited by the size of the output of the
  4975. negotiated PRF. For this reason, a PRF whose output is less than 128
  4976. bits (e.g., 3DES-CBC) MUST NOT be used with this protocol.
  4977. Kaufman, et al. Standards Track [Page 121]
  4978. RFC 5996 IKEv2bis September 2010
  4979. The security of this protocol is critically dependent on the
  4980. randomness of the randomly chosen parameters. These should be
  4981. generated by a strong random or properly seeded pseudorandom source
  4982. (see [RANDOMNESS]). Implementers should take care to ensure that use
  4983. of random numbers for both keys and nonces is engineered in a fashion
  4984. that does not undermine the security of the keys.
  4985. For information on the rationale of many of the cryptographic design
  4986. choices in this protocol, see [SIGMA] and [SKEME]. Though the
  4987. security of negotiated Child SAs does not depend on the strength of
  4988. the encryption and integrity protection negotiated in the IKE SA,
  4989. implementations MUST NOT negotiate NONE as the IKE integrity
  4990. protection algorithm or ENCR_NULL as the IKE encryption algorithm.
  4991. When using pre-shared keys, a critical consideration is how to assure
  4992. the randomness of these secrets. The strongest practice is to ensure
  4993. that any pre-shared key contain as much randomness as the strongest
  4994. key being negotiated. Deriving a shared secret from a password,
  4995. name, or other low-entropy source is not secure. These sources are
  4996. subject to dictionary and social-engineering attacks, among others.
  4997. The NAT_DETECTION_*_IP notifications contain a hash of the addresses
  4998. and ports in an attempt to hide internal IP addresses behind a NAT.
  4999. Since the IPv4 address space is only 32 bits, and it is usually very
  5000. sparse, it would be possible for an attacker to find out the internal
  5001. address used behind the NAT box by trying all possible IP addresses
  5002. and trying to find the matching hash. The port numbers are normally
  5003. fixed to 500, and the SPIs can be extracted from the packet. This
  5004. reduces the number of hash calculations to 2^32. With an educated
  5005. guess of the use of private address space, the number of hash
  5006. calculations is much smaller. Designers should therefore not assume
  5007. that use of IKE will not leak internal address information.
  5008. When using an EAP authentication method that does not generate a
  5009. shared key for protecting a subsequent AUTH payload, certain man-in-
  5010. the-middle and server-impersonation attacks are possible [EAPMITM].
  5011. These vulnerabilities occur when EAP is also used in protocols that
  5012. are not protected with a secure tunnel. Since EAP is a general-
  5013. purpose authentication protocol, which is often used to provide
  5014. single-signon facilities, a deployed IPsec solution that relies on an
  5015. EAP authentication method that does not generate a shared key (also
  5016. known as a non-key-generating EAP method) can become compromised due
  5017. to the deployment of an entirely unrelated application that also
  5018. happens to use the same non-key-generating EAP method, but in an
  5019. unprotected fashion. Note that this vulnerability is not limited to
  5020. just EAP, but can occur in other scenarios where an authentication
  5021. infrastructure is reused. For example, if the EAP mechanism used by
  5022. IKEv2 utilizes a token authenticator, a man-in-the-middle attacker
  5023. Kaufman, et al. Standards Track [Page 122]
  5024. RFC 5996 IKEv2bis September 2010
  5025. could impersonate the web server, intercept the token authentication
  5026. exchange, and use it to initiate an IKEv2 connection. For this
  5027. reason, use of non-key-generating EAP methods SHOULD be avoided where
  5028. possible. Where they are used, it is extremely important that all
  5029. usages of these EAP methods SHOULD utilize a protected tunnel, where
  5030. the initiator validates the responder's certificate before initiating
  5031. the EAP authentication. Implementers should describe the
  5032. vulnerabilities of using non-key-generating EAP methods in the
  5033. documentation of their implementations so that the administrators
  5034. deploying IPsec solutions are aware of these dangers.
  5035. An implementation using EAP MUST also use a public-key-based
  5036. authentication of the server to the client before the EAP
  5037. authentication begins, even if the EAP method offers mutual
  5038. authentication. This avoids having additional IKEv2 protocol
  5039. variations and protects the EAP data from active attackers.
  5040. If the messages of IKEv2 are long enough that IP-level fragmentation
  5041. is necessary, it is possible that attackers could prevent the
  5042. exchange from completing by exhausting the reassembly buffers. The
  5043. chances of this can be minimized by using the Hash and URL encodings
  5044. instead of sending certificates (see Section 3.6). Additional
  5045. mitigations are discussed in [DOSUDPPROT].
  5046. Admission control is critical to the security of the protocol. For
  5047. example, trust anchors used for identifying IKE peers should probably
  5048. be different than those used for other forms of trust, such as those
  5049. used to identify public web servers. Moreover, although IKE provides
  5050. a great deal of leeway in defining the security policy for a trusted
  5051. peer's identity, credentials, and the correlation between them,
  5052. having such security policy defined explicitly is essential to a
  5053. secure implementation.
  5054. 5.1. Traffic Selector Authorization
  5055. IKEv2 relies on information in the Peer Authorization Database (PAD)
  5056. when determining what kind of Child SAs a peer is allowed to create.
  5057. This process is described in Section 4.4.3 of [IPSECARCH]. When a
  5058. peer requests the creation of an Child SA with some Traffic
  5059. Selectors, the PAD must contain "Child SA Authorization Data" linking
  5060. the identity authenticated by IKEv2 and the addresses permitted for
  5061. Traffic Selectors.
  5062. For example, the PAD might be configured so that authenticated
  5063. identity "sgw23.example.com" is allowed to create Child SAs for
  5064. 192.0.2.0/24, meaning this security gateway is a valid
  5065. "representative" for these addresses. Host-to-host IPsec requires
  5066. Kaufman, et al. Standards Track [Page 123]
  5067. RFC 5996 IKEv2bis September 2010
  5068. similar entries, linking, for example, "fooserver4.example.com" with
  5069. 198.51.100.66/32, meaning this identity is a valid "owner" or
  5070. "representative" of the address in question.
  5071. As noted in [IPSECARCH], "It is necessary to impose these constraints
  5072. on creation of child SAs to prevent an authenticated peer from
  5073. spoofing IDs associated with other, legitimate peers". In the
  5074. example given above, a correct configuration of the PAD prevents
  5075. sgw23 from creating Child SAs with address 198.51.100.66, and
  5076. prevents fooserver4 from creating Child SAs with addresses from
  5077. 192.0.2.0/24.
  5078. It is important to note that simply sending IKEv2 packets using some
  5079. particular address does not imply a permission to create Child SAs
  5080. with that address in the Traffic Selectors. For example, even if
  5081. sgw23 would be able to spoof its IP address as 198.51.100.66, it
  5082. could not create Child SAs matching fooserver4's traffic.
  5083. The IKEv2 specification does not specify how exactly IP address
  5084. assignment using Configuration payloads interacts with the PAD. Our
  5085. interpretation is that when a security gateway assigns an address
  5086. using Configuration payloads, it also creates a temporary PAD entry
  5087. linking the authenticated peer identity and the newly allocated inner
  5088. address.
  5089. It has been recognized that configuring the PAD correctly may be
  5090. difficult in some environments. For instance, if IPsec is used
  5091. between a pair of hosts whose addresses are allocated dynamically
  5092. using DHCP, it is extremely difficult to ensure that the PAD
  5093. specifies the correct "owner" for each IP address. This would
  5094. require a mechanism to securely convey address assignments from the
  5095. DHCP server, and link them to identities authenticated using IKEv2.
  5096. Due to this limitation, some vendors have been known to configure
  5097. their PADs to allow an authenticated peer to create Child SAs with
  5098. Traffic Selectors containing the same address that was used for the
  5099. IKEv2 packets. In environments where IP spoofing is possible (i.e.,
  5100. almost everywhere) this essentially allows any peer to create Child
  5101. SAs with any Traffic Selectors. This is not an appropriate or secure
  5102. configuration in most circumstances. See [H2HIPSEC] for an extensive
  5103. discussion about this issue, and the limitations of host-to-host
  5104. IPsec in general.
  5105. 6. IANA Considerations
  5106. [IKEV2] defined many field types and values. IANA has already
  5107. registered those types and values in [IKEV2IANA], so they are not
  5108. listed here again.
  5109. Kaufman, et al. Standards Track [Page 124]
  5110. RFC 5996 IKEv2bis September 2010
  5111. Two items have been removed from the IKEv2 Configuration Payload
  5112. Attribute Types table: INTERNAL_IP6_NBNS and INTERNAL_ADDRESS_EXPIRY.
  5113. Two new additions to the IKEv2 parameters "NOTIFY MESSAGES - ERROR
  5114. TYPES" registry are defined here that were not defined in [IKEV2]:
  5115. 43 TEMPORARY_FAILURE
  5116. 44 CHILD_SA_NOT_FOUND
  5117. IANA has changed the existing IKEv2 Payload Types table from:
  5118. 46 Encrypted E [IKEV2]
  5119. to
  5120. 46 Encrypted and Authenticated SK [This document]
  5121. IANA has updated all references to RFC 4306 to point to this
  5122. document.
  5123. 7. Acknowledgements
  5124. Many individuals in the IPsecME Working Group were very helpful in
  5125. contributing ideas and text for this document, as well as in
  5126. reviewing the clarifications suggested by others.
  5127. The acknowledgements from the IKEv2 document were:
  5128. This document is a collaborative effort of the entire IPsec WG. If
  5129. there were no limit to the number of authors that could appear on an
  5130. RFC, the following, in alphabetical order, would have been listed:
  5131. Bill Aiello, Stephane Beaulieu, Steve Bellovin, Sara Bitan, Matt
  5132. Blaze, Ran Canetti, Darren Dukes, Dan Harkins, Paul Hoffman, John
  5133. Ioannidis, Charlie Kaufman, Steve Kent, Angelos Keromytis, Tero
  5134. Kivinen, Hugo Krawczyk, Andrew Krywaniuk, Radia Perlman, Omer
  5135. Reingold, and Michael Richardson. Many other people contributed to
  5136. the design. It is an evolution of IKEv1, ISAKMP, and the IPsec DOI,
  5137. each of which has its own list of authors. Hugh Daniel suggested the
  5138. feature of having the initiator, in message 3, specify a name for the
  5139. responder, and gave the feature the cute name "You Tarzan, Me Jane".
  5140. David Faucher and Valery Smyslov helped refine the design of the
  5141. Traffic Selector negotiation.
  5142. Kaufman, et al. Standards Track [Page 125]
  5143. RFC 5996 IKEv2bis September 2010
  5144. 8. References
  5145. 8.1. Normative References
  5146. [ADDGROUP] Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
  5147. Diffie-Hellman groups for Internet Key Exchange (IKE)",
  5148. RFC 3526, May 2003.
  5149. [ADDRIPV6] Hinden, R. and S. Deering, "IP Version 6 Addressing
  5150. Architecture", RFC 4291, February 2006.
  5151. [AEAD] Black, D. and D. McGrew, "Using Authenticated Encryption
  5152. Algorithms with the Encrypted Payload of the Internet Key
  5153. Exchange version 2 (IKEv2) Protocol", RFC 5282,
  5154. August 2008.
  5155. [AESCMACPRF128]
  5156. Song, J., Poovendran, R., Lee, J., and T. Iwata, "The
  5157. Advanced Encryption Standard-Cipher-based Message
  5158. Authentication Code-Pseudo-Random Function-128 (AES-CMAC-
  5159. PRF-128) Algorithm for the Internet Key Exchange Protocol
  5160. (IKE)", RFC 4615, August 2006.
  5161. [AESXCBCPRF128]
  5162. Hoffman, P., "The AES-XCBC-PRF-128 Algorithm for the
  5163. Internet Key Exchange Protocol (IKE)", RFC 4434,
  5164. February 2006.
  5165. [EAP] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H.
  5166. Levkowetz, "Extensible Authentication Protocol (EAP)",
  5167. RFC 3748, June 2004.
  5168. [ECN] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition
  5169. of Explicit Congestion Notification (ECN) to IP",
  5170. RFC 3168, September 2001.
  5171. [ESPCBC] Pereira, R. and R. Adams, "The ESP CBC-Mode Cipher
  5172. Algorithms", RFC 2451, November 1998.
  5173. [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
  5174. Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
  5175. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
  5176. [IKEV2IANA]
  5177. "Internet Key Exchange Version 2 (IKEv2) Parameters",
  5178. <http://www.iana.org>.
  5179. Kaufman, et al. Standards Track [Page 126]
  5180. RFC 5996 IKEv2bis September 2010
  5181. [IPSECARCH]
  5182. Kent, S. and K. Seo, "Security Architecture for the
  5183. Internet Protocol", RFC 4301, December 2005.
  5184. [MUSTSHOULD]
  5185. Bradner, S., "Key words for use in RFCs to Indicate
  5186. Requirement Levels", BCP 14, RFC 2119, March 1997.
  5187. [PKCS1] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
  5188. Standards (PKCS) #1: RSA Cryptography Specifications
  5189. Version 2.1", RFC 3447, February 2003.
  5190. [PKIX] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
  5191. Housley, R., and W. Polk, "Internet X.509 Public Key
  5192. Infrastructure Certificate and Certificate Revocation List
  5193. (CRL) Profile", RFC 5280, May 2008.
  5194. [RFC4307] Schiller, J., "Cryptographic Algorithms for Use in the
  5195. Internet Key Exchange Version 2 (IKEv2)", RFC 4307,
  5196. December 2005.
  5197. [UDPENCAPS]
  5198. Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M.
  5199. Stenberg, "UDP Encapsulation of IPsec ESP Packets",
  5200. RFC 3948, January 2005.
  5201. [URLS] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
  5202. Resource Identifier (URI): Generic Syntax", STD 66,
  5203. RFC 3986, January 2005.
  5204. 8.2. Informative References
  5205. [AH] Kent, S., "IP Authentication Header", RFC 4302,
  5206. December 2005.
  5207. [ARCHGUIDEPHIL]
  5208. Bush, R. and D. Meyer, "Some Internet Architectural
  5209. Guidelines and Philosophy", RFC 3439, December 2002.
  5210. [ARCHPRINC]
  5211. Carpenter, B., "Architectural Principles of the Internet",
  5212. RFC 1958, June 1996.
  5213. [Clarif] Eronen, P. and P. Hoffman, "IKEv2 Clarifications and
  5214. Implementation Guidelines", RFC 4718, October 2006.
  5215. Kaufman, et al. Standards Track [Page 127]
  5216. RFC 5996 IKEv2bis September 2010
  5217. [DES] American National Standards Institute, "American National
  5218. Standard for Information Systems-Data Link Encryption",
  5219. ANSI X3.106, 1983.
  5220. [DH] Diffie, W. and M. Hellman, "New Directions in
  5221. Cryptography", IEEE Transactions on Information Theory,
  5222. V.IT-22 n. 6, June 1977.
  5223. [DIFFSERVARCH]
  5224. Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z.,
  5225. and W. Weiss, "An Architecture for Differentiated
  5226. Services", RFC 2475, December 1998.
  5227. [DIFFSERVFIELD]
  5228. Nichols, K., Blake, S., Baker, F., and D. Black,
  5229. "Definition of the Differentiated Services Field (DS
  5230. Field) in the IPv4 and IPv6 Headers", RFC 2474,
  5231. December 1998.
  5232. [DIFFTUNNEL]
  5233. Black, D., "Differentiated Services and Tunnels",
  5234. RFC 2983, October 2000.
  5235. [DOI] Piper, D., "The Internet IP Security Domain of
  5236. Interpretation for ISAKMP", RFC 2407, November 1998.
  5237. [DOSUDPPROT]
  5238. C. Kaufman, R. Perlman, and B. Sommerfeld, "DoS protection
  5239. for UDP-based protocols", ACM Conference on Computer and
  5240. Communications Security, October 2003.
  5241. [DSS] National Institute of Standards and Technology, U.S.
  5242. Department of Commerce, "Digital Signature Standard",
  5243. Draft FIPS 186-3, June 2008.
  5244. [EAI] Abel, Y., "Internationalized Email Headers", RFC 5335,
  5245. September 2008.
  5246. [EAP-IANA] "Extensible Authentication Protocol (EAP) Registry: Method
  5247. Types", <http://www.iana.org>.
  5248. [EAPMITM] N. Asokan, V. Nierni, and K. Nyberg, "Man-in-the-Middle in
  5249. Tunneled Authentication Protocols", November 2002,
  5250. <http://eprint.iacr.org/2002/163>.
  5251. [ESP] Kent, S., "IP Encapsulating Security Payload (ESP)",
  5252. RFC 4303, December 2005.
  5253. Kaufman, et al. Standards Track [Page 128]
  5254. RFC 5996 IKEv2bis September 2010
  5255. [EXCHANGEANALYSIS]
  5256. R. Perlman and C. Kaufman, "Analysis of the IPsec key
  5257. exchange Standard", WET-ICE Security Conference, MIT,
  5258. 2001,
  5259. <http://sec.femto.org/wetice-2001/papers/radia-paper.pdf>.
  5260. [H2HIPSEC] Aura, T., Roe, M., and A. Mohammed, "Experiences with
  5261. Host-to-Host IPsec", 13th International Workshop on
  5262. Security Protocols, Cambridge, UK, April 2005.
  5263. [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
  5264. Hashing for Message Authentication", RFC 2104,
  5265. February 1997.
  5266. [IDEA] X. Lai, "On the Design and Security of Block Ciphers", ETH
  5267. Series in Information Processing, v. 1, Konstanz: Hartung-
  5268. Gorre Verlag, 1992.
  5269. [IDNA] Klensin, J., "Internationalized Domain Names for
  5270. Applications (IDNA): Definitions and Document Framework",
  5271. RFC 5890, August 2010.
  5272. [IKEV1] Harkins, D. and D. Carrel, "The Internet Key Exchange
  5273. (IKE)", RFC 2409, November 1998.
  5274. [IKEV2] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol",
  5275. RFC 4306, December 2005.
  5276. [IP] Postel, J., "Internet Protocol", STD 5, RFC 791,
  5277. September 1981.
  5278. [IP-COMP] Shacham, A., Monsour, B., Pereira, R., and M. Thomas, "IP
  5279. Payload Compression Protocol (IPComp)", RFC 3173,
  5280. September 2001.
  5281. [IPSECARCH-OLD]
  5282. Kent, S. and R. Atkinson, "Security Architecture for the
  5283. Internet Protocol", RFC 2401, November 1998.
  5284. [IPV6CONFIG]
  5285. Eronen, P., Laganier, J., and C. Madson, "IPv6
  5286. Configuration in Internet Key Exchange Protocol Version 2
  5287. (IKEv2)", RFC 5739, February 2010.
  5288. [ISAKMP] Maughan, D., Schneider, M., and M. Schertler, "Internet
  5289. Security Association and Key Management Protocol
  5290. (ISAKMP)", RFC 2408, November 1998.
  5291. Kaufman, et al. Standards Track [Page 129]
  5292. RFC 5996 IKEv2bis September 2010
  5293. [MAILFORMAT]
  5294. Resnick, P., Ed., "Internet Message Format", RFC 5322,
  5295. October 2008.
  5296. [MD5] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
  5297. April 1992.
  5298. [MIPV6] Johnson, D., Perkins, C., and J. Arkko, "Mobility Support
  5299. in IPv6", RFC 3775, June 2004.
  5300. [MLDV2] Vida, R. and L. Costa, "Multicast Listener Discovery
  5301. Version 2 (MLDv2) for IPv6", RFC 3810, June 2004.
  5302. [MOBIKE] Eronen, P., "IKEv2 Mobility and Multihoming Protocol
  5303. (MOBIKE)", RFC 4555, June 2006.
  5304. [MODES] National Institute of Standards and Technology, U.S.
  5305. Department of Commerce, "Recommendation for Block Cipher
  5306. Modes of Operation", SP 800-38A, 2001.
  5307. [NAI] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The
  5308. Network Access Identifier", RFC 4282, December 2005.
  5309. [NATREQ] Aboba, B. and W. Dixon, "IPsec-Network Address Translation
  5310. (NAT) Compatibility Requirements", RFC 3715, March 2004.
  5311. [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
  5312. RFC 2412, November 1998.
  5313. [PFKEY] McDonald, D., Metz, C., and B. Phan, "PF_KEY Key
  5314. Management API, Version 2", RFC 2367, July 1998.
  5315. [PHOTURIS] Karn, P. and W. Simpson, "Photuris: Session-Key Management
  5316. Protocol", RFC 2522, March 1999.
  5317. [RANDOMNESS]
  5318. Eastlake, D., Schiller, J., and S. Crocker, "Randomness
  5319. Requirements for Security", BCP 106, RFC 4086, June 2005.
  5320. [REAUTH] Nir, Y., "Repeated Authentication in Internet Key Exchange
  5321. (IKEv2) Protocol", RFC 4478, April 2006.
  5322. [REUSE] Menezes, A. and B. Ustaoglu, "On Reusing Ephemeral Keys In
  5323. Diffie-Hellman Key Agreement Protocols", December 2008,
  5324. <http://www.cacr.math.uwaterloo.ca/techreports/2008/
  5325. cacr2008-24.pdf>.
  5326. Kaufman, et al. Standards Track [Page 130]
  5327. RFC 5996 IKEv2bis September 2010
  5328. [ROHCV2] Ertekin, E., Christou, C., Jasani, R., Kivinen, T., and C.
  5329. Bormann, "IKEv2 Extensions to Support Robust Header
  5330. Compression over IPsec", RFC 5857, May 2010.
  5331. [RSA] R. Rivest, A. Shamir, and L. Adleman, "A Method for
  5332. Obtaining Digital Signatures and Public-Key
  5333. Cryptosystems", February 1978.
  5334. [SHA] National Institute of Standards and Technology, U.S.
  5335. Department of Commerce, "Secure Hash Standard",
  5336. FIPS 180-3, October 2008.
  5337. [SIGMA] H. Krawczyk, "SIGMA: the `SIGn-and-MAc' Approach to
  5338. Authenticated Diffie-Hellman and its Use in the IKE
  5339. Protocols", Advances in Cryptography - CRYPTO 2003
  5340. Proceedings LNCS 2729, 2003, <http://
  5341. www.informatik.uni-trier.de/~ley/db/conf/crypto/
  5342. crypto2003.html>.
  5343. [SKEME] H. Krawczyk, "SKEME: A Versatile Secure Key Exchange
  5344. Mechanism for Internet", IEEE Proceedings of the 1996
  5345. Symposium on Network and Distributed Systems Security ,
  5346. 1996.
  5347. [TRANSPARENCY]
  5348. Carpenter, B., "Internet Transparency", RFC 2775,
  5349. February 2000.
  5350. Kaufman, et al. Standards Track [Page 131]
  5351. RFC 5996 IKEv2bis September 2010
  5352. Appendix A. Summary of Changes from IKEv1
  5353. The goals of this revision to IKE are:
  5354. 1. To define the entire IKE protocol in a single document,
  5355. replacing RFCs 2407, 2408, and 2409 and incorporating subsequent
  5356. changes to support NAT Traversal, Extensible Authentication, and
  5357. Remote Address acquisition;
  5358. 2. To simplify IKE by replacing the eight different initial
  5359. exchanges with a single four-message exchange (with changes in
  5360. authentication mechanisms affecting only a single AUTH payload
  5361. rather than restructuring the entire exchange) see
  5362. [EXCHANGEANALYSIS];
  5363. 3. To remove the Domain of Interpretation (DOI), Situation (SIT),
  5364. and Labeled Domain Identifier fields, and the Commit and
  5365. Authentication only bits;
  5366. 4. To decrease IKE's latency in the common case by making the
  5367. initial exchange be 2 round trips (4 messages), and allowing the
  5368. ability to piggyback setup of a Child SA on that exchange;
  5369. 5. To replace the cryptographic syntax for protecting the IKE
  5370. messages themselves with one based closely on ESP to simplify
  5371. implementation and security analysis;
  5372. 6. To reduce the number of possible error states by making the
  5373. protocol reliable (all messages are acknowledged) and sequenced.
  5374. This allows shortening CREATE_CHILD_SA exchanges from 3 messages
  5375. to 2;
  5376. 7. To increase robustness by allowing the responder to not do
  5377. significant processing until it receives a message proving that
  5378. the initiator can receive messages at its claimed IP address;
  5379. 8. To fix cryptographic weaknesses such as the problem with
  5380. symmetries in hashes used for authentication (documented by Tero
  5381. Kivinen);
  5382. 9. To specify Traffic Selectors in their own payloads type rather
  5383. than overloading ID payloads, and making more flexible the
  5384. Traffic Selectors that may be specified;
  5385. 10. To specify required behavior under certain error conditions or
  5386. when data that is not understood is received in order to make it
  5387. easier to make future revisions in a way that does not break
  5388. backward compatibility;
  5389. Kaufman, et al. Standards Track [Page 132]
  5390. RFC 5996 IKEv2bis September 2010
  5391. 11. To simplify and clarify how shared state is maintained in the
  5392. presence of network failures and DoS attacks; and
  5393. 12. To maintain existing syntax and magic numbers to the extent
  5394. possible to make it likely that implementations of IKEv1 can be
  5395. enhanced to support IKEv2 with minimum effort.
  5396. Appendix B. Diffie-Hellman Groups
  5397. There are two Diffie-Hellman groups defined here for use in IKE.
  5398. These groups were generated by Richard Schroeppel at the University
  5399. of Arizona. Properties of these primes are described in [OAKLEY].
  5400. The strength supplied by group 1 may not be sufficient for typical
  5401. uses and is here for historic reasons.
  5402. Additional Diffie-Hellman groups have been defined in [ADDGROUP].
  5403. B.1. Group 1 - 768-bit MODP
  5404. This group is assigned ID 1 (one).
  5405. The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 }
  5406. Its hexadecimal value is:
  5407. FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
  5408. 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
  5409. EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
  5410. E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF
  5411. The generator is 2.
  5412. B.2. Group 2 - 1024-bit MODP
  5413. This group is assigned ID 2 (two).
  5414. The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
  5415. Its hexadecimal value is:
  5416. FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
  5417. 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
  5418. EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
  5419. E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
  5420. EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381
  5421. FFFFFFFF FFFFFFFF
  5422. The generator is 2.
  5423. Kaufman, et al. Standards Track [Page 133]
  5424. RFC 5996 IKEv2bis September 2010
  5425. Appendix C. Exchanges and Payloads
  5426. This appendix contains a short summary of the IKEv2 exchanges, and
  5427. what payloads can appear in which message. This appendix is purely
  5428. informative; if it disagrees with the body of this document, the
  5429. other text is considered correct.
  5430. Vendor ID (V) payloads may be included in any place in any message.
  5431. This sequence here shows what are the most logical places for them.
  5432. C.1. IKE_SA_INIT Exchange
  5433. request --> [N(COOKIE)],
  5434. SA, KE, Ni,
  5435. [N(NAT_DETECTION_SOURCE_IP)+,
  5436. N(NAT_DETECTION_DESTINATION_IP)],
  5437. [V+][N+]
  5438. normal response <-- SA, KE, Nr,
  5439. (no cookie) [N(NAT_DETECTION_SOURCE_IP),
  5440. N(NAT_DETECTION_DESTINATION_IP)],
  5441. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  5442. [V+][N+]
  5443. cookie response <-- N(COOKIE),
  5444. [V+][N+]
  5445. different Diffie- <-- N(INVALID_KE_PAYLOAD),
  5446. Hellman group [V+][N+]
  5447. wanted
  5448. Kaufman, et al. Standards Track [Page 134]
  5449. RFC 5996 IKEv2bis September 2010
  5450. C.2. IKE_AUTH Exchange without EAP
  5451. request --> IDi, [CERT+],
  5452. [N(INITIAL_CONTACT)],
  5453. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  5454. [IDr],
  5455. AUTH,
  5456. [CP(CFG_REQUEST)],
  5457. [N(IPCOMP_SUPPORTED)+],
  5458. [N(USE_TRANSPORT_MODE)],
  5459. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5460. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5461. SA, TSi, TSr,
  5462. [V+][N+]
  5463. response <-- IDr, [CERT+],
  5464. AUTH,
  5465. [CP(CFG_REPLY)],
  5466. [N(IPCOMP_SUPPORTED)],
  5467. [N(USE_TRANSPORT_MODE)],
  5468. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5469. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5470. SA, TSi, TSr,
  5471. [N(ADDITIONAL_TS_POSSIBLE)],
  5472. [V+][N+]
  5473. error in Child SA <-- IDr, [CERT+],
  5474. creation AUTH,
  5475. N(error),
  5476. [V+][N+]
  5477. Kaufman, et al. Standards Track [Page 135]
  5478. RFC 5996 IKEv2bis September 2010
  5479. C.3. IKE_AUTH Exchange with EAP
  5480. first request --> IDi,
  5481. [N(INITIAL_CONTACT)],
  5482. [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
  5483. [IDr],
  5484. [CP(CFG_REQUEST)],
  5485. [N(IPCOMP_SUPPORTED)+],
  5486. [N(USE_TRANSPORT_MODE)],
  5487. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5488. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5489. SA, TSi, TSr,
  5490. [V+][N+]
  5491. first response <-- IDr, [CERT+], AUTH,
  5492. EAP,
  5493. [V+][N+]
  5494. / --> EAP
  5495. repeat 1..N times |
  5496. \ <-- EAP
  5497. last request --> AUTH
  5498. last response <-- AUTH,
  5499. [CP(CFG_REPLY)],
  5500. [N(IPCOMP_SUPPORTED)],
  5501. [N(USE_TRANSPORT_MODE)],
  5502. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5503. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5504. SA, TSi, TSr,
  5505. [N(ADDITIONAL_TS_POSSIBLE)],
  5506. [V+][N+]
  5507. Kaufman, et al. Standards Track [Page 136]
  5508. RFC 5996 IKEv2bis September 2010
  5509. C.4. CREATE_CHILD_SA Exchange for Creating or Rekeying Child SAs
  5510. request --> [N(REKEY_SA)],
  5511. [CP(CFG_REQUEST)],
  5512. [N(IPCOMP_SUPPORTED)+],
  5513. [N(USE_TRANSPORT_MODE)],
  5514. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5515. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5516. SA, Ni, [KEi], TSi, TSr
  5517. [V+][N+]
  5518. normal <-- [CP(CFG_REPLY)],
  5519. response [N(IPCOMP_SUPPORTED)],
  5520. [N(USE_TRANSPORT_MODE)],
  5521. [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
  5522. [N(NON_FIRST_FRAGMENTS_ALSO)],
  5523. SA, Nr, [KEr], TSi, TSr,
  5524. [N(ADDITIONAL_TS_POSSIBLE)]
  5525. [V+][N+]
  5526. error case <-- N(error)
  5527. different Diffie- <-- N(INVALID_KE_PAYLOAD),
  5528. Hellman group [V+][N+]
  5529. wanted
  5530. C.5. CREATE_CHILD_SA Exchange for Rekeying the IKE SA
  5531. request --> SA, Ni, KEi
  5532. [V+][N+]
  5533. response <-- SA, Nr, KEr
  5534. [V+][N+]
  5535. C.6. INFORMATIONAL Exchange
  5536. request --> [N+],
  5537. [D+],
  5538. [CP(CFG_REQUEST)]
  5539. response <-- [N+],
  5540. [D+],
  5541. [CP(CFG_REPLY)]
  5542. Kaufman, et al. Standards Track [Page 137]
  5543. RFC 5996 IKEv2bis September 2010
  5544. Authors' Addresses
  5545. Charlie Kaufman
  5546. Microsoft
  5547. 1 Microsoft Way
  5548. Redmond, WA 98052
  5549. US
  5550. Phone: 1-425-707-3335
  5551. EMail: charliek@microsoft.com
  5552. Paul Hoffman
  5553. VPN Consortium
  5554. 127 Segre Place
  5555. Santa Cruz, CA 95060
  5556. US
  5557. Phone: 1-831-426-9827
  5558. EMail: paul.hoffman@vpnc.org
  5559. Yoav Nir
  5560. Check Point Software Technologies Ltd.
  5561. 5 Hasolelim St.
  5562. Tel Aviv 67897
  5563. Israel
  5564. EMail: ynir@checkpoint.com
  5565. Pasi Eronen
  5566. Independent
  5567. EMail: pe@iki.fi
  5568. Kaufman, et al. Standards Track [Page 138]