PPPoE principle of Huawei's routing and switching

The PPPoE , (Point-to-Point Protocol over Ethernet) carried Point to Point Protocol over Ethernet, in other words, the PPP frame is to be transmitted by way of the Ethernet. PPP protocol frame is transmitted in the WAN, now through PPPoE protocol, but also allows PPP frames for transmission in Ethernet.
Ethernet protocol is relative, PPPoE with a wide range of applications, high security, billing and convenient, can perform authentication and accounting, the majority of operators like.

More popular in the early telephone when the telephone line operators will use the network to transmit the signal, in fact, the telephone line can not be directly transmitted digital signal, as it is an analog signal transmitted speech), if when using the telephone lines to transmit digital signals, will use a modem (commonly referred to as a cat), then more widely before the telephone landline time, is using the telephone line to achieve the purpose of the Internet, the Internet is shown below by way of telephone lines.
Here Insert Picture Description
Since the transmission distance of the telephone line is not particularly far, for the non-operator SO last kilometer user uses the telephone line, one end of the telephone line will be connected to the operator's DSLAM equipment, and the other end will be connected to the sub-user side line apparatus, the splitters and two lines branched off, is used as a telephone set, a further branched off as a modem (cat), it is connected with the network cable from pc modem, (in the PC to set PPPoE ) from the pc signals are sent to a digital signal, through the modem (cat), the modem functions via a cable converter, converting the digital signal into an analog signal, and then transmitted to the DSLAM by way of a telephone line, the DSLAM this device can distinguish traffic is voice traffic or an internet traffic, if it is Internet traffic, and then spread to the BRAS through Ethernet, do some authentication on the BRAS equipment (BRAS match the user name from the database, passwords and other information ), after authentication, the user can access the carrier's Internet.
Digital subscriber line DSL (Digital Subscriber Line) transmission technique is a telephone line as the transmission medium, the more popular broadband access as ADSL, ADSL asymmetric DSL technology, is using the PPPoE protocol. DSL is a conventional telephone network using broadband data communications technology. In the case of a DSL access network, the user will install the modem side, connected by a conventional telephone line, a digital subscriber line access multiplexer (DSLAM). Central office equipment is a DSLAM various DSL systems, access device belonging to the last one kilometer.
Then, DSLAM via a high-speed Ethernet or ATM network to forward the user data traffic to a broadband remote access server (BRAS). BRAS is an access gateway for broadband networks, the backbone network layer at the edge.

Application of the DSL PPPoE

After as shown, arranged on the operator side of the PPPoE server, the client-side arranged PPPoE client, host A Ethernet data is sent out to reach the PPPoE client is sent a PPPoE frames, from Modem after (modem) out of the transmission medium is the telephone line, the transmission signal is an analog signal, the DSLAM after arrival, the frame will be transmitted through the network cable to the PPPoE PPPoE server.

PPPoE packet format

Ethernet PPPoE packet format is used to encapsulate. As shown below, PPPoE is encapsulated in DMAC, SMAC, Type later,
Here Insert Picture Description
Ethernet in each field is shown in the following table:

name Action / meaning
DMAC MAC address of the destination device
SMAC Ethernet MAC address of the source device
Type Protocol Type field, a value of 0x8863 indicates when the packet is carried in the PPPoE discovery phase. When the value of 0x8864 indicates when the packet bearer PPPoE session stage

PPPoE field of each field explained in the following table:

name Action / meaning
WATCH PPPoE version number, the value 0x01
Type It represents a type value of 0x01
Code Represents PPPoE packet type, different values ​​to identify the type of PPPoE packets
Session ID (PPPoE Session ID) SMAC and DMAC with Ethernet defines a PPPoE session
Length Payload represents PPPoE packet length, excluding the length of the Ethernet PPPoE headers

PPPoE session establishment

PPPoE can be divided into three stages, i.e. the discovery phase, session termination, and session stage phases, as follows:

stage description
Discovery phase Get the other Ethernet address, and determine a unique PPPoE session
Session Stage Consists of two parts: PPP PPP negotiation phase and message transmission stage
Session termination stage Any time after the session is established, send messages PPPoE session ends

In the discovery phase , you will get the Ethernet address, following a PPPoE server may be a lot PPPoe client, then the server needs to distinguish each client corresponding PPPoE session by pppoe mac address and the message inside the session id.
Session stage is before the PPP negotiation phase (LCP parameter negotiation, the authentication phase, NCP network protocol negotiation) mentioned in the blog and PPPoE packet transmission stage,
if we want to disconnect the PPPoE dial-up, will enter the session termination stage, breaking open PPPoE session. In the process of establishing PPPoE session involves a lot of messages that will be carried in the packet PPPoE protocol.

PPPoE packets.

PPPoE is established by five types of packets and PPPoE session termination, as shown below

Types of description effect
PADI(PPPoE Active Discovery Initiation) Initial PPPoE discovery packet PPPoE server host user-initiated probe packets, the destination MAC address is a broadcast address.
PADO(PPPoE Active Discovery Offer) PPPoE discovery packet provided Response packets after PPPoE server receives the PADI packet, the destination MAC address of the client host's MAC address.
PADR(PPPoE Active Discovery Request) PPPoE discovery request packet After the user host receives PPPoE server response PADO packets, unicast initiated request packet destination address MAC address for that user selected the PPPoE server.
PADS(PPPoE Active Discovery Session Configuration) PPPoE discovery session acknowledgment message PPPoE server process to assign a unique session ID, and by PADS packet to the host.
PADT(PPPoE Active Discovery Terminate) PPPoE discovery packet termination When the server needs to terminate the session, or the user may send such a PADT packets.

PPPoE discovery phase

As shown below, there are three PPPoE server (one operator may deploy multiple PPPoE servers on the network for redundancy) in which a network, first PPPoE client (RTA) does not understand where the network there PPPoE server, it will send a PADI message through radio, used to discover network PPPoE server, this packet contains information about the client service needs.
Here Insert Picture Description
After the server receives the PADI packet, the comparison can provide its own service, if the service can be provided, it will respond by a unicast PADO packet, as shown below, PPPoE Server A and Server B can provide the client (RTA ) needed services, and the server can not provide C, will remain silent, do not reply to messages.
Here Insert Picture Description
When PPPoE client receive multiple PADO packets, packets will use the first received PADO, PADR packet and reply to the corresponding PPPoE server via unicast way, tell each other, I choose you, the following figure shown, PPPoE client server selection among the three server a, the server a sends give PPPoE PADR packet.

Here Insert Picture Description
When the server receives a PPPoE PADR sent by the client, generates unique PPPoE Session ID, and transmits the PADS packet to the client, the session is successfully established as shown below.
Here Insert Picture Description
After the session is established successfully, PPPoE server and client will enter PPPOE session stage.

PPPoE session stage

PPP negotiation on the PPPoE session and ordinary PPP negotiation agreement, divided LCP, authentication, NCP three stages. The main LCP phase is completed to establish, configure and test the data link connection. After the LCP negotiation succeeds, start authentication, authentication protocol type is determined by the LCP negotiation results. After successful authentication, PPP enters the NCP phase, NCP protocol is a family, a different configuration for the network layer protocol, IP Control Protocol is used (the IPCP), which is responsible for configuring the user's IP address and DNS server address. After the PPP PPPoE session negotiation succeeds, PPP can transmit data.
Note: PPPoE Session of the PPP negotiation is successful, it can carry PPP data packets. It must be included in determining the Session ID in the discovery phase of the packet transfer phase and kept constant.

PPPOE session termination

When the PPPoE client wishes to close, it transmits a PADT packet to the PPPoE server. Similarly, if the PPPoE server wants to close the connection, may send a packet to the PPPoE PADT client, the packet is used to close the connection.
In PADT packets, the destination MAC address is a unicast address, Session ID Session ID is to close the connection. Once you receive a PADT packet, the connection closes.
In general, PPPoE session establishment procedure, as shown, the user client sends a PPPoE PADI packet, PPPoE access starts, the server sends PADO packet to the client, according to their client to the server to respond to a case below, PADR initiated the request to the server. It can provide the required server generates a Session ID, to the client by PADS. PPP LCP negotiation between the client and server to establish a communication link layer. At the same time, negotiate the use of authentication, the following figure using CHAP authentication server through the Challenge message to the authentication client, the client receives Challenge packet, and password and Challenge After doing operations, in response message Response the results are sent to the server. Server based on the information sent by the user determines that the user is legitimate, then respond to the authentication success / failure message, the authentication result is returned to the client. After successful authentication, a NCP (such as IPCP) negotiation, to obtain parameters such as IP address planning through the server.
Here Insert Picture Description
OVER!

Released nine original articles · won praise 0 · Views 106

Guess you like

Origin blog.csdn.net/weixin_42463871/article/details/105275573