PPPOE Discovery protocol detailed

 
 

PPPOE protocol introduced

PPPOE, stands for Point-to-Point Protocol Over Ethernet , it works in the OSI data link layer, PPPOE protocol provides a broadcast network (such as Ethernet) to connect to multiple hosts in remote access concentrator (We current to complete the above-described apparatus functions as the broadband access server on a standard).

1.  Works of PPPOE

PPPOE protocol includes a total of two stages, i.e. PPPOE discovery phase ( PPPOE the Discovery the Stage) and the session phase of PPPOE ( PPPOE the Session the Stage). The main difference is that the only encapsulated PPP packets before the PPPOE packet header.

When a host wants to begin a time PPPOE session, it first looks for an access concentrator on the broadcast network, of course, there may be multiple access concentrator, for each host will be based on the network access concentrator ( the AC, Access Concentration) service, or some pre-arranged to offer a user to be selected accordingly. When finished selecting the desired host access concentrators, and access concentrator began to establish a PPPOE session process. In the course of this visit will focus for each is assigned a unique process PPPOE session ID, set up after the session begins structure (this point both of PPPOE session stage, has been established at this stage in connection with the good point PPP is not the same, it is a point on a logical relationship) on the use of PPP protocol to exchange data packets, thus completing a series of processes PPP will ultimately be transmitting a network layer datagrams over point of this logical channel.

2.  PPPOE data packet format

We briefly describe PPPOE data packet format. PPPOE data packet is encapsulated in the data field of the Ethernet frame. We may simply PPPOE packet is divided into two blocks ,, is a large PPPOE data packet header, the other one is the payload PPPOE (data fields), for PPPOE packet data session with the contents of the field and the process of changing. The following figure 1 is a packet format of PPPOE:

version

Types of

Code

Session ID

The length of the field

Payload (or data field)

(FIG. 1 PPPOE data packet format)

L  PPPOE packets beginning of the 4 -bit version field, the agreement gives clear rules, the content of this field is filled 0x1 .

l  Immediately after the version of the domain . 4 bits are type field, the same provisions protocol, this field is filled with 0x1 .

l  Code field occupies . 1 byte, for PPPOE  different stages of the contents of this domain is not the same.

l  session ID point by 2 bytes, when the Access Concentrator yet assigned a unique session ID to the user host, the contents of which must be filled within 0x0000 , once the host acquires the session ID after, then all subsequent packets this field must be filled paper that unique session ID value.

l  the length field is 2 bytes, for indicating PPPOE length of the data packet payloads.

l  data field, sometimes referred to as the payload field, the PPPOE data content in the domain will be very different at different stages. In PPPOE during the discovery phase, which will fill in some domain Tag (tag); and in the PPPOE session stage, which carries the domain it is PPP packets.

Here we introduce PPPOE discovery phase of the packet format and its message:

. 1)  PPPOE data packets Tag (label) format

For the discovery phase of PPPOE data packets, for its payload may contain zero or more Tag (tag), in fact, the significance of these markers are very similar to PPP configuration parameter options, it is also to be negotiated. For the purposes of PPPOE agreement, it did not like the configuration options PPP parameters as defined many of the details, but just a little early definition, and therefore implement in practice this process will be different according to different vendors' equipment. First, let us look at the bearer mark PPPOE encapsulation packet data field, as 2,

Types of

length

data

(FIG. 2 labeled encapsulation format)

From FIG. As can be seen in the 2, labeled encapsulation formats is well known in the TLV structure, that is, (Type + Length + Data). Mark type field is 2 bytes, the table lists the various types of markers meanings:

 

Tag Type

SIGNS

0x0000

It represents the end of a string tag data field PPPOE packets, in order to ensure version compatibility and retention, there are some applications in the message.

0x0101

Service name, is mainly used to indicate the network side to offer some services to users.

0x0102

Access Concentrator name, when the user side receives the AC response of when the PADO packet, can know Hinako eligible access concentrator carried from the tag, but also from which to select the access concentrator.

0x0103

Host unique identifier, similar identification field PPP data packets, is mainly used to match the sending and receiving end, because there are many simultaneous broadcast to the network will PPPOE data packets.

0x0104

AC-Cookies, primarily used to prevent malicious nature DOS power attack.

0x0105

Vendor identifier.

0x0110

Relay session ID, for a data packet as PPPOE can likewise be interrupted as the DHCP packet to another end of the AC, this field is used to maintain another connected.

0x0201

Service name error when requesting service name not be accepted by the peer, will carry the flag in the message response.

0x0202

Access Concentrator name wrong.

0x0203

Generic error.

 

l  mark length field is 2 bytes, which is used to indicate the length of the data field marks.

l  tag data field used to place data corresponding to different types of labels.

2)  PPPOE discovery phase of data packets

PPPOE的发现阶段可分为四步,其实这个过程也是PPPOE四种数据报文的交换的一个过程。当完成这四步后,用户主机与访问集中器双方就能获知对方的MAC地址和唯一的会话ID号,从而进入到下一个阶段(PPPOE的会话阶段)。实际上双方在互相知道了对方的MAC地址后,就已经在广播式的网络上确定了一一的对应关系,为了保证这个连接的有效性,同时使PPPOE协议能更加灵活的运用,因此还加入了会话ID字段,通过这两个条件就可完成确定双方点对点的关系。

在这个阶段一开始,由于接入用户并不知道访问集中器的MAC地址,则使用类似于ARP解析的过程的机制来获取访问集中器的MAC地址。首先由接入用户侧发起一个初始化的广播报文,对于访问集中器如果配置了PPPOE的业务时,它会时实检测网络上的数据包,当发现以太网数据帧中所承载的是PPPOE报文时(通过协议域的内容来区分),就会将其交给相应的模块去处理。当收到初始化报文后,访问集中器会向该用户回应一个报文。如果网络上存在很多这样的访问集中器且都收到了用户侧发送的初始化报文时,它们也都会向用户侧会送一个确认报文,如果该用户收到这个报文后,则会依据报文中所携带的内容或本端的一些配置来选择一个唯一的访问集中器进行会话。到此时已完成了前两步了,那么剩下的两步则是协商一些所提供的服务选项和获取PPPOE会话阶段所必须的会话ID值。

说明:在这个阶段,所有数据报文是被承载在以太网的数据域中的,而且以太网数据帧的协议域始终为0x8863。

PPPOE发现阶段的四步的过程中,PPPOE会遇到PADI、PADO、PADR和PADS这四种报文。PPPOE中的PADT报文是用来终止一条会话的。

l PADIPPPOE Active Discovery Initiation)报文

PPPOE发现阶段的第一步,也即是由用户侧首先发送这样一个报文。用户主机是以广播的方式发送这个报文,所以该报文所对应的以太网帧的目的地址域应填充为全1,而源地址域填充用户主机的MAC地址。广播包可能会被多个访问集中器接收到。

l PADOPPPOE Active Discovery Offer)报文

PPPOE发现阶段的第二步,也即是由访问集中器回应各用户主机发送的PADI报文,此时该报文所对应的以太网帧的源地址填充访问集中器的MAC地址,而目的地址则填充从PADI中所获取的用户主机的MAC地址。

l PADRPPPOE Active Discovery Request)报文

PPPOE发现阶段的第三步,也即是由用户主机向访问服务器发送单播的请求报文。当用户主机收到PADO报文后,会从这些报文中挑选一个访问集中器作为后续会话的对象。由于用户主机在收到PADO报文后,就获知了访问集中器的MAC地址,因此PADR报文所以应的以太网帧的源地址填充用户主机的MAC地址,而以太网的目的地址填充为访问集中器的MAC地址。

l PADSPPPOE Active Discovery Session-confirmation)报文

PPPOE发现阶段的第四步,也即是最后一步,此时访问集中器当收到PADR报文时,就准备进入开始一个PPP的会话了,而此时访问集中器会为在这个会话分配一个唯一的会话进程ID,并在发送给主机的PADS报文中携带上这个会话ID。当然如果访问集中器不满足用户所申请的服务的话,则会向用户发送一个PADS报文,而其中携带一个服务名错误的标记,而且此时该PADS报文中的会话ID填充0x0000。

l PADTPPPOE Active Discovery Terminate)报文

PADT packets transmitted may be performed at any time after the beginning of a session, is mainly used to terminate a dead PPPOE session. It may be sent by the host or access concentrator, the destination address for the end of the filling of the Ethernet MAC address

Guess you like

Origin www.cnblogs.com/im17me/p/12543694.html