PPPoE protocol of hcna Routing & Switching


Previously, we learned about the topics related to HDLC and PPP protocols in Wan. For review, please refer tohttps://www.cnblogs.com/qiuhom-1874/p/15174240.html; Today, let’s talk about PPPoE protocol related topics;

Digital subscriber line (DSL) is a transmission technology with telephone line as the transmission medium. We usually call all DSL technologies xDSL, and X represents different kinds of digital subscriber line technologies; At present, the popular broadband access mode is ADSL, which is asymmetric DSL technology and uses PPPoE (PPP over Ethernet) protocol; PPPoE protocol establishes PPP session by providing point-to-point connection on Ethernet, so that the host in Ethernet can connect to the remote broadband access server. PPPoE has the characteristics of wide application range, high security and convenient billing;

DSL technology application scenario

Tip: bras is the broadband access equipment of the operator; DSLAM is the abbreviation of digital subscriber line access multiplexer, which is called digital subscriber line access multiplexer in Chinese. DSLAM is the office end equipment of various DSL systems and belongs to the last mile. Its function is to accept all DSL lines and aggregate traffic, which is equivalent to a layer-2 switch.

Application of PPPoE in DSL

Tip: inside the enterprise, we connect with modem through PPPoE client through network cable; The function of modem is to convert digital signals into analog signals. It has two interfaces: one is the network port connecting PPPoE client and the other is the telephone port connecting DSLAM; Operators hope to connect multiple remote hosts through one access device, and the access device can provide access control and billing functions; Among many access technologies, the most economical way to connect multiple hosts to access equipment is Ethernet, and PPP protocol can provide good access control and billing functions. Therefore, PPP message technology transmitted on Ethernet, PPPoE, came into being; PPPoE uses Ethernet to form a network of a large number of hosts, connects to the Internet through a remote access device, and uses PPP protocol to control each host, which has the characteristics of wide application range, high security and billing; PPPoE solves the practical application problems such as users’ online charging, and has been recognized and widely used by broadband access operation stores;

PPPoE message format

Tip: PPPoE message is encapsulated in Ethernet format, so PPPoE is the upper layer protocol of Ethernet; In the packaging process, first package the Ethernet header, and then the PPPoE header; The type in the Ethernet header is used to represent the type of upper layer protocol; When the value of type is 0x8863, it means that it carries the message of PPPoE discovery stage; When the value of Poe of the session is 0x8864;

PPPoE session establishment process

Tip: the process of establishing a session in PPPoE mainly goes through the above two stages: discovery stage and session stage; The discovery phase is mainly to discover the PPPoE server and obtain the Ethernet address of the other party; The session stage is mainly the negotiation of PPP protocol; After the above two stages, a PPPoE session is established, and subsequent users can surf the Internet and transmit data through the PPPoE session; In the session termination phase, the user side sends a PPPoE termination message, and then the PPPoE session is terminated;

PPPoE packet type

Prompt: there are mainly five types of messages in the process of PPPoE session establishment and termination; PADI is the initial message of PPPoE discovery, and the main user is looking for PPPoE server; When the PPPoE server receives the PADI message sent by the PPPoE client, the corresponding server will send PADO to the client. This type of message mainly tells the PPPoE client that the corresponding server can meet the client’s request; When the client receives the PADO sent by the server (there may be multiple servers sending PADO), it will select the server corresponding to the earliest received PADO to send Padr; Padr means that the client requests the server to establish a session, and also rejects the PADO message sent by other servers; After receiving the Padr sent by the client, the server will reply to a pads message, which is mainly used to tell the client session ID and other information; When the client or server needs to disconnect, the client or server will send PAdT to the opposite end to terminate the connection. The main function of this type of message is to inform the opposite end of PPPoE session; When the opposite end receives this type of message, the session will be disconnected immediately;

PPPoE workflow

Prompt: the client sends PADI message through broadcast to the access server; Similar to DHCP discover package in DHCP;

Prompt: after receiving the PADI message sent by the client, the server compares the service requested by the client with the service it can provide. If it can provide, unicast restores the PADO message; Similar to DHCP offer package in DHCP;

Prompt: PPPoE client will select the server corresponding to the optimal PADO message according to the PADO received by itself, and unicast send a Padr message; Padr message has two functions: one is to request information such as establishing a session from the corresponding server, and the other is to reject PADO from other servers; Similar to DHCP request package in DHCP;

Prompt: after receiving the Padr message from the client, the PPPoE server will generate a unique PPPoE session ID and send the pads message to the client, indicating that the session is successfully established; Similar to DHCP ACK packet in DHCP;

Tip: after the PPPoE session is successfully established, PPP parameter negotiation will follow; PPP parameter negotiation is the same as PPP parameter negotiation on serial link; Mainly divided into LCP and NCP negotiation; If there is certification, certification is also required; After the PPP parameter negotiation is successful, the corresponding client will obtain a planned IP address and other parameters through the server, and subsequent clients can access the Internet and transmit data through this IP address;

The whole process of PPPoE session establishment

Prompt: only after the NCP negotiation in PPP is completed, the corresponding client will obtain the IP address, and subsequent communication clients will transmit data through this IP address;

PPPoE session termination process

Tip: when the PPPoE client or server needs to close the connection, it can send PAdT message to the server or customer service; Indicates that the connection is closed; In the PAdT message, the destination MAC address is the unicast address, and the session ID is the session ID that you want to close; Once a PAdT message is received, the corresponding session will be closed immediately;

PPPoE configuration

Experiment: configure PPPoE client and server according to the following topology

Server configuration

1. Establish a user name and password for authentication on the server

2. Create an address pool for allocating information such as IP addresses

Tip: gateway, DNS, exclusion address and other information can be added to the address pool;

3. Create virtual template interface

Tip: the virtual template interface is mainly configured with PPP authentication mode, associated address pool and local IP address;

4. Associate physical interface with virtual template interface

All server configurations

PPPoE protocol of hcna Routing & SwitchingPPPoE protocol of hcna Routing & Switching

sys server
local-user qiuhom password cipher admin123.com
local-user qiuhom server ppp
ip pool PPPoE
net mask
int virtual-template 1
ppp authentication-mode chap
remote address pool PPPoE
ip add 30
int g0/0/0
pppoe-server bind virtual-template 1

View Code

Client configuration

1. Create dialing rule

Prompt: the above command indicates that all IP protocol messages are allowed to dial;

2. Create a dialing interface, configure PPP authentication under the interface, and bind dialing rules

Tip: the user name in Dialer user XXX says that it is only used to identify and bind dialer, not for PPP authentication, so the user name here can be arbitrary;

3. Bind physical interface and dial-up interface

Verification: check whether the corresponding dialing interface obtains the IP address?

Prompt: you can see that the corresponding dial-up interface has normally obtained the IP address; Explain that there is no problem with our configuration;

4. Configure the default route and point the outgoing interface to the corresponding dial-up interface

Tip: after configuring the default route, the corresponding client can access the Internet through the session link of PPPoE;

All client configurations

PPPoE protocol of hcna Routing & SwitchingPPPoE protocol of hcna Routing & Switching

sys client
dialer-rule 1 ip permit
int dialer 1
dialer user xxx
dialer bundle 1
ppp chap user qiuhom
ppp chap password ci admin123.com
ip add ppp-negotiate
int g0/0/0
pppoe-client dial-bundle-number 1
ip route-s 0 dialer 1

View Code

Verify PPPoE session information on the client

Verify PPPoE session information on the server

Verify the corresponding dialing interface on the client

Tip: it can be seen that the corresponding dial-up interface uses PPP protocol, the corresponding LCP and IPCP are opened, and the corresponding interface also obtains the address through PPP negotiation;

Recommended Today

Tutorial on sending e-mail using net:: SMTP class in Ruby

Simple Mail Transfer Protocol(SMTP)SendE-mailAnd routing protocol processing between e-mail servers. RubyIt provides the connection of simple mail transfer protocol (SMTP) client of net:: SMTP class, and provides two new methods: new and start New takes two parameters: Server name defaults to localhost Port number defaults to 25 The start method takes these parameters: Server – […]