Debian Codegraph @

rfc2341.html

raw
1 <pre>Network Working Group A. Valencia
2 Request for Comments: 2341 M. Littlewood
3 Category: Historic T. Kolar
4 Cisco Systems
5 May 1998
6
7
8 <span class="h1">Cisco Layer Two Forwarding (Protocol) "L2F"</span>
9
10 Status of Memo
11
12 This memo describes a historic protocol for the Internet community.
13 It does not specify an Internet standard of any kind. Distribution
14 of this memo is unlimited.
15
16 Copyright Notice
17
18 Copyright (C) The Internet Society (1998). All Rights Reserved.
19
20 Abstract
21
22 Virtual dial-up allows many separate and autonomous protocol domains
23 to share common access infrastructure including modems, Access
24 Servers, and ISDN routers. Previous RFCs have specified protocols
25 for supporting IP dial-up via SLIP [<a href="#ref-1" title="&quot;A Nonstandard for Transmission of IP Datagrams over Serial Lines: SLIP&quot;">1</a>] and multiprotocol dial-up via
26 PPP [<a href="#ref-2" title="&quot;The Point-to-Point Protocol (PPP)&quot;">2</a>]. This document describes the Layer Two Forwarding protocol
27 (L2F) which permits the tunneling of the link layer (i.e., HDLC,
28 async HDLC, or SLIP frames) of higher level protocols. Using such
29 tunnels, it is possible to divorce the location of the initial dial-
30 up server from the location at which the dial-up protocol connection
31 is terminated and access to the network provided.
32
33 Table of Contents
34
35 1.0 Introduction 3
36 1.1 Conventions 3
37 2.0 Problem Space Overview 3
38 2.1 Initial Assumptions 3
39 2.2 Topology 4
40 2.3 Virtual dial-up Service - a walk-though 5
41 3.0 Service Model Issues 7
42 3.1 Security 7
43 3.2 Address allocation 8
44 3.3 Authentication 8
45 3.4 Accounting 8
46 4.0 Protocol Definition 9
47 4.1 Encapsulation within L2F 10
48 4.1.1 Encapsulation of PPP within L2F 10
49
50
51
52 <span class="grey">Valencia, et. al. Historic [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
55
56
57 4.1.2 Encapsulation of SLIP within L2F 10
58 4.2 L2F Packet Format 10
59 4.2.1 Overall Packet Format 10
60 4.2.2 Packet Header 11
61 4.2.3 Version field 11
62 4.2.4 Protocol field 11
63 4.2.5 Sequence Number 12
64 4.2.6 Packet Multiplex ID 12
65 4.2.7 Client ID 13
66 4.2.8 Length 13
67 4.2.9 Packet Checksum 13
68 4.2.10 Payload Offset 14
69 4.2.11 Packet Key 14
70 4.2.12 Packet priority 14
71 4.3 L2F Tunnel Establishment 14
72 4.3.1 Normal Tunnel Negotiation Sequence 15
73 4.3.2 Normal Client Negotiation Sequence 17
74 4.4 L2F management message types 18
75 4.4.1 L2F message type: Invalid 18
76 4.4.2 L2F_CONF 19
77 4.4.3 L2F_OPEN, tunnel establishment 20
78 4.4.4 L2F_OPEN, client establishment 20
79 4.4.5 L2F_CLOSE 22
80 4.4.6 L2F_ECHO 22
81 4.4.7 L2F_ECHO_RESP 23
82 4.5 L2F Message Delivery 23
83 4.5.1 Sequenced Delivery 23
84 4.5.2 Flow Control 23
85 4.5.3 Tunnel State Table 24
86 4.5.4 Client State Table 25
87 5.0 Protocol Considerations 26
88 5.1 PPP Features 26
89 5.2 Termination 26
90 5.3 Extended Authentication 26
91 5.4 MNP4 and Apple Remote Access Protocol 27
92 5.5 Operation over IP/UDP 27
93 6.0 Acknowledgments 27
94 7.0 References 27
95 8.0 Security Considerations 28
96 9.0 Authors' Addresses 28
97 10.0 Full Copyright Statement 29
98
99
100
101
102
103
104
105
106
107
108 <span class="grey">Valencia, et. al. Historic [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
111
112
113 <span class="h3"><a class="selflink" id="section-1.0" href="#section-1.0">1.0</a> Introduction</span>
114
115 The traditional dial-up network service on the Internet is for
116 registered IP addresses only. A new class of virtual dial-up
117 application which allows multiple protocols and unregistered IP
118 addresses is also desired on the Internet. Examples of this class of
119 network application are support for privately addressed IP, IPX, and
120 AppleTalk dial-up via SLIP/PPP across existing Internet
121 infrastructure.
122
123 The support of these multiprotocol virtual dial-up applications is of
124 significant benefit to end users and Internet Service providers as it
125 allows the sharing of very large investments in access and core
126 infrastructure and allows local calls to be used. It also allows
127 existing investments in non-IP protocol applications to be supported
128 in a secure manner while still leveraging the access infrastructure
129 of the Internet.
130
131 It is the purpose of this RFC to identify the issues encountered in
132 integrating multiprotocol dial-up services into an existing Internet
133 Service Provider's Point of Presence (hereafter referred to as ISP
134 and POP, respectively), and to describe the L2F protocol which
135 permits the leveraging of existing access protocols.
136
137 <span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Conventions</span>
138
139 The following language conventions are used in the items of
140 specification in this document:
141
142 o MUST, SHALL, or MANDATORY -- This item is an absolute
143 requirement of the specification.
144
145 o SHOULD or RECOMMEND -- This item should generally be followed
146 for all but exceptional circumstances.
147
148 o MAY or OPTIONAL -- This item is truly optional and may be
149 followed or ignored according to the needs of the implementor.
150
151 <span class="h3"><a class="selflink" id="section-2.0" href="#section-2.0">2.0</a> Problem Space Overview</span>
152
153 In this section we describe in high level terms the scope of the
154 problem that will be explored in more detail in later sections.
155
156 <span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Initial Assumptions</span>
157
158 We begin by assuming that Internet access is provided by an ISP and
159 that the ISP wishes to offer services other than traditional
160 registered IP address based services to dial-up users of the network.
161
162
163
164 <span class="grey">Valencia, et. al. Historic [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
167
168
169 We also assume that the user of such a service wants all of the
170 security facilities that are available to him in a dedicated dial-up
171 configuration. In particular, the end user requires:
172
173 + End System transparency: Neither the remote end system nor his
174 home site hosts should require any special software to use this
175 service in a secure manner.
176
177 + Authentication as provided via dial-up PPP CHAP or PAP, or through
178 other dialogs as needed for protocols without authentication
179 (e.g., SLIP). This will include TACACS+ and RADIUS solutions as
180 well as support for smart cards and one-time passwords. The
181 authentication should be manageable by the user independently of
182 the ISP.
183
184 + Addressing should be as manageable as dedicated dial-up solutions.
185 The address should be assigned by the home site and not the ISP.
186
187 + Authorization should be managed by the home site as it would in a
188 direct dial-up solution.
189
190 + Accounting should be performed both by the ISP (for billing
191 purposes) and by the user (for charge-back and auditing).
192
193 <span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Topology</span>
194
195 Shown below is a generic Internet with Public switched Telephone
196 Network (PSTN) access (i.e., async PPP via modems) and Integrated
197 Services Digital Network (ISDN) access (i.e., synchronous PPP
198 access). Remote users (either async PPP or SLIP, or ISDN) will
199 access the Home LAN as if they were dialed into the Home Gateway,
200 although their physical dial-up is via the ISP Network Access Server.
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 <span class="grey">Valencia, et. al. Historic [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
223
224
225 ...----[L]----+---[L]-----...
226 |
227 |
228 [<a href="#ref-H">H</a>]
229 |
230 ________|________________________
231 | |
232 ________|__ ______|________
233 | | | |
234 | PSTN [R] [R] ISDN |
235 | Cloud | | Cloud [N]__[U]
236 | | Internet | |
237 | | [R] |
238 [N]______[R] |_____________|
239 | | |
240 | | |
241 [U] |________________________________|
242
243
244 [<a id="ref-H">H</a>] = Home Gateway
245 [L] = Home LAN(s)
246 [R] = Router
247 [U] = Remote User
248 [N] = ISP Network Access Server ("NAS")
249
250 <span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a> Providing Virtual dial-up Services - a walk-through</span>
251
252 To motivate the following discussion, this section walks through an
253 example of what might happen when a Virtual dial-up client initiates
254 access.
255
256 The Remote User initiates a PPP connection to an ISP via either the
257 PSTN or ISDN. The Network Access Server (NAS) accepts the connection
258 and the PPP link is established.
259
260 The ISP undertakes a partial authentication of the end system/user
261 via CHAP or PAP. Only the username field is interpreted to determine
262 whether the user requires a Virtual dial-up service. It is
263 expected-- but not required--that usernames will be structured (e.g.
264 [email protected]). Alternatively, the ISP may maintain a database
265 mapping users to services. In the case of Virtual dial-up, the
266 mapping will name a specific endpoint, the Home Gateway.
267
268 If a virtual dial-up service is not required, standard access to the
269 Internet may be provided.
270
271
272
273
274
275
276 <span class="grey">Valencia, et. al. Historic [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
279
280
281 If no tunnel connection currently exists to the desired Home Gateway,
282 one is initiated. L2F is designed to be largely insulated from the
283 details of the media over which the tunnel is established; L2F
284 requires only that the tunnel media provide packet oriented point-
285 to-point connectivity. Obvious examples of such media are UDP, Frame
286 Relay PVC's, or X.25 VC's. Details for L2F operation over UDP are
287 provided in <a href="#section-5.5">section 5.5</a>. The specification for L2F packet formats is
288 provided in <a href="#section-4.2">section 4.2</a>, and the message types and semantics starting
289 in <a href="#section-4.4">section 4.4</a>.
290
291 Once the tunnel exists, an unused Multiplex ID (hereafter, "MID") is
292 allocated, and a connect indication is sent to notify the Home
293 Gateway of this new dial-up session. The Home Gateway either accepts
294 the connection, or rejects. Rejection may include a reason
295 indication, which may be displayed to the dial-up user, after which
296 the call should be disconnected.
297
298 The initial setup notification may include the authentication
299 information required to allow the Home Gateway to authenticate the
300 user and decide to accept or decline the connection. In the case of
301 CHAP, the set-up packet includes the challenge, username and raw
302 response. For PAP or text dialog (i.e., for SLIP users), it includes
303 username and clear text password. The Home Gateway may choose to use
304 this information to complete its authentication, avoiding an
305 additional cycle of authentication.
306
307 For PPP, the initial setup notification may also include a copy of
308 the the LCP CONFACKs sent in each direction which completed LCP
309 negotiation. The Home Gateway may use this information to initialize
310 its own PPP state (thus avoiding an additional LCP negotiation), or
311 it may choose to initiate a new LCP CONFREQ exchange.
312
313 If the Home Gateway accepts the connection, it creates a "virtual
314 interface" for SLIP or PPP in a manner analogous to what it would use
315 for a direct-dialed connection. With this "virtual interface" in
316 place, link layer frames may now pass over this tunnel in both
317 directions. Frames from the remote user are received at the POP,
318 stripped of any link framing or transparency bytes, encapsulated in
319 L2F, and forwarded over the appropriate tunnel.
320
321 The Home Gateway accepts these frames, strips L2F, and processes them
322 as normal incoming frames for the appropriate interface and protocol.
323 The "virtual interface" behaves very much like a hardware interface,
324 with the exception that the hardware in this case is physically
325 located at the ISP POP. The other direction behaves analogously,
326 with the Home Gateway encapsulating the packet in L2F, and the POP
327 stripping L2F before transmitting it out the physical interface to
328 the remote user.
329
330
331
332 <span class="grey">Valencia, et. al. Historic [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
335
336
337 At this point, the connectivity is a point-to-point PPP or SLIP
338 connection whose endpoints are the remote user's networking
339 application on one end and the termination of this connectivity into
340 the Home Gateway's SLIP or PPP support on the other. Because the
341 remote user has become simply another dial-up client of the Home
342 Gateway access server, client connectivity can now be managed using
343 traditional mechanisms with respect to further authorization,
344 protocol access, and filtering.
345
346 Accounting can be performed at both the NAS as well as the Home
347 Gateway. This document illustrates some Accounting techniques which
348 are possible using L2F, but the policies surrounding such Accounting
349 are outside the scope of this specification.
350
351 Because L2F connect notifications for PPP clients contain sufficient
352 information for a Home Gateway to authenticate and initialize its LCP
353 state machine, it is not required that the remote user be queried a
354 second time for CHAP authentication, nor that the client undergo
355 multiple rounds of LCP negotiation and convergence. These techniques
356 are intended to optimize connection setup, and are not intended to
357 deprecate any functions required by the PPP specification.
358
359 <span class="h3"><a class="selflink" id="section-3.0" href="#section-3.0">3.0</a> Service Model Issues</span>
360
361 There are several significant differences between the standard
362 Internet access service and the Virtual dial-up service with respect
363 to authentication, address allocation, authorization and accounting.
364 The details of the differences between these services and the
365 problems presented by these differences are described below. The
366 mechanisms used for Virtual Dial-up service are intended to coexist
367 with more traditional mechanisms; it is intended that an ISP's POP
368 can simultaneously service ISP clients as well as Virtual dial-up
369 clients.
370
371 <span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> Security</span>
372
373 For the Virtual dial-up service, the ISP pursues authentication only
374 to the extent required to discover the user's apparent identity (and
375 by implication, their desired Home Gateway). As soon as this is
376 determined, a connection to the Home Gateway is initiated with the
377 authentication information gathered by the ISP. The Home Gateway
378 completes the authentication by either accepting the connection, or
379 rejecting it.
380
381 The Home Gateway must also protect against attempts by third parties
382 to establish tunnels to the Home Gateway. Tunnel establishment
383 involves an ISP-to-Home Gateway authentication phase to protect
384 against such attacks.
385
386
387
388 <span class="grey">Valencia, et. al. Historic [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
391
392
393 <span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Address Allocation</span>
394
395 For an Internet service, the user accepts that the IP address may be
396 allocated dynamically from a pool of Service provider addresses.
397 This model often means that the remote user has little or no access
398 to their home network's resources, due to firewalls and other
399 security policies applied by the home network to accesses from
400 external IP addresses.
401
402 For the Virtual dial-up service, the Home Gateway can exist behind
403 the home firewall, allocating addresses which are internal (and, in
404 fact, can be <a href="./rfc1597">RFC1597</a> addresses, or non-IP addresses). Because L2F
405 tunnels exclusively at the frame layer, the actual policies of such
406 address management are irrelevant to correct Virtual dial-up service;
407 for all purposes of PPP or SLIP protocol handling, the dial-in user
408 appears to have connected at the Home Gateway.
409
410 <span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a> Authentication</span>
411
412 The authentication of the user occurs in three phases; the first at
413 the ISP, and the second and optional third at the Home gateway.
414
415 The ISP uses the username to determine that a Virtual dial-up service
416 is required and initiate the tunnel connection to the appropriate
417 Home Gateway. Once a tunnel is established, a new MID is allocated
418 and a session initiated by forwarding the gathered authentication
419 information.
420
421 The Home Gateway undertakes the second phase by deciding whether or
422 not to accept the connection. The connection indication may include
423 CHAP, PAP, or textual authentication information. Based on this
424 information, the Home Gateway may accept the connection, or may
425 reject it (for instance, it was a PAP request and the
426 username/password are found to be incorrect).
427
428 Once the connection is accepted, the Home Gateway is free to pursue a
429 third phase of authentication at the PPP or SLIP layer. These
430 activities are outside the scope of this specification, but might
431 include an additional cycle of LCP authentication, proprietary PPP
432 extensions, or textual challenges carried via a TCP/IP telnet
433 session.
434
435 <span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a> Accounting</span>
436
437 It is a requirement that both the Access gateway and the Home Gateway
438 can provide accounting data and hence both may count packets, octets
439 and connection start and stop times.
440
441
442
443
444 <span class="grey">Valencia, et. al. Historic [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
447
448
449 Since Virtual dial-up is an access service, accounting of connection
450 attempts (in particular, failed connection attempts) is of
451 significant interest. The Home Gateway can reject new connections
452 based on the authentication information gathered by the ISP, with
453 corresponding logging. For cases where the Home Gateway accepts the
454 connection and then continues with further authentication, the Home
455 Gateway might subsequently disconnect the client. For such
456 scenarios, the disconnection indication back to the ISP may also
457 include a reason.
458
459 Because the Home Gateway can decline a connection based on the
460 authentication information collected by the ISP, accounting can
461 easily draw a distinction between a series of failed connection
462 attempts and a series of brief successful connections. Lacking this
463 facility, the Home Gateway must always accept connection requests,
464 and would need to exchange a number of PPP packets with the remote
465 system.
466
467 <span class="h3"><a class="selflink" id="section-4.0" href="#section-4.0">4.0</a> Protocol Definition</span>
468
469 The protocol definition for Virtual dial-up services requires two
470 areas of standardization:
471
472 + Encapsulation of PPP packets within L2F. The ISP NAS and the
473 Home gateway require a common understanding of the encapsulation
474 protocol so that SLIP/PPP packets can be successfully transmitted
475 and received across the Internet.
476
477 + Connection management of L2F and MIDs. The tunnel must be
478 initiated and terminated, as must MIDs within the tunnel.
479 Termination includes diagnostic codes to assist in the diagnosis
480 of problems and to support accounting.
481
482 While providing these services, the protocol must address the
483 following required attributes:
484
485 + Low overhead. The protocol must impose a minimal additional
486 overhead. This requires a compact encapsulation, and a structure
487 for omitting some portions of the encapsulation where their
488 function is not required.
489
490 + Efficiency. The protocol must be efficient to encapsulate and
491 deencapsulate.
492
493 + Protocol independence. The protocol must make very few
494 assumptions about the substrate over which L2F packets are
495 carried.
496
497
498
499
500 <span class="grey">Valencia, et. al. Historic [Page 9]</span></pre>
501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
502 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
503
504
505 + Simple deployment. The protocol must not rely on additional
506 telecommunication support (for instance, unique called numbers,
507 or caller ID) to operate.
508
509 <span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a> Encapsulation within L2F</span>
510
511 <span class="h4"><a class="selflink" id="section-4.1.1" href="#section-4.1.1">4.1.1</a> Encapsulation of PPP within L2F</span>
512
513 The PPP packets may be encapsulated within L2F. The packet
514 encapsulated is the packet as it would be transmitted over a physical
515 link. The following are NOT present in the packet:
516
517 + Flags
518 + Transparency data (ACCM for async, bit stuffing for sync)
519 + CRC
520
521 The following ARE still present:
522
523 + Address and control flags (unless negotiated away by LCP)
524 + Protocol value
525
526 <span class="h4"><a class="selflink" id="section-4.1.2" href="#section-4.1.2">4.1.2</a> Encapsulation of SLIP within L2F</span>
527
528 SLIP is encapsulated within L2F in much the same way as PPP. The
529 transparency characters are removed before encapsulating within L2F,
530 as is the framing.
531
532 <span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a> L2F Packet Format</span>
533
534 <span class="h4"><a class="selflink" id="section-4.2.1" href="#section-4.2.1">4.2.1</a> Overall Packet Format</span>
535
536 The entire encapsulated packet has the form:
537
538
539 ---------------------------------
540 | |
541 | L2F Header |
542 | |
543 ---------------------------------
544 | |
545 | Payload packet (SLIP/PPP) |
546 | |
547 ---------------------------------
548 | |
549 | L2F Checksum (optional) |
550 | |
551 ---------------------------------
552
553
554
555
556 <span class="grey">Valencia, et. al. Historic [Page 10]</span></pre>
557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
558 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
559
560
561 <span class="h4"><a class="selflink" id="section-4.2.2" href="#section-4.2.2">4.2.2</a> Packet Format</span>
562
563 An L2F packet has the form:
564
565 0 1 2 3
566 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
567 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568 |F|K|P|S|0|0|0|0|0|0|0|0|C| Ver | Protocol |Sequence (opt)|\
569 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\
570 | Multiplex ID | Client ID | |
571 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | L2F
572 | Length | Offset (opt) | |Header
573 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
574 | Key (opt) | /
575 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+/
576 + (payload) |
577 + ..... |
578 + ..... |
579 + ..... |
580 + (payload) |
581 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 | L2F Checksum (optional) |
583 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584
585 <span class="h4"><a class="selflink" id="section-4.2.3" href="#section-4.2.3">4.2.3</a> Version field</span>
586
587 The Ver ("Version") field represents the major version of the L2F
588 software creating the packet. It MUST contain the value 001.
589
590 If Ver holds a value other than 1, or any bits are non-zero after bit
591 S but before bit C, this corresponds to a packet containing
592 extensions not understood by the receiving end. The packet is
593 handled as an invalid packet as defined in 4.4.1.
594
595 <span class="h4"><a class="selflink" id="section-4.2.4" href="#section-4.2.4">4.2.4</a> Protocol field</span>
596
597 The Protocol specifies the protocol carried within the L2F packet.
598 Legal values (represented here in hexadecimal) are:
599
600 Value Type Description
601 0x00 L2F_ILLEGAL Illegal
602 0x01 L2F_PROTO L2F management packets
603 0x02 L2F_PPP PPP tunneled inside L2F
604 0x03 L2F_SLIP SLIP tunneled inside L2F
605
606 If a packet is received with a Protocol of L2F_ILLEGAL or any other
607 unrecognized value, it MUST be treated as an illegal packet as
608 defined in 4.4.1.
609
610
611
612 <span class="grey">Valencia, et. al. Historic [Page 11]</span></pre>
613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
614 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
615
616
617 <span class="h4"><a class="selflink" id="section-4.2.5" href="#section-4.2.5">4.2.5</a> Sequence Number</span>
618
619 The Sequence number is present if the S bit in the L2F header is set
620 to 1. This bit MUST be 1 for all L2F management packets. It MAY be
621 set to 1 for non-L2F management packets. If a non-L2F management
622 packet is received with the S bit set, all future L2F packets sent
623 for that MID MUST have the S bit set (and, by implication, be sent
624 using sequence numbers). For instance, the Home Gateway might choose
625 to force sequenced packet delivery if it detects an NCP opening for a
626 protocol which can not operate with out-of-sequence packets.
627
628 The Sequence number starts at 0 for the first sequenced L2F packet.
629 Each subsequent packet is sent with the next increment of the
630 sequence number. The sequence number is thus a free running counter
631 represented modulo 256. There is distinct Sequence number state
632 (i.e., counter) for each distinct MID value.
633
634 For packets with S bit and sequence number, the sequence number is
635 used to protect against duplication of packets, as follows:
636
637 The receiving side of the tunnel records the sequence number of each
638 valid L2F packet it receives. If a received packet appears to have a
639 value less than or equal to the last received value, the packet MUST
640 be silently discarded. Otherwise, the packet is accepted and the
641 sequence number in the packet recorded as the latest value last
642 received.
643
644 For purposes of detecting duplication, a received sequence value is
645 considered less than or equal to the last received value if its value
646 lies in the range of the last value and its 127 successor values.
647 For example, if the last received sequence number was 15, then
648 packets with sequence numbers 0 through 15, as well as 144 through
649 255, would be considered less than or equal to, and would be silently
650 discarded. Otherwise it would be accepted.
651
652 <span class="h4"><a class="selflink" id="section-4.2.6" href="#section-4.2.6">4.2.6</a> Packet Multiplex ID</span>
653
654 The Multiplex ID ("MID") identifies a particular connection within
655 the tunnel. Each new connection is assigned a MID currently unused
656 within the tunnel. It is recommended that the MID cycle through the
657 entire 16-bit namespace, to reduce aliasing between previous and
658 current sessions. A MID value which has been previously used within
659 a tunnel, has been closed, and will now be used again, must be
660 considered as an entirely new MID, and initialised as such.
661
662 The MID with value 0 is special; it is used to communicate the state
663 of the tunnel itself, as distinct from any connection within the
664 tunnel. Only L2F_PROTO packets may be sent using an MID of 0; if any
665
666
667
668 <span class="grey">Valencia, et. al. Historic [Page 12]</span></pre>
669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
670 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
671
672
673 other type is sent on MID 0, the packet is illegal and MUST be
674 processed as defined in 4.4.1.
675
676 <span class="h4"><a class="selflink" id="section-4.2.7" href="#section-4.2.7">4.2.7</a> Client ID</span>
677
678 The Client ID ("CLID") is used to assist endpoints in demultiplexing
679 tunnels when the underlying point-to-point substrate lacks an
680 efficient or dependable technique for doing so directly. Using the
681 CLID, it is possible to demultiplex multiple tunnels whose packets
682 arrive over the point-to-point media interleaved, without requiring
683 media-specific semantics.
684
685 When transmitting the L2F_CONF message (described below), the peer's
686 CLID must be communicated via the Assigned_CLID field. This MUST be
687 a unique non-zero value on the sender's side, which is to be expected
688 in the Home Gateway's L2F_CONF response, as well as all future non-
689 L2F_CONF packets received.
690
691 The CLID value from the last valid L2F_CONF message received MUST be
692 recorded and used as the CLID field value for all subsequent packets
693 sent to the peer.
694
695 Packets with an unknown Client ID MUST be silently discarded.
696
697 For the initial packet sent during tunnel establishment, where no
698 L2F_CONF has yet been received, the CLID field MUST be set to 0.
699
700 Thus, during L2F_CONF each side is told its CLID value. All later
701 packets sent, tagged with this CLID value, serve as a tag which
702 uniquely identifies this peer.
703
704 <span class="h4"><a class="selflink" id="section-4.2.8" href="#section-4.2.8">4.2.8</a> Length</span>
705
706 Length is the size in octets of the entire packet, including header,
707 all fields present, and payload. Length does not reflect the
708 addition of the checksum, if one is present. The packet should be
709 silently discarded if the received packet is shorter than the
710 indicated length. Additional bytes present in the packet beyond the
711 indicated length MUST be silently ignored.
712
713 <span class="h4"><a class="selflink" id="section-4.2.9" href="#section-4.2.9">4.2.9</a> Packet Checksum</span>
714
715 The Checksum is present if the C bit is present in the header flags.
716 It is a 16-bit CRC as used by PPP/HDLC (specifically, FCS-16 [<a href="#ref-3" title="&quot;PPP in HDLC-like Framing&quot;">3</a>]).
717 Is is applied over the entire packet starting with the first byte of
718 L2F flags, through the last byte of payload data. The checksum is
719 then added as two bytes immediately following the last byte of
720 payload data.
721
722
723
724 <span class="grey">Valencia, et. al. Historic [Page 13]</span></pre>
725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
726 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
727
728
729 <span class="h4"><a class="selflink" id="section-4.2.10" href="#section-4.2.10">4.2.10</a> Payload Offset</span>
730
731 The Offset is present if the F bit is set in the header flags. This
732 field specifies the number of bytes past the L2F header at which the
733 payload data is expected to start. If it is 0, or the F bit is not
734 set, the first byte following the last byte of L2F header is the
735 first byte of payload data.
736
737 It is recommended that data skipped due to the payload offset be
738 initialized to 0's.
739
740 For architectures where it is more efficient to have the payload
741 start at an aligned 32-bit boundary with respect to the L2F header,
742 it is recommended that the F bit be set, and an offset of 0 be used.
743
744 <span class="h4"><a class="selflink" id="section-4.2.11" href="#section-4.2.11">4.2.11</a> Packet Key</span>
745
746 The Key field is present if the K bit is set in the L2F header. The
747 Key is based on the authentication response last given to the peer
748 during tunnel creation (the details of tunnel creation are provided
749 in the next section). It serves as a key during the life of a
750 session to resist attacks based on spoofing. If a packet is received
751 in which the Key does not match the expected value, the packet MUST
752 be silently discarded. Such handling takes precedence over 4.4.1.
753
754 The Key value is generated by taking the 128-bit authentication
755 response from the peer, interpreting it as four adjacent 32-bit words
756 in network byte order, XOR'ing these words together, and using the
757 resulting 32-bit value as the Key.
758
759 <span class="h4"><a class="selflink" id="section-4.2.12" href="#section-4.2.12">4.2.12</a> Packet priority</span>
760
761 If the P bit in the L2F header is set, this packet is a "priority"
762 packet. When possible for an implementation, a packet received with
763 the P bit should be processed in preference to previously received
764 unprocessed packets without the P bit.
765
766 The P bit may be set by an implementation based on criteria beyond
767 the scope of this specification. However, it is recommended that PPP
768 keepalive traffic, if any, be sent with this bit set.
769
770 <span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a> L2F Tunnel Establishment</span>
771
772 When the point-to-point link is first initiated between the NAS and
773 the Home Gateway, the endpoints communicate on MID 0 prior to
774 providing general L2F services to clients. This communication is
775 used to verify the presence of L2F on the remote end, and to permit
776 any needed authentication.
777
778
779
780 <span class="grey">Valencia, et. al. Historic [Page 14]</span></pre>
781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
782 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
783
784
785 The protocol for such negotiation is always 1, indicating L2F
786 management. The message itself is structured as a sequence of single
787 octets indicating an option, followed by zero or more further octets
788 formatted as needed for the option.
789
790 <span class="h4"><a class="selflink" id="section-4.3.1" href="#section-4.3.1">4.3.1</a> Normal Tunnel Negotiation Sequence</span>
791
792 The establishment sequence is best illustrated by a "typical"
793 connection sequence. Detailed description of each functions follows,
794 along with descriptions of the handling of exceptional conditions.
795
796 Each packet is described as a source-&gt;destination on one line, a
797 description of the L2F packet field contents on the next, and the
798 contents of the packet's body on following lines. The exact encoding
799 of octets will be described later.
800
801 Note that this example uses the Key option, but does not use the
802 Offset and Checksum options. The Length field would be present,
803 reflecting the actual length of the packets as encoded as an octet
804 stream.
805
806 1. NAS-&gt;GW:
807 Proto=L2F, Seq=0, MID=0, CLID=0, Key=0
808 L2F_CONF
809 Name: NAS_name
810 Challenge: Rnd
811 Assigned_CLID: 22
812
813 The NAS decides that a tunnel must be initiated from the NAS to the
814 GW. An L2F packet is sent with the Proto field indicating an L2F
815 management message is contained.
816
817 Because the tunnel is being initiated, Key is set to 0. The sequence
818 number starts at 0; the MID is 0 to reflect the establishment of the
819 tunnel itself. Since the NAS has not yet received an L2F_CONF, the
820 CLID is set to 0.
821
822 The body of the packet specifies the claimed name of the NAS, and a
823 challenge random number which GW will use in authenticating itself as
824 a valid tunnel endpoint. Assigned_CLID is generated to be a value
825 not currently assigned out to any other tunnel to any other Home
826 Gateway.
827
828
829
830
831
832
833
834
835
836 <span class="grey">Valencia, et. al. Historic [Page 15]</span></pre>
837 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
838 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
839
840
841 2. GW-&gt;NAS:
842 Proto=L2F, Seq=0, MID=0, CLID=22, Key=0
843 L2F_CONF
844 Name: GW_name
845 Challenge: Rnd2
846 Assigned_CLID: 73
847
848 The Home Gateway has processed the previous packet, and sends a
849 response. The protocol continues to be L2F, with a sequence number 0
850 (each side maintains its own sequence number for transmissions). MID
851 continues to be 0 to reflect tunnel establishment. CLID reflects the
852 Assigned_CLID field of the L2F_CONF received. The Key continues to
853 be 0 during this phase of tunnel establishment.
854
855 The body contains the Home Gateway's name, its own random number
856 challenge, and its own Assigned_CLID for the NAS to place in the CLID
857 field of future packets. The CLID is generated in an analogous
858 manner to that of the NAS. After this, all packets received from the
859 NAS must be tagged with a CLID field containing 73, and all packets
860 sent to the NAS must be tagged with a CLID field containing 22.
861
862 3. NAS-&gt;GW
863 Proto=L2F, Seq=1, MID=0, CLID=73, Key=C(Rnd2)
864 L2F_OPEN
865 Response: C(Rnd2)
866
867 The NAS responds with its Key now set to reflect the shared secret.
868 The Key is a CHAP-style hash of the random number received; each
869 packet hereafter will reflect this calculated value, which serves as
870 a key for the life of the tunnel. Both the Home Gateway and the NAS
871 use such Keys for the life of the tunnel. The Key is a 32-bit
872 representation of the MD5 digest resulting from encrypting the shared
873 secret; the full MD5 digest is included in the L2F_OPEN response, in
874 the "response" field.
875
876 4. GW-&gt;NAS
877 Proto=L2F, Seq=1, MID=0, CLID=22, Key=C(Rnd)
878 L2F_OPEN
879 Response: C(Rnd)
880
881 The Home Gateway provides closure of the key from the NAS, reflected
882 in both the Key field as well as the "response" field. The tunnel is
883 now available for clients to be established.
884
885
886
887
888
889
890
891
892 <span class="grey">Valencia, et. al. Historic [Page 16]</span></pre>
893 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
894 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
895
896
897 <span class="h4"><a class="selflink" id="section-4.3.2" href="#section-4.3.2">4.3.2</a> Normal Client Negotiation Sequence</span>
898
899 This section describes the establishment of a Virtual dial-up client
900 on a NAS into a Home Gateway. It assumes a tunnel has been created
901 in the way described in 4.3.1. The client for this example is a PPP
902 client configured for CHAP.
903
904 Treatment of Checksum, Length, and Offset are as in 4.3.1.
905
906 1. NAS-&gt;GW
907 Proto=L2F, Seq=2, MID=1, CLID=73, Key=C(Rnd2)
908 L2F_OPEN
909 Type: CHAP
910 Name: CHAP-name
911 Challenge: Rnd3
912 Response: &lt;Value received, presumably C(Rnd3)&gt;
913 ID: &lt;ID used in challenge&gt;
914
915 The NAS has received a call, tried CHAP with a challenge value of
916 Rnd3, and found that the client responded. The claimed name lead the
917 NAS to believe it was a Virtual dial-up client hosted by the Home
918 Gateway. The next free MID is allocated, and the information
919 associated with the CHAP challenge/response is included in the
920 connect notification.
921
922 2. GW-&gt;NAS
923 Proto=L2F, Seq=2, MID=1, CLID=22, Key=C(Rnd)
924 L2F_OPEN
925
926 The Home Gateway, by sending back the L2F_OPEN, accepts the client.
927
928 3. NAS-&gt;GW
929 Proto=PPP, Seq=0, MID=1, CLID=73, Key=C(Rnd2)
930 &lt;Frame follows&gt;
931
932 4. GW-&gt;NAS
933 Proto=PPP, Seq=0, MID=1, CLID=22, Key=C(Rnd)
934 &lt;Frame follows&gt;
935
936 Traffic is now free to flow in either direction as sent by the remote
937 client or the home site. The contents is uninterpreted data, HDLC in
938 this case. Data traffic, since it is not the L2F protocol, does not
939 usually use the Seq field, which is set to 0 in non-L2F messages (see
940 the S bit in <a href="#section-4.2.5">section 4.2.5</a> for details on an exception to this).
941
942
943
944
945
946
947
948 <span class="grey">Valencia, et. al. Historic [Page 17]</span></pre>
949 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
950 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
951
952
953 <span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a> L2F management message types</span>
954
955 When an L2F packet's Proto field specifies L2F management, the body
956 of the packet is encoded as zero or more options. An option is a
957 single octet "message type", followed by zero or more sub-options.
958 Each sub-option is a single byte sub-option value, and further bytes
959 as appropriate for the sub-option.
960
961 Options in L2F are:
962
963
964 Hex Value Abbreviation Description
965 -------- ------------ -----------
966 0x00 Invalid Invalid message
967 0x01 L2F_CONF Request configuration
968 0x02 L2F_CONF_NAME Name of peer sending L2F_CONF
969 0x03 L2F_CONF_CHAL Random number peer challenges with
970 0x04 L2F_CONF_CLID Assigned_CLID for peer to use
971 0x02 L2F_OPEN Accept configuration
972 0x01 L2F_OPEN_NAME Name received from client
973 0x02 L2F_OPEN_CHAL Challenge client received
974 0x03 L2F_OPEN_RESP Challenge response from client
975 0x04 L2F_ACK_LCP1 LCP CONFACK accepted from client
976 0x05 L2F_ACK_LCP2 LCP CONFACK sent to client
977 0x06 L2F_OPEN_TYPE Type of authentication used
978 0x07 L2F_OPEN_ID ID associated with authentication
979 0x08 L2F_REQ_LCP0 First LCP CONFREQ from client
980 0x03 L2F_CLOSE Request disconnect
981 0x01 L2F_CLOSE_WHY Reason code for close
982 0x02 L2F_CLOSE_STR ASCII string description
983 0x04 L2F_ECHO Verify presence of peer
984 0x05 L2F_ECHO_RESP Respond to L2F_ECHO
985
986 <span class="h4"><a class="selflink" id="section-4.4.1" href="#section-4.4.1">4.4.1</a> L2F message type: Invalid</span>
987
988 If a message is received with this value, or any value higher than
989 the last recognized option value, or if an illegal packet as defined
990 by other parts of this specification is received, the packet is
991 considered invalid. The packet MUST be discarded, and an L2F_CLOSE
992 of the entire tunnel MUST be requested. Upon receipt of an
993 L2F_CLOSE, the tunnel itself may be closed. All other received
994 message MUST be discarded. An implementation MAY close the tunnel
995 after an interval of time appropriate to the characteristics of the
996 tunnel.
997
998
999
1000
1001
1002
1003
1004 <span class="grey">Valencia, et. al. Historic [Page 18]</span></pre>
1005 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
1006 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1007
1008
1009 Note that packets with an invalid Key are discarded, but disconnect
1010 is not initiated. This prevents denial-of-service attacks. Invalid
1011 option types within a message MUST be treated as if the entire
1012 message type was invalid.
1013
1014 <span class="h4"><a class="selflink" id="section-4.4.2" href="#section-4.4.2">4.4.2</a> L2F_CONF</span>
1015
1016 The L2F message type is used to establish the tunnel between the NAS
1017 and the Home Gateway. MID is always set to 0. The body of such a
1018 message starts with the octet 0x01 (L2F_CONF), followed by all three
1019 of the sub-options below.
1020
1021 The L2F_CONF_NAME sub-option MUST be present. It is encoded as the
1022 octet value 0x02, followed by an octet specifying a non-zero length,
1023 followed by the indicated number of bytes, which are interpreted as
1024 the sender's ASCII name.
1025
1026 The L2F_CONF_CHAL sub-option MUST be present. It is encoded as the
1027 octet value 0x03, followed by a non-zero octet, followed by a number
1028 of bytes specified by this non-zero octet.
1029
1030 The challenge value should be generated using whatever techniques
1031 provide the highest quality of random numbers available to a given
1032 implementation.
1033
1034 The L2F_CONF_CLID sub-option MUST be present. It is encoded as the
1035 octet 0x04, followed by four bytes of Assigned_CLID value. The
1036 Assigned_CLID value is generated as a non-zero 16-bit integer value
1037 unique across all tunnels which exist on the sending system. The
1038 least significant two octets of Assigned_CLID are set to this value,
1039 and the most significant two octets MUST be set to 0.
1040
1041 The CLID field is sent as 0 in the initial L2F_CONF packet from NAS
1042 to Home Gateway, and otherwise MUST be sent containing the value
1043 specified in the Assigned_CLID field of the last L2F_CONF message
1044 received.
1045
1046 Key MUST be set to 0 in all L2F_CONF packets, and no key field is
1047 included in the packet.
1048
1049 When sent from a NAS to a Home Gateway, the L2F_CONF is the initial
1050 packet in the conversation.
1051
1052 When sent from the Home Gateway to the NAS, an L2F_CONF indicates the
1053 Home Gateway's recognition of the tunnel creation request. The Home
1054 Gateway MUST provide its name and its own challenge in the message
1055 body.
1056
1057
1058
1059
1060 <span class="grey">Valencia, et. al. Historic [Page 19]</span></pre>
1061 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
1062 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1063
1064
1065 In all packets following the L2F_CONF, the Key MUST be set to the
1066 CHAP-style hash of the received challenge bytes. The CHAP-style hash
1067 is done over the concatenation of the low 8 bits of the assigned
1068 CLID, the secret, and the challenge value. Generation of the 32-bit
1069 key value is discussed in <a href="#section-4.2.11">section 4.2.11</a>.
1070
1071 <span class="h4"><a class="selflink" id="section-4.4.3" href="#section-4.4.3">4.4.3</a> L2F_OPEN, tunnel establishment</span>
1072
1073 The L2F_OPEN message is used to provide tunnel setup closure (for a
1074 MID of 0) or to establish a client connection within a tunnel
1075 previously established by L2F_CONF and L2F_OPEN messages (MID not
1076 equal to 0). This section describes tunnel establishment; <a href="#section-4.4.4">section</a>
1077 <a href="#section-4.4.4">4.4.4</a> following describes clients established within the tunnel.
1078
1079 An L2F_OPEN for tunnel establishment MUST contain only the sub-option
1080 0x03, L2F_OPEN_RESP. This option MUST be followed by the octet 0x10,
1081 specifying the size of the 128-bit MD5 digest resulting from
1082 encrypting the challenge value in the L2F_CONF, along with the low
1083 byte of the Assigned_CLID. After this byte MUST be the sixteen bytes
1084 of the generated MD5 digest.
1085
1086 If during tunnel establishment an L2F_OPEN is received with an
1087 incorrect L2F_OPEN_RESP, the packet MUST be silently discarded. It
1088 is recommended that such an event generate a log event as well.
1089
1090 <span class="h4"><a class="selflink" id="section-4.4.4" href="#section-4.4.4">4.4.4</a> L2F_OPEN, client establishment</span>
1091
1092 An L2F_OPEN (with non-zero MID) sent from the NAS to the Home Gateway
1093 indicates the presence of a new dial-in client. When sent back from
1094 the Home Gateway to the NAS, it indicates acceptance of the client.
1095 This message starts with the octet 0x02. When sent from the NAS, it
1096 may contain further sub-options. When sent from the Home Gateway, it
1097 may not contain any sub-options. All further discussion of sub-
1098 options in this section apply only to the NAS to Home Gateway
1099 direction.
1100
1101 The L2F_OPEN_TYPE sub-option MUST be present. It is encoded as the
1102 octet 0x06, followed by a single byte describing the type of
1103 authentication the NAS exchanged with the client in detecting the
1104 client's claimed identification. Implicit in the authentication type
1105 is the encapsulation to be carried over the life of the session. The
1106 authentication types are:
1107
1108 0x01 Textual username/password exchange for SLIP
1109 0x02 PPP CHAP
1110 0x03 PPP PAP
1111 0x04 PPP no authentication
1112 0x05 SLIP no authentication
1113
1114
1115
1116 <span class="grey">Valencia, et. al. Historic [Page 20]</span></pre>
1117 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
1118 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1119
1120
1121 The L2F_OPEN_NAME sub-option is encoded as the octet 0x01, followed
1122 by an octet specifying the length of the name, followed by the
1123 indicated number of bytes of the name. This field MUST be present
1124 for any authentication type except 0x04 (None). It MUST contain the
1125 name specified in the client's authentication response.
1126
1127 The L2F_OPEN_CHAL sub-option is encoded as the octet 0x02, followed
1128 by an octet specifying the length of the challenge sent, followed by
1129 the challenge itself. This field is only present for CHAP, and MUST
1130 contain the challenge value sent to the client by the NAS.
1131
1132 The L2F_OPEN_RESP sub-option is encoded as the octet 0x03, followed
1133 by an octet specifying the length of the response received, followed
1134 by the client's response to the challenge. For CHAP, this field
1135 contains the response value received by the NAS. For PAP or textual
1136 authentication, it contains the clear text password received from the
1137 client by the NAS. This field is absent for authentication 0x04
1138 "None".
1139
1140 The L2F_ACK_LCP1 and L2F_ACK_LCP2 sub-options are encoded as the
1141 octets 0x04 and 0x05 respectively, followed in either case by two
1142 octets in network byte order specifying the length of the LCP CONFACK
1143 last received from or sent to the client. Following these octets is
1144 an exact copy of the CONFACK packet. L2F_ACK_LCP1 specifies a copy
1145 of the closing CONFACK received from the client, and L2F_ACK_LCP2
1146 specifies a copy of the closing CONFACK sent to the client by the
1147 NAS.
1148
1149 The L2F_REQ_LCP0 sub-option is encoded as the octet 0x08, followed by
1150 two octets in network byte order specifying the length of the LCP
1151 CONFREQ initially received from the client. This may be used by the
1152 Home Gateway to detect capabilities of the client which were
1153 negotiated away while starting LCP with the NAS. Detection of such
1154 options may be used by the Home Gateway to decide to renegotiate LCP.
1155
1156 The L2F_OPEN_ID sub-option is encoded as the octet 0x06, followed by
1157 a single octet. This sub-option is only present for CHAP; the single
1158 octet contains the CHAP Identifier value sent to the client during
1159 the CHAP challenge.
1160
1161 The Home Gateway may choose to ignore any sub-option of the L2F_OPEN,
1162 and accept the connection anyway. The Home Gateway would then have
1163 to undertake its own LCP negotiations and authentication. To
1164 maximize the transparency of the L2F tunnel, it is recommended that
1165 extra negotiations and authentication be avoided if possible.
1166
1167
1168
1169
1170
1171
1172 <span class="grey">Valencia, et. al. Historic [Page 21]</span></pre>
1173 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
1174 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1175
1176
1177 <span class="h4"><a class="selflink" id="section-4.4.5" href="#section-4.4.5">4.4.5</a> L2F_CLOSE</span>
1178
1179 This message is encoded as the byte 0x03. An L2F_CLOSE may be sent
1180 by either side of the tunnel at any time. When sent with MID of 0,
1181 it indicates the desire to terminate the entire tunnel and all
1182 clients within the tunnel. When sent from the Home Gateway in
1183 response to an L2F_OPEN, it indicates that the Home Gateway has
1184 declined the connection. When sent with a non-zero MID, it indicates
1185 the termination of that client within the tunnel.
1186
1187 The L2F_CLOSE_WHY sub-option is encoded as the byte 0x01 followed
1188 four bytes in network byte order specifying a bit mask of reasons for
1189 the disconnection. The bits are encoded as:
1190
1191 0x00000001 Authentication failed
1192 0x00000002 Out of resources
1193 0x00000004 Administrative intervention
1194 0x00000008 User quota exceeded
1195 0x00000010 Protocol error
1196 0x00000020 Unknown user
1197 0x00000040 Incorrect password
1198 0x00000080 PPP configuration incompatible
1199 0x00000100 Wrong multilink PPP destination
1200
1201 Bits in the mask 0xFF000000 are reserved for per-vendor
1202 interpretation.
1203
1204 An implementation can choose to not provide status bits even if it
1205 detects a condition described by one of these bits. For instance, an
1206 implementation may choose to not use 0x00000020 due to security
1207 considerations, as it can be used to probe user name space.
1208
1209 The L2F_CLOSE_STR sub-option is encoded as the byte 0x02, followed by
1210 a two-byte length in network byte order, followed by the indicated
1211 number of bytes, which are interpreted as descriptive ASCII text
1212 associated with the disconnection. This string may be ignored, but
1213 could be recorded in a log to provide detailed or auxiliary
1214 information associated with the L2F_CLOSE.
1215
1216 <span class="h4"><a class="selflink" id="section-4.4.6" href="#section-4.4.6">4.4.6</a> L2F_ECHO</span>
1217
1218 Transmission of L2F_ECHO messages is optional. If an implementation
1219 transmits L2F_ECHO messages, it MUST not transmit more than one such
1220 request each second. The payload size MUST be 64 bytes or less in
1221 length. It is recommended that at least 5 L2F_ECHO messages be sent
1222 without response before an implementation assumes that its peer has
1223 terminated.
1224
1225
1226
1227
1228 <span class="grey">Valencia, et. al. Historic [Page 22]</span></pre>
1229 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
1230 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1231
1232
1233 The L2F_ECHO message is encoded as the single byte 0x04. It may be
1234 sent by either side once the tunnel is established. MID MUST be 0.
1235 An L2F_ECHO_RESP (documented below) MUST be sent back in response.
1236
1237 <span class="h4"><a class="selflink" id="section-4.4.7" href="#section-4.4.7">4.4.7</a> L2F_ECHO_RESP</span>
1238
1239 All implementations MUST respond to L2F_ECHO, using L2F_ECHO_RESP.
1240 The received packet MUST be sent back verbatim, except that the CLID,
1241 sequence number, and checksum (if any) MUST be updated, and the
1242 L2F_ECHO message type changed to an L2F_ECHO_RESP. Payload data
1243 following the 0x04 octet, if any, MUST be preserved in the response.
1244
1245 When an L2F_ECHO_RESP is received, the payload data may be used to
1246 associate this response with a previously sent L2F_ECHO, or the
1247 packet may be silently discarded.
1248
1249 <span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a> L2F Message Delivery</span>
1250
1251 L2F is designed to operate over point-to-point unreliable links. It
1252 is not designed to provide flow control of the data traffic, nor does
1253 it provide reliable delivery of this traffic; each protocol tunnel
1254 carried via L2F is expected to manage flow control and retry itself.
1255 Thus, it is only L2F control messages which must be retransmitted;
1256 this process is described in this section.
1257
1258 <span class="h4"><a class="selflink" id="section-4.5.1" href="#section-4.5.1">4.5.1</a> Sequenced delivery</span>
1259
1260 All L2F control messages (i.e., those L2F packets with a protocol
1261 type of 0x01) are transmitted with a sequence number. The sequence
1262 number is a per-L2F tunnel free running counter which is incremented
1263 (modulo 256) after each packet is transmitted. It is used to permit
1264 the receiving end to detect duplicated or out-of-order packets, and
1265 to discard such packets. <a href="#section-4.2.5">Section 4.2.5</a> describes the process in
1266 detail.
1267
1268 <span class="h4"><a class="selflink" id="section-4.5.2" href="#section-4.5.2">4.5.2</a> Flow control</span>
1269
1270 L2F control messages are expected to be exchanged lock-step. Thus,
1271 per-client activities can not occur until tunnel setup is complete.
1272 Neither can one client be serviced until the L2F message exchange is
1273 complete for a previous client. Thus, it is expected that rarely--if
1274 ever--should a flow control action be required. If the input queue
1275 of L2F control messages reaches an objectionable level for an
1276 implementation, the implementation may silently discard all messages
1277 in the queue to stabilize the situation.
1278
1279
1280
1281
1282
1283
1284 <span class="grey">Valencia, et. al. Historic [Page 23]</span></pre>
1285 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
1286 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1287
1288
1289 <span class="h4"><a class="selflink" id="section-4.5.3" href="#section-4.5.3">4.5.3</a> Tunnel State table</span>
1290
1291 The following enumerates the handling of L2F messages for tunnel
1292 creation in state table format. Events name an L2F_ message type
1293 (the L2F_ portion of the named message is omitted to permit a more
1294 compact table). A start ("*") matches any event not otherwise
1295 matched for the named state.
1296
1297 A NAS starts at initial state Start0, sending a packet before waiting
1298 for its first event. A Home Gateway starts at Start1, waiting for an
1299 initial packet to start service.
1300
1301 If an event is not matched for a given state, the packet associated
1302 with that event is silently discarded.
1303
1304 Tunnel establishment (MID == 0), NAS side.
1305
1306
1307 State Event Action New State
1308 ----- ----- ------ ---------
1309 Start0 Send CONF Start1
1310 Start1 CONF Send OPEN Start2
1311 Start1 timeout 1-3 Send CONF Start1
1312 Start1 timeout 4 Clean up tunnel (done)
1313 Start2 OPEN (initiate 1st client) Open1
1314 Start2 timeout 1-3 Send OPEN Start2
1315 Start2 timeout 4 Clean up tunnel (done)
1316 Open1 OPEN Send OPEN Open1
1317 Open1 CLOSE Send CLOSE Close1
1318 Open1 no MIDs open Send CLOSE Close2
1319 Close1 CLOSE Send CLOSE Close1
1320 Close1 timeout 4 Clean up tunnel (done)
1321 Close2 CLOSE Clean up tunnel (done)
1322 Close2 timeout 1-3 Send CLOSE Close2
1323 Close2 timeout 4 Clean up tunnel (done)
1324
1325 Tunnel establishment (MID == 0), Home Gateway side.
1326
1327 State Event Action New State
1328 ----- ----- ------ ---------
1329 Start0 CONF Send CONF Start1
1330 Start1 CONF Send CONF Start1
1331 Start1 OPEN Send OPEN Open1
1332 Start1 timeout 4 Clean up tunnel (done)
1333 Open1 OPEN Send OPEN Open1
1334 Open1 OPEN (MID &gt; 0) (1st client, below) Open2
1335 Open1 CLOSE Send CLOSE Close1
1336 Open1 timeout 4 Clean up tunnel (done)
1337
1338
1339
1340 <span class="grey">Valencia, et. al. Historic [Page 24]</span></pre>
1341 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
1342 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1343
1344
1345 Open2 OPEN (MID &gt; 0) (below) Open2
1346 Open2 CLOSE Send CLOSE Close1
1347 Close1 CLOSE Send CLOSE Close1
1348 Close1 timeout 4 Clean up tunnel (done)
1349
1350 <span class="h4"><a class="selflink" id="section-4.5.4" href="#section-4.5.4">4.5.4</a> Client State table</span>
1351
1352 This table is similar to the previous one, but enumerates the states
1353 for a client connection within a tunnel in the opened state from
1354 4.5.3. As this sequence addresses clients, MID will be non-zero.
1355
1356 Client establishment (MID != 0), NAS side.
1357
1358 State Event Action New State
1359 ----- ----- ------ ---------
1360 Start0 Send OPEN Start1
1361 Start1 OPEN (enable forwarding) Open1
1362 Start1 CLOSE Clean up MID (MID done)
1363 Start1 timeout 1-3 Send OPEN Start1
1364 Start1 timeout 4 Clean up MID (MID done)
1365 Start1 client done Send CLOSE Close2
1366 Open1 OPEN (no change) Open1
1367 Open1 CLOSE Send CLOSE Close1
1368 Open1 client done Send CLOSE Close2
1369 Close1 CLOSE Send CLOSE Close1
1370 Close1 timeout 4 Clean up MID (MID done)
1371 Close2 CLOSE Clean up MID (MID done)
1372 Close2 timeout 1-3 Send CLOSE Close2
1373 Close2 timeout 4 Clean up MID (MID done)
1374
1375 Client establishment (MID != 0), Home Gateway side.
1376
1377 State Event Action New State
1378 ----- ----- ------ ---------
1379 Start0 OPEN Send OPEN Open1
1380 Start0 OPEN (fail) Send CLOSE Close3
1381 Open1 OPEN Send OPEN Open1
1382 Open1 CLOSE Send CLOSE Close1
1383 Open1 client done Send CLOSE Close2
1384 Close1 CLOSE Send CLOSE Close1
1385 Close1 timeout 4 Clean up MID (MID done)
1386 Close2 CLOSE Clean up MID (MID done)
1387 Close2 timeout 1-3 Send CLOSE Close2
1388 Close2 timeout 4 Clean up MID (MID done)
1389 Close3 OPEN Send CLOSE Close3
1390 Close3 timeout 4 Clean up MID (MID done)
1391
1392
1393
1394
1395
1396 <span class="grey">Valencia, et. al. Historic [Page 25]</span></pre>
1397 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
1398 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1399
1400
1401 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Protocol Considerations</span>
1402
1403 Several aspects of operation over L2F, while outside the realm of the
1404 protocol description itself, serve to clarify the operation of L2F.
1405
1406 <span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a> PPP Features</span>
1407
1408 Because L2F in operation carries uninterpreted frames, it permits
1409 operation of features without explicit knowledge of these features.
1410 For instance, if a PPP session is carried, L2F is simply transporting
1411 HDLC frames. The two PPP endpoints can negotiate higher-level
1412 features, such as reliable link, compression, multi-link, or
1413 encryption. These features then operate between the two PPP
1414 endpoints (the dial-in client on one end, and the Home Gateway on the
1415 other), with L2F continuing to simply ship HDLC frames back and
1416 forth.
1417
1418 For similar reasons, PPP echo requests, NCP configuration
1419 negotiation, and even termination requests, are all simply tunneled
1420 HDLC frames.
1421
1422 <span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a> Termination</span>
1423
1424 As L2F simply tunnels link-layer frames, it does not detect frames
1425 like PPP TERMREQ. L2F termination in these scenarios is driven from
1426 a protocol endpoint; for instance, if a Home Gateway receives a
1427 TERMREQ, its action will be to "hang up" the PPP session. It is the
1428 responsibility of the L2F implementation at the Home Gateway to
1429 convert a "hang up" into an L2F_CLOSE action, which will shut down
1430 client's session in the tunnel cleanly. L2F_CLOSE_WHY and
1431 L2F_CLOSE_STR may be included to describe the reason for the
1432 shutdown.
1433
1434 <span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a> Extended Authentication</span>
1435
1436 L2F is compatible with both PAP and CHAP protocols. SLIP does not
1437 provide authentication within the protocol itself, and thus requires
1438 an ASCII exchange of username and password before SLIP is started.
1439 L2F is compatible with this mode of operation as well.
1440
1441 One-time password cards have become very common. To the extent the
1442 NAS can capture and forward the one-time password, L2F operation is
1443 compatible with password cards. For the most general solution, an
1444 arbitrary request/response exchange must be supported. In an L2F
1445 environment, the protocol must be structured so that the NAS can
1446 detect the apparent identity of the user and establish a tunnel
1447 connection to the Home Gateway, where the arbitrary exchange can
1448 occur.
1449
1450
1451
1452 <span class="grey">Valencia, et. al. Historic [Page 26]</span></pre>
1453 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
1454 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1455
1456
1457 <span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a> MNP4 and Apple Remote Access Protocol</span>
1458
1459 L2F appears compatible with Apple's ARAP protocol. Its operation
1460 under L2F has not been described simply because this experimental RFC
1461 does not have a corresponding implementation of such operation.
1462
1463 <span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a> Operation of IP and UDP</span>
1464
1465 L2F tries to be self-describing, operating at a level above the
1466 particular media over which it is carried. However, some details of
1467 its connection to media are required to permit interoperable
1468 implementations. This section describes the issues which have been
1469 found when operating L2F over IP and UDP.
1470
1471 L2F uses the well-known UDP port 1701 [<a href="#ref-4" title="&quot;Assigned Numbers&quot;">4</a>]. The entire L2F packet,
1472 including payload and L2F header, is sent within a UDP datagram. The
1473 source and destination ports are the same (1701), with demultiplexing
1474 being achieved using CLID values. It is legal for the source IP
1475 address of a given CLID to change over the life of a connection, as
1476 this may correspond to a peer with multiple IP interfaces responding
1477 to a network topology change. Responses should reflect the last
1478 source IP address for that CLID.
1479
1480 IP fragmentation may occur as the L2F packet travels over the IP
1481 substrate. L2F makes no special efforts to optimize this. A NAS
1482 implementation MAY cause its LCP to negotiate for a specific MRU,
1483 which could optimize for NAS environments in which the MTUs of the
1484 path over which the L2F packets are likely to travel have a
1485 consistent value.
1486
1487 <span class="h3"><a class="selflink" id="section-6.0" href="#section-6.0">6.0</a> Acknowledgments</span>
1488
1489 L2F uses a packet format inspired by GRE [<a href="#ref-5" title="&quot;Generic Routing Encapsulation (GRE)&quot;">5</a>]. Thanks to Fred Baker
1490 for consultation, Dave Carrel for consulting on security aspects, and
1491 to Paul Traina for philosophical guidance.
1492
1493 <span class="h3"><a class="selflink" id="section-7.0" href="#section-7.0">7.0</a> References</span>
1494
1495 [<a id="ref-1">1</a>] Romkey, J., "A Nonstandard for Transmission of IP Datagrams over
1496 Serial Lines: SLIP", <a href="./rfc1055">RFC 1055</a>, June 1988.
1497
1498 [<a id="ref-2">2</a>] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51,
1499 <a href="./rfc1661">RFC 1661</a>, July 1994.
1500
1501 [<a id="ref-3">3</a>] Simpson, W., "PPP in HDLC-like Framing", STD 51,, <a href="./rfc1662">RFC 1662</a>,
1502 July 1994.
1503
1504
1505
1506
1507
1508 <span class="grey">Valencia, et. al. Historic [Page 27]</span></pre>
1509 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
1510 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1511
1512
1513 [<a id="ref-4">4</a>] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, <a href="./rfc1700">RFC 1700</a>,
1514 October 1994.
1515
1516 [<a id="ref-5">5</a>] Hanks, S., Li, T., Farinacci, D., and P. Traina, "Generic Routing
1517 Encapsulation (GRE)", <a href="./rfc1701">RFC 1701</a>, October 1994.
1518
1519 <span class="h3"><a class="selflink" id="section-8.0" href="#section-8.0">8.0</a> Security Considerations</span>
1520
1521 Security issues are discussed in <a href="#section-3.1">Section 3.1</a>.
1522
1523 <span class="h3"><a class="selflink" id="section-9.0" href="#section-9.0">9.0</a> Authors' Addresses</span>
1524
1525 Tim Kolar
1526 Cisco Systems
1527 170 West Tasman Drive
1528 San Jose CA 95134-1706
1529
1530 EMail: [email protected]
1531
1532
1533 Morgan Littlewood
1534 Cisco Systems
1535 170 West Tasman Drive
1536 San Jose CA 95134-1706
1537
1538 EMail: [email protected]
1539
1540
1541 Andy Valencia
1542 Cisco Systems
1543 170 West Tasman Drive
1544 San Jose CA 95134-1706
1545
1546 EMail: [email protected]
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564 <span class="grey">Valencia, et. al. Historic [Page 28]</span></pre>
1565 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
1566 <span class="grey"><a href="./rfc2341">RFC 2341</a> Cisco L2F May 1998</span>
1567
1568
1569 <span class="h3"><a class="selflink" id="section-9.0" href="#section-9.0">9.0</a> Full Copyright Statement</span>
1570
1571 Copyright (C) The Internet Society (1998). All Rights Reserved.
1572
1573 This document and translations of it may be copied and furnished to
1574 others, and derivative works that comment on or otherwise explain it
1575 or assist in its implementation may be prepared, copied, published
1576 and distributed, in whole or in part, without restriction of any
1577 kind, provided that the above copyright notice and this paragraph are
1578 included on all such copies and derivative works. However, this
1579 document itself may not be modified in any way, such as by removing
1580 the copyright notice or references to the Internet Society or other
1581 Internet organizations, except as needed for the purpose of
1582 developing Internet standards in which case the procedures for
1583 copyrights defined in the Internet Standards process must be
1584 followed, or as required to translate it into languages other than
1585 English.
1586
1587 The limited permissions granted above are perpetual and will not be
1588 revoked by the Internet Society or its successors or assigns.
1589
1590 This document and the information contained herein is provided on an
1591 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1592 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1593 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1594 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1595 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620 Valencia, et. al. Historic [Page 29]
1621 </pre>