0% found this document useful (0 votes)
41 views36 pages

Computer Communication Networks CS-418: Lecture 4 - 2 Data Link Layer Protocols - PPP

This document discusses the Point-to-Point Protocol (PPP) which is used to connect home computers to the Internet. PPP uses encapsulation and frame formats based on HDLC. It establishes and configures connections using a Link Control Protocol (LCP) and can carry multiple network layer protocols using Network Control Protocols (NCPs). PPP provides a basic data link function without features like flow control or error control.

Uploaded by

Ali Memon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views36 pages

Computer Communication Networks CS-418: Lecture 4 - 2 Data Link Layer Protocols - PPP

This document discusses the Point-to-Point Protocol (PPP) which is used to connect home computers to the Internet. PPP uses encapsulation and frame formats based on HDLC. It establishes and configures connections using a Link Control Protocol (LCP) and can carry multiple network layer protocols using Network Control Protocols (NCPs). PPP provides a basic data link function without features like flow control or error control.

Uploaded by

Ali Memon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Computer Communication Networks

CS-418

Course Teacher : Sumayya Zafar


Class : BE EE

Lecture 4 – 2
Data Link Layer Protocols - PPP

Spring Semester 2021 1


Introduction
• In the following slides we will examine several widely used data
link protocols.
• The second one, PPP, is the data link protocol used to connect
home computers to the Internet.

Spring Semester 2021 3


PPP – Point-to-Point Protocol
• Although HDLC is a general protocol that can be used for both
point to point and multipoint configurations, one of the most
common protocols for point to point access is the Point-to-Point
Protocol (PPP).
• Today, millions of Internet users who need to connect their home
computers to the server of an Internet service provider use PPP.
• The Point-to-Point Protocol uses the principles, terminology, and
frame structure of the International Organization For
Standardization's (ISO) High level Data Link Control (HDLC)
procedures.

Spring Semester 2021 4


PPP – Basic Characteristics
• The Point-to-Point Protocol consists of three main components:
• A method for Encapsulating datagrams over serial links.
• A Link Control Protocol (LCP) for establishing, configuring, and testing the
data link connection.
• A family of Network Control Protocols (NCPs) for establishing and
configuring different network layer protocols.
• The mechanism that PPP uses to carry network traffic is to open a link with a
short exchange of packets. Once the link is open, network traffic is carried
with very little overhead. Frames are sent as unnumbered information frames,
so no data link acknowledgement is required and no retransmissions are
carried out. Once the link is established, PPP acts as a straight data pipe for
protocols.

Spring Semester 2021 5


PPP – Basic Characteristics
• PPP does not offer several services which are:
• Flow control - A sender can send several frames one after another
with no concern about overwhelming the receiver.
• Error Control – A CRC field is used to detect errors. If the frame is
corrupted, it is silently discarded. Lack of error control and
sequence numbering may cause a packet to be received out of
order.
• PPP does not provide a sophisticated addressing mechanism to
handle frames in a multipoint configuration.

Spring Semester 2021 6


PPP – Encapsulation
• The PPP frame format was chosen to closely resemble the HDLC
frame format.
• The major difference between PPP and HDLC is that PPP is
character oriented i.e. the frame always has an integral number of
bytes(octets).
• Data comes in frames, delimited by special characters called flags.
• When a frame is not being sent, the sender transmits flags
continually. This means that there is constant activity on any
synchronous line that is running properly.

Spring Semester 2021 7


PPP – Encapsulation
• All PPP frames begin and end with the standard HDLC flag byte 01111110 or
0x7E.
• When the payload (user data) contains flags, an escape byte 01111101 or
0x7D is inserted (byte stuffing).
• Next comes the Address field, which is always set to 11111111 or 0xFF to
indicate that all stations are to accept the frame. PPP does not assign
individual station addresses.
• Frames with unrecognized Addresses should be silently discarded.

Spring Semester 2021 8


PPP – Encapsulation
• The Address field is followed by the Control field, the default value
of which is 00000011 or 0x03. This value indicates an unnumbered
frame.
• In other words, PPP does not provide reliable transmission using
sequence numbers and acknowledgements as the default.
• Since the Address and Control fields are always constant in the
default configuration, LCP provides the necessary mechanism for
the two parties to negotiate an option to just omit them altogether
and save 2 bytes per frame.

Spring Semester 2021 9


PPP – Encapsulation
• The control field is followed
by the Protocol field.
• The Protocol field is two
octets and its value
identifies the protocol
encapsulated in the Payload
field of the frame.
• This Protocol field is defined
by PPP and is not a field
defined by HDLC.

Spring Semester 2021 10


PPP – Encapsulation
• The protocol field is followed by the Payload/Information Field.
Payload/Information field is zero or more octets(variable). The
Information field contains the datagram for the protocol specified
in the Protocol field. The default maximum length of the
Information field is 1500 octets.
• The Payload/Information field is followed by Frame Check
Sequence(FCS) which is normally 16 bits (two octets). The FCS
field is calculated over all bits of the Address , Control, Protocol
and Information fields.

Spring Semester 2021 11


PPP – Phase Transition Diagram

• This diagram shows the phases


that a line goes through when it
is brought up, used, and taken
down again.
• The phases include:
• Dead
• Establish
• Authenticate
• Network
• Open
• Terminate

Spring Semester 2021 12


PPP – Phase Transition Diagram

• The protocol starts with the line in the DEAD state, which means
that no physical layer carrier is present and no physical layer
connection exists.
• After physical connection is established, the line moves to
ESTABLISH.
• At that point LCP option negotiation begins, which, if successful,
leads to AUTHENTICATE. Now the two parties can check on each
other's identities if desired.
• When the NETWORK phase is entered, the appropriate NCP
protocol is invoked to configure the network layer.
• If the configuration is successful, OPEN is reached and data
transport can take place.
• When data transport is finished, the line moves into the
TERMINATE phase, and from there, back to DEAD when the
carrier is dropped.

Spring Semester 2021 13


PPP – Link Control Protocol
• PPP uses a Link Control Protocol (LCP) to establish, configure and test the data link connection that goes
through four distinct phases.
• Firstly, link establishment and configuration negotiation occur. Before any network layer packets (e.g.
IP) can be exchanged, LCP first must open the connection and negotiate configuration parameters.
• This phase is complete when a configuration acknowledgement frame has been both sent and received.
• This is followed by an link maintenance phase. In this phase, the link is tested to determine whether the
link quality is sufficient to support the network layer protocols. Transmission of network layer protocol
information is delayed until this phase is complete.
• At this point, a network layer protocol configuration negotiation occurs. PPP is designed to allow the
simultaneous use of multiple network layer protocols and network layer protocols can be configured
separately and can be brought into use and taken down at any time.
• Finally, link termination can occur. This is usually carried out at the request of a user but can happen
because of a physical event, such as the loss of line signals or the expiration of an idle period timer.

Spring Semester 2021 14


PPP – Link Control Protocol
• Each of these functions corresponds to one of the “life phases” of
a PPP link.
• Link configuration is performed during the initial Link
Establishment phase of a link;
• Link maintenance occurs while the link is open, and
• Link termination happens in the Link Termination phase.
• Three classes of LCP frames are used:
• Link configuration frames are used to establish and configure a link;
• Link termination frames are used to terminate a link; and
• Link maintenance frames are used to manage and debug a link.
Spring Semester 2021 15
PPP – LCP Frame Format
• All LCP packets(frames) are carried in the payload field of the PPP frame with the protocol
field set to 0xC021 in hexadecimal.
• The code field is one byte in length and defines the type of LCP packet.
• The id field is one byte in length and carries an identifier that is used to match associated
requests and replies.
• The length is two bytes in length and indicates the total length of the LCP frame including the
Code, Id, length, and data fields.
• Data field is variable in length and contains information specific to the message type.

Code ID Length Information

Flag Address Control Protocol Flag


Payload FCS
0111110 1111111 00000011 1100000000100001 0111110
Spring Semester 2021 16
PPP – LCP Link Configuration Frames
• Link configuration frames are transmitted during the link establishment phase.
• The information field of the LCP frame carries information used to negotiate
the configuration options for the link.
• The Link configuration frames are:
• Configure-Request – Code 0x01.Request the establishment of a link with a particular configuration.
Represents the start of the link establishment phase. (Direction: Initiator Responder)
• Configure-Ack – Code 0x02. Acknowledge the receipt of a recognizable Configure-request frame, and
accept the requested configuration. Represents the end of the link establishment phase. (Direction:
Initiator Responder)
• Configure-Nak – Code 0x03. Acknowledge the receipt of a recognizable Configure-request frame, but
reject some or all of the requested configuration. (Direction: Initiator Responder)
• Configure-Reject - Code 0x04. Reject a Configure-request frame because it is not recognizable or
because the requested configuration is not acceptable. (Direction: Initiator Responder)

Spring Semester 2021 17


PPP – LCP Link Termination Frames
• Link termination frames are transmitted during the link termination phase.
• The link termination frames are:
• Terminate-request - Code 0x05. Request the termination of a link. Represents the start of the
link termination phase. (Direction: Initiator Responder)
• Terminate-ack - Code 0x06. Acknowledge the receipt of a recognizable Terminate-
request frame, and accept the termination request. Represents the end of the link termination
phase(Direction: Initiator Responder)

Spring Semester 2021 18


PPP – LCP Link Maintenance Frames
• Link maintenance frames are transmitted periodically to test and maintain the
link.
• The link maintenance frames are:
• Code-reject – Code 0x07. Rejects an LCP frame that has an invalid code field. (Direction:
Initiator Responder)
• Protocol-reject - Code 0x08. Rejects a PPP frame that has an invalid protocol id. (Direction:
Initiator Responder)
• Echo-request - Code 0x09. Requests a response, in the form of an Echo-reply frame, from the
remote end point. Used to test that the link is still up. (Direction: Initiator Responder)
• Echo-reply - Code 0x10. Responds to a valid Echo-request frame. Used to test that the link is
still up. (Direction: Initiator Responder)
• Discard-request -Code 0x11. Sends a frame which is silently discarded at the remote
endpoint. Used as a debugging mechanism. (Direction: Initiator Responder)

Spring Semester 2021 19


This diagram provides an overview of
message exchanges performed by LCP during
different phases of a PPP connection.
• Link Configuration is shown as a simple
exchange of a Configure-Request and
Configure-Ack.
• After subsequent exchanges using other
PPP protocols to authenticate and
configure one or more NCPs, the link
enters the Link Open phase.
• An Echo-Request and Echo-Reply message
are first used to test the link, followed by
the sending and receiving of data by both
devices.
• One Data message is shown being
rejected due to an invalid Code field.
• Finally, the link is terminated using
Terminate-Request and Terminate-Ack
messages.

Spring Semester 2021 20


PPP – LCP Configuration Options
• Link configuration is the most important job that LCP does in PPP. During the Link
Establishment phase, LCP frames are exchanged that enable the two physically connected
devices to negotiate the conditions under which the link will operate.
• The process starts with the initiating device (let's call it initiator) creating a Configure-
Request frame that contains a variable number of configuration options that it wants to use to
set up on the link.
• A number of different configuration options that the initiator can specify in this request are:
• Maximum Receive Unit (MRU)
• This configuration option may be sent to inform the peer that the implementation can
receive larger frames, or to request that the peer send smaller frames.
• The maximum receive unit covers only the data link layer Information field.
• It does not include the header, FCS, or any other bytes.
• By default, it is ‘1500’.

Spring Semester 2021 21


PPP – LCP Configuration Options
• A number of different configuration options that the initiator can specify in this request are:
• Authentication Protocol
• On some links it may be desirable to require a peer to authenticate itself before allowing
network layer protocol packets to be exchanged.
• This configuration option provides a way to negotiate the use of a specific authentication
protocol.
• An implementation should not include multiple authentication protocol configuration
options in its configure request packet.
• Instead, it should attempt to configure the most desirable protocol first.
• If that protocol is rejected , then the implementation could attempt the next most
desirable protocol in the next configure request packet.
• By default authentication protocol is ‘authentication is not necessary’.

Spring Semester 2021 22


PPP – LCP Configuration Options
• A number of different configuration options that the initiator can specify in this request are:
• Quality Protocol
• On some links it may be desirable to determine when, and how often, the link is dropping
data.
• This process is called link quality monitoring.
• This field shows whether initiator wants to enable quality monitoring on the link.
• It is defined by Link Quality Report (LQR) packet which is transmitted down the link by
the router at regular intervals.
• This LQR packet contains information which is used to determine how many packets are
being lost on the link.
• By default quality protocol is ‘None’.

Spring Semester 2021 23


PPP – LCP Configuration Options
• A number of different configuration options that the initiator can specify in this request are:
• Protocol Field Compression
• This configuration option provides a way to negotiate the compression of the data link layer protocol
field.
• By default, all implementations must transmit standard PPP frames with two octet Protocol fields.
• However, PPP protocol field numbers are chosen such that some values may be compressed into a
single octet form which is clearly distinguishable from the two octet form.
• This configuration option is sent to inform the peer that the implementation can receive such single
octet protocol fields.
• Compressed protocol fields must not be transmitted unless this configuration option has been
negotiated.
• When a protocol field is compressed, the data link layer FCS field is calculated on the compressed
frame, not the original uncompressed frame.
• This provides a small savings (one byte) on each PPP frame.
• By default , it is ‘disabled’.

Spring Semester 2021 24


PPP – LCP Configuration Options
• A number of different configuration options that the initiator can specify in this request are:
• Address and Control Field Compression (ACFC)
• This configuration option provides a way to negotiate the compression of the data link
layer address and control fields.
• By default, all implementations must transmit frames with address and control fields and
must use the hexadecimal values 0xff and 0x03 respectively.
• Since these fields have constant values, they are easily compressed.
• This configuration option is sent to inform the peer that the implementation can receive
compressed address and control fields.
• Compressed address and control fields are formed by simply omitting them.
• By default , it is ‘not compressed’.

Spring Semester 2021 25


PPP – Network Control Protocol
• One of the reasons why PPP is such a powerful technology is that it is flexible i.e. PPP could easily carry
data from many types of network layer protocols.
• If only LCP is used for link configuration, it would need to know all the unique requirements of each
layer three protocol.
• This would also require that LCP be constantly updated as new layer three protocols were defined and
as new parameters were defined for existing ones.
• Instead of this, PPP takes a modular approach to link establishment. LCP performs the basic link setup,
and after authentication, invokes a Network Control Protocol (NCP) that is specific to each layer three
protocol that is to be carried over the link.
• The NCP conducts a negotiation of any parameters that are unique to the particular network layer
protocol.
• It is important to note that only configuration options which are independent of particular network layer
protocols are configured by LCP. Configuration of individual network layer protocols is handled by
separate Network Control Protocols (NCPs) during the Network Layer Protocol phase (see PPP Phase
transition diagram)

Spring Semester 2021 26


PPP – Network Control Protocol
• Like LCP, each NCP performs functions for link setup, maintenance and termination but it only
deals with its particular type of NCP link and not the overall LCP link.
• Each NCP uses a subset of seven of the message types defined in LCP, and uses them in very
much the same way as the message type of the same name is used in LCP:
• Link Configuration: The process of setting up and negotiating the parameters of the particular
NCP link (once an LCP link is established) is accomplished using Configure-
Request, Configure-Ack, Configure-Nak and Configure-Reject messages. The configuration
options are network layer protocol parameter being negotiated.
• Link Maintenance: Code-Reject messages can be sent to indicate invalid code values (NCP
frame types).
• Link Termination: An NCP link can be terminated using Terminate-Request and Terminate-Ack.
NCP links are set up within an LCP link and there can be more than one NCP link open.
Closing NCP links doesn't terminate the LCP link.

Spring Semester 2021 27


PPP – NCP Internet Protocol Control Protocol

• One example of NCP protocol is the Internet Protocol Control


Protocol (IPCP).
• This protocol configures the link used to carry IP packets in the
Internet.
• The value of the protocol field in hexadecimal is 0x8021(see table
on slide 10).

Spring Semester 2021 28


PPP – NCP Internet Protocol Control Protocol

• After the network layer configuration is completed by one of the


NCP protocols, the users can exchange data packets from the
network layer.
• There are different protocol fields for different network layers. For
example, if PPP is carrying data from the IP network layer, the field
value is 0x0021.

Spring Semester 2021 29


The overall operation of the NCPs, such as
IPCP is very similar to that of LCP.
• After LCP configuration(including
authentication) is complete, IPCP
Configure-Request and Configure-Ack
messages are used to establish an IPCP
link.
• IP Data can then be sent over the link.
• If the IPCP connection is no longer
needed it may be terminated, after which
the LCP link remains open for other types
of data to be transmitted.

Spring Semester 2021 30


PPP – Authentication Protocols
• The PPP Link Control Protocol (LCP) is responsible for establishing,
configuring and maintaining data link connections.
• Part of the process of configuring a link is the negotiation of
various options, including an authentication protocol, which is
performed before allowing Network Layer protocols to transmit
data over the link.
• The router supports two authentication protocols:
• The Password Authentication Protocol (PAP) and
• The Challenge-Handshake Authentication Protocol (CHAP).

Spring Semester 2021 31


PPP – Password Authentication Protocol
• Password Authentication Protocol(PAP) is a very straight forward authentication scheme,
consisting of only two basic steps.
• Authentication Request: The initiating device sends an Authenticate-Request message that
contains a name and a password.
• Authentication Reply: The responding device looks at the name and password and decides
whether to accept the initiating device and continue in setting up the link. If so, it sends back
an Authenticate-Ack. Otherwise, it sends an Authenticate-Nak.
• PAP transmits the user name and password in clear text across the link i.e. they are not
encrypted. This is a big no in security protocols, as it means any eavesdropper can get the
password and use it in the future.
• PAP also provides no protection against various security attacks. For example, an
unauthorized user could simply try different passwords indefinitely and hope he or she
eventually found one that worked.

Spring Semester 2021 32


• PAP frames are exchanged during the peer
authentication phase.
• The protocol id is 0xC023 for PAP frames.
• The code field identifies the type of PAP frame,
based on the following codes:
• PAP Authenticate-request frames (code 0x01)
are transmitted to start the authentication
phase, and contain the PAP id(username) and
PAP password sent for authentication.
• A PAP Authenticate-ack frame (code 0x02) is
transmitted by the authenticator when it
receives a recognizable PAP Authenticate-
request frame that contains an acceptable PAP
id(username) and PAP password.
• A PAP Authenticate-nak frame (code 0x03) is
transmitted by the authenticator when it
receives a PAP Authenticate-request frame that
is not recognizable, or that contains an
unacceptable PAP id(username) and PAP
password pair.

Spring Semester 2021 33


PPP – Challenge Handshake Authentication Protocol
• The Challenge Handshake Authentication Protocol (CHAP) is a more robust protocol which provides for
both authentication during the Link Establishment phase and periodic verification during the Network
Layer Protocol phase.
• The most important difference between PAP and CHAP is that CHAP doesn't transmit the password
across the link. It is a three way hand shaking authentication protocol that provides greater security
than PAP.
• The three-way handshake steps are as follows:
• Challenge: The authenticator generates a frame called a Challenge and sends it to the initiator. This
frame contains a simple text message(often called Challenge text). The message has no inherent
special meaning so it doesn't matter if anyone intercepts it. The important thing is that after receipt
of the Challenge both devices have the same challenge message.
• Response: The initiator uses its password to encrypt the challenge text. It then sends the encrypted
challenge text as a Response back to the authenticator.
• Success or Failure: The authenticator performs the same encryption on the challenge text that the
initiator did. If the authenticator gets the same result that the initiator sent it in the Response, the
authenticator knows that the initiator had the right password when it did its encryption, so the
authenticator sends back a Success message. Otherwise, it sends a Failure message.
Spring Semester 2021 34
• CHAP frames are exchanged during the peer authentication
phase.
• The protocol id is 0xC223 for CHAP frames.
• The code field identifies the type of CHAP frame, based on the
following codes:
• A CHAP Challenge frames (code 0x01) are used to start
the authentication negotiation, and are transmitted by the
authenticator. They contain the CHAP name and a
challenge value, which is calculated from the CHAP secret
using a one way hash algorithm.
• A CHAP Response frame (code 0x02) is sent on receipt of
a recognized CHAP Challenge frame. It contains a
response value, which is calculated using the CHAP secret,
the challenge value received, and the same one way hash
algorithm.
• A CHAP Success frame (code 0x03) is transmitted by the
authenticator when it receives a recognizable
CHAP response frame that contains an acceptable CHAP
name and response value.
• A CHAP Failure frame (code 0x04) is transmitted by the
authenticator when it receives a CHAP response frame that
is not recognizable, or that contains an unacceptable PAP
id and PAP password pair.

Spring Semester 2021 35


PPP – CHAP Vs PAP
• CHAP verifies that the two devices have the same “shared secret”
but doesn't require that the secret be sent over the link.
• The Response is calculated based on the password, but the
content of the Response is encrypted and thus, much harder to
derive the password from.
• CHAP also provides protection against replay attacks, where an
unauthorized user captures a message and tries to send it again
later on. This is done by changing an identifier in each message
and varying the challenge text.
• Also, in CHAP the server controls the authentication process, not
the client that is initiating the link.
Spring Semester 2021 36
Questions?

Spring Semester 2021 38

You might also like