SlideShare a Scribd company logo
Unit-2
Data Link Layer
• The data-link layer is located between the physical and the network layers.
• The data-link layer provides services to the network layer; it receives services from
the physical layer
• Communication at the data-link layer is node-to-node.
• A data unit from one point in the Internet needs to pass through many networks
(LANs and WANs) to reach another point.
• These LAN and WAN are connected by routers.
• Two end hosts and the routers as nodes and the networks in between as links
Services of Data-link layer
• When a packet is travelling in the Internet, the data-link layer of a
node (host or router) is responsible for delivering a datagram to the
next node in the path.
• Data-link layer of the sending node needs to encapsulate the datagram
received from the network in a frame. Data-link layer of the receiving
node needs to decapsulate the datagram from the frame.
• Encapsulation and Decapsulation is needed at each intermediate node.
• Reason: Each link may be using a different protocol with a different
frame format. Even if one link and the next are using the same
protocol, encapsulation and decapsulation are needed because the
link-layer addresses are normally different.
Framing
Link layer addressing
Flow Control
Error Control
Framing : First service provided by the data-link layer is framing
Link Layer Addressing
• In a connectionless internetwork such as the Internet we cannot make a datagram reach its destination using only IP addresses.
• The reason is that each datagram in the Internet, from the same source host to the same destination host, may take a different path.
• The source and destination IP addresses define the two ends but cannot define which links the datagram should pass through.
• We need to remember that the IP addresses in a datagram should not be changed. If the destination IP address in a datagram changes, the
packet never reaches its destination; if the source IP address in a datagram changes, the destination host or a router can never
communicate with the source if a response needs to be sent back or an error needs to be reported back to the source
• We need another addressing mechanism in a connectionless internetwork: the link-layer addresses of the two nodes.
• A link-layer address is sometimes called a link address, sometimes a physical address, and sometimes a MAC address.
• Since a link is controlled at the data-link layer, the addresses need to belong to the data-link layer.
When a datagram passes from the network layer to the data-link layer,
the datagram will be encapsulated in a frame and two data-link addresses
are added to the frame header. These two addresses are changed every
time the frame moves from one link to another.
Consider the figure shown in previous slide:
We have three links and two routers.
Two hosts: Alice as source and Bob as destination.
For each host, we have shown two addresses, the IP addresses (N) and the
link-layer addresses (L).
A router has as many pairs of addresses as the number of links the router is
connected to.
In the figure in the previous slide, it is shown three frames, one in each link.
Each frame carries the same datagram with the same source and destination
addresses (N1 and N8), but the link-layer addresses of the frame change from
link to link.
In link 1, the link-layer addresses are L1 and L2.
In link 2, they are L4 and L5.
In link 3, they are L7 and L8.
Note that the IP addresses and the link-layer addresses are not in the same
order.
For IP addresses, the source address comes before the destination address;
For link-layer addresses, the destination address comes before the source
Data Link Control
• Flow Control
• Error Control
MAC ADDRESS, IP ADDRESS AND OSI LAYER ITS FUNCTIONS
Stop and Wait
Sliding Window
 Sliding window protocols are data link layer protocols for
reliable and sequential delivery of data frames.
 The sliding window is also used in Transmission Control
Protocol (TCP).
 In this protocol, multiple frames can be sent by a sender at a
time before receiving an acknowledgment from the receiver.
 The term sliding window refers to the imaginary boxes to hold
frames.
 Sliding window method is also known as windowing
 In these protocols, the sender has a buffer called the sending
window and the receiver has buffer called the receiving window.
Sender Sliding Window
The size of the sending window determines the sequence number of the
outbound frames.
If the sequence number of the frames is an n-bit field in the protocol, then the
range of sequence numbers that can be assigned is 0 to 2𝑛
−1.
Thus, the size of the sending window is 2𝑛
−1.
The sequence numbers are numbered as modulo-n.
For example, if the sending window size is 8, then the sequence numbers will
be 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, and so on. The number of bits
in the sequence number is 3 to generate the binary sequence 000, 001, 010,
011,100,100,101,110,111
Receiver Sliding Window
The size of the receiving window is the maximum number of frames
that the receiver can accept at a time.
It determines the maximum number of frames that the sender can send
before receiving acknowledgment.
Sliding Window Example
Sender
Receiver
Difference between Stop and Wait and Sliding Window Protocol
Parameter Stop and Wait Protocol Sliding Window
Mechanism In Stop and Wait protocol, the
sender sends a single frame and
waits for an acknowledgment
from the receiver.
In Sliding window protocol, the sender
sends multiple frames at a time and
retransmits the damaged frames.
Window Size 1 Varies from 1 to n, where n is the
number of bits allotted in the protocol to
represent the sequence number
Sorting Sorting of frames is not needed. Sorting of frames helps to increase the
efficiency of the protocol.
Efficiency Stop and Wait protocol
efficiency is formulated as
1/(1+2a) where a is a ratio of
propagation delay to the
transmission delay.
Sliding Window protocol efficiency is
formulated as N/(1+2a) where N is no.
of window frames and a is a ratio of
propagation delay to the transmission
delay.
Duplex Stop and Wait protocol is half-
duplex in nature.
Sliding Window protocol is full-duplex
in nature.
Error Control
Damaged Frame
Stop and Wait Error Control Mechanism
Lost Frame
 The McGraw-Hill Companies, Inc., 1998
Stop and Wait Error Control Mechanism
Lost ACK
Stop and Wait Error Control Mechanism
Go-Back-n Error Control Mechanism
Normal Operation
Go-Back-n Error Control Mechanism
Lost Frame
Go-Back-n - Sender window size
Damaged Frame
Go-Back-n Error Control Mechanism
The size of the receiving window is 1.
Lost ACK
Go-Back-n Error Control Mechanism
Selective Reject Error Control Mechanism
The size of the receiving window is < 2n
-1.
Damaged Frame
Lost Frame
Selective Reject Error Control Mechanism
Difference between Stop and Wait, Go-Back-n and Selective Reject
Parameter Stop and Wait Go-Back-n Selective Reject
Sender window
size
Sender window size is 1. Sender window size is
less than 2𝑛
−1.
Sender window size is
equal to 2𝑛
−1.
Receiver Window
size
Receiver window size is
1
Receiver window size
is 1.
Receiver window size
is n.
Acknowledgement
Type
Individual Cumulative Individual
Supported Order no specific order is
needed at receiver end
In-order delivery only
are accepted at
receiver end
Out-of-order
deliveries also can be
accepted at receiver
end.
Re-transmission in case of packet drop,
number of re-
transmission is 1
in case of packet
drop, numbers of re-
transmissions are N
in case of packet
drop, number of re-
transmission is 1
HDLC
• High-level Data Link Control (HDLC)
• All bit oriented protocols are related to High-level
Data Link Control
• It is published by ISO.
• HDLC supports both half duplex and full duplex
modes in point to point and multipoint
configurations
• is a bit-oriented protocol. It implements ARQ
mechanisms
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Configuration
In this one device is primary and other is secondary
If it is point to point only two devices are involved
If it is multipoint one primary controlling several secondary's.
HDLC Configuration
Each physical station on a link consists of two logical stations
One primary and the other a secondary
Separate lines link the Primary of one physical station to
secondary aspect of another physical station.
HDLC Configuration
 In balanced types both the point to point topology are of
combined type.
 Stations are link by a single line
 That is controlled by either station
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC MODES
• HDLC supports three modes of communication
between station
Normal Response Mode (NRM)
Asynchronous Response Mode (ARM)
Asynchronous Balanced Mode (ABM)
HDLC MODES
Normal Response Mode (NRM)
Refers to standard Primary – Secondary relationship
In this mode, secondary device must have permission from the primary device before
transmitting
Once permission has been granted, the secondary may initiate a response transmission of
one or more frames containing data.
Asynchronous Response Mode (ARM)
Refers to standard Primary – Secondary relationship
In this mode, secondary device may initiate transmission without permission from the
primary whenever the channel is idle.
All transmissions from a secondary must be made to the primary for relay to a final
destination
Asynchronous Balanced Mode (ABM)
In this mode, all stations are equal
Only combined stations connected in point to point are used.
Either combined station may initiate transmission with the other combined station
without permission.
HDLC Frame Types
HDLC defines three types of frames:
Information frames (I-frames)
Supervisory frames (S-frames)
Unnumbered frames (U-frames)
Each type of frame works as an envelope for the transmission of a
different types of message
I-frames are used to transport user data and control information
relating to user data
 S-frames are used only to transport control information.
U-frames are reserved for system management.
Information carried by U-frames is intended for managing the link
itself.
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Frame Types
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Frame Types
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Frame Types
HDLC Frame Fields
Each frame in HDLC contains the following six
fields
 Beginning flag field
 Address field
 Control field
 Information field
 Frame check sequence (FCS) field
 Ending Flag field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Flag Field
Flag
It is an 8-bit sequence with the bit pattern 01111110 that identifies the beginning
and end of a frame.
It serves as a synchronization pattern for the receiver.
Bit Stuffing and removal
 HDLC uses a process called bit stuffing
 Sender wants to transmit a bit sequence having more than five consecutive
1s. It inserts one redundant 0 after the fifth 1
For example 011111111000 becomes 0111110111000
 It indicates the receiver that the current sequence is not a flag, its data
 Once the receiver has seen the stuffed 0, it is dropped from the data and the
original bit stream is restored.
 Bit stuffing is the process of adding one extra 0 whenever there are five
consecutive 1s in the data
 So that receiver does not mistake the data for a flag.
HDLC Address Field
 It contains address of the secondary station.
 If a primary station created the frame, it contains a to address.
 If a secondary creates the frame, it contains a from address.
 An address field can be 1 byte or several bytes, depending on the
network.
 If the address is only one byte, the last bit is always 1.
 If the address is more than one byte , all bytes but last one will end
with 0; and only the last will end with 1.
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC Control Field
HDLC Control Field
• Control field is a one or two byte segment of the frame
• It is used for flow management
• It differ depending on frame type
• If the first bit is 0 – the frame is an I Frame
• If the first bit is 1 and second bit is 0 – the frame is an S- Frame
• If the both first and second bits are 1s – the frame is a U frame.
• All three types of frames contain a bit called the Poll/Final (P/F) bit
Control Field of I-frame
 An I frame contains two 3 bit - flow [N(S)] and error control sequence
[N(R )], either side of P/F bit
 N(S) – Number of frame being sent
 N(R ) – Number of frame expected in return in a two way exchange
 N(R ) – is the acknowledgement field
 If the last frame is was error free – N(R ) number will be that of the
next frame in the sequence
 If the last frame was not received correctly
 N(R ) number will be number of the damaged frame indicating the
need for its retransmission
Control Field of S-Frame
• Control field of S Frame contains an N(R ) field but not N(S) field
• S- Frames are used to return N(R ) when the receiver does not have data
of its own to send
• ACK is contained in the control field of an I – Frame
• S- Frame - do not transmit data and so do not require N(S) field
• Two bits proceeding the P/F bit - are sued to carry coded flow and error
control information
• U – Frames have neither N(S) or N(R )
• It is not designed for user data exchange of ACL
• It have two code field – one two bits and other three bits either side of P/F bit
• These codes are used to identify the type of U frame and its functions
Control Field of U-Frame
Poll / Final
• P/F field is a single bit with a dual purpose
• When it is set (bit = 1) mean Poll or Final
• Poll  means when the frame is sent by a primary station to
secondary
• The address field contains the address of the receiver
• Final  means when the frame is send by a secondary to a primary
• When the address field contains the address of the sender
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Types of S – Frames
Receive ready (RR) : If the value of code is 00, it is an RR S-frame. This kind of frame
acknowledges the receipt of a safe frame or group of frames.
Receive not ready (RNR): If the value of code is 10, it is an RNR S-frame. It
acknowledges the receipt of a frame(s), and announces that the receiver is busy and
cannot receive more frames. It acts as a congestion control mechanism.
Reject (REJ): If the value of the code subfield is 01, it is a REJ S-frame. This is a
NAK frame used in Go-Back-N ARQ to inform the sender, before the sender time
expires, that the last frame is lost or damaged.
Selective reject (SREJ): If the value of the code subfield is 11, it is an SREJ S-frame.
This is a NAK frame used in Selective Repeat ARQ.
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
HDLC FCS Field
It is HDLC’s Error detection field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Use of P/F Field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Use of P/F Field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Use of P/F Field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Use of P/F Field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
Use of P/F Field
WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
U-Frame Control Field
Unnumbered frames are used to exchange session management
and control information between connected devices.
U-frame codes are divided into two sections: a 2-bit and 3-bit
before and after the P/F bit, i.e 32 different types of U-frames.
U-frame Control Field

More Related Content

PPTX
Different protocols for data communication networks
PPTX
Datalink control(framing,protocols)
PPTX
jjjjjjjjjjjjjjjjjjjjjjjjjjjLecture 11.pptx
PDF
document.pdf
PPT
data-link layer protocols
PPT
DataLinkControl.ppt
PPT
3a data link layer
PPT
UNIT-2 Data Link Layer Services, Functions PPT.ppt
Different protocols for data communication networks
Datalink control(framing,protocols)
jjjjjjjjjjjjjjjjjjjjjjjjjjjLecture 11.pptx
document.pdf
data-link layer protocols
DataLinkControl.ppt
3a data link layer
UNIT-2 Data Link Layer Services, Functions PPT.ppt

Similar to MAC ADDRESS, IP ADDRESS AND OSI LAYER ITS FUNCTIONS (20)

PPTX
New framing-protocols
PPT
CN_unit2.ppt Data Link Layer characteristics, categories
PPT
09 Data Link LayerFlow Control.ppt
PPTX
Dcn ppt by roma
PPTX
Computer Networks (Computer Engineering) Unit-3 Data Link Layer & its Protoco...
PPTX
Dcn ppt on data link layer
PPTX
Introduction to the Data link layer.pptx
PPT
DataLinkLayer.ppt ,bigtd6tykfh5er7iuhkmiytfr7
PPTX
A computer network is a system of interconnected devices that can share resou...
PDF
Data link layer (Unit 2).pdf
PPTX
Chapter 11: Data Link Control
PPTX
Computer networks module 2 data link layer
PPT
Dcn unit 2 ppt
PPTX
CN UNIT II.pptx
PPT
Flow Control (1).ppt
PPT
Data Link Layer Protocols in Wide Access Network.ppt
PPT
PPT
PPT
11 Data Link_Control
New framing-protocols
CN_unit2.ppt Data Link Layer characteristics, categories
09 Data Link LayerFlow Control.ppt
Dcn ppt by roma
Computer Networks (Computer Engineering) Unit-3 Data Link Layer & its Protoco...
Dcn ppt on data link layer
Introduction to the Data link layer.pptx
DataLinkLayer.ppt ,bigtd6tykfh5er7iuhkmiytfr7
A computer network is a system of interconnected devices that can share resou...
Data link layer (Unit 2).pdf
Chapter 11: Data Link Control
Computer networks module 2 data link layer
Dcn unit 2 ppt
CN UNIT II.pptx
Flow Control (1).ppt
Data Link Layer Protocols in Wide Access Network.ppt
11 Data Link_Control
Ad

More from elaelango (6)

PPTX
DISTANCE VECTOR ROUTING AND LINK STATE ROUTING
PPT
OSI LAYERS FUNCTIONS, TOPOLOGIES,LAN,WAN AND METROPOLITAN NETWORK
PPTX
18ECC303J-Unit1-Week1-AY2020-21.pptx
PDF
unit-4.pdf
PDF
WirelessCommunicationsbyTheodoreS.Rappaportz-lib.org.pdf
PDF
unit-5.pdf
DISTANCE VECTOR ROUTING AND LINK STATE ROUTING
OSI LAYERS FUNCTIONS, TOPOLOGIES,LAN,WAN AND METROPOLITAN NETWORK
18ECC303J-Unit1-Week1-AY2020-21.pptx
unit-4.pdf
WirelessCommunicationsbyTheodoreS.Rappaportz-lib.org.pdf
unit-5.pdf
Ad

Recently uploaded (20)

PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PPT on Performance Review to get promotions
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Well-logging-methods_new................
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
composite construction of structures.pdf
PPTX
web development for engineering and engineering
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
bas. eng. economics group 4 presentation 1.pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Safety Seminar civil to be ensured for safe working.
Operating System & Kernel Study Guide-1 - converted.pdf
PPT on Performance Review to get promotions
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Well-logging-methods_new................
UNIT-1 - COAL BASED THERMAL POWER PLANTS
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Foundation to blockchain - A guide to Blockchain Tech
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
composite construction of structures.pdf
web development for engineering and engineering
R24 SURVEYING LAB MANUAL for civil enggi
OOP with Java - Java Introduction (Basics)
bas. eng. economics group 4 presentation 1.pptx

MAC ADDRESS, IP ADDRESS AND OSI LAYER ITS FUNCTIONS

  • 1. Unit-2 Data Link Layer • The data-link layer is located between the physical and the network layers. • The data-link layer provides services to the network layer; it receives services from the physical layer • Communication at the data-link layer is node-to-node. • A data unit from one point in the Internet needs to pass through many networks (LANs and WANs) to reach another point. • These LAN and WAN are connected by routers. • Two end hosts and the routers as nodes and the networks in between as links
  • 2. Services of Data-link layer • When a packet is travelling in the Internet, the data-link layer of a node (host or router) is responsible for delivering a datagram to the next node in the path. • Data-link layer of the sending node needs to encapsulate the datagram received from the network in a frame. Data-link layer of the receiving node needs to decapsulate the datagram from the frame. • Encapsulation and Decapsulation is needed at each intermediate node. • Reason: Each link may be using a different protocol with a different frame format. Even if one link and the next are using the same protocol, encapsulation and decapsulation are needed because the link-layer addresses are normally different. Framing Link layer addressing Flow Control Error Control Framing : First service provided by the data-link layer is framing
  • 3. Link Layer Addressing • In a connectionless internetwork such as the Internet we cannot make a datagram reach its destination using only IP addresses. • The reason is that each datagram in the Internet, from the same source host to the same destination host, may take a different path. • The source and destination IP addresses define the two ends but cannot define which links the datagram should pass through. • We need to remember that the IP addresses in a datagram should not be changed. If the destination IP address in a datagram changes, the packet never reaches its destination; if the source IP address in a datagram changes, the destination host or a router can never communicate with the source if a response needs to be sent back or an error needs to be reported back to the source • We need another addressing mechanism in a connectionless internetwork: the link-layer addresses of the two nodes. • A link-layer address is sometimes called a link address, sometimes a physical address, and sometimes a MAC address. • Since a link is controlled at the data-link layer, the addresses need to belong to the data-link layer.
  • 4. When a datagram passes from the network layer to the data-link layer, the datagram will be encapsulated in a frame and two data-link addresses are added to the frame header. These two addresses are changed every time the frame moves from one link to another.
  • 5. Consider the figure shown in previous slide: We have three links and two routers. Two hosts: Alice as source and Bob as destination. For each host, we have shown two addresses, the IP addresses (N) and the link-layer addresses (L). A router has as many pairs of addresses as the number of links the router is connected to. In the figure in the previous slide, it is shown three frames, one in each link. Each frame carries the same datagram with the same source and destination addresses (N1 and N8), but the link-layer addresses of the frame change from link to link. In link 1, the link-layer addresses are L1 and L2. In link 2, they are L4 and L5. In link 3, they are L7 and L8. Note that the IP addresses and the link-layer addresses are not in the same order. For IP addresses, the source address comes before the destination address; For link-layer addresses, the destination address comes before the source
  • 6. Data Link Control • Flow Control • Error Control
  • 9. Sliding Window  Sliding window protocols are data link layer protocols for reliable and sequential delivery of data frames.  The sliding window is also used in Transmission Control Protocol (TCP).  In this protocol, multiple frames can be sent by a sender at a time before receiving an acknowledgment from the receiver.  The term sliding window refers to the imaginary boxes to hold frames.  Sliding window method is also known as windowing  In these protocols, the sender has a buffer called the sending window and the receiver has buffer called the receiving window.
  • 10. Sender Sliding Window The size of the sending window determines the sequence number of the outbound frames. If the sequence number of the frames is an n-bit field in the protocol, then the range of sequence numbers that can be assigned is 0 to 2𝑛 −1. Thus, the size of the sending window is 2𝑛 −1. The sequence numbers are numbered as modulo-n. For example, if the sending window size is 8, then the sequence numbers will be 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, and so on. The number of bits in the sequence number is 3 to generate the binary sequence 000, 001, 010, 011,100,100,101,110,111
  • 11. Receiver Sliding Window The size of the receiving window is the maximum number of frames that the receiver can accept at a time. It determines the maximum number of frames that the sender can send before receiving acknowledgment.
  • 15. Difference between Stop and Wait and Sliding Window Protocol Parameter Stop and Wait Protocol Sliding Window Mechanism In Stop and Wait protocol, the sender sends a single frame and waits for an acknowledgment from the receiver. In Sliding window protocol, the sender sends multiple frames at a time and retransmits the damaged frames. Window Size 1 Varies from 1 to n, where n is the number of bits allotted in the protocol to represent the sequence number Sorting Sorting of frames is not needed. Sorting of frames helps to increase the efficiency of the protocol. Efficiency Stop and Wait protocol efficiency is formulated as 1/(1+2a) where a is a ratio of propagation delay to the transmission delay. Sliding Window protocol efficiency is formulated as N/(1+2a) where N is no. of window frames and a is a ratio of propagation delay to the transmission delay. Duplex Stop and Wait protocol is half- duplex in nature. Sliding Window protocol is full-duplex in nature.
  • 17. Damaged Frame Stop and Wait Error Control Mechanism
  • 18. Lost Frame  The McGraw-Hill Companies, Inc., 1998 Stop and Wait Error Control Mechanism
  • 19. Lost ACK Stop and Wait Error Control Mechanism
  • 20. Go-Back-n Error Control Mechanism Normal Operation
  • 21. Go-Back-n Error Control Mechanism Lost Frame
  • 22. Go-Back-n - Sender window size
  • 23. Damaged Frame Go-Back-n Error Control Mechanism The size of the receiving window is 1.
  • 24. Lost ACK Go-Back-n Error Control Mechanism
  • 25. Selective Reject Error Control Mechanism The size of the receiving window is < 2n -1. Damaged Frame
  • 26. Lost Frame Selective Reject Error Control Mechanism
  • 27. Difference between Stop and Wait, Go-Back-n and Selective Reject Parameter Stop and Wait Go-Back-n Selective Reject Sender window size Sender window size is 1. Sender window size is less than 2𝑛 −1. Sender window size is equal to 2𝑛 −1. Receiver Window size Receiver window size is 1 Receiver window size is 1. Receiver window size is n. Acknowledgement Type Individual Cumulative Individual Supported Order no specific order is needed at receiver end In-order delivery only are accepted at receiver end Out-of-order deliveries also can be accepted at receiver end. Re-transmission in case of packet drop, number of re- transmission is 1 in case of packet drop, numbers of re- transmissions are N in case of packet drop, number of re- transmission is 1
  • 28. HDLC • High-level Data Link Control (HDLC) • All bit oriented protocols are related to High-level Data Link Control • It is published by ISO. • HDLC supports both half duplex and full duplex modes in point to point and multipoint configurations • is a bit-oriented protocol. It implements ARQ mechanisms
  • 29. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Configuration In this one device is primary and other is secondary If it is point to point only two devices are involved If it is multipoint one primary controlling several secondary's.
  • 30. HDLC Configuration Each physical station on a link consists of two logical stations One primary and the other a secondary Separate lines link the Primary of one physical station to secondary aspect of another physical station.
  • 31. HDLC Configuration  In balanced types both the point to point topology are of combined type.  Stations are link by a single line  That is controlled by either station
  • 32. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC MODES • HDLC supports three modes of communication between station Normal Response Mode (NRM) Asynchronous Response Mode (ARM) Asynchronous Balanced Mode (ABM)
  • 33. HDLC MODES Normal Response Mode (NRM) Refers to standard Primary – Secondary relationship In this mode, secondary device must have permission from the primary device before transmitting Once permission has been granted, the secondary may initiate a response transmission of one or more frames containing data. Asynchronous Response Mode (ARM) Refers to standard Primary – Secondary relationship In this mode, secondary device may initiate transmission without permission from the primary whenever the channel is idle. All transmissions from a secondary must be made to the primary for relay to a final destination Asynchronous Balanced Mode (ABM) In this mode, all stations are equal Only combined stations connected in point to point are used. Either combined station may initiate transmission with the other combined station without permission.
  • 34. HDLC Frame Types HDLC defines three types of frames: Information frames (I-frames) Supervisory frames (S-frames) Unnumbered frames (U-frames) Each type of frame works as an envelope for the transmission of a different types of message I-frames are used to transport user data and control information relating to user data  S-frames are used only to transport control information. U-frames are reserved for system management. Information carried by U-frames is intended for managing the link itself.
  • 35. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Frame Types
  • 36. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Frame Types
  • 37. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Frame Types
  • 38. HDLC Frame Fields Each frame in HDLC contains the following six fields  Beginning flag field  Address field  Control field  Information field  Frame check sequence (FCS) field  Ending Flag field
  • 39. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Flag Field Flag It is an 8-bit sequence with the bit pattern 01111110 that identifies the beginning and end of a frame. It serves as a synchronization pattern for the receiver.
  • 40. Bit Stuffing and removal  HDLC uses a process called bit stuffing  Sender wants to transmit a bit sequence having more than five consecutive 1s. It inserts one redundant 0 after the fifth 1 For example 011111111000 becomes 0111110111000  It indicates the receiver that the current sequence is not a flag, its data  Once the receiver has seen the stuffed 0, it is dropped from the data and the original bit stream is restored.  Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the data  So that receiver does not mistake the data for a flag.
  • 41. HDLC Address Field  It contains address of the secondary station.  If a primary station created the frame, it contains a to address.  If a secondary creates the frame, it contains a from address.  An address field can be 1 byte or several bytes, depending on the network.  If the address is only one byte, the last bit is always 1.  If the address is more than one byte , all bytes but last one will end with 0; and only the last will end with 1.
  • 42. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC Control Field
  • 43. HDLC Control Field • Control field is a one or two byte segment of the frame • It is used for flow management • It differ depending on frame type • If the first bit is 0 – the frame is an I Frame • If the first bit is 1 and second bit is 0 – the frame is an S- Frame • If the both first and second bits are 1s – the frame is a U frame. • All three types of frames contain a bit called the Poll/Final (P/F) bit
  • 44. Control Field of I-frame  An I frame contains two 3 bit - flow [N(S)] and error control sequence [N(R )], either side of P/F bit  N(S) – Number of frame being sent  N(R ) – Number of frame expected in return in a two way exchange  N(R ) – is the acknowledgement field  If the last frame is was error free – N(R ) number will be that of the next frame in the sequence  If the last frame was not received correctly  N(R ) number will be number of the damaged frame indicating the need for its retransmission
  • 45. Control Field of S-Frame • Control field of S Frame contains an N(R ) field but not N(S) field • S- Frames are used to return N(R ) when the receiver does not have data of its own to send • ACK is contained in the control field of an I – Frame • S- Frame - do not transmit data and so do not require N(S) field • Two bits proceeding the P/F bit - are sued to carry coded flow and error control information • U – Frames have neither N(S) or N(R ) • It is not designed for user data exchange of ACL • It have two code field – one two bits and other three bits either side of P/F bit • These codes are used to identify the type of U frame and its functions Control Field of U-Frame
  • 46. Poll / Final • P/F field is a single bit with a dual purpose • When it is set (bit = 1) mean Poll or Final • Poll  means when the frame is sent by a primary station to secondary • The address field contains the address of the receiver • Final  means when the frame is send by a secondary to a primary • When the address field contains the address of the sender
  • 47. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998
  • 48. Types of S – Frames Receive ready (RR) : If the value of code is 00, it is an RR S-frame. This kind of frame acknowledges the receipt of a safe frame or group of frames. Receive not ready (RNR): If the value of code is 10, it is an RNR S-frame. It acknowledges the receipt of a frame(s), and announces that the receiver is busy and cannot receive more frames. It acts as a congestion control mechanism. Reject (REJ): If the value of the code subfield is 01, it is a REJ S-frame. This is a NAK frame used in Go-Back-N ARQ to inform the sender, before the sender time expires, that the last frame is lost or damaged. Selective reject (SREJ): If the value of the code subfield is 11, it is an SREJ S-frame. This is a NAK frame used in Selective Repeat ARQ.
  • 49. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 HDLC FCS Field It is HDLC’s Error detection field
  • 50. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Use of P/F Field
  • 51. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Use of P/F Field
  • 52. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Use of P/F Field
  • 53. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Use of P/F Field
  • 54. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Use of P/F Field
  • 55. WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 U-Frame Control Field Unnumbered frames are used to exchange session management and control information between connected devices. U-frame codes are divided into two sections: a 2-bit and 3-bit before and after the P/F bit, i.e 32 different types of U-frames.