Enterprise and home network dial-up Internet technology-PPPoE principle and configuration

  • Digital Subscriber Line DSL (Digital Subscriber Line) is a transmission technology that uses telephone lines as the transmission medium. People usually refer to all DSL technologies collectively as xDSL , where x represents different types of digital subscriber line technologies. Currently, the more popular broadband access method is ADSL . ADSL is an asymmetric DSL technology and uses the PPPoE ( PP over Ethernet ) protocol.
  • The PPPoE protocol provides point-to-point connections on the Ethernet and establishes PPP sessions, allowing hosts in the Ethernet to connect to remote broadband access servers. PPPoE has the characteristics of wide application range, high security, and convenient billing.

 DSL application scenarios

  • Digital subscriber line DSL is a transmission technology that uses telephone lines as the transmission medium. 
  • DSL is a broadband technology that utilizes existing telephone networks for data communications. When using DSL to access the network, a modem is installed on the user side and then connected to a Digital Subscriber Line Access Multiplexer ( DSLAM ) through the existing telephone line . DSLAM is the central office equipment of various DSL systems and belongs to the last mile access equipment.
  • The DSLAM then forwards the user's data traffic to the Broadband Remote Access Server ( BRAS ) through the high-speed ATM network or Ethernet . BRAS is an access gateway for broadband network applications and is located at the edge layer of the backbone network.

Application of PPPoE in DSL

  •  Operators hope to connect multiple remote hosts through the same access device, and the access device can provide access control and billing functions. Among the many access technologies, the most economical way to connect multiple hosts to access equipment is Ethernet, and the PPP protocol can provide good access control and accounting functions, so the transmission of PPP messages on Ethernet was born. technology, namely PPPoE .
  • PPPoE uses Ethernet to form a large number of hosts into a network, connects to the Internet through a remote access device, and uses the PPP protocol to control each connected host. It has the characteristics of wide application range, high security, and convenient billing.
  • PPPoE technology solves practical application problems such as user charges for Internet access, and has been recognized by broadband access operators and widely used.

PPPoE message 

 

  • PPPoE messages are encapsulated using Ethernet format.
  • PPPoE messages are encapsulated using Ethernet format. Each field in Ethernet is explained as follows:
1. DMAC : Indicates the MAC address of the destination device, usually an Ethernet unicast destination address or an Ethernet broadcast address ( 0xFFFFFFFF ).
2. SMAC : Indicates the Ethernet MAC address of the source device.
3. Type : Indicates the protocol type field. When the value is 0x8863, it means that the packets are carried in the PPPoE discovery phase. When the value is 0x8864, it indicates that the packets carried are PPPoE session phase packets.
l Each field in the PPPoE field is explained as follows:
1. VER : Indicates the PPPoE version number, the value is 0x01 .
2. Type : Indicates the type, the value is 0x01 .
3. Code : Indicates the PPPoE packet type. Different values ​​identify different PPPoE packet types.
4. PPPoE session ID , which together with Ethernet SMAC and DMAC defines a PPPoE session.
5. Length : Indicates the payload length of the PPPoE message , excluding the length of the Ethernet header and PPPoE header.

PPPoE session establishment process 

  • PPPoE can be divided into three phases, namely discovery phase, session phase and session termination phase.

PPPoE protocol message 

 

  •  PPPoE uses these five types of messages to establish and terminate PPPoE sessions.
1. PADI ( PPPoE Active Discovery Initiation ) message : PPPoE server detection message initiated by the user host , the destination MAC address is the broadcast address.
2. PADO ( PPPoE Active Discovery Offer ) message : The PPPoE server responds after receiving the PADI message. The destination MAC address is the MAC address of the client host .
3. PADR ( PPPoE Active Discovery Request ) message : After the user host receives the PADO message responded by the PPPoE server , it unicasts the request message. The destination address is the MAC address of the PPPoE server selected by the user .
4. PADS ( PPPoE Active Discovery Session Configuration ) message : The PPPoE server assigns a unique session process ID and sends it to the host through the PADS message.
5. PADT ( PPPoE Active Discovery Terminate ) message : When the user or server needs to terminate the session, this PADT message can be sent .

PPPoE discovery phase 

 

  •  The client sends PADI messages through broadcast to discover the access server.
  • In the discovery phase, the PPPoE client broadcasts a PADI message on the local Ethernet. This PADI message contains the service information required by the client. In the PADI message, the destination MAC address is a broadcast address, the Code field is 0x09 , and the Session ID field is 0x0000 . After receiving the PADI message, all PPPoE servers will compare the services requested in the message with the services they can provide.

 

  • After receiving the PADI message, all PPPoE servers compare the services requested by the client with the services they can provide. If they can provide them, they unicast a PADO message. 
  • If the server can provide the service requested by the client, it will reply with a PADO message. The client ( RTA ) may receive PADO messages sent by multiple PPPoE servers. In the PADO message, the destination address is the MAC address of the client sending the PADI message , the Code field is 0x07 , and the Session ID field is 0x0000 .

 

  • The PPPoE client selects the PPPoE server corresponding to the first received PADO message and unicasts a PADR message. 
  • Because the PPPoE client sends PADI messages in the form of broadcast , the client may receive multiple PADO messages. Among all received PADO messages, the PPPoE client selects the PPPoE server corresponding to the first received PADO message and sends a PADR message to this server. In the PADR message, the destination address is the MAC address of the selected server, the Code field is 0x19 , and the Session ID field is 0x0000 . 

 

  • The PPPoE server generates a unique PPPoE Session ID and sends a PADS message to the client. The session is successfully established. 
  • After receiving the PADR message, the PPPoE server generates a unique Session ID to identify the session with the PPPoE client, and sends the Session ID to the PPPoE client through a PADS message . In the PADS message, the destination address is the MAC address of the PPPoE client , the Code field is 0x65 , and the Session ID field is the Session ID generated by the PPPoE server for this PPPoE session . After the session is successfully established, the PPPoE client and server enter the PPPoE session stage.

PPPoE session phase

 

  • The PPP negotiation on the PPPoE session is the same as the ordinary PPP negotiation, and is divided into three stages: LCP , authentication, and NCP .
  • After the PPP negotiation of the PPPoE session is successful, PPP data can be transmitted .
  • The PPPoE session phase can be divided into two parts: PPP negotiation phase and PPP message transmission phase.
1. PPP negotiation on PPPoE Session is the same as ordinary PPP negotiation, and is divided into three stages: LCP , authentication, and NCP . The LCP phase mainly completes the establishment, configuration and detection of data link connections. After the LCP negotiation is successful, authentication begins. The authentication protocol type is determined by the LCP negotiation result. After successful authentication, PPP enters the NCP stage. NCP is a protocol suite used to configure different network layer protocols. The most commonly used one is IP Control Protocol ( IPCP ), which is responsible for configuring the user's IP address and DNS server address.
2. After the PPP negotiation of the PPPoE Session is successful, PPP data packets can be carried . The data packets transmitted during this phase must contain the Session ID determined during the discovery phase and remain unchanged.

 

PPPoE session termination 

  • PADT messages are used to notify the peer end of the PPPoE session. 
  • When the PPPOE client wants to close the connection, it can send a PADT message to the PPPOE server . Similarly, if the PPPOE server wants to close the connection, it can also send a PADT message to the PPPOE client . This message is used to close the connection.
  • In the PADT message, the destination MAC address is the unicast address, and the Session ID is the Session ID of the connection you want to close . Once a PADT message is received, the connection is closed.

PPPoE session establishment process

 

 

  • The user client sends a PADI message to the server to start PPPOE access.
  • The server sends a PADO message to the client .
  • Based on the response, the client initiates a PADR request to the server .
  • The server generates a Session ID and sends it to the client through PADS .
  • PPP LCP negotiation is conducted between the client and the server to establish link layer communication. At the same time, negotiate the use of CHAP authentication.
  • The server sends it to the authentication client through a Challenge message , providing a 128- bit Challenge .
  • After receiving the Challenge message, the client performs the MD5 algorithm calculation on the password and Challenge , and sends the result to the server in the Response message .
  • The server determines whether the user is legitimate based on the information sent by the user , then responds with an authentication success / failure message and returns the authentication result to the client.
  • Carry out NCP (such as IPCP ) negotiation and obtain the planned IP address and other parameters through the server .

PPPoE configuration

 

 

[RTA]dialer-rule

[RTA-dialer-rule]dialer-rule 1 ip permit

[RTA-dialer-rule]quit

[RTA]interface dialer 1

[RTA-Dialer1]dialer user enterprise

[RTA-Dialer1]dialer-group 1

[RTA-Dialer1]dialer bundle 1

[RTA-Dialer1]ppp chap user enterprise@huawei

[RTA-Dialer1]ppp chap password cipher huawei123

[RTA-Dialer1]ip address ppp-negotiate

  • PPPoE client configuration consists of three steps
  • First you need to configure a dial-up interface
  • The dialer-rule command is used to enter Dialer-rule view. In this view, you can configure the conditions for initiating PPPoE sessions through dialing rules.
  • The interface dialer number command is used to create and enter the Dialer interface .
  • The dialer user user-name command is used to configure the peer user name. This user name must be the same as the PPP user name on the peer server.
  • The dialer-group group-number command is used to place the interface into a dial-up access group.
  • The dialer bundle  number command is used to specify the Dialer bundle used by the Dialer interface . The device associates the physical interface with the dial-up interface through the Dialer bundle .
  • The second step is to bind the Dialer Bundle to the interface on the interface :
  • The pppoe -client dial-bundle-number number command is used to bind the Dialer Bundle to the physical interface and to specify the Dialer Bundle corresponding to the PPPoE session , where number is the Dialer Bundle number corresponding to the PPPoE session . on-demand means that the PPPoE session works in dial-on-demand mode. The AR2200 supports on-demand dialing in packet-triggered mode. Currently, the on-demand dialing method supported by the ARG3 series routers is the message triggering method. That is, when the physical line is Up , the device will not initiate a PPPoE call immediately . Only when there is data to be transmitted, the device will initiate a PPPoE call and establish a PPPoE session.
  • The third step is to configure a default static route, which allows traffic without corresponding matching entries in the routing table to initiate PPPoE sessions through the dial-up interface.

 Configuration verification

<RTA>display interface Dialer 1

Dialer1 current state: UP

Line protocol current state: UP (spoofing)

Description: HUAWEI, AR Series, Dialer1 Interface

Route Port, The Maximum Transmit Unit is 1500, Hold timer is 10(sec)

Internet Address is negotiated, 192.168.10.254/32

Link layer protocol is PPP

LCP initial

Physical is Dialer

Bound to Dialer1:0:

Dialer1:0 current state : UP

Line protocol current state : UP

Link layer protocol is PPP

LCP opened, IPCP opened

  • The display interface dialernumber  ] command is used to view the configuration of the dial-up interface to facilitate locating faults on the dial-up interface.
  • LCP opened and IPCP opened indicate that the link status is completely normal.

 

  • The display pppoe -client session summary command is used to view the PPPoE session status and statistics of the PPPoE client .
  • This section gives two examples to illustrate different PPPoE session states.
  • ID represents the PPPoE session ID . The values ​​of Bundle ID and Dialer ID are related to the dialing parameter configuration.
  • Intf represents the physical interface during client-side negotiation .
  • State indicates the status of the PPPoE session, including the following four types:
1.   IDLE indicates that the current session status is idle .
2.   PADI indicates that the PPPoE session is in the discovery phase and PADI messages have been sent.
3.   PADR indicates that the PPPoE session is in the discovery phase and a PADR message has been sent.
4.   UP indicates that the PPPoE session is successfully established.

Chapter summary

Q: Why does the PPPoE frame need to reduce the MTU size?

Answer: Ethernet supports a maximum payload of 1500 bytes by default . The PPPoE header length is 6 bytes, and the PPP protocol ID length is 2 bytes, so the MTU in the PPPoE frame cannot exceed 1492 bytes.

Q: What is the role of the dialer bundle command when configuring PPPoE?

Answer: The dialer bundle command is used to specify the Dialer bundle used by the Dialer interface . The device associates the physical interface with the dial-up interface through the Dialer bundle .

 

Guess you like

Origin blog.csdn.net/yy123cisco/article/details/135133566