@@ -212,7 +212,7 @@ The fixed portion of the base header is defined as follows.
212212 0 1 2 3
213213 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
214214 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
215- |1|Version| Opt Len | Flags | Session ID |
215+ |1|Version|Flags| OptLen | Session ID |
216216 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
217217 | SPI |
218218 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -230,8 +230,8 @@ The fixed portion of the base header is defined as follows.
230230 necessarily able to parse the packet correctly. Intermediate
231231 treatment of such packets is policy-dependent (e.g., it may dictate
232232 dropping such packets).
233- - Opt Len :: 5 bits: Length in 4 bytes of the ~Options~ field .
234- - Flags :: 6 bits: The Flags field is used as specified in [[flags]] .
233+ - Flags :: 3 bits: The Flags field is used as specified in [[flags]] .
234+ - Opt Len :: 8 bits: Length in bytes of the ~Options~ field .
235235- Session ID :: 16 bits: The Session ID covers additional information
236236 that might be used to identify the SA.
237237 For instance, it can be used to encode a Sub SA ID. The meaning of
@@ -248,17 +248,17 @@ The Flags field in the fixed Base Header is defined as follows:
248248#+caption: Base Header Flags
249249#+name: flags
250250#+begin_src
251- 0 1 2 3 4 5
252- +-+-+-+-+-+-+
253- |F| R |
254- +-+-+-+-+-+-+
251+ 0 1 2
252+ +-+-+-+
253+ |F| R |
254+ +-+-+-+
255255#+end_src
256256
257257- Packet Format (F) :: 1 bit: Set to zero for full EESP packet Format (i.e., the EESP header includes the
258258 ~Payload Info Header~), set to 1 for Optimized EESP Packet format. This bit
259259 MAY be only set to 1 if the Crypt Offset is positive. It MUST be set to
260260 0 otherwise.
261- - Reserved (R) :: 5 bits: Reserved for future versions, MUST be set to 0,
261+ - Reserved (R) :: 2 bits: Reserved for future versions, MUST be set to 0,
262262 and ignored by the receiver.
263263
264264
@@ -301,27 +301,31 @@ alignment is dictated by the packet format, see [[Payload Data]].
301301** Peer Header
302302
303303The ~Peer Header~ follows the ~Base Header~ and ~Options~ field.
304- The ~Peer Header~ containing a ~Sequence Number~ and an
305- optional ~Initialization Vector~, and the format is shown below.
306304The Peer Header is private to the IPsec peers, middleboxes MUST
307- NOT act upon the Peer Header fields.
308-
305+ NOT act upon the Peer Header fields. Peer Header fields are
306+ optional and MUST be
307+ negotiated by IKEv2 or any other appropriate protocol, therefore
308+ is is not parsable by middelboxes. This document defines two
309+ Peer Header fileds, a ~Sequence Number~ and an
310+ ~Initialization Vector~, the format is shown below.
311+ Future documents can define additional Peer Header fields
312+ based on their needs.
309313
310314#+caption: Peer Header
311315#+name: peer-header
312316#+begin_src
313317 0 1 2 3
314318 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
315319 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
316- | Sequence Number |
320+ | Sequence Number (optional) |
317321 | |
318322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319323 | IV (optional) |
320324 | |
321325 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
322326#+end_src
323327
324- The ~Sequence Number~ is a full 64bit sequence number.
328+ If present, the ~Sequence Number~ is a full 64bit sequence number.
325329EESP only support 64bit sequence numbers, a.k.a ESN and transmits the
326330entire sequence number on each packet. The actual size of the
327331~Initialization Vector~ depends on the choice of the cipher suite.
@@ -331,6 +335,7 @@ in the following sections.
331335
332336*** Sequence Number
333337
338+ The sequence number field is used for relay protection.
334339This unsigned 64-bit field contains a counter value that increases
335340for each packet sent, i.e., a per-SA packet sequence number. For a
336341unicast SA or a single-sender multicast SA, the sender MUST increment
@@ -354,6 +359,18 @@ Similar to the Session ID, this Sender ID can be used as an
354359additional Subs SA ID (see [[Session ID as Sub SA ID]]).
355360Defining such an Option is left for future documents.
356361
362+ Replay protection is optional, but enabled by default.
363+ Replay protection SHOULD be enabled whenever possible.
364+ However, on multicast or in datacenter environments where
365+ the upper layer protocols ensure replay protection,
366+ it can be disabled. Disabling replay protection MUST
367+ be negotiated by IKEv2. In this case the sequence number
368+ field is omitted.
369+
370+ In contrast to ESP, where the receiver alone decides wether to
371+ disable replay protecton, it is negotiated in EESP so
372+ that sender and receiver can agree on it.
373+
357374# Note STK: The text below needs to be reworded. It does not
358375# match with the optional Sequence Number mentioned above.
359376#
0 commit comments