0% found this document useful (0 votes)
3 views

Part 2-Data Link Layer

Uploaded by

Lohith Reddy A
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Part 2-Data Link Layer

Uploaded by

Lohith Reddy A
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 68

SYLLABUS:

1. Introduction & Physical Layer - Introduction to the Internet - Services and Protocols, Edge -
Protocol Layers and Service Models OSI and TCP/IP models. ​
2. Data link Layer - Link Layer – Services - Error Detection and Correction; Multiple Access
protocols- channel partitioning - Random access - Taking-Turns protocols - Switched LANs ARP - Ethernet
- Link layer switching – VLANs – MPLS.​
3. Network Layer - Data plane forwarding vs. Control plane routing - Software Defined Networking
(SDN) approach - Network Services - Router architecture - Switching fabrics - Input and output queueing-
Core, Packet Switching vs. Circuit Switching - Performance Metrics Delay - Loss – Throughput - IPv4 and
IPv6 addressing DHCP -NAT - IPv4 and IPv6 fragmentation – SDN-based generalized forwarding -
Routing and Supporting Algorithms - Link State vs. Distance Vector - RIP - OSPF – BGP – ICMP - SNMP
- SDN Control Plane. ​
4.Transport Layer - Unreliable Connectionless vs. Reliable Connection-Oriented Services -
Multiplexing; Stop-and-Wait - Go-Back-N and Selective-Repeat - UDP vs. TCP - Flow and Congestion
Control. ​
5. Application Layer - Client-Server and Peer-to-Peer architectures - Application Layer protocols ​
6. Introduction to Wireless and Mobile Networks - Link characteristics - CDMA - 802.11 WiFi -
Bluetooth and Zigbee - Cellular Networks - GSM – UMTS – LTE - Mobility management and handoff -
Mobile IP.​
Part-2 (Lecture Flow & Book Details)

Data link Layer - Link Layer – Services - Error Detection and Correction: Behrouz Forouzan, “Data
Communication and Networking”, Tata McGraw Hill 3rd edition. Chapter-10, Page Nos: 243-259.
Multiple Access protocols Channel partitioning - Random access - Taking-Turns protocols: Behrouz
Forouzan, “Data Communication and Networking”, Tata McGraw Hill 3rd edition. Chapter-13, Page
Nos: 311-325.
Switched LANs ARP: James Kurose and Keith Ross, “Computer Networking: A Top-down Approach”
6th edition, Addison Wesley 2010. Chapter-5- Only 5.4.1. Page Nos: 462 to 469.
Ethernet: James Kurose and Keith Ross, “Computer Networking: A Top-down Approach” 6th edition,
Addison Wesley 2010. Chapter-5- Only 5.4.2. Page Nos: 469 to 474.
Link layer switching: Behrouz Forouzan, “Data Communication and Networking”, Tata McGraw Hill
4th edition. Chapter-15— only page no.-447(Bridges).
The Link Layer and Local Area Networks

Understand the principles behind link layer services


• error detection, correction
• sharing a broadcast channel: multiple access
Understanding Link Layer protocol
Understanding local area network
Introduction and Services
• Data link layer is responsible for carrying packets from one hop to
the next hop
• Data link layer has local responsibility
• Data link layer is divided into two functionality-oriented sublayers
- Logical Link Control (LLC)
- Medium Access Control (MAC)
ERROR CONTROL:
• Network transfers data from one device to another with accuracy
• Reliable systems have mechanisms for detecting and correcting errors
• Data can be corrupted during transmission.
• Due to interference change in the shape of the signal.
Types of Error :
• Single-Bit Error
• Burst Error
Single-bit error:
In a single-bit error, only one bit in the data unit has changed.
ERROR CONTROL:
Burst Error:
A burst error means that 2 or more bits in the data unit have changed.
SINGLE BIT ERROR:
• Only one bit is changed
• For ex: If ASCII word 02H is transmitted, when it reaches receiver it becomes 0AH, meaning
itself is changed
• 02H- STX- start of text
• 0AH-LF-Line feed
• In serial data transmission, single bit errors are least likely to occur.
• For ex: If data rate is 1 Mbps, duration of each bit is 1/data rate = 1micro sec
• Single bit error to occur, noise must have duration of 1 micro sec only which is not possible
because noise duration is more than this.
• It affects parallel transmission
BURST ERROR:
• Two or more bits are changed.
• The length of the burst is measured from first corrupted bit to last corrupted bit
• In parallel data transmission, burst errors are least likely to occur.
• It affects serial transmission
• For ex: If data rate is 1 Kbps, duration of each bit is 1/data rate = 1msec
• Noise duration is longer than the duration of one bit, so it affects set of bits
• Number of bits affected depends on data rate and the duration of the noise

0 1 1 0 0 0 1 0
0 0 0 0 0 0 0 1
1
0
Sender 1 Receiver
1
0
1
Error detection:
• Redundancy
• Parity Check
• Cyclic Redundancy Check (CRC)
• Checksum

Ist method:
• Error detection is done by sending every data twice
• Receiver does bit by bit comparison between the two sets of the data
• Any discrepancy results in error and correction has to be done
Advantage:
Accuracy
Disadvantage:
Slow
Transmission time is doubled and takes more time for bit by bit comparison
Redundancy:
• Adding extra bits for detecting errors at the destination.
• Sender appends shorter group of bits and transmits
• Receiver checks the data and redundant bits are discarded
Error Detection Methods:
Simple Parity Check:
• Even or Odd parity check: Parity bit is added to every data unit so that the total number of 1s
is even (or odd for odd-parity)
Numerical:
Ex:1
Suppose the sender wants to send the word world. In ASCII the five characters are coded as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001

Ex:2
Now suppose the word world in Ex:1 is received by the receiver without being corrupted in
transmission.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4).
The data are accepted.
Numerical:
Ex3:
Now suppose the word world in Ex:1 is corrupted during transmission.
11111110 11011110 11101100 11011000 11001001
The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5,
4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission.

Note:

• Simple parity check can detect all single-bit errors.

• It can detect burst errors only if the total number of errors in each data unit is odd.
CRC ( CYCLIC REDUNDANCY CHECK):
• Most powerful technique
• Performs binary division
• Sequence of redundant bits called the CRC( remainder) which is appended to the end of data
unit
• Resulting data unit is exactly divisible by predetermined binary number
• At the destination, incoming data unit is divisible by the same binary number
• No remainder – data is proper and accepted
• There is remainder – data is damaged and rejected
• Redundancy bits are derived by dividing the data unit by a predetermined divisor and
remainder is the CRC

Two qualities:
• CRC must have exactly one bit less than the divisor
• After appending CRC at the end of the data, resulting sequence exactly divisible by the divisor
CRC ( CYCLIC REDUNDANCY CHECK):
Note:
• CRC can be all zeros
CRC:
CRC Polynomial:
• Divisor is represented as a algebraic
polynomial but not as a string of o’s and 1’s
Reason for using polynomial:
• Short
• Used to prove the concept mathematically
CRC Generator:
• Uses mod 2 division
• Size of divisor is n+1
• n= Number of appended
zeros
• Divisor always begins
with 1
• Dividend – divisor and
leftmost bit of dividend
should be 1
• First bit of remainder is
zero then use 0000
• If second bit is also
zero then it is
retained
CRC Checker:
• Uses mod 2 division
• Data is received as data
followed by CRC
• Remainder=0, CRC is
dropped and data is
accepted
• Else data is discarded and
resent
Checksum
Now, suppose receiver receives the pattern and
there is no error
Error Correction Methods:

• Retransmission

• Receiver asks for retransmission of entire data

• Forward Error Correction


ERROR CORRECTION:
Forward error correction:
• Consider single bit error has occurred in ASCII character, error is detected by error detecting
code and error correcting code must determine which 7 bits has changed
• Define 8 states
1. No error
2. Error in bit 1
3. Error in bit 2
4. Error in bit 3
5. Error in bit 4
6. Error in bit 5
7. Error in bit 6
8. Error in bit 7
• Redundancy bits are required to show the above states
• 3 bit redundancy code is enough to show 000 to 111
ERROR CORRECTION:
Forward error correction:
• Suppose error occurs in redundancy bit itself. i.e. data (7) + redundancy bits (3)=10 bits
• If 3 bits are taken then it will identify only 8 states, additional bits are required to cover all
error
• 2r >= m + r + 1
• Where m = number of data bits in message
r = number of redundant bits
• Length of the resulting code= m + r
• If m= 7, then r = ? 4
Redundant bits are represented as r1, r2, r4, r8
m + r = 7 + 4 = 11
Hamming code:
• Provides practical solution
• Applied to data unit of any length

Number of Number of Total


data bits redundancy bits bits
m r m+r

1 2 3

2 3 5

3 3 6

4 3 7

5 4 9

6 4 10

7 4 11
r8 r4 r2 r1 No. of
bits
0 0 0 1 1 r1 : 1 , 3, 5, 7, 9, 11, 13……..
0 0 1 0 2
0 0 1 1 3 r2 : 2, 3, 6, 7, 10, 11………….
0 1 0 0 4
0 1 0 1 5
r4 : 4, 5, 6,7, 12, 13, 14, 15,………..
0 1 1 0 6
0 1 1 1 7
r8 : 8, 9, 10, 11, 12, 13, 14, 15,………
1 0 0 0 8
1 0 0 1 9
1 0 1 0 10
1 0 1 1 11
1 1 0 0 12
1 1 0 1 13
1 1 1 0 14
1 1 1 1 15
Hamming code:
Finding r values:
Hamming code:
Hamming code:
• Easily implemented using hardware
• Code is corrected before the receiver knows about it
Multiple access protocols
Multiple access protocols- Random access
• In random access or contention methods, no station is superior to
another station and none is assigned the control over another. No
station permits, or does not permit, another station to send. At each
instance, a station that has data to send uses a procedure defined by
the protocol to make a decision on whether or not to send.

• ALOHA-Additive Links On-line Hawaii Area


• Carrier Sense Multiple Access
• Carrier Sense Multiple Access with Collision Detection
• Carrier Sense Multiple Access with Collision Avoidance
Multiple access protocols- Random access
Multiple access protocols- Random access
• ALOHA
Multiple access protocols- Random access
• Collision in CSMA
Multiple access protocols- Random access

Persistence strategies
Multiple access protocols- Random access
• CSMA/CD
Multiple access protocols- Random access
• CSMA/CA
Multiple access protocols- Controlled access

• In controlled access, the stations consult one another to find which


station has the right to send. A station cannot send unless it has been
authorized by other stations. We discuss three popular controlled-
access methods.

• Reservation
• Polling
• Token Passing
Multiple access protocols- Controlled access

• Reservation access method


Multiple access protocols- Controlled access
• Select and poll functions in polling access method
Multiple access protocols- Controlled access

• Token-passing network
Multiple access protocols- Channelization

• Channelization is a multiple-access method in which the available


bandwidth of a link is shared in time, frequency, or through code,
between different stations. In this section, we discuss three
channelization protocols.

• Frequency-Division Multiple Access (FDMA)


• Time-Division Multiple Access (TDMA)
• Code-Division Multiple Access (CDMA)
Multiple access protocols- Channelization

Frequency-division multiple access (FDMA)


Multiple access protocols- Channelization
• Time-division multiple access (TDMA)
Multiple access protocols- Channelization
• CDMA
Multiple access protocols- Channelization
Multiple access protocols- Channelization
Data Link Layer addressing
• MAC (or LAN or physical or Ethernet) address:
• 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software
settable
• e.g.: 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation


(each “numeral” represents 4 bits)

• MAC address allocation administered by IEEE


• MAC - flat address - portable
• IP - hierarchical address not portable
• MAC broadcast address
LAN addresses and ARP
each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98
Question: how to determine interface’s MAC address, knowing its IP address?

ARP: Address Resolution Protocol


ARP table: each IP node (host, router) on LAN has a
table
• IP/MAC address mappings for some LAN nodes:
< IP address; MAC address; TTL>
• TTL (Time To Live): time after which address
mapping will be forgotten (typically 20 min)
ARP protocol: same LAN
• A wants to send frame to B
• B’s MAC address not in A’s ARP table.
• A broadcasts ARP query packet, containing B's IP address
• B receives ARP query packet, replies to A with its (B's) MAC address
• A caches (saves) IP-to-MAC address pair in its ARP table until information becomes
old (times out)
• soft state: information that times out (goes away) unless refreshed
• ARP is “plug-and-play”:
• nodes create their ARP tables without intervention from network administrator
ARP protocol: different LAN
Send frame from A to B via R
 assume A knows B’s IP address
 assume A knows IP address of first hop router, R
 assume A knows R’s MAC address

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F
ARP protocol: different LAN
 A creates IP datagram with IP source A, destination B
 A creates link-layer frame with R's MAC address as destination
address, frame contains A-to-B IP datagram
MAC dest: E6-E9-00-17-BB-4B
MAC src: 74-29-9C-E8-FF-55
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP
Eth
Phy

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F
ARP protocol: different LAN
 frame sent from A to R
 frame received at R, datagram removed, passed up to IP

MAC dest: E6-E9-00-17-BB-4B


MAC src: 74-29-9C-E8-FF-55
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP IP
Eth Eth
Phy Phy

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F
ARP protocol: different LAN
 R forwards datagram with IP source A, destination B
 R creates link-layer frame with B's MAC address as destination
address, frame contains A-to-B IP datagram

MAC dest: 49-BD-D2-C7-56-2A


MAC src: 1A-23-F9-CD-06-9B
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
IP Eth
Eth Phy
Phy

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F
ARP protocol: different LAN
 R forwards datagram with IP source A, destination B
 R creates link-layer frame with B's MAC address as destination
address, frame contains A-to-B IP datagram

MAC dest: 49-BD-D2-C7-56-2A


MAC src: 1A-23-F9-CD-06-9B
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
IP Eth
Eth Phy
Phy

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F
ARP protocol: different LAN
 R forwards datagram with IP source A, destination B
 R creates link-layer frame with B's MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP
Eth
Phy

A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B

111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
Ethernet
• “dominant” wired LAN technology
• first widely used LAN technology
• simpler, cheap
• kept up with speed race: 10 Mbps – 10 Gbps
• Ethernet LAN was invented in the mid-1970s by Bob Metcalfe and David Boggs
Ethernet: physical topology
• bus: popular through mid 90s
• all nodes in same collision domain (can collide with each
other)
• star: (1990s end and 2000 starting)
• active switch in center
• each “spoke” runs a (separate) Ethernet protocol (nodes do not
collide with each other)

switch
star
bus: coaxial cable
Ethernet frame structure

sending node encapsulates IP datagram (or other


network layer protocol packet) in Ethernet frame
type
dest. source
preamble address address data CRC
(payload)

preamble:
• 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
• used to synchronize receiver, sender clock rates
Ethernet frame structure
• addresses: 6 byte source, destination MAC addresses
• if station receives frame with matching destination address,
or with broadcast address (e.g. ARP packet), it passes data
in frame to network layer protocol
• otherwise, station discards frame
• type: 2 bytes indicates higher layer protocol
• CRC: 4 bytes cyclic redundancy check at receiver
• error detected: frame is dropped

type
dest. source
preamble address address data CRC
(payload)
Ethernet: unreliable, connectionless
• connectionless: no handshaking between sending and
receiving NICs
• unreliable: receiving NIC doesn't send acks or nacks
to sending NIC
• Ethernet’s MAC protocol: CSMA/CD
Link Layer Switching
Link Layer Switching
Transparent bridge is a bridge in which the stations are completely unware of the bridge existence
• Frame Forwarding
• Address Learning

You might also like