PPP protocol
1. Introduction
The point-to-point protocol is designed to establish a simple connection between two peer entities. This connection provides the same
The two-way full-duplex operation and assume that the packet is delivered in order. PPP connection provides a wide range of
The solution is convenient to facilitate the value of a variety of unforgettable values as the maximum receiving unit.
Fill field
In transmission, the information field may fill to the maximum receiving unit length by additional number of bytes. This by
Each protocol is responsible for distinguishing the information field and the fill area.
3. PPP connection operation
3.1 Overview
In order to establish communication in point-to-point connections, each end of the PPP connection must first send LCP data.
Bread configuration and test data connection. After the connection is established, the peer entity may also require authentication.
Then, PPP must send an NCP packet to select one or more network layer protocols to configure. once
After the selected network layer protocol is configured, the data report of the network layer can be transmitted on the link.
The link will remain configurable until the LCP packet and the NCP packet terminate the connection, or by
Other external events occur (such as non-active clocks are full or interference of network managers).
3.2 state map
In the process of configuring the maintenance and termination point to point connection, the PPP connection has experienced several different stages, this
Some phases are described by the following simplified state diagram:
---- ---------- ------------
| | | Connect | | | Success / No
Death | -------> | Establish | ----------> | Certification |
| | | | | | | | |
---- ---------- ------------ |
^ | | | |
| Failure | Failure | |
------------ -------- |
| | | | |
| ----------- | --------- |
| Disconnect | | | Off | | | | |
---------- | Termination | <- - <---------- | Network | <-
| | | | | |
--------- -------
3.3 Connection death phase (physical layer is not ready) A connection start and end must undergo this stage. When an external event (eg, the carrier or network
Support management configuration) Indicates that the physical layer is ready and can be used, and the PPP will enter the establishment of the connection phase.
At this stage, the LCP protocol automaton (later will be mentioned) is in the initial or positive start state. Be entering
The UP event notifies the LCP protocol automation after the connection phase is established.
Application consideration:
Typically, a connection will automatically return to this phase after the modem connection is disconnected. In use phone line
In the case of connectivity, this stage will be quite short, short to a little enough time can detect its existence with the instrument. 3.4 Establish a connection phase
The Link Control Protocol (LCP) establishes a connection by a switched configuration packet. When the LCP protocol is automatic
The exchange process for establishing a connection is completed when the configured confirmation data packet is opened and sent and received.
All configuration options are assumed to be default unless changed during configuration interaction. About LCP
Further discussion of the configuration options See the chapters of the following.
One thing is very important, that is, those who have nothing to do with the specific network level agreement can be LCP
Configuration. Configuring a separate network layer protocol is configured by the corresponding network control protocol during the network layer protocol phase.
Any non-LCP packet received at this stage will be silently discarded.
Received an LCP configuration request packet will cause a PPP connection from a network layer protocol phase or a certification phase
Back to the establishment of the connection phase.
3.5 Certification Stage
In some connection, you want to authenticate the peer entity before allowing the network layer protocol packet exchange.
When default, certification is not necessary. If you want to use some authentication protocols to authenticate
This requirement must be proposed in the establishment of the connection phase.
The certification phase should be immediately after establishing the connection phase. However, there may be decisions in connection quality in parallel.
It is absolutely not allowed to determine the exchange of data packets to have an uncertain delay for the authentication.
The network layer protocol phase after the certification phase must wait until the end of the certification will begin. If the authentication fails, it will turn into
Terminate the connection phase.
Just connection control protocol, authentication protocol, and connection quality monitoring data package is allowed to appear in this stage. all
Other packets received in this stage will be silently discarded.
Application consideration:
The application cannot be simply due to the timeout or lack of response, it is considered that the authentication failed. It should be allowed to retransmit, only try only
The number of times the diagram authentication exceeds a certain limit to the termination connection phase.
If the other party refuses to authenticate, the self will have the right to enter the termination connection phase.
3.6 Network layer protocol
Once the PPP completes the above phase, each network layer protocol (such as IP, IPX,
AppleTalk must be individually configured by the appropriate network control protocol (NCP).
Each network control protocol can be turned on or off at any time.
Application consideration:
Since it is possible to use a lot of time to get a lot of time, it is waiting for the other party to enter.
The row network control protocol configuration should avoid using a fixed timeout limit.
When a network control protocol automatic machine reaches the open state, the PPP connection can be transmitted
Network layer protocol packet. When any supported network layer protocol packet is received, as long as the corresponding network control
The status of the protocol is not entered the open state, and it will be silently discarded.
Application consideration:
As long as the LCP protocol status Automata is in an open state, any received unsupported protocol data
The bag will return the protocol refusal package (will be mentioned later). The supported protocol packets will be silently discarded.
At this stage, the connection flows through the LCP packet, NCP packet, and network layer protocol packets. 3.7 Termination of the connection phase
The PPP connection can be terminated at any time. The reason may be that the carrier is lost, the authentication failed, the connection quality failed, super
When the counter is overflow, or the network administrator turns off the connection.
The LCP terminates the connection by swapping the connection termination packet. PPP will be connected when the connection is terminated
Know the network layer so that it takes the corresponding action.
After the exchange of termination request packages, the physical layer will be notified to make the connection really terminate, especially when the authentication failed.
Hou. Sending a connection termination request package should wait for the reception of the connection to stop the confirmation package or the timeout counter is filled.
After disconnection. One party that receives the connection to the termination confirmation package should wait for the other party to disconnect, and never disconnect until at least
There is a timeout timer overflow after the end of the connection confirmation package. Then PPP should enter the connection death phase
.
All received non-LCP packets will be silently discarded in this stage.
Application consideration:
It is enough to use LCP when you turn it off. Each NCP does not need to send termination connection packets. phase
Inverse, an NCP protocol automatic shutdown does not turn off the entire PPP connection, even if this NCP protocol is automatically
The machine is currently unique in an open state.
4. Option negotiation automaton
Finite state automaton is defined by events, action, and status migration. Events include receiving external commands, such as opening, close
The timeout timer overflows and receives the data packet sent by the other party. Action includes opening the timeout counter and sending to the other party
Send a packet.
Some types of packets, such as configuring negative packets and configuration rejection packages, or numbered reject packets and protocols refused packages, or
Responding to the request package, respond to the answer package, and discard the request package in the description of the automaton. Just as it will
It is mentioned that although these different types of data packets can cause the same state migration, they do have a different work.
use.
Event action
UP = low-layer connected TLU = This layer is connected
Down = low layer has been disconnected TLD = This layer has been disconnected
Open = Open connection TLS = This layer has started to connect
CLOSE = Close connection TLF = This layer has been closed
TO = timeout timer overflow and timeout counter value is greater than zero IRC = initialization timeout counter
TO- = timeout timer overflow and timeout counter value is less than zero Zrc = timeout counter clear
Rcr = Receive the correct configuration request package SCR = Send configuration request package
Rcr- = received incorrect configuration request package
RCA = Receive Configuration Confirmation Pack SCA = Send Configuration Confirmation Pack
RCN = receive configured negative package / rejection package SCN = send configuration negation package / refusal package
RTR = Receive Termination Request Pack Str = Send Termination Request Pack
RTA = Receive Termination Confirmation Pack STA = Send Termination Confirmation Package
RUC = received unknown coded package SCJ = transmission coding refusal package
RXJ = Received encoding rejected package (allowed)
Or accept the agreement
RXJ- = received the encoding refusal package (bad)
Or accept the agreement
RXR = Received Request Pack Ser = Send a response answer package
Or receive a response answer package
Or receive a discard request package
4.1 Status Transfer Table
Here is a complete state transfer table. The state level is listed. The low layer is still not ready. The timeout timer is not run in this state.
When the low layer becomes available, the configuration request package is sent.
Closed status
In this state, the connection is valid, but the OPEN event does not appear. The timeout timer is not running
In this state.
After receiving the configuration request package, the termination request packet will be sent. Received the termination confirmation package will be silently discarded
To avoid cycling.
STOPPED status
This state is migrated after the OPEN event has occurred in the Closed state. When the automaton is in progress
After the TLF action or when the termination request package is sent, you will enter this status when you wait for the DOWN event. Timeout
There is no running in this state.
The appropriate answer will be made after receiving the configuration request package. When you receive other types of packages, send
Terminate the confirmation package. The receiving the termination confirmation package will be silently discarded to avoid a loop.
Fundamental:
The Stopped status is the connection termination phase, the connection configuration failed and other automaton error modes
Convergence.
There is also a case where the DOWN event (triggered by TLF action) and the RCR event. Be
Or reject other users' requests. Since the connection is confirmed as available, you can follow a Down event and a tight.
Then the OPEN event notifies the LCP to simulate the implementation. It should be specially note that the Close event cannot be
Other reasons triggered.
A Down event is triggered at this time, and then a UP event is immediately. This will make the connection
The start of the order is re-negotiated, and the automatic machine is transferred from the CLOSIING state to the Stopping state, and
The TLF action will be disconnected. Automatic machine will wait in the stopped status or Starting state
Next connection.
Timeout (To , TO-) event
The Timeout event indicates the timeout timer overflow. When sending a configuration request package and termination request package
The timeout timer starts timing.
The TO event indicates that the value of the timeout counter is still greater than zero. The timeout counter is reduced every minute, indicating that the configuration request package or terminate the request package returns once.
The TO-event indicates that the value of the timeout counter is less than zero, and no packets need to be retransmitted.
Receive-Configure-Request (RCR , RCR-) event
The RCR event appears indicates that the configuration request package sent from the other party is received. Configure the arrival of the request package
The other party wants to open the connection and specify the connection option. The configuration request package will be described in more detail later.
The RCR event indicates that the other party's configuration request is acceptable and the transfer configuration confirms package.
The RCR-event indicates that the other party's configuration request is unacceptable, and the corresponding configuration negation package will be transmitted or
Configure the refusal package.
Application consideration:
These events can occur when the automat is already in the OPENED state. It must be prepared immediately at this time.
Good to negotiate the option.
Receive-Configure-Ack (RCA) event
The RCA event indicates that the other κ κ κ 鹗 卮稹 ? This action is highly dependent on the needs of the application.
This-layer-finished (tlf) action
TLF action indicates that the low-level protocol automatic machine enters intial status, Closed status
, Or stopped status, and low-layer no longer used. Down should be used when the low layer is terminated
The piece is an answer.
Typically, this action may be used by the LCP to enter the connection death phase in advance, or by NCP
Notifying the LCP When no NCP is opened, the connection may terminate.
The result of this action is highly dependent on the needs of the application.
INITIALIZE-RESTART-COUNT (IRC) Action IRC Action Initialization Timeout Counter is a suitable value (Max-Terminate or
Max-configure). Each time a packet is transmitted, the counter is reduced and includes the first time.
Application consideration:
In addition to setting the timeout counter, you must set the time length of the timeout event for the timeout timer.
ZERO-RESTART-COUNT (ZRC) action
Zrc action clears the timeout counter.
Application consideration:
This action allows the limited automatic state machine to stop before entering the final desired state, allowing by the other party
Treat network traffic. In addition to setting the timeout counter, you must set the time length of the timeout event for the timeout timer.
Send-Configure-Request (SCR) action
SCR Action will send a configuration request package. This indicates that it is expected to open the connection with the specified configuration option. Be in configured
When the option package is sent, the timeout timer starts timing to prevent it from being lost. Whenever a configuration request package is sent,
The timer is reduced.
Send-Configure-Ack (SCA) action
SCA action sends a configuration confirmation package. It indicates that all configuration selection in the received configuration request package is confirmed.
item.
Send-configure-nak (scN) action
SCN motion sends a configured negative package or configuring a rejected package. It demonstrates some configuration options in the received configuration request package.
Configuring the negative package is used to reject a configuration option value, and it also recommended a new acceptable match.
Set the option value. Configuration Dressing Pack is used to reject all configuration options, typically because these options cannot be identified.
Or is used. About How to Use Configuration Negative Packages and Configuration Refused Packs will be described later in the link control protocol packet format
Detailed explanation in the chapter.
Send-Terminate-Request (STR) action
STR Action Sends a termination request package. It indicates that it is expected to close the connection. When the termination request package is sent,
The time timer starts timing to prevent it from being lost. When a configuration request package is sent, the timeout counter is reduced.
Send-Terminate-Ack (STA) action
The STA action sends a termination confirmation package. It indicates that the received termination request package or the association of both parties
The automatic machine acts as a synchronization.
Send-code-reject (scj) action
SCJ motion sends a coding reject package. It indicates that the received packets cannot be identified.
Send-echo-reply (SER) action
The SER action sends a response to answer package. It indicates that it is recognized that the response request package is received.
4.6 Avoid circulation
The protocol is effectively avoided the loop when negotiating configuration options. However, the agreement does not guarantee that this cycle will no longer appear.
When negotiating any option, both parties may adopt a conflicting configuration strategy. But both parties are also possible
Take a compatible configuration strategy, but it may take a lot of time. Applicants should be in their hearts and should
Apply cyclic monitoring mechanisms and higher levels of timeout mechanisms.
4.7 Counters and Timers
Timeout timer
The automatic machine does not use a special timer. Oversurcation timer is used to monitor configuration request packages and termination requests
Transfer of the package. When the timer is filled, a Timeout event will be triggered and resend the corresponding configuration request.
Pack or terminate the request package. The timeout timer must be configured, and the default value should be three seconds.
Application consideration:
The setting of the timeout timer should be based on the speed of the connection. The default is a low speed connection (2400-
9600bps), high-speed exchange connection (typical such as telephone line). A higher speed connection, or low switching speed connections should increase the number of retransmissions.
Replacing a fixed timeout value, the timeout timer should be initially set to a small value and then add to the final configuration value. each
A value that is less than the final value should be twice the previous value. The initial value should be processed to handle a packet,
It is usually set to twice the connection speed to make a round-trip time in the transmission time, plus one hundred milliseconds to allow each other
Packets can be processed before doing respond.
Maximum termination
It is a value required to terminate the timeout counter of the request package count. It shows that the other party cannot
Send the maximum number of senders that have been sent before doing an answer before and not receiving the termination confirmation package. Maximum termination
It is necessary to be configured, and the default value should be returned twice.
Maximum configuration
Similar amounts are recommended to configure request packages. It shows that the other party cannot make an answer before and not received
To configure the confirmation package, configure the negative package, or configure the reject package, send the configuration request package maximum number of sents. Maximum configuration
The number must be configured, and the default value should be returned ten times.
Maximum number of failures
Similar amounts are recommended to configure negative packages. It indicates whether the confirmation is not reached unanimously sent configuration confirmation package.
The maximum number of sent package. Any of the configured negative package is added to the configuration refusal package.
Options and local desired options are no longer added in the negotiation process. The maximum number of configurations must be configured, and
The default value should be five times.
5. Link Control Protocol Packet Format
There are three types of link control protocol data packets:
1. Connection configuration packets are used to establish and configure connections. (Configuration Request Pack, Configuration Confirmation Pack, Configuring Negative Package
And configure the rejection package).
2. Connection Termination Packet is used to terminate the connection (termination request package and termination confirmation package).
3. Connection maintenance packets are used to manage and debug connections (encoded rejection packages, protocol refusal packages, respond to request packages,
Respond to the answer package and discard the request package).
For simplicity, there is no version number in the data link control protocol packet format. For protocols that cannot be identified and
Encoding can respond with a simple identifiable link control protocol, so it provides other versions
A deterministic but low efficiency running mechanism.
Regardless of the configuration options being identified as enable, all connection configuration packages, connection termination pack, encoding rejection package (code number
1-7) All assume that no configuration options are negotiated. In fact, each configuration option is specified for a default.
This makes it possible to make a packet such as link control protocols always recognize, even if the connection has ended but still being errors
When it is open for the connection.
Link Control Protocol Packet is encapsulated in a data field in a PPP frame format, and the value of the protocol domain of the PPP frame is 0X
C021.
The link control protocol packet format is summarized. The sequence from left to right is transmitted.
0 1 2 3
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
- - - - - - - - - - - - - - - -
| Code | Identification | Length |
- - - - - - - - - - - - - - - - - - - | Data. . .
- - -
Encoding domain
The coding domain accounts for an eight-bit byte. It identifies this type of link control protocol packet. Be received
When the encoding domain is unrecognizable, send the encoded denial of the data package.
The value of the latest coding domain is received by the recently announced "Assigned Numbers" RFC
Instructions. There are the following values associated with this document:
1 Configuration Request (Configure-Request)
2 Configuration confirmation (Configure-Ack)
3 Configuration Dericization (Configure-Nak)
4 Configure rejection (configure-reject)
5 Termination request (TERMINATE-Request)
6 Termination Confirmation (Terminate-Ack)
7 Code rejection (Code-Reject)
8 protocol rejected (protocol-reject)
9 response request (echo-request)
10 response answer (echo-reply)
11 Discard Request (Discard-Request)
Logo domain
Identification domain encoding accounts for an eight-bit byte, which helps request and answer. When the standard in the received data package
The knowledge is invalid, it will be silently discarded and does not affect the status of the automaton.
Length domain
Identification domain coding accounts for two eight-bit bytes, which identifies the length of the link control protocol packet, including the coding domain
, Identification domain, data field, etc. This length cannot exceed the maximum reception length of the connection.
Oversente bytes of the length of the domain are considered to populate bytes and ignore when receiving. When receiving the length of the length is invalid
When the packet is silently discarded and does not affect the status of the automat.
Data domain
The data field has zero or more eight-bit bytes, as indicated in the length domain. The format in the data domain is
The value in the coding domain is determined.
5.1 Configuration Request
description
When you want to open a connection, you must transfer the configuration request package. Default to the default value by the expected change in the option domain
Configuration options populate. The configuration option does not have to contain configuration options that use the default value.
When the configuration request package is received, the appropriate packet must be transmitted as a response.
The format of the configuration request package is summarized below. The sequence from left to right is transmitted.
0 1 2 3
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
- - - - - - - - - - - - - - - -
| Code | Identification | Length |
- - - - - - - - - - - - - - - - - - | Options. . .
- - -
coding
1 represents the configuration request.
Logo
The content change in the selection field or when the invalid answer to the previous request is received, the identification domain should change
. When retransmission, the identification field should not change.
Option
The option domain length varies, contains a list of configuration options with zero or more desirable negotiation. All configuration
The item will be negotiated at the same time. The format of the option domain will be discussed in detail later.
5.2 Confirmation confirmation
description
If the configuration options in the configuration request package sent by the other party can be identified and acceptable, you can send
Configuration confirmation package. The order and options of the options that have been confirmed will not be modified in any way.
The identification field in the received configuration confirmation packet must match the identification domain in the configuration request packet in the previously transmitted
. In addition, the options in the configuration confirmation package must be identical to the options in the configuration request packets previously sent.
The format of the configuration request package is summarized below. The sequence from left to right is transmitted.
0 1 2 It is used to notify the other party's own yourself to receive more
The packet or requires the other party to send a smaller packet.
Its default is 1500 bytes. If a smaller packet is required, the application still applies when the connection is lost synchronous
The information field will be received at 1500 bytes.
Application consideration:
This option illustrates the ability of the application. The other party does not require the maximum ability to use. For example, when the MRU is
2048 bytes, and the other party is not required to send a 2048-byte size packet. At this point the other party does not need to use
Configuring a negative package indicates that it only sends a data packet smaller than 2048 bytes, because the application always requires at least
1500 bytes of packets.
The maximum receiving unit configuration option format is summarized. The sequence from left to right is transmitted.
0 1 2 3
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
- - - - - - - - - - - - - - - -
| Type | Length | Maximum Receiving Unit |
- - - - - - - - - - - - - - - -
Types of
1
length
4
Maximum receiving unit
There are two eight bytes in the maximum receiving unit domain, which specifies the maximum byte that the information field and the filling area can accept.
number. It does not include frame protocols, cyclic check code, and any bit or bytes required for transparent transmission. 6.2 Certification Agreement
description
You may wish to authenticate yourself before the switching network layer packet is switched when performing some connections.
This configuration option provides a method for certifying with the specified authentication protocol. By default, certification
It is not necessary.
When applied, multiple authentication protocol configuration options cannot be included in the Configuration Request Pack. On the contrary, it should be first configured.
The most expected authentication agreement. If the negative packet is configured, you should configure the second most in the next configuration request.
Expect the use of the authentication protocol.
Application Send Configuration Request Package indicates that it wants the other party to conduct certificates yourself. If the other party is sent to confirm confirmation
Package, indicating that it agrees to use the specified protocol for Erkins, D., "Requirements for an Internet
Standard Point-To-Point Protocol, RFC 1547, Carnegie Mellon University,
DECEMBER 1993.
[2] Reynolds, J., And Postel, J., "Assigned Numbers", STD 2, RFC
1340, USC / INFORMATION sciences institute, July 1992.