brief introduction ：
PPP It is a link layer protocol that carries network layer data packets on point-to-point links , As in the router Serial The default protocol of the interface link is PPP, Of course you can PPP More than that Serial This is a port , Other examples Dialer, Virtual template interface can run （ Mainly in PPPOE Application in ）.
In general, user authentication can be provided , Easy to expand , And support the same / asynchronous communication , Therefore, activities are widely used . Can achieve PPPOE,PPPOA And other businesses , And it can also be used with special line network , Realize the communication between enterprise headquarters and branches DDN Network docking . Now let's explain it in small points PPP What are the advantages over other link layer protocols ：
PPP It supports both synchronous and asynchronous links , and X.25,FR And other data link layer protocols only support synchronous links ,SLIP Only asynchronous links are supported . But now PPP Basically, they operate on the synchronous link , Clock synchronization is enabled by default .
* PPP Good expansibility , for example , When it needs to be carried on the Ethernet link PPP Time ,PPP Can be extended to PPPOE.
* provide LCP, Used to build , Demolition and monitoring PPP data link .
* Provide various NCP（IPCP,IPXCP etc. ） It is mainly used to negotiate the format and type of data packets transmitted on the data link , Better support for network layer protocols .
* Provide authentication protocol CHAP（ Challenge Handshake Authentication ）,PAP（ Password authentication protocol ）, It is mainly used for network security authentication , Better ensure the security of the network .
* No retransmission mechanism , Low network overhead , Fast speed .
<>PPP Three protocol families included ：
Link control protocol family （Link Control
Protocol）, Supervisor level 2 , Mainly used to establish , Demolition and monitoring PPP data link .LCP The link environment can be detected automatically , If there is a loop （ Ethernet needs STP）; Negotiate link parameters , Such as maximum packet length , What authentication protocol is used （ Ethernet needs 802.1x） wait . Compared with other data link layer protocols ,PPP An important feature of the protocol is that it can provide authentication function , Both ends of the link can negotiate which authentication protocol to use and implement the authentication process , The connection will not be established until the authentication is successful . This feature makes PPP The protocol is very suitable for operators to access decentralized users .
Network layer control protocol family （Network Control
Protocol）, Supervisor level 3 , It is mainly used to negotiate the format and type of data packets transmitted on the data link . for example IPCP For negotiation control IP,IPXCP For negotiation control IPX Agreement, etc .
PPP The extended protocol family is mainly used to provide PPP Further support for functions . for example ：PPP Provides a family of authentication protocols for network security （PAP and CHAP）.
<>PPP Message format ：
with LCP Message as an example ：
• Flag Domain identifies the beginning and end of a physical frame , This byte is 0x7E.
Address The domain can uniquely identify the opposite end .PPP The protocol is used on point-to-point links , therefore , use PPP Two communication devices interconnected by the protocol do not need to know each other's data link layer address . Fill the byte as full as specified in the protocol 1 Broadcast address of , about PPP In terms of the agreement , This field has no practical significance .
• The default value of this field is 0x03, The sequence number indicates no frame ,PPP By default, serial number and confirmation are not used to realize reliable transmission .
• Address and Control Domain together to identify this message as PPP message , Namely PPP The message header is FF03.
Protocol domains can be used to distinguish PPP Datagram type carried by information field in data frame . as 0x0021 Time , express PPP The information field of the frame is IP Data message . different Protocol identification Data Different meanings of fields .
• ISO Protocol domain type under standard ：
Several commonly used Protocol Value ：
information field ：LCP,NCP,IP Such agreement
FCS Check bit field ： The first character in each frame @ To the last text in the frame ASCII Character as “ XOR ” operation , And convert the result of XOR into two ASCII code , I got it FCS ,
It is sent to the receiver as part of the frame . The receiving end calculates the of the received frame FCS , If it is transmitted from the sender FCS Different , It can be determined that the communication is wrong .
<>PPP Link establishment process ：
Dead Status indicates that the physical layer is not connected , It is also the initial stage of the link . After establishing physical layer connection , And entered Establish stage , Interact with each other through both devices LCP The link configuration package completes the negotiation of the link layer , If the negotiation is successful , Then enter LCP of Open state , Enter the next negotiation , Otherwise, return to Dead state . Link entry Open After status , If authentication is configured （ Non default ）, Then enter Authenticate Link authentication in phase , Otherwise, enter directly Network stage . stay Authenticate If the status can be authenticated successfully , Then enter Network stage , If authentication fails , Will migrate to Terminate state .Network It is the network layer parameter negotiation stage , The corresponding protocol will be selected for each network layer protocol NCP The parameters of the agreement shall be agreed , Only if negotiation is successful , get into NCP arrive Open After status , Network layer traffic can be PPP Link bearer .Terminate Phase is the termination phase of the link ,PPP The link can be terminated at any time , Except for the failure of authentication just now ,LCP End of link packet , The network administrator will shut down the link manually PPP Enter this stage . For example, in LCP After interacting with the end of link packet , The physical layer is then notified to disconnect , Return to the original Dead state .
be careful ： Listed here are PPP Work phase of , be not PPP Agreement status of .
reference material ： Huawei data communication training materials