SlideShare a Scribd company logo
CS8591 – Computer
Networks
14.08.2020
Dr.S.Selvakanmani,
Assistant Professor II,
Department of Computer Science &
Engineering
Velammal Institute of Technology,
Chennai
www.selvakanmani.blogspot.com
2
Internet Connection might be instable…
Stay online…!!!!
3
Attend the Class with a notebook and pen..!
Install “Google meet” app in your mobile..!
Unit II
DATA-LINK LAYER & MEDIA ACCESS 9
Introduction – Link-Layer Addressing – DLC Services –
Data-Link Layer Protocols – HDLC – PPP – Media
Access Control – Wired LANs: Ethernet – Wireless LANs
– Introduction – IEEE 802.11, Bluetooth – Connecting
Devices.
4
CO2 - Build wired/wireless LAN and configure the networking
devices for a required scenario.
Recap
• ARP
• RARP
• Connection Vs Connectionless services
• DLC services – Framing
5
Recap: Address Resolution Protocol (ARP)
• ARP belongs to the network layer.
• ARP accepts an IP address from the IP protocol,
maps the address to the corresponding link-
layer address, and passes it to the data-link
layer.
Position of ARP in TCP/IP protocol suite
6
Recap: Reverse Address Resolution Protocol (RARP)
• RARP finds the logical address for a machine
that only knows its physical address.
• This often encountered on thin-client
workstations. No disk, so when machine is
booted, it needs to know its IP address
• RARP requests are broadcast, RARP replies are
unicast.
7
Recap: Framing
• A frame is a group of bits.
• Framing means organizing the bits into a
frame that are carried by the physical
layer.
• Framing separates a message from other
messages by adding sender-address &
destination-address.
• The destination address defines where the
packet is to go; the sender address helps the
recipient acknowledge the receipt
• Two types of frames
8
Type of Frame Size
1) Fixed-Size Framing
• There is no need for defining boundaries of
frames; the size itself can be used as a delimiter.
• For example: ATM WAN uses frames of fixed
size called cells.
2) Variable-Size Framing
• We need to define the end of the frame and the
beginning of the next frame.
• Two approaches are used:
1) Character-oriented approach
2) Bit-oriented approach
9
Character-Oriented Framing
• Data to be carried are 8-bit characters from a
coding system such as ASCII.
• The header and the trailer are also
multiples of 8 bits.
1) Header carries the source and destination-
addresses and other control information.
2) Trailer carries error-detection or error-
correction redundant bits.
• To separate one frame from the next frame, an
8- bit (I-byte) flag is added at the
beginning and the end of a frame.
• The flag signals the start or end of a frame.
10
A frame in a Character Oriented protocol
• Character-oriented framing is suitable when
only text is exchanged by the data-link-layers.
• The flag could be selected to be any character
not used for text communication
11
Problems
Problems in Character - Oriented
• However, if we send other type of information
(say audio/video), then any pattern used for the
flag can also be part of the information.
• If the flag-pattern appears in the data-section,
the receiver might think that it has reached the
end of the frame.
• Solution: A byte-stuffing is used.
• (Byte stuffing ->character stuffing)
• Byte Stuffing: In byte stuffing, a special byte is
added to the data-section of the frame when
there is a character with the same pattern as the
flag.
12
Byte Stuffing
• The data-section is stuffed with an extra byte.
This byte is called the escape character (ESC),
which has a predefined bit pattern.
• When a receiver encounters the ESC character,
the receiver
→ removes ESC character from the data-section
and
→ treats the next character as data, not a
delimiting flag.
13
14
Byte Stuffing and Unstuffing
• Byte stuffing is the process of adding one extra
byte whenever there is a flag or escape character
in the text.
15
Bit Oriented Approach
• The data-section of a frame is a sequence of bits
to be interpreted by the upper layer as text,
audio, video, and so on.
• However, in addition to headers and trailers, we
need a delimiter to separate one frame from the
other.
• Most protocols use a special 8-bit pattern flag
01111110 as the delimiter to define the
beginning and the end of the frame
16
Frame in Bit – Oriented Protocol
• If the flag-pattern appears in the data-section, the
receiver might think that it has reached the end of the
frame.
• Solution: A bit-stuffing is used.
• In bit stuffing, if a 0 and five consecutive 1 bits are
encountered, an extra 0 is added. This extra stuffed bit
is eventually removed from the data by the receiver.
17
Bit Stuffing and Unstuffing
• This guarantees that the flag field sequence does not
inadvertently appear in the frame.
• So, bit stuffing is the process of adding one
extra 0 whenever five consecutive 1s follow a 0
in the data, so that the receiver does not
mistake the pattern 0111110 for a flag
18
Flow Control and Error Control
• One of the responsibilities of the DLC sublayer is
flow and error control at the data-link layer.
Flow Control
• Whenever an entity produces data and another
entity consumes them, there should be a balance
between production and consumption rates.
• If the data are produced faster than they can be
consumed, the consumer can be overwhelmed
and may need to discard some dat.
• We need to prevent losing the data at the
consumer site.
19
Flow control @ DLL
• At the sending node, the data-link layer tries to
push frames toward the data-link layer at the
receiving node.
• If the receiving node cannot process and deliver
the packet to its network at the same rate that
the frames arrive, it becomes overwhelmed with
frames.
20
Flow control @ DLL
• Here, flow control can be feedback from the
receiving node to the sending node to stop or
slow down pushing frames.
Buffers
• Flow control can be implemented by using buffer.
• A buffer is a set of memory locations that can hold
packets at the sender and receiver.
• Normally, two buffers can be used.
• 1) First buffer at the sender.
• 2) Second buffer at the receiver.
21
Flow Control & Error Control
• The flow control communication can occur by
sending signals from the consumer to the
producer.
• When the buffer of the receiver is full, it informs
the sender to stop pushing frames.
Error Control
• Error-control includes both error-detection and
error-correction.
• Error-control allows the receiver to inform the
sender of any frames lost/damaged in
transmission.
22
Error Control
• A CRC is
→ added to the frame header by the sender and
→ checked by the receiver.
• At the data-link layer, error control is normally
implemented using one of the following two
methods.
1)First method: If the frame is corrupted, it
is discarded;
▫ If the frame is not corrupted, the packet is
delivered to the network layer.
• This method is used mostly in wired LANs such
as Ethernet.
23
Error Control
2)Second method: If the frame is corrupted, it
is discarded;
▫ If the frame is not corrupted, an acknowledgment is
sent to the sender.
• Acknowledgment is used for the purpose of both flow
and error control.
Combination of Flow and Error Control
• The acknowledgment that is sent for flow control can also
be used for error control to tell the sender the packet has
arrived uncorrupted.
• The lack of acknowledgment means that there is a problem
in the sent frame.
• A frame that carries an acknowledgment is normally called
an ACK to distinguish it from the data frame.
24
2.4 Data link layer Protocols
• A protocol in data communications is the set of
rules or specifications used to implement one or
more layers of the OSI model.
• Data link protocols are sets of specifications
used to implement the data link layer.
• Traditionally four protocols have been defined
for the data-link layer to deal with flow and error
control: Simple, Stop-and-Wait, Go-Back- N,
and Selective-Repeat.
25
Finite State Machine (FSM)
• The behavior of a data-link-layer protocol can be
better shown using Finite State Machine (FSM)
• We have used rounded-corner rectangles to show
states, colored text to show events, and regular
black text to show actions.
26
Finite State Machine (FSM)
• An FSM is thought of as a machine with a finite
number of states.
• The machine is always in one of the states until
an event occurs.
• Each event is associated with two reactions:
defining the list of actions to be performed and
determining the next state (which can be the
same as the current state).
• One of the states must be defined as the initial
state, the state in which the machine starts when
it turns on.
27
Simple Protocol
• Our first protocol is a simple protocol with
neither flow nor error control.
• We assume that the receiver can immediately
handle any frame it receives. In other words, the
receiver can never be overwhelmed with
incoming frames.
• Below Figure 11.7 shows the layout for this
protocol.
28
FSM of Simple Protocol
• The sender site should not send a frame until its network
layer has a message to send.
• The receiver site cannot deliver a message to its network
layer until a frame arrives.
• We can show these requirements using two FSMs. Each
FSM has only one state, the ready state.
• The sending machine remains in the ready state until a
request comes from the network layer.
• When this event occurs, the sending machine
encapsulates the message in a frame and sends it to the
receiving machine.
• The receiving machine remains in the ready state until a
frame arrives from the sending machine.
29
FSM of Simple Protocol
30
Stop and Wait Protocol
• Sender sends one data frame, waits for
acknowledgement (ACK) from receiver before
proceeding to transmit next frame.
• This simple flow control will break down if ACK
gets lost or errors occur then sender may wait
for the ACK that never arrives
31
FSM of Stop and Wait Protocol
32
Reference Links
33
https://www.youtube.com/watch?v=3WPrKiBp4cs
NPTEL:
https://www.youtube.com/watch?v=bhU2nRF36q4
37
38

More Related Content

Similar to Unit 2 ppt 3.ppt

Computer Network
Computer NetworkComputer Network
Computer Network
Rubaya Mim
 
Computer network coe351- part4- final
Computer network coe351- part4- finalComputer network coe351- part4- final
Computer network coe351- part4- final
Taymoor Nazmy
 
CN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptxCN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptx
Pondinesh2
 
Unit 2
Unit 2Unit 2
Unit 2
APARNA P
 
Presentation of computer network on data link layer
Presentation of computer network on data link layerPresentation of computer network on data link layer
Presentation of computer network on data link layer
sumit gyawali
 
Unit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part AUnit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part A
Chandan Gupta Bhagat
 
module 2 cn new.pptx
module 2 cn new.pptxmodule 2 cn new.pptx
module 2 cn new.pptx
DrPreethiD1
 
DLL
DLLDLL
Frame relay
Frame relayFrame relay
Data link layer
Data link layerData link layer
Data link layer
Hassanein Alwan
 
III_UNIT.ppt
III_UNIT.pptIII_UNIT.ppt
III_UNIT.ppt
ShantanuDharekar
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
Joshuaeeda1
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
MelkamuEndale1
 
Data link layer
Data link layerData link layer
Data link layer
sbkbca
 
unit2-210710110327.pptx
unit2-210710110327.pptxunit2-210710110327.pptx
unit2-210710110327.pptx
LAVANYAsrietacin
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
TamiratDejene1
 
Data link layer
Data link layer Data link layer
Data link layer
Mukesh Chinta
 
A427 nic card
A427 nic cardA427 nic card
A427 nic card
surajbhai
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
k2w9psdb96
 
Mobile computing unit-5
Mobile computing unit-5Mobile computing unit-5
Mobile computing unit-5
Ramesh Babu
 

Similar to Unit 2 ppt 3.ppt (20)

Computer Network
Computer NetworkComputer Network
Computer Network
 
Computer network coe351- part4- final
Computer network coe351- part4- finalComputer network coe351- part4- final
Computer network coe351- part4- final
 
CN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptxCN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
Presentation of computer network on data link layer
Presentation of computer network on data link layerPresentation of computer network on data link layer
Presentation of computer network on data link layer
 
Unit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part AUnit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part A
 
module 2 cn new.pptx
module 2 cn new.pptxmodule 2 cn new.pptx
module 2 cn new.pptx
 
DLL
DLLDLL
DLL
 
Frame relay
Frame relayFrame relay
Frame relay
 
Data link layer
Data link layerData link layer
Data link layer
 
III_UNIT.ppt
III_UNIT.pptIII_UNIT.ppt
III_UNIT.ppt
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
Data link layer
Data link layerData link layer
Data link layer
 
unit2-210710110327.pptx
unit2-210710110327.pptxunit2-210710110327.pptx
unit2-210710110327.pptx
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
 
Data link layer
Data link layer Data link layer
Data link layer
 
A427 nic card
A427 nic cardA427 nic card
A427 nic card
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
Mobile computing unit-5
Mobile computing unit-5Mobile computing unit-5
Mobile computing unit-5
 

Recently uploaded

ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 

Recently uploaded (20)

ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 

Unit 2 ppt 3.ppt

  • 1. CS8591 – Computer Networks 14.08.2020 Dr.S.Selvakanmani, Assistant Professor II, Department of Computer Science & Engineering Velammal Institute of Technology, Chennai www.selvakanmani.blogspot.com
  • 2. 2
  • 3. Internet Connection might be instable… Stay online…!!!! 3 Attend the Class with a notebook and pen..! Install “Google meet” app in your mobile..!
  • 4. Unit II DATA-LINK LAYER & MEDIA ACCESS 9 Introduction – Link-Layer Addressing – DLC Services – Data-Link Layer Protocols – HDLC – PPP – Media Access Control – Wired LANs: Ethernet – Wireless LANs – Introduction – IEEE 802.11, Bluetooth – Connecting Devices. 4 CO2 - Build wired/wireless LAN and configure the networking devices for a required scenario.
  • 5. Recap • ARP • RARP • Connection Vs Connectionless services • DLC services – Framing 5
  • 6. Recap: Address Resolution Protocol (ARP) • ARP belongs to the network layer. • ARP accepts an IP address from the IP protocol, maps the address to the corresponding link- layer address, and passes it to the data-link layer. Position of ARP in TCP/IP protocol suite 6
  • 7. Recap: Reverse Address Resolution Protocol (RARP) • RARP finds the logical address for a machine that only knows its physical address. • This often encountered on thin-client workstations. No disk, so when machine is booted, it needs to know its IP address • RARP requests are broadcast, RARP replies are unicast. 7
  • 8. Recap: Framing • A frame is a group of bits. • Framing means organizing the bits into a frame that are carried by the physical layer. • Framing separates a message from other messages by adding sender-address & destination-address. • The destination address defines where the packet is to go; the sender address helps the recipient acknowledge the receipt • Two types of frames 8
  • 9. Type of Frame Size 1) Fixed-Size Framing • There is no need for defining boundaries of frames; the size itself can be used as a delimiter. • For example: ATM WAN uses frames of fixed size called cells. 2) Variable-Size Framing • We need to define the end of the frame and the beginning of the next frame. • Two approaches are used: 1) Character-oriented approach 2) Bit-oriented approach 9
  • 10. Character-Oriented Framing • Data to be carried are 8-bit characters from a coding system such as ASCII. • The header and the trailer are also multiples of 8 bits. 1) Header carries the source and destination- addresses and other control information. 2) Trailer carries error-detection or error- correction redundant bits. • To separate one frame from the next frame, an 8- bit (I-byte) flag is added at the beginning and the end of a frame. • The flag signals the start or end of a frame. 10
  • 11. A frame in a Character Oriented protocol • Character-oriented framing is suitable when only text is exchanged by the data-link-layers. • The flag could be selected to be any character not used for text communication 11 Problems
  • 12. Problems in Character - Oriented • However, if we send other type of information (say audio/video), then any pattern used for the flag can also be part of the information. • If the flag-pattern appears in the data-section, the receiver might think that it has reached the end of the frame. • Solution: A byte-stuffing is used. • (Byte stuffing ->character stuffing) • Byte Stuffing: In byte stuffing, a special byte is added to the data-section of the frame when there is a character with the same pattern as the flag. 12
  • 13. Byte Stuffing • The data-section is stuffed with an extra byte. This byte is called the escape character (ESC), which has a predefined bit pattern. • When a receiver encounters the ESC character, the receiver → removes ESC character from the data-section and → treats the next character as data, not a delimiting flag. 13
  • 14. 14
  • 15. Byte Stuffing and Unstuffing • Byte stuffing is the process of adding one extra byte whenever there is a flag or escape character in the text. 15
  • 16. Bit Oriented Approach • The data-section of a frame is a sequence of bits to be interpreted by the upper layer as text, audio, video, and so on. • However, in addition to headers and trailers, we need a delimiter to separate one frame from the other. • Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning and the end of the frame 16
  • 17. Frame in Bit – Oriented Protocol • If the flag-pattern appears in the data-section, the receiver might think that it has reached the end of the frame. • Solution: A bit-stuffing is used. • In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an extra 0 is added. This extra stuffed bit is eventually removed from the data by the receiver. 17
  • 18. Bit Stuffing and Unstuffing • This guarantees that the flag field sequence does not inadvertently appear in the frame. • So, bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag 18
  • 19. Flow Control and Error Control • One of the responsibilities of the DLC sublayer is flow and error control at the data-link layer. Flow Control • Whenever an entity produces data and another entity consumes them, there should be a balance between production and consumption rates. • If the data are produced faster than they can be consumed, the consumer can be overwhelmed and may need to discard some dat. • We need to prevent losing the data at the consumer site. 19
  • 20. Flow control @ DLL • At the sending node, the data-link layer tries to push frames toward the data-link layer at the receiving node. • If the receiving node cannot process and deliver the packet to its network at the same rate that the frames arrive, it becomes overwhelmed with frames. 20
  • 21. Flow control @ DLL • Here, flow control can be feedback from the receiving node to the sending node to stop or slow down pushing frames. Buffers • Flow control can be implemented by using buffer. • A buffer is a set of memory locations that can hold packets at the sender and receiver. • Normally, two buffers can be used. • 1) First buffer at the sender. • 2) Second buffer at the receiver. 21
  • 22. Flow Control & Error Control • The flow control communication can occur by sending signals from the consumer to the producer. • When the buffer of the receiver is full, it informs the sender to stop pushing frames. Error Control • Error-control includes both error-detection and error-correction. • Error-control allows the receiver to inform the sender of any frames lost/damaged in transmission. 22
  • 23. Error Control • A CRC is → added to the frame header by the sender and → checked by the receiver. • At the data-link layer, error control is normally implemented using one of the following two methods. 1)First method: If the frame is corrupted, it is discarded; ▫ If the frame is not corrupted, the packet is delivered to the network layer. • This method is used mostly in wired LANs such as Ethernet. 23
  • 24. Error Control 2)Second method: If the frame is corrupted, it is discarded; ▫ If the frame is not corrupted, an acknowledgment is sent to the sender. • Acknowledgment is used for the purpose of both flow and error control. Combination of Flow and Error Control • The acknowledgment that is sent for flow control can also be used for error control to tell the sender the packet has arrived uncorrupted. • The lack of acknowledgment means that there is a problem in the sent frame. • A frame that carries an acknowledgment is normally called an ACK to distinguish it from the data frame. 24
  • 25. 2.4 Data link layer Protocols • A protocol in data communications is the set of rules or specifications used to implement one or more layers of the OSI model. • Data link protocols are sets of specifications used to implement the data link layer. • Traditionally four protocols have been defined for the data-link layer to deal with flow and error control: Simple, Stop-and-Wait, Go-Back- N, and Selective-Repeat. 25
  • 26. Finite State Machine (FSM) • The behavior of a data-link-layer protocol can be better shown using Finite State Machine (FSM) • We have used rounded-corner rectangles to show states, colored text to show events, and regular black text to show actions. 26
  • 27. Finite State Machine (FSM) • An FSM is thought of as a machine with a finite number of states. • The machine is always in one of the states until an event occurs. • Each event is associated with two reactions: defining the list of actions to be performed and determining the next state (which can be the same as the current state). • One of the states must be defined as the initial state, the state in which the machine starts when it turns on. 27
  • 28. Simple Protocol • Our first protocol is a simple protocol with neither flow nor error control. • We assume that the receiver can immediately handle any frame it receives. In other words, the receiver can never be overwhelmed with incoming frames. • Below Figure 11.7 shows the layout for this protocol. 28
  • 29. FSM of Simple Protocol • The sender site should not send a frame until its network layer has a message to send. • The receiver site cannot deliver a message to its network layer until a frame arrives. • We can show these requirements using two FSMs. Each FSM has only one state, the ready state. • The sending machine remains in the ready state until a request comes from the network layer. • When this event occurs, the sending machine encapsulates the message in a frame and sends it to the receiving machine. • The receiving machine remains in the ready state until a frame arrives from the sending machine. 29
  • 30. FSM of Simple Protocol 30
  • 31. Stop and Wait Protocol • Sender sends one data frame, waits for acknowledgement (ACK) from receiver before proceeding to transmit next frame. • This simple flow control will break down if ACK gets lost or errors occur then sender may wait for the ACK that never arrives 31
  • 32. FSM of Stop and Wait Protocol 32
  • 34. 37
  • 35. 38