Nothing Special   »   [go: up one dir, main page]

Hdlc&point To Point Protocol

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

High-level Data Link Control

(HDLC)

High-level Data Link Control (HDLC) is a group of communication protocols of


the data link layer for transmitting data between network points or nodes.
Since it is a data link protocol, data is organized into frames. A frame is
transmitted via the network to the destination that verifies its successful arrival.
It is a bit - oriented protocol that is applicable for both point - to - point and
multipoint communications.

Transfer Modes
HDLC supports two types of transfer modes, normal response mode and
asynchronous balanced mode.

 Normal Response Mode (NRM) − Here, two types of stations are there,
a primary station that send commands and secondary station that can
respond to received commands. It is used for both point - to - point and
multipoint communications.
 Asynchronous Balanced Mode (ABM) − Here, the configuration is
balanced, i.e. each station can both send commands and respond to
commands. It is used for only point - to - point communications.

 Asynchronous Response Mode (ARM):


Primarily used in multi-point configurations.

HDLC Frame
HDLC is a bit - oriented protocol where each frame contains up to six fields. The
structure varies according to the type of frame. The fields of a HDLC frame are

 Flag − It is an 8-bit sequence that marks the beginning and the end of
the frame. The bit pattern of the flag is 01111110.
 Address − It contains the address of the receiver. If the frame is sent by
the primary station, it contains the address(es) of the secondary
station(s). If it is sent by the secondary station, it contains the address of
the primary station. The address field may be from 1 byte to several
bytes.
 Control − It is 1 or 2 bytes containing flow and error control information.
 Payload − This carries the data from the network layer. Its length may
vary from one network to another.
 FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)

Types of HDLC Frames


There are three types of HDLC frames. The type of frame is determined by the
control field of the frame −

 I-frame − I-frames or Information frames carry user data from the


network layer. They also include flow and error control information that is
piggybacked on user data. The first bit of control field of I-frame is 0.
 S-frame − S-frames or Supervisory frames do not contain information
field. They are used for flow and error control when piggybacking is not
required. The first two bits of control field of S-frame is 10.
 U-frame − U-frames or Un-numbered frames are used for myriad
miscellaneous functions, like link management. It may contain an
information field, if required. The first two bits of control field of U-frame is
11.

Point-to-Point Protocol (PPP)


• PPP was devised by IETF (Internet Engineering Task Force) to create a data
link protocol for point to point lines that can solve all the problems present in SLIP.
• PPP is most commonly used data link protocol. It is used to connect the Home PC to
the server of ISP via a modem.
• This protocol offers several facilities that were not present in SLIP. Some of these
facilities are:
1. PPP defines the format of the frame to be exchanged between the devices.
2. It defines link control protocol (LCP) for:-
(a) Establishing the link between two devices.
(b) Maintaining this established link.
(c) Configuring this link.
(d) Terminating this link after the transfer.
3. It defines how network layer data are encapsulated in data link frame.
4. PPP provides error detection.
5. Unlike SLIP that supports only IP, PPP supports multiple protocols.
6. PPP allows the IP address to be assigned at the connection time i.e. dynamically.
Thus a temporary IP address can be assigned to each host.
7. PPP provides multiple network layer services supporting a variety of network layer
protocol. For this PPP uses a protocol called NCP (Network Control Protocol).
8. It also defines how two devices can authenticate each other.
PPP Frame Format

The frame format of PPP resembles HDLC frame. Its various fields are:

1. Flag field: Flag field marks the beginning and end of the PPP frame. Flag byte is
01111110. (1 byte).
2. Address field: This field is of 1 byte and is always 11111111. This address is the
broadcast address i.e. all the stations accept this frame.
3. Control field: This field is also of 1 byte. This field uses the format of the U-frame
(unnumbered) in HDLC. The value is always 00000011 to show that the frame does
not contain any sequence numbers and there is no flow control or error control.
4. Protocol field: This field specifies the kind of packet in the data field i.e. what is
being carried in data field.
5. Data field: Its length is variable. If the length is not negotiated using LCP during line
set up, a default length of 1500 bytes is used. It carries user data or other information.
6. FCS field: The frame checks sequence. It is either of 2 bytes or 4 bytes. It contains
the checksum.
Transition Phases in PPP

The PPP connection goes through different states as shown in fig.


1. Dead: In dead phase the link is not used. There is no active carrier and the line is
quiet.
2. Establish: Connection goes into this phase when one of the nodes start
communication. In this phase, two parties negotiate the options. If negotiation is
successful, the system goes into authentication phase or directly to networking phase.
LCP packets are used for this purpose.
3. Authenticate: This phase is optional. The two nodes may decide during the
establishment phase, not to skip this phase. However if they decide to proceed with
authentication, they send several authentication packets. If the result is successful, the
connection goes to the networking phase; otherwise, it goes to the termination phase.
4. Network: In network phase, negotiation for the network layer protocols takes place.
PPP specifies that two nodes establish a network layer agreement before data at the
network layer can be exchanged. This is because PPP supports several protocols at
network layer. If a node is running multiple protocols simultaneously at the network
layer, the receiving node needs to know which protocol will receive the data.
5. Open: In this phase, data transfer takes place. The connection remains in this phase
until one of the endpoints wants to end the connection.
6. Terminate: In this phase connection is terminated.
Point-to-point protocol Stack

PPP uses several other protocols to establish link, authenticate users and to carry the
network layer data.
The various protocols used are:
1. Link Control Protocol
2. Authentication Protocol
3. Network Control Protocol
1. Link Control Protocol

• It is responsible for establishing, maintaining, configuring and terminating the link.


• It provides negotiation mechanism to set options between two endpoints.

• All LCP packets are carried in the data field of the PPP frame.
• The presence of a value C021 16 in the protocol field of PPP frame indicates that LCP
packet is present in the data field.
• The various fields present in LCP packet are:
1. Code: 1 byte-specifies the type of LCP packet.
2. ID: 1 byte-holds a value used to match a request with the reply.
3. Length: 2 byte-specifies the length of entire LCP packet.
4. Information: Contains extra information required for some LCP packet.

• There are eleven different type of LCP packets. These are categorized in three
groups:
1. Configuration packet: These are used to negotiate options between the two ends.
For example: configure-request, configure-ack, configure-nak, configure-reject are
some configuration packets.
2. Link termination packets: These are used to disconnect the link between two end
points. For example: terminate-request, terminate-ack, are some link termination
packets.
3. Link monitoring and debugging packets: These are used to monitor and debug
the links. For example: code-reject, protocol-reject, echo-request, echo-reply and
discard-request are some link monitoring and debugging packets.
2. Authentication Protocol

Authentication protocols help to validate the identity of a user who needs to access the
resources.
There are two authentication protocols:
1. Password Authentication Protocols (PAP)
2. Challenge Handshake Authentication Protocol (CHAP)

1. PAP (Password Authentication Protocols)

PAP is less secure as compared to CHAP as in case of PAP protocol, password


is sent in the form of a clear text. It is a two-step process. Suppose there are
two routers, i.e., router 1 and router 2. In the first step, the router 1 wants to
authenticate so it sends the username and password for the authentication.
In the second step, if the username and password are matched then the
router 2 will authenticate the router 1 otherwise the authentication failed.

2. CHAP (Challenged Handshake Authentication Protocol)

CHAP is a three-step process. Let's understand the three steps of CHAP.


Step 1: Suppose there are two routers, i.e., router 1 and router 2. In this
step, router 1 sends the username but not the password to the router 2.

Step 2: The router 2 maintains a database that contains a list of allowed


hosts with their login credentials. If no data is found which means that the
router 1 is not a valid host to connect with it and the connection gets
terminated. If the match is found then the random key is passed. This
random key along with the password is passed in the MD5 hashing function,
and the hashing function generates the hashed value from the password and
the random key (password + random key). The hashed value is also known
as Challenge. The challenge along with the random key will be sent to the
router 1.
Step 3: The router 1 receives the hashed value and a random key from the
router 2. Then, the router 1 will pass the random key and locally stored
password to the MD5 hashing function. The MD5 hashing function generates
the hashed value from the combination of random key and password. If the
generated hashed value does not match with the received hashed value then
the connection gets terminated. If it is matched, then the connection is
granted. Based on the above authentication result, the authentication signal
that could be either accepted or rejected is sent to the router 2.

3. Network Control Protocol (NCP)

• After establishing the link and authenticating the user, PPP connects to the network
layer. This connection is established by NCP.
• Therefore NCP is a set of control protocols that allow the encapsulation of the data
coming from network layer.
• After the network layer configuration is done by one of the NCP protocols, the users
can exchange data from the network layer.
• PPP can carry a network layer data packet from protocols defined by the Internet,
DECNET, Apple Talk, Novell, OSI, Xerox and so on.
• None of the NCP packets carry networks layer data. They just configure the link at the
network layer for the incoming data.

You might also like