Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 109

HDLC PROTOCOL

Data Link Control Protocols


• Advance Data Communication Control
Procedures (ADCCP): ANSI X3.66 adopted by
the US National Bureau of Standards (FIPS
PUB 71-1)
• Link access procedure balanced (LAP-B):
adopted by CCITT, a part of x.25
• Synchronous data link control (SDLC): IBM
• High level data link control (HDLC): most
widely used
High Level Data Link Control
• HDLC
• ISO 33009, ISO 4335
• Most widely used DLC protocol
HDLC Station Types
• Primary station
– Controls operation of link
– Issues commands (frames)
– Maintains separate logical link to each secondary station
• Secondary station
– Under control of primary station
– Issues responses (frames)
• Combined station
– May issue commands and responses
– Combines the features of primary and secondary stations
HDLC
Unbalanced Mode

Commands
Primary
Responses

Secondary Secondary

Balanced mode

Combined Combined
commands/Responses
HDLC Link Configurations
• Unbalanced
– One primary and one or more secondary stations
– Supports full duplex and half duplex
• Balanced
– Two combined stations
– Supports full duplex and half duplex
HDLC Transfer Modes (1)
• Normal Response Mode (NRM)
– Unbalanced configuration
– Primary can only initiate transmission
– Secondary may only transmit data in response to
command (poll) from primary
– Used on multi-drop lines
– Host computer as primary
– Terminals as secondary
HDLC Transfer Modes (2)
• Asynchronous Balanced Mode (ABM)
– Balanced configuration
– Either station may initiate transmission without
receiving permission
– Most widely used
– No polling overhead
HDLC Transfer Modes (3)
• Asynchronous Response Mode (ARM)
– Unbalanced configuration
– Secondary may initiate transmission without
permission form primary
– Primary is responsible for connect, disconnect,
error recovery, and initialization
– rarely used
Frame Structure
• Synchronous transmission
• All transmissions in frames
• Single frame format for all data and control
exchanges
Frame Structure
Defines 3 types of frames
(I,S,U frames)
01111110 01111110
HDLC Frame Fields
Flag field
– is 8 bits of a fixed pattern (0111 1110).
– There is one flag at the beginning and one at the end frame.
– The ending flag of one Frame can be used as the beginning flag of
the next frame.
– To guarantee that the flag does not appear anywhere else in the
frame
– HDLC uses a process called Bit Stuffing.
– Every time a sender wants to transmit a bit sequence having more
than 6 consecutive 1’s, it inserts 1 redundant 0 after the 5th 1
Exceptions:
• When the bit sequence is really a flag.
• when transmission is being aborted.
• when the channel is being put into idle.
12
Bit Stuffing
• the process of adding one extra zero whenever there are 5
consecutive 1’s in the data, so that the receiver doesn’t
mistake the data for a flag.

A frame before bit stuffing:


01111110 01111100 101101111 110010

After
011111010 011111000 101101111 1010010

13
How does the receiver identify a stuffed bit?

• Receiver reads incoming bits and counts 1’s.


• When number of consecutive 1s after a zero is
5, it checks the next bit (7th bit).
• If 7th bit = zero  receiver recognizes it as a
stuffed bit, discard it and resets the counter.
• If the 7th bit = 1  then the receiver checks the
8th bit; If the 8th bit = 0, the sequence is
recognized as a flag.

01111010 011111000 101101111 1010010


14
How does the receiver identify a stuffed bit?

15
Bit Stuffing
Address Field
• Identifies secondary station that sent or will receive frame
• Usually 8 bits long
• May be extended to multiples of 7 bits
– LSB of each octet indicates that it is the last octet (1) or not (0)
• All ones (11111111) is broadcast
Control Field
• Different for different frame type
– I-frame (information frame)
• data to be transmitted to user (next layer up)
• Flow and error control piggybacked on information frames
– S-frame (Supervisory frame)
• Used for flow and error control
– U-frame (Unnumbered frame)
• supplementary link control
• First one or two bits of control filed identify
frame type
Control Field Diagram
Poll/Final Bit
• Use depends on context
• Command frame
– P bit : used for poll from primary
– 1 to solicit (poll) response from peer
• Response frame
– F bit : used for response from secondary
– 1 indicates response to soliciting command
I-frame
• Contains the sequence number of
transmitted frames and a piggybacked ACK
1 2 3 4 5 6 7 8
0 N(S) P/F N(R)

•I,0,0
•I,1,0
•I,2,0,P
S-frame
• Used for flow and error control

1 2 3 4 5 6 7 8
1 0 S P/F N(R)

•RR --- receive ready


•RNR --- receive not ready
•REJ --- reject on frame N(R)
•SREJ --- selective reject on N(R)
U-frame
• Mode setting, recovery, connect/diconnect

1 2 3 4 5 6 7 8
1 1 M P/F M

Unnumbered
function bits
Unnumberred frames
• Set normal response mode (SNRM)
• Set asynchronous response mode (SARM)
• Set asynchronous balanced mode (SABM)
• Disconnect (DISC)
• Unnumberred acknowledgement (UA)
• Disconnect mode (DM)
• Request disconnect (RD)
• Unnumberred poll (UP)
• Reset (RSET)
• Exchange identification (XID)
• Test (TEST)
• Frame reject (FRMR)
Information Field
• Only in information and some unnumbered
frames
• Must contain integral number of octets
• Variable length
Frame Check Sequence Field
• FCS
• Error detection
• 16 bit CRC
• Optional 32 bit CRC
HDLC Operation
• Exchange of information, supervisory and
unnumbered frames
• Three phases
– Initialization
– Data transfer
– Disconnect
Examples of Operation (1)
Examples of Operation (2)

PPP
In a network, two devices can be connected by a dedicated
link or a shared link.

• In the first case, the link can be used by the two devices at
any time. We refer to this type of access as point-to-point
access.

• In the second case, the link is shared between pairs of


devices that need to use the link. We refer to this type of
access as multiple access.
• 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).

• PPP is a byte-oriented protocol.


PPP Overview
A protocol for use over point-to-point serial links. Used for
connections to an Internet server provider over dial up links,
telephone or ISDN.

It is a link-level protocol, and carries network layer packets in the


payload of its messages.

PPP consists of several protocols. In order to set up a link, test it,


and authenticate the communicating parties, the LCP protocol is
used. (Link Control Protocol).

To select the network layer type traffic to be carried, Network


Control Protocol (NCP) is used.
PPP is not restricted to IP as a network layer protocol, but can carry
the packets of several other Network layer protocols as well. For
example, IPX, SNA, AppleTalk, and Banyan Vines are other
network layer protocols that may be in use.

The NCP protocol is used to select the network layer protocol.


Once the network layer protocol is selected, then there is a
protocol-specific control protocol to actually configure the network
layer options. For example, if IP is selected as the network layer
protocol, then an IP specific protocol, IPCP, is used to set up
addresses etc for both ends of the link. If AppleTalk is selected
then there is a specific ATCP (AppleTalk Control Protocol) to
configure the settings for AppleTalk.
The Data Link Layer in the Internet
A home personal computer acting as an internet
host.

A home personal computer acting as an internet host.


PPP services
• It defines the format of the frame to be exchanged between
devices.

• It defines how two devices can negotiate the establishment


of the link and the exchange of data.

• It defines how network layer data are encapsulated in the


data link frame.

• It defines how two devices can authenticate each other.


To keep PPP simple, several services are missing:

• Does not provide flow control


• Has a very simple mechanism for error control
• Lack of sequence numbering
• Does not provide sophisticated addressing mechanism to
handle frames in multipoint configuration
PPP frame format
PPP FRAME
• Flag field. The flag fields identify the boundaries of a PPP
frame. Its value is 01111110.
• Address field. Because PPP is used for a point-to-point
connection, it uses the broadcast address of HDLC, 11111111,
to avoid a data link address in the protocol.
• Control field. The control field uses the format of the U-
frame in HDLC.
• Protocol field. The protocol field defines what is being carried
in the data field: user data or other information.
• Data field. This field carries either the user data or other
information.
• Frame check sequence (FCS) field. This field is used for error
detection.
Note

PPP is a byte-oriented protocol using byte stuffing with the


escape byte 01111101.
Byte Stuffing
Byte Stuffing
• For “data transparency”, the data field must be allowed to include
the pattern <01111110> ; ie, this must not be interpreted as a flag
• to alert the receiver, the transmitter “stuffs” an extra < 01111101>
byte after each < 01111110> data byte
• the receiver discards each 01111101 after 01111110, and continues
data reception
Transition phases
Transition States
• Idle state. The idle state means that the link is not being used.
There is no active carrier, and the line is quiet.

• Establishing link. When one of the end point starts the


communication, the connection goes into the establishing
state. In this state, options are negotiated between the two
parties. If the negotiation is successful, the system goes to
the authenticating state (if authentication is required) or
directly to the networking state.

• Authenticating state. The authenticating state is optional. If


the result is successful , the connection goes to the
networking state; otherwise, it goes to the terminating state.
Transition States
• Networking State. When a connection reaches this state, the
exchange of user control and data packets can be started.
The connection remains in this state until one of the
endpoints wants to terminate the connection.

• Terminating state. When the connection is in the terminating


state, several packets are exchanged between the two ends
for house cleaning and closing the link.
An example
PPP Stack

• PPP is a data-link layer protocol, PPP uses a stack of other


protocols to establish the link, to authenticate the parties
involved, and to carry the network layer data.

• Three sets of protocols are used by PPP: Link control protocol,


authentication protocols, and network control protocol.
Protocol stack
PPP Frame Format
• Support for several (sub)protocols
• Address & control not used
• Maximum payload 1500 bytes
Link Control Protocol (LCP)
• It is responsible for establishing, maintaining, configuring, and
terminating links.

• It also provides negotiation mechanisms to set options


between endpoints. Both endpoints of the link must reach an
agreement about the options before the link can be
established.

• When PPP is carrying an LCP packet, it is either in the


establishing state or in the terminating state.

• All LCP packets are carried in the data field of the PPP frame.
What defines the frame as one carrying an LCP packet is the
value of the protocol field, which is set to C021 (base 16).
Link Control Protocol (LCP)
• Configuration packets are used to negotiate the options
between the two ends. There are four different types of
packets for this purpose: configure-request, configure-ack,
configure-nak, and configure-reject.

• Link termination packets. The link termination packets are


used to disconnect the link between two endpoints.
There are two types: terminate-request and terminate-ack.

• Link monitoring and debugging packets. These packets are


used for monitoring and debugging the link. There are five
types: code-reject, protocol-reject, echo-reply, discard-
request.
Link control protocol
(LCP)
• Establish
• Configure
• Terminate
An Example
Common options
Authentication Protocols
• Authentication plays a very important role in PPP because
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 uses two protocols for authentication: Password


Authentication Protocol (PAP) and Challenge Handshake
Authentication Protocol (CHAP)
PAP
• The PAP is a simple authentication procedure with two
steps:

1. The user who wants to access a system sends an ID


(identification) and a password.
2. The system checks the validity of the identification and
password and either accepts or denies a connection.

• For those systems that require greater security, PAP is not


enough. A third party with access to the link can easily pick
up the password and access the system resources.
Authentication protocols
(AP)
Password authentication PAP
CHAP
• The CHAP protocol is a three-way handshaking authentication
protocol that provides greater security than PAP.
• In this method, the password is kept secret; it is never sent on-
line.

Steps
• The system sends to 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.
CHAP
• The system does the same. It applies the same function to the
password of the user and the challenge value to create a
result. If the result created is the same as the result sent in
the response packet, access is granted; otherwise, it is
denied.
Authentication protocols
(AP)
Challenge handshake authentication (CHAP)
Network Control Protocol (NCP)

• After the link is established and authentication (if any) is


successful, the connection goes on the networking state.

• NCP is a set of control protocols to allow the encapsulation of


data coming from network layer protocols into the PPP frame.

• The set of packets that establish and terminate a network


layer connection is called Internetwork Protocol Control
Protocol (IPCP).
Network control protocols
(NCP)
Preparations for the
network layer– IPCP
for Internet
IP datagram encapsulated in a PPP frame

11.62
Let us go through the phases followed by a network layer
packet as it is transmitted through a PPP connection.
Figure shows the steps. For simplicity, we assume
unidirectional movement of data from the user site to the
system site (such as sending an e-mail through an ISP).
ATM
Multiplexing using different frame sizes
Note
A cell network uses the cell as the basic unit of data exchange.
A cell is defined as a small, fixed-size block of information.
Multiplexing using cells
What is Asynchronous Transfer
Mode (ATM)?
• Asynchronous Transfer Mode (ATM) is a connection-oriented, high-speed, low-delay
switching and transmission technology that uses short and fixed-size packets, called
cells, to transport information.

5 octets 48 octets

Header Information

53 octets

• Using the cell switching technique, ATM combines the benefits of both circuit
switching (low and constant delay, guaranteed capacity) and packet switching
(flexibility, efficiency for bursty traffic) to support the transmission of multimedia
traffic such as voice, video, image, and data over the same network.
ATM: What it is
• Asynchronous Transfer Mode
• A low-layer networking technology based on
fast packet-switching of small fixed size
packets called cells
• ATM provides a single transport mechanism
for integrated services traffic: data, voice,
video, image, graphics.
• All statistically multiplexed at ATM layer
ATM multiplexing
ATM: What it isn’t
• Synchronous Transfer Mode (STM)
• STM relies on pre-assigned “slots” for each
user within a frame, and global timing
information to mark frame boundaries
• Example: T1 transmission (1.544 Mbps)
Synchronous Transfer Mode
• STM relies on positional association: slots are
identified by their relative position from the
start of the frame (global timing info)
• Each user knows which slot(s) to use
• All slots are the same size (e.g., 8 bits)
• Bandwidth allocated in multiples of slots
• Efficient for Constant Bit Rate traffic
• Inefficient for Variable Bit Rate traffic
Asynchronous Transfer Mode
• ATM does not use a priori assignment of slots
to users
• Slots are assigned “on demand” on an as
needed basis
• Users can use whichever slots are empty
ATM Transmission

Slotted transmission scheme


All slots are the same size (53 bytes = 1 ATM cell)
Any user can use any empty slot
No notion of specific slots assigned to specific users
Bandwidth allocation in ATM may reserve a certain
percentage of the total slots for a given call, but which
slots you get is determined at time of transmission
Can support arbitrary bit rates
Asynchronous Transfer Mode
• No global timing relationship between slots
(i.e., cells) of different users (asynchronous)
• Efficient for Variable Bit Rate traffic
• Implication: the cell in each slot has to be
completely self-identifying (i.e., overhead)
Why ATM?
• International standard-based technology (for interoperability)
• Low network latency (for voice, video, and real-time applications)
• Low variance of delay (for voice and video transmission)
• Guaranteed quality of service
• High capacity switching (multi-giga bits per second)
• Bandwidth flexibility (dynamically assigned to users)
• Scalability (capacity may be increased on demand)
• Medium not shared for ATM LAN (no degradation in performance as traffic
load or number of users increases)
• Supports a wide range of user access speeds
• Appropriate (seamless integration) for LANs, MANs, and WANs
• Supports audio, video, imagery, and data traffic (for integrated services)
Advantages of ATM
• Better for bursty traffic (i.e., VBR)
• Statistical multiplexing gain
• Better network utilization
• Same mechanism works for all traffic types
• Simple and fast hardware switching
Characteristics of ATM
• Point to point technology
• Connection-oriented: an end-to-end
connection (called a virtual channel) must
be set up using a signalling protocol before
any data cells can be sent on that VC
• “Bandwidth on demand”
• Statistical multiplexing
• Integrated services
• ATM is a scalable technology
– scalable in bandwidth
– scalable in distance
– scalable in deployment
ATM: Scalable Bandwidth
• ATM is not tied to any particular bit rate or
physical layer network technology
• ATM is simply the abstract concept of fast
packet switching with small fixed size cells
• Can do low speed ATM (e.g., 1.5 Mbps)
• Can do high speed ATM (e.g., 155 Mbps)
• Primary interest: high speed ATM networks
ATM: Scalable Distance
• ATM can be used for LANs
• ATM can be used for MANs
• ATM can be used for WANs
• Initial market: ATM LANs, enterprise area
networks, LAN backbones
• Future: wide area network backbone, ATM to
the desktop, wireless ATM
ATM: Scalable Deployment
• Emphasis on interoperability, compatibility
• Incremental evolutionary path to ATM
• Ethernet => switched Ethernet => ATM hub
• Start with one switch, N ports, plus NICs
• Add more ports as needed
• Add more switches as needed
• Hierarchical cascading structure
The ATM reference protocol model consists of three planes:

Management Plane
User Plane
Control Plane
B-ISDN ATM Reference Model
Management Plane:
Two types of functions exist in this plane

Layer management: All the management functions related to


the resources and parameters residing in its protocol entities
such as signaling are performed by layer management.

Plane management: All the management functions that relate


to the whole system are located in the plane management.
USER PLANE:

The function of the user plane is to transfer the user information


from point A to point B in the network.

All associated mechanisms, such as flow control congestion


control, or recovery from errors are included.

CONTROL OR SIGNALING PLANE:

This plane is responsible for call control and connection control


functions related to setting up and tearing down a connection.
Architecture of an ATM network
ATM Connection Relationships
ATM Layer
Cell Formats
• UNI(User-Network Interface)
– Define boundary between a host and an ATM network
(between the customer and the carrier)

40 bits
• NNI(Network-Network Interface)
– Define boundary between two ATM switches

GFC : General Flow Control PTI : Payload Type


40 bits
VPI : Virtual Path Identifier CLP : Cell Loss Priority
VCI : Virtual Channel Identification HEC : Header Error Check
Payload type Meaning
000 User data cell, no congestion, cell type 0
001 User data cell, no congestion, cell type 1
010 User data cell, congestion experienced, cell type 0
011 User data cell, congestion experienced, cell type 1
100 Maintenance information between adjacent switches
101 Maintenance information between source and destination switch
110 Resource Management cell(used for ABR congestion control)
111 Reserved for future function
Data Link Layer in ATM
TC(Transmission Convergence) sublayer
• Cell Transmission
– takes a sequence of cells
– add HEC to each one ( HEC : Header Error Control )
– convert the result to bit stream
– match the bit stream to the speed of the underlying
physical transmission system by inserting OAM cells as
filler
– OAM : Operation And Maintenance
• Cell Reception
– takes an incoming bit stream
– locates cell boundaries
– verifies the header
– processes the OAM cells
– passes the data cell up to the ATM layer
• Locating the cell boundaries
– HUNT : Shifting bits into the shift registers one at a
time looking for a valid HEC
– PRESYNCH : shifts in the next 424 bits(5-bytes)
without examining them
Cell Payload Scrambling
• At source, scramble the cell payload
• At receiver, descramble the cell payload
• To increase the security and robustness
– To protect against malicious users or unintended
simulation of a correct HEC in the information field
Medium Access Control
Sublayer
• Two types of transmission technology

Point-to-Point Link Broadcast Link


• Channel Allocation
Problem

Who's first?
Channel Allocation
Problem

Static Method Dynamic Method


Static Channel Allocation
• FDM

• TDM

Wastage of resources when some of the users


are idle.
What if the number of users increase
Dynamic Channel Allocation :

Systems in which multiple users share a


common channel in a way that can lead to
conflicts are called contention systems.
The Channel Allocation Problem

Five key assumptions:


1. Station Model. The model consists of N independent
stations, each with a program or user that generates frames
for transmission.

The probability of a frame being generated in an interval of


length t is t, where  is a constant (the arrival rate of
new frames).

Once a frame has been generated, the station is blocked and


does nothing until the frame has been successfully
transmitted.
The Channel Allocation Problem
Dynamic Channel Allocation in LANs and MANs
Five key assumptions:

2. Single Channel Assumption. A single channel is available


for all communication. All stations can transmit on it and
all can receive from it.

As far as the hardware is concerned, all stations are


equivalent, although some protocol software may assign
priorities to them.
The Channel Allocation Problem
Dynamic Channel Allocation in LANs and MANs
Five key assumptions:

3. Collision Assumption. If two frames are transmitted


simultaneously, they overlap in time and the resulting
signal is garbled. This event is called a collision.

All stations can detect collisions. A collided frame must be


transmitted again alter. There are no errors other than those
generated by collisions.
The Channel Allocation Problem
Dynamic Channel Allocation in LANs and MANs
Five key assumptions:

4a. Continuous Time. Frame transmission can begin at any


instant. There is no master clock dividing time into discrete
intervals.

4b. Slotted Time. Time is divided into discrete intervals


(slots). Frame transmissions always begin at the start of a
slot. A slot may contain 0, 1, or more frames,
corresponding to an idle slot, a successful transmission, or
a collision, respectively.
The Channel Allocation Problem
Dynamic Channel Allocation in LANs and MANs
Five key assumptions:

5a. Carrier Sense. Stations can tell if the channel is in use


before trying to use it. If the channel is sensed as busy, no
station will attempt to use it until it goes idle.

5b. No Carrier Sense. Stations cannot sense the channel


before trying to use it. They just go ahead and transmit.
Only later can they determine whether or not the
transmission was successful.
Multiple Access Protocols
• ALOHA (by Norman Abramson in 1970) – No carrier
Sense
• Carrier Sense Multiple Access Protocols
• Collision-Free Protocols
• Limited-Contention Protocols

You might also like