IT22501 – DATA
COMMUNICATION AND
NETWORKING
Unit I I – Data Link Layer
UNIT II DATALINK LAYER 6
Introduction-nodes and link-Two types of links-Two
sublayers -Data link control: Framing-Error Control-Two
DLC protocols – Link-Layer Addressing – DLC Services –
Data-Link Layer Protocols – HDLC.
Definition of Network Units: Packet, Fragment, Frame,
Datagram, and Segment
 The data in network - bytes.
 The data bytes have their specific format in each layer of
OSI networking model or depending on the used protocol or
connections.
 They can be of - packet, fragment, frame, datagram, and
segment.
PACKETS
– is the basic unit of communication between a source and
destination in a network.
They are the data units within the network layer of OSI model.
Each packet contain a
• header with source, destination IP addresses
• a field for protocol specification
• the data
• a trailer – with error correction, flags etc.
 It helps in managing bandwidth, routes, and other
devices that they share and receive packets independently.
 It makes it easier to retransmit lost pieces of data
FRAGMENTS
In network there is a pre-defined maximum size of the data to be transmitted
called the Maximum Transmitted Unit (MTU).
But the packets can be larger than the maximum size.
So, each packet which is larger than the MTU is divided into smaller pieces of
data called fragments.
The network layer is responsible for fragmentation
If the packet had a flag Don’t fragment (DF) = 1, then the packet is discarded.
Else depending upon the fragment size, it
O create the header
O encapsulate the fragment with header
O send them to next layer
 The receiver reassembles the IP fragments into the packets and forwards
them to higher layer.
FRAGMENT
In network there is a pre-defined maximum size of the data to be
transmitted called the Maximum Transmitted Unit (MTU). But the
packets can be larger than the maximum size. So, each packet
which is larger than the MTU is divided into smaller pieces of data
called fragments.
 The network layer is responsible for fragmentation
 If the packet had a flag Don’t fragment (DF) = 1, then the
packet is discarded.
 Else depending upon the fragment size, it
O create the header
O encapsulate the fragment with header
O send them to next layer
 The receiver reassembles the IP fragments into the packets and
forwards them to higher layer.
INTRODUCTION TO NODES AND LINKS
NODES AND LINKS
• Communication at data-link layer is node-to-node where
application, transport, and network layer is end-to-end
FUNCTIONS OF DATA LINK LAYER
• Controls the medium and its capacity
• Transmitting frames from one node to another node
• Transfer datagrams across links
• Framing – bits to frames
• Physical addressing – adds header to frames – source and
destination address
• Flow control – what is flow control?
• Error control – retransmitting lost frames, prevent duplicate
frames
• MAC – which device has control over the link at any
instance
TWO TYPES OF LINKS
o a point-to-point is a dedicated link between two links.
e.g. home phones
o a broadcast link is shared between several pair of
devices. e.g. mobile phones
TWO SUBLAYERS
The service provided by the data-link layer can be divided
into two sublayer services –
i. data-link control (DLC) – deals with both point-to-point
and broadcast links
ii. media access control (MAC) – deals only with the issues
specific to broadcast links.
DLC – DATA LINK CONTROL
• Is the communication procedure – node-to-node or
broadcast
• Framing
• Error control
FRAMING
• Physical layer bits transmission and their synchronization
• In data-link layer
• Pack bots into frames
• i.e. framing
• Adds senders address and receivers address – source and
destination address
• Why full message not in single frame?----------
• Types of framing
• Fixed length framing-----?
• Variable length framing-------?
• Character-oriented or byte-oriented
• Bit-oriented
CHARACTER-ORIENTED FRAMING
A frame
- Header  source, destination and control information
- trailer – error deduction redundant bit - 8 bits
- byte-stuffing  a special character – escape sequence
(ESC) – indicates the end of frame – also called as a flag
- On receiving the escape character is removed
Problem:
- If same bytes (ESC) are as text – make confusions
- It may be removed – collapses the data
Solution:
- Add another escape sequence within the text
- What happen if
- ESC (flag)ESC(text)  ESC ESC ESC  indicates ESC belongs
to text
A COMMUNICATION WITH ONLY THREE NODES
BYTE ORIENTED FRAMING
• Delimiter flag – 8-bit number – 01111110 – added to start and
end of frame
• Problem - text has a similar flag bits as data
• Solution
• As 6 consecutive 1’s add 0 to it as extra bit
• If data = (flaglike pattern) 01111110 it is changed to
011111010 (stuffed)
ERROR CONTROL
- includes error detection and correction
-error is caused due to interference
Types of ERRORS:
1. single-bit error – one bit is changed
2. Bust error – 2 or more bits are changed
• Redundancy – detecting or correcting errors – adding extra
bits – called redundant bits
• Error detection – is there an error or not?
• Error Correction – finding the exact corrupted bits and their
location
• Coding – for redundancy
• Sender adds 1 or few bits to make a relationship b/w
actual and redundant bits
• The relationship is again checked in receiver side via
• Block coding
• Convolution coding
BLOCK CODING
• Messages divided into blocks (k-bits) – the dataword
• Add r – redundant bits
• Now length of codeword is n = k + r
• With k and n there are 2^k and 2^n possibilities and n > k
• As the process is 1-to-1  each data word is related to same
codeword
•  2n-2k code words are neglected
• Easy to check
ERROR DETECTION
• When to change the original codeword?
1. The receiver has (or can find) a list of valid codewords.
2. The original codeword has changed to an invalid one.
Problems:
Let us assume that k = 2 and n = 3. The Table shows the list of
datawords and codewords.
k = 2 and n = 3
Assume the sender encodes the dataword 01 as 011 and sends it to
the receiver. Consider the following cases:
1. The receiver receives uncorrupted codeword 011  valid
codeword dataword 01 is extracted from it.
2. If the corrupted codeword 111(left-most bit is corrupted) is
received  it is not valid and is discarded.
3. If the corrupted codeword 000 (right 2 bits are corrupted)
incorrect data still valid codeword
  dataword 00 received as an
undetectable error word.
Datawor
ds
Codewor
ds
Datawor
ds
Codewor
ds
00 000 10 101
01 011 11 110
• Hamming distance – no. of differences between the
corresponding bits of words x and y
• This defines the no. of corrupted bits during transaction
How to find the hamming distanc?
X ⊕ Y >=0 and count the number of 1s in result
Problem – find the hamming distance between the two words
000 and 011.
d(000, 011) = 000 011 = 011 i.e., 2
⊕
Problem – find the hamming distance between the two words
10101 and 11110.
d(10101, 11110) = 10101 11110 = 01011
⊕
• Hamming distance = s +1  s errors are there in the received
bit
• If s errors occur during transmission, the Hamming distance
between the sent codeword and received codeword is s. If
our system is to detect up to s errors, the minimum distance
between the valid codes must be (s + 1) so that the received
codeword does not match a valid codeword.
• i.e., if the minimum distance between all valid codewords is
(s + 1), the received codeword cannot be erroneously
mistaken for another codeword. The error will be detected.
• Although a code with dmin = s + 1 may be able to detect
more than s errors in some special cases, only s or fewer
errors are guaranteed to be detected.

Data Structures unit I just look to learn the contents

  • 1.
    IT22501 – DATA COMMUNICATIONAND NETWORKING Unit I I – Data Link Layer
  • 2.
    UNIT II DATALINKLAYER 6 Introduction-nodes and link-Two types of links-Two sublayers -Data link control: Framing-Error Control-Two DLC protocols – Link-Layer Addressing – DLC Services – Data-Link Layer Protocols – HDLC.
  • 3.
    Definition of NetworkUnits: Packet, Fragment, Frame, Datagram, and Segment  The data in network - bytes.  The data bytes have their specific format in each layer of OSI networking model or depending on the used protocol or connections.  They can be of - packet, fragment, frame, datagram, and segment.
  • 4.
    PACKETS – is thebasic unit of communication between a source and destination in a network. They are the data units within the network layer of OSI model. Each packet contain a • header with source, destination IP addresses • a field for protocol specification • the data • a trailer – with error correction, flags etc.  It helps in managing bandwidth, routes, and other devices that they share and receive packets independently.  It makes it easier to retransmit lost pieces of data
  • 5.
    FRAGMENTS In network thereis a pre-defined maximum size of the data to be transmitted called the Maximum Transmitted Unit (MTU). But the packets can be larger than the maximum size. So, each packet which is larger than the MTU is divided into smaller pieces of data called fragments. The network layer is responsible for fragmentation If the packet had a flag Don’t fragment (DF) = 1, then the packet is discarded. Else depending upon the fragment size, it O create the header O encapsulate the fragment with header O send them to next layer  The receiver reassembles the IP fragments into the packets and forwards them to higher layer.
  • 6.
    FRAGMENT In network thereis a pre-defined maximum size of the data to be transmitted called the Maximum Transmitted Unit (MTU). But the packets can be larger than the maximum size. So, each packet which is larger than the MTU is divided into smaller pieces of data called fragments.  The network layer is responsible for fragmentation  If the packet had a flag Don’t fragment (DF) = 1, then the packet is discarded.  Else depending upon the fragment size, it O create the header O encapsulate the fragment with header O send them to next layer  The receiver reassembles the IP fragments into the packets and forwards them to higher layer.
  • 7.
  • 9.
    NODES AND LINKS •Communication at data-link layer is node-to-node where application, transport, and network layer is end-to-end
  • 10.
    FUNCTIONS OF DATALINK LAYER • Controls the medium and its capacity • Transmitting frames from one node to another node • Transfer datagrams across links • Framing – bits to frames • Physical addressing – adds header to frames – source and destination address • Flow control – what is flow control? • Error control – retransmitting lost frames, prevent duplicate frames • MAC – which device has control over the link at any instance
  • 11.
    TWO TYPES OFLINKS o a point-to-point is a dedicated link between two links. e.g. home phones o a broadcast link is shared between several pair of devices. e.g. mobile phones
  • 12.
    TWO SUBLAYERS The serviceprovided by the data-link layer can be divided into two sublayer services – i. data-link control (DLC) – deals with both point-to-point and broadcast links ii. media access control (MAC) – deals only with the issues specific to broadcast links.
  • 13.
    DLC – DATALINK CONTROL • Is the communication procedure – node-to-node or broadcast • Framing • Error control
  • 14.
    FRAMING • Physical layerbits transmission and their synchronization • In data-link layer • Pack bots into frames • i.e. framing • Adds senders address and receivers address – source and destination address • Why full message not in single frame?---------- • Types of framing • Fixed length framing-----? • Variable length framing-------? • Character-oriented or byte-oriented • Bit-oriented
  • 15.
    CHARACTER-ORIENTED FRAMING A frame -Header  source, destination and control information - trailer – error deduction redundant bit - 8 bits - byte-stuffing  a special character – escape sequence (ESC) – indicates the end of frame – also called as a flag - On receiving the escape character is removed
  • 16.
    Problem: - If samebytes (ESC) are as text – make confusions - It may be removed – collapses the data Solution: - Add another escape sequence within the text - What happen if - ESC (flag)ESC(text)  ESC ESC ESC  indicates ESC belongs to text
  • 17.
    A COMMUNICATION WITHONLY THREE NODES
  • 18.
    BYTE ORIENTED FRAMING •Delimiter flag – 8-bit number – 01111110 – added to start and end of frame • Problem - text has a similar flag bits as data • Solution • As 6 consecutive 1’s add 0 to it as extra bit • If data = (flaglike pattern) 01111110 it is changed to 011111010 (stuffed)
  • 20.
    ERROR CONTROL - includeserror detection and correction -error is caused due to interference Types of ERRORS: 1. single-bit error – one bit is changed 2. Bust error – 2 or more bits are changed
  • 21.
    • Redundancy –detecting or correcting errors – adding extra bits – called redundant bits • Error detection – is there an error or not? • Error Correction – finding the exact corrupted bits and their location • Coding – for redundancy • Sender adds 1 or few bits to make a relationship b/w actual and redundant bits • The relationship is again checked in receiver side via • Block coding • Convolution coding
  • 22.
    BLOCK CODING • Messagesdivided into blocks (k-bits) – the dataword • Add r – redundant bits • Now length of codeword is n = k + r • With k and n there are 2^k and 2^n possibilities and n > k • As the process is 1-to-1  each data word is related to same codeword •  2n-2k code words are neglected • Easy to check
  • 23.
    ERROR DETECTION • Whento change the original codeword? 1. The receiver has (or can find) a list of valid codewords. 2. The original codeword has changed to an invalid one.
  • 24.
    Problems: Let us assumethat k = 2 and n = 3. The Table shows the list of datawords and codewords. k = 2 and n = 3 Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider the following cases: 1. The receiver receives uncorrupted codeword 011  valid codeword dataword 01 is extracted from it. 2. If the corrupted codeword 111(left-most bit is corrupted) is received  it is not valid and is discarded. 3. If the corrupted codeword 000 (right 2 bits are corrupted) incorrect data still valid codeword   dataword 00 received as an undetectable error word. Datawor ds Codewor ds Datawor ds Codewor ds 00 000 10 101 01 011 11 110
  • 25.
    • Hamming distance– no. of differences between the corresponding bits of words x and y • This defines the no. of corrupted bits during transaction How to find the hamming distanc? X ⊕ Y >=0 and count the number of 1s in result Problem – find the hamming distance between the two words 000 and 011. d(000, 011) = 000 011 = 011 i.e., 2 ⊕ Problem – find the hamming distance between the two words 10101 and 11110. d(10101, 11110) = 10101 11110 = 01011 ⊕
  • 26.
    • Hamming distance= s +1  s errors are there in the received bit • If s errors occur during transmission, the Hamming distance between the sent codeword and received codeword is s. If our system is to detect up to s errors, the minimum distance between the valid codes must be (s + 1) so that the received codeword does not match a valid codeword. • i.e., if the minimum distance between all valid codewords is (s + 1), the received codeword cannot be erroneously mistaken for another codeword. The error will be detected. • Although a code with dmin = s + 1 may be able to detect more than s errors in some special cases, only s or fewer errors are guaranteed to be detected.