Professional Documents
Culture Documents
Datalink layer
HEDSPI Project
Hanoi University of Technology
by
Ngo Hong Son
1
Overview
Last weeks : Application layer
Model: client-server vs. P2P
Case study: HTTP, Mail, FTP…
Today: Datalink layer
LAN technologies
Services of datalink layer: Ethernet
Framing and addressing Wireless LAN
Error detection and correction WAN technologies
Flow control Frame relay
ATM
Media access control
….
2
Introduction of Data-link layer
3
Nodes and links
“link”
Nodes:
PCs, Laptop, Routers,
Server…
Links:
Communication channels
between adjacent nodes
Wired links: Ethernet LAN,
ADSL, fiber optic…
Wireless Link: Wi-fi, Wi-
Max
Data-link layer: Dealing the
communication between
adjacent nodes
4
Data-link layer
in OSI model
Application Media independent
sub-layer
Transport
Network LLC
(Logical Link Control)
Data-link
MAC
Physical (Media Access Control) Media dependent
sub-layer
802.2 LLC
Datalink layer
6
Services of Data link (1)
Framing:
At sender side: encapsulate datagram into frame,
adding header, trailer
At receiver side: remove header, trailer, take
datagram and pass to upper layer
Addressing:
Physical addresses used in frame headers to
identify source & destination
7
Services of Datalink (2)
Media access control:
Channel access if the medium is shared, e.g. LAN
with bus topology, Wireless LAN,..
Flow control:
Restrict the data rate that sender can send so that
sender does not overwhelm receiver
Error control:
Detect and correct bit errors
e.g. parity check, checksum, CRC check
8
Error control
Error detection
Error detection and correction
9
Principle of error detection
EDC= Error Detection Code (redundancy)
Data Data
Y
All bit in Error
Data’ OK?
N
10
Parity check
Single parity check
Detect only single bit error
D D
Y
N
<D’, R’> mod G = 0 ?
<D, R> mod G = 0
D R D’ R’
12
Link with bit errors
CRC: How to compute R
13
CRC in terms of polynomials
1011 : x3 +x +1
In reality, some following patterns are used:
CRC-8 = x8 + x2 + x + 1
CRC-12 = x12+x11+x3+x2+x
CRC-16-CCITT = x16 + x12 + x5 + 1
CRC-32 = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 +
x4 + x2 + x + 1
The longer G, the more powerful CRC
CRC is very effective and is used widely
Wi-fi, ATM, Ethernet…
can detect all burst errors less than r+1 bits
Modulo 2 operator are implemented by hardware
14
Media Access Control
15
Type of links
Point-to-point
ASDL
Telephone modem
….
Broadcast
Traditional LAN with bus topology
Wireless LAN
HFC:
…
Broadcast channel need a complex protocol to
control the access of multiples users
16
Multiple access protocol
classification
Channel Division:
Divide channel into smaller “pieces” (time slots - TDMA,
frequency - FDMA, code - CDMA)
allocate piece to node for exclusive use
Random Access:
channel not divided, allow collisions (contention)
mechanisms for detect or avoid collisions
e.g. Pure Aloha, Slotted Aloha, CSMA/CD, CSMA/CA…
Taking turn:
Round robin manner
Token Ring, Token Bus….
17
Channel Division
FDMA: frequency division multiple access
TDMA: time division multiple access
CDMA: code division multiple access
18
Example:
TDMA and FDMA 4 hosts
FDMA
frequency
time
TDMA:
frequency
time 19
CSMA/CD
Carrier Sense Multiple Access with Collision
Detection
Human analogy: at a meeting:
Multiple Access: Many people want to talk
Collision: At least two people speak at the same
time
CSMA: “Listen before talk”
CD: If two people speak at the same time, then
both should stop (they are all polite)
“Listen while talking”
20
CSMA/CD
21
CSMA collisions
Assume there are 4 nodes
with 1 channel
Electrical signal need
some delay to propagate
from 1 node to other
e.g. at time t1, D does not
know about transmission
from B at start to transmit
-> Collision
22
CSMA/CD: Summary
Host listen to channel before transmit
Busy: Continue to listen
Idle: Start transmission, but keep listening to the
channel for a short time (to detect collision)
If there are collision: cancel transmission and
come back to listen state.
Some variant of CSMA
Persistent CSMA
Non-persistent CSMA
P-persistent CSMA
23
Random Access and Channel
Division: Pros & Cons.
Channel Division
Efficient and Fair for links with high load
Wasted if one allocated channel with high speed
is used by only one node.
Random Access
Efficient at low load: 1 node can fully use the
channel
At high load: Too many collisions
Token approach: Can share load fairly and
use channel efficiently
24
Token Ring
Control token passed
from one node to next T
sequentially.
Node can send data if
and only if it has token (nothing
to send)
Problems T
token overhead
latency
single point of failure
(token)
data
25
Summary of multiple access
control
Channel division
Random Access
Taking turn
Pros and cons
26
LAN: Local Area Network
27
LAN topology
WLAN
Traditional bus
hub, switch
28
Ring
‘Dominant’ wired LAN technology: Ethernet
IEEE 802.3
Variant rate: 10 Mbps – 10 Gbps
Metcalfe’s Ethernet
sketch
29
Star topology
switch
31
Ethernet LAN
32
LAN addressing and ARP
33
Hub, switch, bridge
Spanning - Tree
34
Wireless LAN
Topology
Security issues
Media Access Control: CSMA/CA
35
Overview of WAN Technology
36
Next week
Local area networks
Physical layer
37
Acknowledgement
This course materials contains charts and texts
provided by Keio University, Japan
Some materials from the textbook “Computer
Network, a top down approach” J.F Kurose and
K.W. Ross
38