Computer Networks

Download Report

Transcript Computer Networks

Computer Networks
Data link layer
Data link layer -- June 2004
1
Overview
 Design issues
 Channel allocation
 Point-to-point links
 Multi access protocols
 Local area Networks
 Ethernet
 Data Link layer Switching
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
2
LANs: channel allocation
 Allocation?
Who goes next?
o Static:
o Dynamic:
assignment for long duration
stations continuously compete
Data link layer -- June 2004
3
LANs: channel allocation
 Static channel allocation
o Scheme: • Request channel
• Data Transfer
• Release channel
o After allocation: • Channel is private
• Can be used for a long time
o Division of channel • FDM: Frequency division multiplexing
• TDM: time division multiplexing
Data link layer -- June 2004
4
LANs: channel allocation
 Static channel allocation
o Simple and efficient
• Small & fixed number of users
• Heavy load
o Problems
T
Mean delay
C
Capacity of channel in Mbps

Mean arrival rate in frames/sec
• Loss of bandwidth
1/ 
– If some users are quiescent
– If less users than subchannels
• Poor performance
T
1
=
.C-
Mean frame length in bits
1
TFDM =

Data link layer -- June 2004
C
N
= N.T
-

N
5
Overview
 Channel allocation
 Design issues
 Point-to-point links
 Local area Networks
 Data Link layer Switching
 Multi access protocols
o Aloha
o CSMA protocols
o CSMA/CD protocols
o Collision free
o Wavelength division
multiple access protocols
o Wireless LAN protocols
 Ethernet
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
6
LANs: MA Protocols
Multiple Access protocols
 University of Hawaii Aloha system
o Central computer system
o Terminals spread over 4 islands
o Communication: FM radio
o No station to station communication
o Shared channel for communication from terminals to computer
system
o Transmission strategy:
• Terminal sends data as data comes available
• Collision possible
• Retransmission if no ack received
Data link layer -- June 2004
7
LANs: MA Protocols
 Pure Aloha: frames transmitted at arbitrary times
2 frames sent at same time 
collision
both frames destroyed
Data link layer -- June 2004
8
LANs: MA Protocols
 Pure Aloha: channel efficiency
o Vulnerable period = 2 x packet time
o Packet time = time required to transmit 1 frame
Data link layer -- June 2004
9
LANs: MA Protocols
 Aloha: channel efficiency
o Pure: max 18%
o Slotted (time divided in slots; start sending at start of slot)
Data link layer -- June 2004
10
LANs: CSMA protocols
Carrier Sense Multiple Access CSMA
 Aloha type system + ability to test for a carrier i.e. a transmission
 Persistent <> Nonpersistent
o 1-persistent
• If channel is idle, a frame is transmitted
• If channel is busy, the channel is continuously checked
o Nonpersistent
• If channel is idle, a frame is transmitted
• If channel is busy, a random time is waited before channel is sensed again
o p-persistent (slotted channel only)
• If channel is idle a frame is transmitted with probability p
• If channel is busy, next slot is sensed again
Data link layer -- June 2004
11
LANs: CSMA protocols
Carrier Sense Multiple Access CSMA
 Performance
Data link layer -- June 2004
12
LANs: CSMA/CD protocols
Carrier Sense Multiple Access Collision Detect
 Strategy
o Try to detect collisions asap
o Listen while transmitting
o If collision is detected, abort transmission
 Channel model
Data link layer -- June 2004
13
LANs: CSMA/CD protocols
Carrier Sense Multiple Access Collision Detect
 Contention period
o Worst case scenario
o Detection = analog process
Data link layer -- June 2004
14
LANs: collision free protocols
 Problem?
o 20 km, 100 Mbps
o Very long, high bandwidth protocols
 = 100 sec or 10.000 bits
o 1 km, 10 Mbps
o 1 km, 10 Gbps
 = 5 sec or 50 bits
 = 5 sec or 50.000 bits
 Bit-Map protocol
o Each contention period has N slots (N = #stations)
o Station k is assigned slot k; is used to indicate if station k has to
send data
o Data transmission proceed without collisions
Data link layer -- June 2004
15
LANs: WDMA protocols
Wavelength division multiple access
 Approach:
o Divide channel into subchannels (FDM,…)
o Allocate them as needed
 2 channels/station
o Narrow: used by other stations to signal the station:
o Wide: used by station to output data frames
Data link layer -- June 2004
16
LANs: WDMA protocols
Wavelength division multiple access
 2 transmitters & 2 receivers for each station:
o
o
o
o
Fixed-wavelength receiver for its own control channel
Tunable transmitter for sending on other control channels
Fixed wavelength transmitter for its own data channel
Tunable receiver for other data channels
 Support for 3 traffic classes:
o Constant data rate connection oriented traffic
o Variable data rate connection oriented traffic
o Datagram traffic
Data link layer -- June 2004
17
LANs: WDMA protocols
Wavelength division multiple access
 Scenario for datagram from A to B:
o A: tunes on data channel of B
o A: waits for status slot & selects free slot on control
channel of B (e.g. slot 4)
o A: sends on control channel of B, slot 4: data on data
channel of A, slot 3
Collision possible!
o B: tunes on data channel of A
o B: accepts data on slot 3
B not ready to accept data
Data link layer -- June 2004
18
LANs: WDMA protocols
Wavelength division multiple access
 Scenario for variable data rate connection from A to B:
o A: tunes on data channel of B
o A: waits for status slot & selects free slot on control channel
of B (e.g. slot 4)
o A: sends on control channel of B, slot 4: connection request
o B: announces assignment of slot 4 to A in status slot of its
data channel
o A wants to send data:
• A: sends on control channel of B, slot 4: data on data channel of A,
slot 3
• B: tunes on data channel of A
• B: accepts data on slot 3
Data link layer -- June 2004
19
LANs: wireless protocols
 Common configuration for a wireless LAN
o Base stations (access points) wired together
o Notebooks with radio transmitter/receiver
o A receiver within range of 2 active transmitters receives
a garbled signal
o Not all stations are in range of one another
o CSMA does not work: interference at receiver is
important not at sender
o Example …
Data link layer -- June 2004
20
LANs: wireless protocols
 A sends to B
 B sends to A
 If C senses medium, it will
 If C senses the medium, it
not hear A
 If C transmits to B, it will
garble the signal at B
may falsely conclude it
cannot send to D
Hidden station problem
Exposed station problem
Data link layer -- June 2004
21
LANs: wireless protocols
Multiple Access with Collision Avoidance MACA
 A wants to send to B
 A sends RTS (request to
send) frame (short frame)
 B replies with CTS (clear to
with length of data frame
send) frame, containing
same length
Data link layer -- June 2004
22
LANs: wireless protocols
Multiple Access with Collision Avoidance MACA

A wants to send to B
 A sends RTS (request to send) frame (short
frame) with length of data frame

 Stations hearing RTS
 Stations hearing CTS
should remain silent to not
interfere with CTS
B replies with CTS (clear to send) frame,
containing same length
should remain silent to not
interfere with data frame
Collisions possible!
Wait random time
Binary exponential backoff!
Data link layer -- June 2004
23
LANs: wireless protocols
MACAW = MACA for Wireless
 Optimisations for MACA
o Introduce ACK from receiver of data frame to sender:
detect loss in DL iso network/transport layer
o Add CSMA: avoid sending a RTS by a station close to
a station sending to the same destination
o Run binary exponential backoff for each destination
iso each station
o Exchange of information between stations about
congestion
Data link layer -- June 2004
24
Overview
 Design issues
 Channel allocation
 Point-to-point links
 Multi access protocols
 Local area Networks
 Ethernet
 Data Link layer Switching
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
25
LANs: IEEE 802.3 or Ethernet
 Overview
o 1-persistent CSMA/CD
•
•
•
•
When a station wants to transmit, it listens to the cable
If idle, it transmits immediately
If busy, it waits until the cable goes idle
If collision, it waits a random time
o History
•
•
•
•
Real start: Aloha
3 Mbps experiment at Xerox  ethernet
Agreement between Intel, DEC, Xerox
Base for IEEE 802.3
Data link layer -- June 2004
26
LANs: IEEE 802.3 or Ethernet
 Cabling
Name
Cable
Max
Length
Nodes/
segment
Advantages
10Base5
Thick coax
500m
10Base2
Thin coax
200m
30 Cheapest system
10Base-T
Twisted pair
100m
1024 Easy maintenance
10Base-F
Fiber optics
2000m
Data link layer -- June 2004
100 ??
1024 Best between buildings
27
LANs: IEEE 802.3 or Ethernet
Cabling
 Thick Ethernet
o Vampire taps, 2.5 m apart
o Segments up to 500m + repeaters
o Transceiver at tap
 Twisted pair
o Cables to central hub
o Net = box
o Easy maintenance
 Thin Ethernet
o Industry standard BNC
connectors
o Easier to install, more reliable,
cheaper
o Up to 200m, 30 systems per
segment
o Transceiver on controller board
 Fiber
o Expensive due to cost of
connectors
o Excellent noise immunity
o Preference for connections
between buildings
Data link layer -- June 2004
28
LANs: IEEE 802.3 or Ethernet
 MAC frame
o Preamble: 7 bytes with 1010101010
o Start of frame delimiter: 1010101011
o Address:
• For 10 Mbps: 6 byte addresses
• Assigned by IEEE; globally unique
• All 1s: broadcast
o Pad: to ensure minimum length of 64 bytes for frame; minimum
frame must take 51.2 sec
Data link layer -- June 2004
29
LANs: IEEE 802.3 or Ethernet
 MAC frame: 2 definitions
o DIX ethernet (original proposal of DEC, Intel, Xerox)
o IEEE 802.3
 Differences:
o Type  length: All defined types > 1500
o SOF: for compatibility with 802.4 & 802.5
Data link layer -- June 2004
30
LANs: IEEE 802.3 or Ethernet
 Binary exponential Backoff Algorithm
o Randomisation in case of collisions?
o After collision time is divided in discrete slots of 51.2 sec
o After 1 collision: station waits 0..1 slots before trying to send again
o After 2 collisions: station waits 0..3 slots before …
o After i collisions: station waits 0 .. 2i – 1 slots before …
o After 10 collisions: interval is frozen at 1024 slots
o After 16 collisions: failure reported
o Why not always 1024 slots?
o Fair?
Data link layer -- June 2004
31
LANs: IEEE 802.3 or Ethernet
 Performance
o Assumptions
• Heavy load, k stations always ready to transmit
• Constant retransmission probability (not exponential Backoff)
o Channel efficiency
P
Time to transmit a frame
B Bandwidth



P
=
P + 5.4  
1



BL
1 + 5.4 
cF
L
Cable length
F
Frame length
c
Signal propagation speed
Average length of collision period
Data link layer -- June 2004
32
LANs: IEEE 802.3 or Ethernet
 Performance
Why so poor?
Data link layer -- June 2004
33
LANs: IEEE 802.3 or Ethernet
 From hubs to switches:
o Collision domain = box  hub
= card  #collisions reduced
= line  no collisions
o Internal forwarding?
Data link layer -- June 2004
34
LANs: IEEE 802.3 or Ethernet
 Fast Ethernet:
10 Mbps  100 Mbps
 Implications on performance?
P
=
P + 5.4  
 B +
o L
o F
1
1 + 5.4 
BL
cF
same efficiency:
Twisted pair cabling: 100m * 2
<> 2500m for coax cable
Data link layer -- June 2004
35
Fast Ethernet
 Faster 802.3, no other changes
o Need for backward compatibility with existing LANs
o New protocol  unforeseen problems?
o Get it done before technology changes
 Simple basic idea:
o Reduce bit time from 100 nsec to 10 nsec
o Allow only hubs/switches
 Cabling
o 100Base-T4
o 100Base-TX
o 100Base-F
UTP3, 25 Mhz signaling
4 twisted pairs (host to hub, hub to host, 2 switchable)
Ternary signals, 3 wires  27 symbols  4 bits per cycle
UTP5, 125 Mhz signaling
2 twisted pairs
Coding scheme: 4B/5B 4 bits in 5 clock periods
Data link layer -- June 2004
36
Gigabit Ethernet
 Goal of standards committee
o 10 times faster  1000 Mbps or 1 Gbps
o Remain backward compatible! Same frame format
 Implications on performance?
Same minimum/maximum frame size
Same addressing scheme
P
=
P + 5.4  
 B +
o L
o F
1
BL
1 + 5.4 
cF
same efficiency:
2500m for Ethernet 
25m for gigabit ethernet
Data link layer -- June 2004
37
Gigabit Ethernet
 Solution? Limitation on configurations
o Only point-to-point line
o Use hubs or switches
Data link layer -- June 2004
38
Gigabit Ethernet
 Full-duplex operation mode  switches
o Collisions impossible: CSMA/CD not used
o Maximum cable length determined by signal strength
 Half -duplex operation mode  hubs
o Collisions possible: CSMA/CD required
o Cable length not to be reduced: 200m!
o Solutions:
• Carrier extension: hardware padding of frames to minimum of
512 bytes
• Frame bursting: transmit concatenated sequence of frames in a
single transmission
Data link layer -- June 2004
39
Gigabit Ethernet
 Need for flow control
o 1ms  1.000.000bits or 1953 frames of minimal length
 Control frames
o Type = 0x8808
 PAUSE control frame
o Wait for x time units
o Time unit = 512 nsec
Data link layer -- June 2004
40
Gigabit Ethernet
 10-gigabit Ethernet
o IEEE 802.3ae: standard approved in 2002
Data link layer -- June 2004
41
Overview
 Design issues
 Channel allocation
 Point-to-point links
 Multi access protocols
 Local area Networks
 Ethernet
 Data Link layer Switching
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
42
LANs: 802
 LLC: Logical Link Control
o Services: ~ data link
o Header: ~ HDLC
o Identical for all LANs
 MAC: Medium Access Control
o Access to medium specific layer
o Service
• Datagram
• Datagram with some ack
Data link layer -- June 2004
43
Overview
 Design issues
 Channel allocation
 Point-to-point links
 Multi access protocols
 Local area Networks
 Ethernet
 Data Link layer Switching
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
44
Wireless LANs – 802.11
 2 modes:
o In the presence of a wired base station – access point
o In the absence of a base station – ad hoc networking
 Make 802.11 compatible with ethernet
Data link layer -- June 2004
45
Wireless LANs – 802.11

Physical Layer
Too slow!!
Data link layer -- June 2004
46
Wireless LANs – 802.11
 802.11a - OFDM
Orthogonal Frequency Division Multiplexing
o 54 Mbps in 5 GHz ISM band
o Different frequencies used (48 data + 4 synchronisation
o Form of spread spectrum
 802.11b - HR-DSS
High rate direct sequence spread spectrum
o up to 11 Mbps in 2.4 GHz ISM band
o Supports 1, 2, 5.5, 11 Mbps
 802.11g – OFDM
o 54 Mbps in 2.4 GHz ISM band
Data link layer -- June 2004
47
Wireless LANs – 802.11
MAC Sublayer Protocol
 2 modes of operation:
o DCF – Distributed coordination function
• CSMA/CA: physical + virtual channel sensing
• 2 methods of operation
– Physical channel sensing only
– Physical + virtual channel sensing  MACAW
o PCF – Point coordination function
• Base station controls all activity in cell
• Polling mode + DCF
Data link layer -- June 2004
48
Wireless LANs – 802.11
MAC Sublayer Protocol
 DCF – Distributed coordination function
o Physical channel sensing only
• Channel idle: station starts transmission
busy: sense till idle
• No listening during transmission
• Collision: wait random time – binary exponential backoff
o Physical + virtual channel sensing  MACAW
Data link layer -- June 2004
49
Wireless LANs – 802.11
MAC Sublayer Protocol
 DCF – Distributed coordination function
o Physical channel sensing only
o Physical + virtual channel sensing  MACAW
NAV = Network Allocation Vector or kind of virtual channel busy
Data link layer -- June 2004
50
Wireless LANs – 802.11
MAC Sublayer Protocol
 PCF– Point coordination function
o Polling: base station broadcasts a beacon frame
periodically (10 – 100 times/sec)
• Beacon frame contains system parameters
• Invites new stations to sign up for polling service
o Once signed up for polling at a certain rate  guaranteed
fraction of bandwidth
o Supports battery management: forces a station to go into
sleep state until awakened by base station or user; base
station will buffer arriving frames
Data link layer -- June 2004
51
Wireless LANs – 802.11
MAC Sublayer Protocol
 PCF & DCF combined
o Central control (polling) combided with distributed
control by using 4 timers InterFrame Spacing
o Some dead time after every frame: 4 intervals
Data link layer -- June 2004
52
Wireless LANs – 802.11
MAC Sublayer Protocol
 Transmission errors
o Wireless  noisy & unreliable
o Long frames  high chance for errors
 Solution: fragmentation (+ Checksum, seq number, stop&wait)
Data link layer -- June 2004
53
Wireless LANs – 802.11
Frame Structure
 3 classes of frames: data, control, management
Data frame
Duration time to transmit frame + ack
Address 1 destination
Address 2 source
Seq.
Supports fragment numbering:
12 bits frame + 4 bits fragment
Address 3 destination base station
Address 4 source base station
Data link layer -- June 2004
54
Wireless LANs – 802.11
Frame Structure
Data frame
Version
Support for different versions of protocol
Type
Data, control, management
Subtype
e.g. RTS, CTS
To DS
Frame to intercell distribution system
From DS
Frame from intercell distribution system
MF
More fragments to follow
Retry
Indicates retransmission of frame
Pwr
Used by base station to put receiver into sleep state or to wake it up
More
Sender has additional frames for receiver
W
Frame body encrypted using
WEP
Privacy)
Data
link(Wired
layer Equivalent
-- June 2004
O
Sequence of frames must be processed strictly in order
55
Wireless LANs – 802.11
 Services:
o 5 distribution services:
•
•
•
•
•

Association
Disassociation
Reassociation
Distribution
Integration
o 4 station services:
•
•
•
•
Authentication
De-authentication
Privacy
Data delivery
Association:
 Connect to base station
 Announce identity & capabilities
 Data rates supported
 Need for PCF services
 Power management requirements
Determines how to route frames sent
to base station
Handles translation to format of
destination network
Data link layer -- June 2004
56
Overview
 Design issues
 Channel allocation
 Point-to-point links
 Multi access protocols
 Local area Networks
 Ethernet
 Data Link layer Switching
 Logical link control
 Wireless LANs
 Broadband wireless
Data link layer -- June 2004
57
Broadband wireless
 802.16 or
o Wireless MAN
o Wireless local loop
 Competition for last mile
o Cable
o Telephone system
Designed for
802.11
mobile ethernet
802.16
mobile cable television
Data link layer -- June 2004
58
802.16 - Broadband wireless
 Comparison with 802.11
o Provide service to buildings and buildings are not mobile
o Better radios can be used
o Security & privacy are essential and mandatory
o Users need more bandwidth  operate in 10 – 66 GHz
o Waves are strongly absorbed by water  error handling
more important (error correction)
o Support for real-time traffic (telephony, television,…)
Data link layer -- June 2004
59
802.16 - Broadband wireless
 Protocol stack
Replaces LLC: aims for integration with
Location of main protocols & channel management
 Connection oriented
 Controlled by base station
 Datagram protocols: PPP, IP, Ethernet
 ATM
Encryption
Decryption
Key management
Data link layer -- June 2004
60
802.16 - Broadband wireless
 Physical layer
o Waves travel in straight lines
o Multiple antenna’s possible
o Signal strength falls off
sharply with distance
o 3 different modulation
schemes
Data link layer -- June 2004
61
802.16 - Broadband wireless
 Physical layer
o Efficient use of available bandwidth: 2 schemes
• FDD: frequency division duplexing
• TDD: time division duplexing
• first 2 subframes: upstream & downstream maps
» What is in which slot?
» Which time slots are free?
–
–
–
–
–
–
Base station sends out frames
Each frame contains time slots
Variable # slots for upstream & downstream traffic
Base station maps downstream traffic to slots
Upstream slot allocation done by MAC sublayer
Error correction
Data link layer -- June 2004
62
802.16 - Broadband wireless
 MAC protocol
o MAC frame
• Occupy an integral number of physical layer time slots
o Allocation of upstream slots
• Depends on service requested
• Connection-oriented
o Services:
•
•
•
•
Constant bit rate
Real-time variable bit rate
Non-real-time variable bit rate
Best-efforts rate
Data link layer -- June 2004
63
802.16 - Broadband wireless
 MAC protocol
o Services:
• Constant bit rate
– Slots are reserved when connection is set up
• Real-time variable bit rate
– Polling at fixed rate to know how much bandwidth is
needed
• Non-real-time variable bit rate
– Polling (not at fixed rate)
– No response for k times  multicast group
• Best-efforts rate
– Requests done in time slots available for contention
– Success noted in downstream map
– No success: retry + binary exponential backoff
Data link layer -- June 2004
64
802.16 - Broadband wireless
 Generic frame
 EC: payload encrypted?
 Type: frame type
 Bandwidth request frame
 CI: final CRC present?
 EK: which encryption key used
 Length
 Connection ID
Data link layer -- June 2004
65
Overview
 Design issues
 Point-to-point links
 Local area Networks
 Data Link layer Switching
Data link layer -- June 2004
66
Computer Networks
Data link layer
Data link layer -- June 2004
67