10 mars 2010

PPPoE Part 1/2 - Theory

PPPoE

- Header PPPoE Format:









- Discovery Stage:
Discovery Ethernet frames have the ETHER_TYPE field set to the value 0x8863

Step 1 - PPPoE Active Discovery Initiation (PADI):
- DESTINATION_ADDR set to the broadcast
- CODE field is set to 0x09
- SESSION_ID MUST be set to 0x0000

Step 2 - PPPoE Active Discovery Offer (PADO):
When the Access Concentrator receives a PADI that it can serve, it replies by sending a PADO packet.
- DESTINATION_ADDR is the unicast address of the Host that sent the PADI
- CODE field is 0x07
- SESSION_ID MUST be set to 0x0000

A PADO packet MUST contain:
One AC-Name TAG containing the Access Concentrator's name,
A Service-Name TAG identical to the one in the PADI,
Any number of other Service-Name TAGs indicating other services that the Access Concentrator offers.

Step 3 - PPPoE Active Discovery Request (PADR):
A host can receive more than one PADI (it uses the broadcast address).
So, the host looks through the PADO packet it receives and chooses one.
The Host then sends one PADR packet to the Access Concentrator that it has chosen.
DESTINATION_ADDR field is set to the unicast Ethernet address of the Access Concentrator that sent the PADO.

Step 4 - PPPoE Active Discovery Session-confirmation (PADS):
When the Access Concentrator receives a PADR packet, it prepares to begin a PPP session. It generates a unique SESSION_ID for the PPPoE session and replies to the Host with a PADS packet.
- DESTINATION_ADDR field is the unicast Ethernet address of the Host that sent the PADR.
- CODE field is set to 0x65
- SESSION_ID MUST be set to the unique value generated for this PPPoE session.

PPPoE Active Discovery Terminate (PADT) packet:
This packet may be sent anytime after a session is established to indicate that a PPPoE session has been terminated.
- DESTINATION_ADDR is a unicast Ethernet address, the CODE field is set to 0xa7 and the SESSION_ID MUST be set to indicate which session is to be terminated.


PPP Session Stage:
Once the PPPoE session begins, PPP data is sent as in any other PPP encapsulation.
All Ethernet packets are unicast.

- ETHER_TYPE is 0x8864.
- CODE MUST be set to 0x00.
- SESSION_ID MUST NOT change for that PPPoE session and MUST be the value assigned in the Discovery stage.

The PPPoE payload contains a PPP frame.


PPP 
The PPPoE frame begins with the PPP Protocol-ID.
http://tools.ietf.org/html/rfc1548
http://tools.ietf.org/html/rfc1332


- Header PPPoE Format:







Protocol Field:

c021 Link Control Protocol
0021 Internet Protocol

Establishment:
1 - Test the data-link: LCP
2 - Authenticate (optional)
3 - Choose Network Layer Protocol (NCP)


LCP:
Used to control PPP links:
 - Link Configuration
 - Link Maintenance
 - Link Termination


LCP Messages:
 - Configure-Request
 - Configure-Ack (all of the options have acceptable values)
 - Configure-Nack (one or more options have unacceptable values)
 - Configure-Reject (one or more of the options are unknown or not negotiable)
 - Echo-Request
 - Echo-Reply
 - Terminate-Request
 - Terminate-Ack

Link Configuration Stage:
Common options:
 - Maximum Receive Unit (MRU)
 - Authentication Protocol (EAP, MS-CHAP, PAP...)
 - Magic Number (used to distinguish a peer a detect loopback lines)
 - Protocol Compression
 - Address and Control Field Compression
 - Callback

Link Maintenance Stage:
Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply, and Discard-Request
Echo-Request and Echo-Reply message act as keepalive.
Link Termination Stage:
Terminate-Request and Terminate-Ack are a mechanism for closing a connection.


















http://blog.ine.com/2008/01/20/example-configurations-for-ppp-over-ethernet-pppoe/

NTP - ACL

NTP - Network Time Protocol Packet types: -  Control messages : don't bother with this. -  NTP request/update messages: used for time sy...