PPPoE & PPP

PPPoE

  • PPPoE:Point-to-Point Protocol over Ethernet,RFC 2516;
  • PPP:Point-to-Point Protocol,RFC 1661;
  • For encapsulating PPP frames inside Ethernet frames.
    PPPoE & PPP_第1张图片
    PPPoE and TCP/IP protocol stack
PPPoE & PPP_第2张图片
Typical PPP over Ethernet Topology
  • PPPoE 的两个阶段:PPPoE Discovery,PPP session

  • PPPoE Discovery
    Client to server: Initiation
    Server to client: Offer
    Client to server: request
    Server to client: session-confirmation

  • PPP session
    Either end to other end: termination.

  • EtherType;
    The ETHER_TYPE is set to either 0x8863 (Discovery Stage) or 0x8864 (PPP Session Stage).

    PPPoE & PPP_第3张图片
    Ethernet II

  • 1492?!
    The MRU (Maximum-Receive-Unit) option MUST NOT be negotiated to a larger size than 1492. Since Ethernet has a maximum payload size of 1500 octets, the PPPoE header is 6 octets and the PPP Protocol ID is 2 octets, the PPP MTU MUST NOT be greater than 1492.

  • Ethernet payload
    PPPoE Discovery phase and PPPoE PPP session phase packets travel as payload in an Ethernet frame. The Ethernet payload for PPPoE always start with a VERSION field, TYPE field, CODE field, SESSION ID and LENGTH as shown below.

    PPPoE & PPP_第4张图片
    Ethernet frame with payload

PPPoE & PPP_第5张图片
Ethernet payload for PPPoE
  • PPPoE Header


    PPPoE & PPP_第6张图片
    PPPoE header fields (6 bytes)
  • PPPoE Payload


    PPPoE & PPP_第7张图片
    PPPoE Payload
  • Treck wiki 上的 PPP over Ethernet (PPPoE) Interface 可以读一下。

DSL Internet access architecture

PPPoE & PPP_第8张图片
DSL Internet access architecture

PPP

  • PPP 是 data link layer (layer 2) 数据链路层协议。


    PPPoE & PPP_第9张图片
    PPP three main components: Encapsulation, LCP, NCP
  • How does PPP create a link and communicate between two machines?
    Communication is established in essentially three phases:
    1. Link Control Protocol (LCP)
    2. Authentication
    3. Network Control Protocol (NCP)
PPPoE & PPP_第10张图片
PPP architecture

PPPoE & PPP_第11张图片
Internet protocol suite
  • PPP Encapsulation

    PPPoE & PPP_第12张图片
    PPPoE Payload

  • RFC 1662 (PPP in HDLC-like Framing)

    PPPoE & PPP_第13张图片
    PPP General Frame Format(RFC 1662)

  • PPP General Frame Format (HDLC-like)

Linux 拨号

  • RP-PPPoE
    Roaring Penguin 公司提供的免费版 PPPoE client for Linux and Solaris systems to connect to PPPoE service providers.
    yum install rp-pppoe 可以安装。
  • 当前最新版 rp-pppoe-3.12.tar.gz;
    可以查看 doc 和 man 下文件了解。
  • -I option specifies the Ethernet interface to use.
    pppd 启动参数指定使用 eth0 (Ethernet card 以太网网卡名);
  • The role of pppd is managing PPP session establishment and session termination.
PPPoE & PPP_第14张图片
pppd & pppoe
PPPoE & PPP_第15张图片
ppp0 & eth0
  • 通过 ppp0 获得外网IP;
  • 通过 etho 获得 mac 地址;

Windows 拨号

PPPoE & PPP_第16张图片
宽带连接
PPPoE & PPP_第17张图片
接口适配器

你可能感兴趣的:(PPPoE & PPP)