0% found this document useful (0 votes)
6 views58 pages

dcc2015s1 Lecture05

t

Uploaded by

Ron Shen
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)
6 views58 pages

dcc2015s1 Lecture05

t

Uploaded by

Ron Shen
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/ 58

Content Outline (Unit 5)

 High-Level Data Link Control (HDLC)


 HDLC Configurations
 HDLC Transfer Modes
 HDLC Frame Structure
 Bit Stuffing
 HDLC Operations
 Point-to-Point Protocol (PPP)
 Framing
 Link Control Protocol (LCP)
 Authentication Protocols (AP)
 Network Control Protocols (NCP)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 1


HDLC
 High-level Data Link Control (HDLC) was developed by ISO in 1979
 HDLC supports both half-duplex and full-duplex communications over
point-to-point and multipoint links
 HDLC has become the basis for most data link protocols used today
including:
 Point-to-Point Protocol (PPP)

 Frame Relay

 Link Access Protocols (LAPs)

 Most LANs and MANs, e.g. IEEE 802 family

EIE3333 DCC KTLO/EIE/HKPolyU/2015 2


HDLC
 Station Types
 Primary Station – has complete control of the link and sends commands to

secondary stations
 Secondary Station – receives commands and send response to primary

station
 Combined Station – sends command and response

 Configurations
 Unbalanced – One primary station and one or more secondary stations

 Balanced – Two combined stations

EIE3333 DCC KTLO/EIE/HKPolyU/2015 3


HDLC Configurations

EIE3333 DCC KTLO/EIE/HKPolyU/2015 4


HDLC Transfer Modes
 A mode in HDLC is the relationship between two devices involved in an
exchange

 The mode of communication describes who controls the link

 HDLC supports two modes of communication between stations:


 Normal Response Mode (NRM)

 Asynchronous Balanced Mode (ABM)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 5


HDLC Transfer Modes
 Normal Response Mode (NRM)
 used with an unbalanced configuration

 refers to the standard primary-secondary relationship

 secondary device must have permission from the primary

device before transmitting

EIE3333 DCC KTLO/EIE/HKPolyU/2015 6


HDLC Transfer Modes
 Asynchronous Balanced Mode (ABM)
 used with a balanced configuration

 all stations are equal and therefore only combined stations connected in

point-to-point are used


 either combined station may initiate transmission with the other

combined station without permission

NRM ABM
Station Primary
type & Combined
Secondary
Initiator Primary Any

EIE3333 DCC KTLO/EIE/HKPolyU/2015 7


HDLC Frame Types
 Information frames (I-frames)
 Used to transport user data and control information relating to user data

 Supervisory frames (S-frames)


 Used only to transport control information, primarily data link layer flow

control and error control

 Unnumbered frames (U-frames)


 Reserved for system management

 Information carried by U-frames is intended for managing the link itself

EIE3333 DCC KTLO/EIE/HKPolyU/2015 8


HDLC Frame Structures
 All HDLC frame types share a
similar basic structure
 Frame may contain up to six
fields:
 Beginning flag

 Address

 Control

 Information (absent in S-
frames)
 Frame Check Sequence
(FCS)
 Ending flag

EIE3333 DCC KTLO/EIE/HKPolyU/2015 9


Flag Field of HDLC Frame
 Flag field is an 8-bit pattern of 01111110
 A synchronization pattern for the receiver

EIE3333 DCC KTLO/EIE/HKPolyU/2015 10


Flag Field
 Sequence reserved for flag field : 01111110

 Problem: data field of HDLC may contain the same sequence pattern
 Receiver wrongly interprets the data

 Lack of data transparency

 Solution: Bit Stuffing


 Guarantee the flag field sequence does not appear anywhere else in the

frame

EIE3333 DCC KTLO/EIE/HKPolyU/2015 11


Bit Stuffing in HDLC
 Bit stuffing
 Process of adding one extra 0 whenever there are five consecutive
1s in the data
 Receiver does not misinterpret the data as flag

EIE3333 DCC KTLO/EIE/HKPolyU/2015 12


Address Field of HDLC Frame
 Address field contains the address of the secondary station that is
either the originator or destination of the frame
 One byte can identify up to 128 stations (7 bits used)

 Large network requires multiple-byte address fields

EIE3333 DCC Primary station createsKTLO/EIE/HKPolyU/2015


a frame, it contains “to address” 13
Control Field of HDLC Frame

 A one-byte segment of HDLC frame

EIE3333 DCC KTLO/EIE/HKPolyU/2015 14


Control Field of HDLC Frame
 Poll/Final (P/F) bit = 1 for access control
 Poll (or Select) – Primary asks whether the secondary has anything to

send
 Final – Secondary replies that there is nothing to send; otherwise it

would reply with an I-frame

EIE3333 DCC KTLO/EIE/HKPolyU/2015 15


Control Field of HDLC Frame
 N(S) and N(R) for flow control
 I-frame contains both N(S) and N(R) fields

 S-frame contains an N(R) only


 S-frames are used to return N(R) for flow control when the receiver

does not have data to send

 U-frame has neither N(S) nor N(R) fields


 U-frames are used for system management information, but not for

user data exchange or acknowledgement

EIE3333 DCC KTLO/EIE/HKPolyU/2015 16


Control Codes in S-Frame
 S-frame is used for acknowledgement, flow control, and error control

EIE3333 DCC KTLO/EIE/HKPolyU/2015 17


Control Codes in S-Frame
 RR (Receive Ready)
 ACK – Used by a receiving station to return a positive acknowledgement,

N(R) (Next frame expected by the receiver) field having 3 bits (up to 8
frames)
 Poll – When transmitted by primary with P/F bit set, RR asks if it has

anything to send
 Negative response to poll – RR tells primary that secondary has nothing

to send. If the secondary does have data to transmit, it responds to poll


with an I-frame not an S-frame
 Positive response to select – When a secondary is able to receive a

transmission from the primary

EIE3333 DCC KTLO/EIE/HKPolyU/2015 18


Control Codes in S-Frame
 RNR (Receive Not Ready)
 ACK – RNR returned by a receiver to a sending station acknowledges

receipt of all frames up to, but not including the frame indicated in the
N(R) field
 Select – When a primary wishes to transmit data to a specific secondary,

it alerts the secondary by sending an RNR frame with the P/F (used as P)
set
 Negative response to select – When a selected secondary is unable to

receive data, it returns an RNR

EIE3333 DCC KTLO/EIE/HKPolyU/2015 19


Control Codes in S-Frame
 REJ (Reject)
 The negative acknowledgement returned by a receiver in a go-back-n

ARQ error correction system


 In an REJ frame, the N(R) field contains the number of the damaged

frame

 SREJ (Selective-reject)
 The negative acknowledgement returned by a receiver in a selective-reject

ARQ error correction system

EIE3333 DCC KTLO/EIE/HKPolyU/2015 20


Poll and Select in HDLC

EIE3333 DCC KTLO/EIE/HKPolyU/2015 21


Control Codes of U-Frame
 U-frame is used to exchange session management and control information
between connected devices

EIE3333 DCC KTLO/EIE/HKPolyU/2015 22


Control Codes of U-Frame
 2+3 control bits in U-frames, 32 possible combinations
 In general, U-frame control functions are of 5 types:
1. Mode setting – set NRM, ARM or ABM modes
2. Disconnection – negative acknowledgement of mode setting commands
3. Unnumbered exchange – exchange of specific data such as date and
time
4. Initialization mode – initialize data link functions
5. Miscellaneous – exchange of address, resetting of sequence numbers,
etc

EIE3333 DCC KTLO/EIE/HKPolyU/2015 23


Control Codes of U-Frame

EIE3333 DCC KTLO/EIE/HKPolyU/2015 24


Information Field and
Piggybacking
 Information field
 contains user data (variable length) in I-frames

 contains network management data (if any) in U-frames

 The main purpose of I-frames is to carry user data in the Information field,
but they also use N(S) and N(R) fields to acknowledge receipt of frames
 The combination of data and acknowledgement in one single frame is called
piggybacking

 Frame check sequence (FCS)


is for error detection
 2 or 4-byte CRC

EIE3333 DCC KTLO/EIE/HKPolyU/2015 25


HDLC Operation
 HDLC operations consists of exchange of information, supervisory and
unnumbered frames

 It have three phases


 initialization

 by either side, set mode & seq

 data transfer

 with flow and error control

 using both I & S-frames (RR, RNR, REJ, SREJ)

 disconnect

 when ready or fault noted

EIE3333 DCC KTLO/EIE/HKPolyU/2015 26


Example 1: Poll / Response

EIE3333 DCC KTLO/EIE/HKPolyU/2015 27


Example 2: Select /
Response

EIE3333 DCC KTLO/EIE/HKPolyU/2015 28


Example 3: Connection and
Disconnection

KTLO/EIE/HKPolyU/2015 29
Example 4: Piggybacking

KTLO/EIE/HKPolyU/2015 30
Example 5: Piggybacking
with Error
 Node B sends three data frames (0, 1, and 2),
but frame 1 is lost.
 When node A receives frame 2, it discards it
and sends a REJ frame for frame 1.
 Note that the protocol being used is Go-
Back-N with the special use of an REJ frame
as a NAK frame.
 The NAK frame does two things here: It
confirms the receipt of frame 0 and declares
that frame 1 and any following frames must
be resent.
 Node B, after receiving the REJ frame,
resends frames 1 and 2.
 Node A acknowledges the receipt by sending
an RR frame (ACK) with acknowledgment
number 3.

EIE3333 DCC 31
HDLC Operation Example

EIE3333 DCC KTLO/EIE/HKPolyU/2015 32


HDLC Operation Example

EIE3333 DCC KTLO/EIE/HKPolyU/2015 33


Point-to-Point Protocol (PPP)
 One of the most common protocols for point-to-point access.

 PPP provides router-to-router and host-to-network connections over


synchronous and asynchronous circuits, which can be either dialup or
leased lines.

 Millions of Internet users who need to connect their home computers to the
server of an Internet service provider use PPP.

 PPP can often be run over other data link technologies providing best of
both worlds, e.g., PPPoE.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 34


PPP Services
 The designers of PPP have included several services to make it suitable for
a point-to-point protocol, but have ignored some traditional services to
make it simple.

 Services provided:
 Establishment of the link and the exchange of data
 Authentication (optional)
 Provide connections over multiple links (Multilink PPP)
 Services not provided:
 No flow control
 No error control (only error detection)
 No sequence numbering

EIE3333 DCC KTLO/EIE/HKPolyU/2015 35


PPP Framing
 PPP uses a character-oriented (or byte-oriented) frame.

 Flag: A PPP frame starts and ends with a specific 1-byte pattern of 01111110
 Address: A constant value and set to 11111111 (broadcast address)
 Control: Set to a constant value 00000011 (imitating unnumbered frames in
HDLC)
 Protocol: Define what is being carried in the data field: either user data or other
information.
 FCS: The frame check sequence is simply a 2-byte or 4-byte CRC.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 36


PPP Framing
 Payload: The data field is a sequence of bytes with the default of a
maximum of 1500 bytes; but this can be changed during negotiation.
 Byte Stuffing:

 Since PPP is a byte-oriented protocol, the flag in PPP is a byte that

needs to be escaped whenever it appears in the data section of the


frame.
 The escape byte is 01111101. Every time when the flag-like pattern

appears in the data, this extra byte is stuffed to tell the receiver that
the next byte is not a flag. The escape byte should also be stuffed
with another escape byte.
 Padding: Since there is no field defining the size of the data field,

padding is needed if the size is less than the maximum default value or
a maximum negotiated value.
EIE3333 DCC KTLO/EIE/HKPolyU/2015 37
PPP Transition Phases
 A PPP connection goes through phases which can be shown in a transition
phase diagram

EIE3333 DCC KTLO/EIE/HKPolyU/2015 38


PPP Multiplexing
 Although PPP is a link-layer protocol, it uses another set of protocols to
establish the link, authenticate the parties involved, and carry the network-
layer data.
 Three sets of protocols are defined to make PPP powerful:
 the Link Control Protocol (LCP)

 two Authentication Protocols (APs)

 several Network Control Protocols (NCPs)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 39


PPP Multiplexing

EIE3333 DCC KTLO/EIE/HKPolyU/2015 40


PPP Architecture

EIE3333 DCC KTLO/EIE/HKPolyU/2015 41


Link Control Protocol
 LCP is responsible for establishing, maintaining, configuring, and
terminating links.
 It also provides negotiation mechanisms to set options between the two end
points.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 42


LCP Packets
 The ID field holds a value that matches a request with a reply.
 One endpoint inserts a value in this field, which will be copied into the
reply packet.
 The length field defines the length of the entire packet.
 The information field contains information, such as options, needed for
some LCP packets.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 43


LCP Packets

EIE3333 DCC KTLO/EIE/HKPolyU/2015 44


Options
 There are many options that can be negotiated between two end points.
 Options are inserted in the information field of the configuration packets. In
this case, the information field is divided into three fields: option type,
option length, and option data.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 45


Authentication Protocols
 PPP is designed for use over dial-up links where verification of user
identity is necessary.
 Authentication means validating the identity of a user who needs to access
a set of resources.
 PPP has 2 protocols for authentication:
 Password Authentication Protocol

 Challenge Handshake Authentication Protocol

EIE3333 DCC KTLO/EIE/HKPolyU/2015 46


Password Authentication
Protocol (PAP)
 PAP is a simple authentication procedure with a two-step process:

 The user who wants to access a system sends an authentication


identification (usually the user name) and a password.

 The system checks the validity of the identification and password and
either accepts or denies connection.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 47


Password Authentication
Protocol (PAP)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 48


Challenge Handshake
Authentication Protocol (CHAP)
 CHAP is a three-way handshaking authentication protocol that provides
greater security than PAP.

 In CHAP, the password is kept secret; it is never sent online


 The system sends the user a challenge packet containing a challenge value,
usually a few bytes.
 The user applies a predefined function that takes the challenge value and the
user’s own password and creates a result. The user sends the result in the
response packet to the system.
 The system does the same. It applies the same function to the password of the
user (known to the system) and the challenge value to create a result. It the
result created is the same as the result sent in the response packet, access is
granted; otherwise, it is denied.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 49


Challenge Handshake
Authentication Protocol (CHAP)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 50


Network Control Protocols
 PPP is a multiple-network-layer protocol that it can carry network-layer
data packet from different network layer protocols defined by the Internet,
OSI, Xerox, DECnet, AppleTalk, Novel and so on.
 PPP has defined a specific Network Control Protocol for each network
protocol.
 Internet Protocol Control Protocol (IPCP)

 OSI Network Control Protocol

 Xerox NS IDP Control Protocol

 None of the NCP packets carry network layer data; they just
configure the link at the network layer for the incoming data.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 51


IPCP
 Internet Protocol Control Protocol

EIE3333 DCC KTLO/EIE/HKPolyU/2015 52


IPCP Packets

EIE3333 DCC KTLO/EIE/HKPolyU/2015 53


Data from Network Layer
 After the network-layer configuration is completed by one of the NCP
protocols, the user can exchange data packets from the network layer.

 IP datagram encapsulated in a PPP frame:

EIE3333 DCC KTLO/EIE/HKPolyU/2015 54


Multilink PPP
 PPP was originally designed for a single-channel point-to-point physical
link.
 For multilink PPP (multiple channels in a single point-to-point link), a
logical PPP frame is carried in the payload of an actual PPP frame.

EIE3333 DCC KTLO/EIE/HKPolyU/2015 55


An
Example

EIE3333 DCC KTLO/EIE/HKPolyU/2015 56


An Example

LCP
Setup

PAP
IP NCP
setup

EIE3333 DCC KTLO/EIE/HKPolyU/2015 57


Reading
 B. A. Forouzan, “Data Communications and Networking,” 5th
Edition, McGraw-Hill 2013 (Chapter 11)

 William Stallings, “Data and Computer Communications,” 9th


Edition, Prentice Hall 2012 (Chapter 7)

EIE3333 DCC KTLO/EIE/HKPolyU/2015 58

You might also like