Ex4 Chapter 2 - PPP

One of the most common types of WAN connection is PPP (Point-to-point).
PPP provides a continuous connection between two remote sites.
PPP is :
 - multi-protocol allowing for TCP/IP, IPX, and AppleTalk simultaneously,
 - media independent being used over twisted pair, fiber, and satellite,
 - works over Layer 2 technologies such as ATM, Frame Relay, and ISDN,
 - for authentication purposes it uses either PAP or CHAP.  

PPP uses a serial connection.
Serial data transfer is when one bit is sent at a time compared to parallel transfer where 8 bits are sent at a time.
Serial communication is preferred over parallel because of:
 - clock skew and crosstalk interference that happens more often in parallel communication,
 - the cost of serial cables is also less expensive than parallel cables.

Common serial standards: RS-232, V.35, HSSI (High-speed serial interface, up to 52Mb/s)

Layer 1

PPP uses HDLC (High-level Data Link Control) framing format for sending its data.
HDLC is a set of protocols for transmitting data between two network nodes. According to these protocols, data is sent in units of frames with defined header bytes, escape sequences etc

Wide Area Networks (WANs) operate over serial links. 
A serial link is one that transmits and receives digitized signal one bit at a time.
An example of parallel link is printer connection over parallel cable. A printer receives several bits at a time and processes them all. A parallel line is typically used for connecting your monitor, printer, and CDROM drive. Parallel links run over over a very short distances.

At the physical layer, you can configure PPP on a range of interfaces, including:
 - Asynchronous serial,
 - Synchronous serial,
 - HSSI,
 - ISDN.

* Asynchronous means "not synchronous".
Async (short for Asynchronous) links require start and stop bits for effective communication. It can also have parity bits for error checking. When using Async communication link, both sender and receiver need to agree on fixed line speed (expressed in terms of bits per second), otherwise, the receiver may not be able to receive any data at all.
 ATM, RS-232, PC ports COM1, COM.
These are widely used for connecting to Internet using your dial-up modem.
Asynchronous link is normally used for low speed communications.

* Synchronous serial links
Synchronous links, as the name suggests use clocking to transmit or receive data.
A clock signal is required for transmitting or receiving synchronous data.
The clock signal may be transmitted separately, or could be derived from the received signal. In either case, the clock signals are used for receiving the data.
Synchronous links can operate at very high speeds. SDLC, and HDLC are examples of synchronous link protocols.

Time Division Multiplexing (TDM) is layer 1 protocol that helps increase the amount of bandwidth possible.  It divides single link into separate channels to allow for more than one device to communicate at a time.

Demarcation point is the physical place where the owner controls their equipment and the ISP controls there equipment.



The demarcation point in the US is at the CSU/DSU (channel service / data service).
Where as in Europe it is at the NTU (network terminating unit).

NTU


 Connection types between DTE and DCE


Layer 2 Encapsulation Protocols
•  HDLC – default standard for two Cisco routers connected together
•  PPP – provides router-to-router and host-to-network connections over synchronous and asynchronous circuits. PPP works with several Network layer protocols, such as IP and IPX. PPP also has built-in security mechanisms such as PAP and CHAP.
•  SLIP – uses on TCP/IP
•  X.25/LAPB
•  Frame Relay – industry standard, switched protocol
•  ATM – international standard for cell relay

HDLC
“HDLC uses synchronous serial transmission to provide error-free communication between two points. HDLC defines a Layer 2 framing structure that allows for flow control and error control through the use of acknowledgments. Each frame has the same format, whether it is a data frame or a control frame.”

HDLC Configuration
1.  Enter the serial interface for configuration
2.  Issue encapsulation hdlc

Router 1 = DCE with clock rate of 64000 on s0
Router 2 = DTE with no clock rate on s0


Serial Interface Status: show serial interface

Options. Detailed explain.
•  Serial x is down, line protocol is down 
•  Serial x is up, line protocol is down 
•  Serial x is up, line protocol is up (looped) 
•  Serial x is up, line protocol is down (disabled) 
•  Serial x is administratively down, line protocol is down 
You can also use show controllers to see which interfaces have a physical connection.

PPP
 PPP features not available in HDLC:
- The link quality management feature monitors the quality of the link. If too many errors are detected, PPP takes the link down.
- PPP supports PAP and CHAP authentication.

Three main components:
•  HDLC protocol for encapsulating datagrams over point-to-point links. 
•  LCP Extensible (Link Control Protocol)  to establish, configure, and test the data link connection. 
•  NCP Family of (Network Control Protocols) for establishing and configuring different Network layer protocols. PPP allows the simultaneous use of multiple Network layer protocols. Some of the more common NCPs are Internet Protocol Control Protocol, Appletalk Control Protocol, Novell IPX Control Protocol, Cisco Systems Control Protocol, SNA Control Protocol, and Compression Control Protocol.

“The LCP is the real working part of PPP.
The LCP sits on top of the Physical layer and has a role in establishing, configuring, and testing the data-link connection.
The LCP establishes the point-to-point link.
The LCP also negotiates and sets up control options on the WAN data link, which are handled by the NCPs.

PPP LCP Features

1) Looped link detection (feature - Magic number)
    Detects if the link is looped, and disable interface, allowing rerouting over a working route

2) Error detection (LQM - Link Quality Monitoring)
    Disable an interface that exceeds an error percentage threshold, allowing rerouting over better route.

3) Multilink support (Multilink PPP)
    Load-balance traffic over multiple parallel links.

4) Authentication (PAP and CHAP)
Exchanges names and password so that each device can verify the identity of the device on the other end of the link.


The LCP provides automatic configuration of the interfaces at each end, including:
•  Handling varying limits on packet size 
•  Detecting common misconfiguration errors 
•  Terminating the link 
•  Determining when a link is functioning properly or when it is failing”

“Point-to-point links tend to worsen many problems with the current family of network protocols. For instance, assignment and management of IP addresses, which is a problem even in LAN environments, is especially difficult over circuit-switched point-to-point links (such as dialup modem servers). PPP addresses these issues using NCPs. 
PPP permits multiple Network layer protocols to operate on the same communications link. For every Network layer protocol used, PPP uses a separate NCP. For example, IP uses the IP Control Protocol (IPCP), and IPX uses the Novell IPX Control Protocol (IPXCP). “

Configuring PPP
1.  Enter serial interface
2.  Issue encapsulation ppp
3.  compress [predictor | stac ] – use this option if you want to compress your data, do not use if the data is already compressed (.zip, .mpeg)
4.  ppp multilink – use this option if you want to use load balancing also known as (MP, MPPP, MLP)

LCP Configuration Options
Option           Function                                   Protocol      Command
Authentication   Requires a password >>                     PAP           ppp authentication pap
                 Performs a challenge handshake >>          CHAP          ppp authentication chap
Compression      Compresses data at the source>>            Stacker       ppp compress stacker
                 Reproduces data at the destination >>      Predictor     ppp compress predictor
Error Detection  Monitors the data dropped on the link,     Quality,      ppp quality <number 1-100>
                 avoids frame looping                       Magic Number
Multilink        Performs load balancing across multiple links    MP      ppp multilink

 PPP may include the following LCP options:
- Authentication - Peer routers exchange authentication messages (PAP/CHAP)
- Compression -
Increases the effective throughput on PPP connections by reducing the amount of data in the frame that must travel across the link. (Stacker/Predictor),
- Error detection - Identifies fault conditions. The Quality and Magic Number options help ensure a reliable, loop-free data link,
- Multilink - provides a method for spreading traffic across multiple physical WAN links while providing packet fragmentation and reassembly, proper sequencing, multivendor interoperability, and load balancing on inbound and outbound traffic,
- PPP callback
- a Cisco router can act as a callback client or a callback server.

Debug PPP 

debug ppp {packet | negotiation | error | chap}
no debug ppp {packet | negotiation | error | chap}

Issue:
•  debug ppp packet - Causes the debug ppp command to display PPP packets being sent and received. (This command displays low-level packet dumps.)
•  debug ppp negotiatio - Causes the debug ppp command to display PPP packets transmitted during PPP startup, where PPP options are negotiated.
•  debug ppp error - Causes the debug ppp command to display protocol errors and error statistics associated with PPP connection negotiation and operation.
•  debug ppp chap - Causes the debug ppp command to display Challenge Authentication Protocol (CHAP) packet exchanges.


PPP Authentication
PAP or CHAP is available for use.  PPP authentication is an extensible LCP that requires a check before allowing network layer protocols to transmit over the link.
PAP
•  Basic two-way process
•  No encryption, username and password sent plain text
•  Username is name of router
•  Issue: username R1 password cisco – this is the remote router username/pass
•  Issue: ppp authentication pap
•  Issue: ppp pap sent-username R2 password cisco – this is local router username/pass

CHAP
•  Periodic challenges unlike PAP
•  MD5 encryption
•  Challenges unique and random
•  debug ppp authentication
•  Issue: username R2 password cisco
•  Issue: ppp authentication chap

PPP Link Operation
In order to establish communications over a point-to-point link, each end of the PPP link must first send LCP packets to configure the data link during Link Establishment phase.
After the link has been established, PPP provides for an optional Authentication phase before proceeding to the Network-Layer Protocol phase. (RFC1994)

By default, authentication is not mandatory.  If authentication of the link is desired, an implementation MUST specify the Authentication-Protocol Configuration Option during Link Establishment phase.

Each PPP link peer send LCP packets over point-to-point link to configure and test data-link layer. After the link has been established, the peer can be authenticated.

Then PPP send NCP packets to choose & configure one or more network-layer protocols. Once each of the chosen network-layer protocols has been configured, datagrams from each network-layer protocol can be sent over the link.

The link remains available until explicit LCP or NCP packets close the link down or manually shutdown.

PPP Phases: 


1. Link Dead phase
The link starts and stops in this phase. The detection of a carrier signal at the peer triggers the link to proceed to the next phase.
Disconnecting from the modem line should bring the link back to this  phase.

2. Link Establishment phase (mandatory)
Once the presence of the peer is detected, the link proceeds to this phase.
In this phase, the LCP establishes a healthy connection by exchanging configuration packets. After the link configuration has been consented upon, Configure-Ack (CONFACK) packets are sent and received.
Configuration options have defined default values, which can be modified during this phase. These options are independent of the network layer protocol being implemented. These options are negotiated between the peers based on the hardware and software abilities at both the ends.
Any non-LCP packets received during this phase should be discarded and logged. When the link is in the network layer protocol (NLP) phase, receiving a Configure-Request packet causes the link to move back to the Link Establishment phase.
The end of this phase indicates the LCP open state.
 There are three classes of LCP packets:
a) The Link Configuration Packets used to establish & configure a link (Configure-Request, Configure-Ack, Configure-NAK & Configure-Reject).
b) Link Termination packets used to terminate a link (Terminate-Request & Terminate-Ack).
c) Link Maintenance packets used to manage & debug a link (Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply and Discard-Request).
# debug ppp negotiation
01:46:48.923: Se1/0 PPP: Phase is DOWN
01:46:48.927: Se1/0 PPP: Phase is ESTABLISHING, Passive Open
!-- When PPP receives an indication that physical-layer is UP, LCP negotiation starts by sending & receiving CONFREQ packets. LCP state reaches OPEN and LCP negotiation finishes when CONFACK packets are sent & received.
!-- "I" indicates incoming Configure packets while "O" indicates outgoing Configure packets.
!-- "MagicNumber" is used to detect loopbacks and is always sent
01:47:11.095: Se1/0 LCP: State is Listen
01:47:21.539: Se1/0 LCP: I CONFREQ [Listen] id 1 len 10
01:47:21.539: Se1/0 LCP:    MagicNumber 0x01725F52 (0x050601725F52)
01:47:21.543: Se1/0 LCP: O CONFREQ [Listen] id 37 len 10
01:47:21.543: Se1/0 LCP:    MagicNumber 0x00727699 (0x050600727699)
01:47:21.543: Se1/0 LCP: O CONFACK [Listen] id 1 len 10
01:47:21.543: Se1/0 LCP:    MagicNumber 0x01725F52 (0x050601725F52)
01:47:21.635: Se1/0 LCP: I CONFACK [ACKsent] id 37 len 10
01:47:21.639: Se1/0 LCP:    MagicNumber 0x00727699 (0x050600727699)

01:47:21.639: Se1/0 LCP: State is Open
01:47:21.639: Se1/0 PPP: Phase is FORWARDING, Attempting Forward
01:47:21.639: Se1/0 PPP: Phase is ESTABLISHING, Finish LCP
01:47:21.643: Se1/0 PPP: Phase is UP

3. Authentication phase (optional)
This is an optional phase. Before proceeding to the NLP, a peer may request authentication or validation by the other peer.
If PAP or CHAP is configured, PPP enters AUTHENTICATING phase.
If requested, this phase must be entered as soon as link establishment is complete. It is possible that link quality determination may occur during this phase. If link quality determination needs to be performed while in the authentication phase, appropriate priority levels should be given to the quality determination process.
Entering the NLP, requires passing the authentication phase. Failing at validation necessitates the link to move to the termination phase, only after a sufficient number of failed attempts. Only authentication protocol, LCP, and linkquality determination packets can be sent and received during this phase. All other  packets received must be discarded and logged.
There are two types of authentication protocols that can be implemented.

4 Network Layer Protocol phase (mandatory)
Once the PPP has successfully passed through the authentication phase, the NLP phases must be configured (similar to the LCP phases). Some examples of NLPs are Internet Protocol (IP), AppleTalk (AT) etc. IPCP negotiates two options: IP Address & Compression method.

5 Link Termination phase
The link can be terminated at any point of time. This can happen due to any of the following factors:
 -- carrier can not be detected, authentication failure, idle-period time-out, human intervention or bad link quality.
The link has now reached the link dead phase again. 


At what point in the PPP connection process does the authentication phase occur?
 - after NCP establishes Layer 3 parameters
 - before LCP begins the link establishment process
 - after the initial Configure-Request message from the link initiator
 * after the link initiator receives a Configure-Ack message from the responder


Commands
show controller serial #/#     Shows controller information about the specified serial interface including the clock rate and cable termination type (DTE or DCE)

clock rate #    
This command is executed in serial interface configuration mode to set the clock rate of a DCE termination point of a serial link.

encapsulation [ HDLC | PPP ]    
This command when executed in Serial interface configuration mode configures the interface encapsulation to Cisco HDLC (High-Level Data Link Control protocol) or the Industry Standard PPP (Point to Point Protocol)

show interface serial #/#    
This command when executed in privileged mode will display Serial interface information such as encapsulaton, MTU, up time, current utilization and more.

The clock rate command is added in newer IOS versions automatically to the interface and cannot be removed manually. It will be automatically removed if you connect the DTE cable to the serial interface. So don't worry about that command being present in the configuration right now. It will disappear automatically when a DTE cable is plugged to the port.

Note that a serial interface cannot be configured to work in Layer1 DCE or DTE mode by command. This depends exclusively on the type of the cable. Most certainly, the clock rate command simply sets the clockrate to be used if a DCE-type cable is connected. Otherwise, that command is ignored.


debug ppp auth - CHAP, PAP debug
debug ppp negotiation - PPP  LCP, NCP debug

Shutdown process
R1 - is a local router, R2 - remote PPP router,
What happens when S0/0/0 on R2 are administrativly shutted down
R1#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Serial0/0/0 PPP: Phase is TERMINATING
Serial0/0/0 LCP: State is Closed
Serial0/0/0 PPP: Phase is DOWN
When S0/0/0 on R2 are "no shutdown"-ed:
R1#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to upSerial0/0/0 PPP: Using default call direction
Serial0/0/0 PPP: Treating connection as a dedicated line
Serial0/0/0 PPP: Phase is ESTABLISHING, Active Open
Serial0/0/0 IPCP: I CONFREQ [Closed] id 1 len 10
Serial0/0/0 IPCP: O CONFACK [Closed] id 1 len 10
Serial0/0/0 LCP: State is Open
Serial0/0/0 PPP: Phase is AUTHENTICATING
Serial0/0/0 IPCP: O CONFREQ [Closed] id 1 len 10
Serial0/0/0 IPCP: I CONFACK [Closed] id 1 len 10
Serial0/0/0 IPCP: O CONFREQ [Closed] id 1 len 10
Serial0/0/0 IPCP: I CONFACK [REQsent] id 1 len 10
Serial0/0/0 PPP: Phase is FORWARDING, Attempting Forward
Serial0/0/0 Phase is ESTABLISHING, Finish LCP
Serial0/0/0 Phase is UP
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
%DUAL-5-NBRCHANGE: IP-EIGRP 90: Neighbor 192.168.0.2 (Serial0/0/0) is up: new adjacency

https://sites.google.com/site/amitsciscozone/home/ppp/understanding
http://tools.ietf.org/html/rfc1994

No comments :

Post a Comment