1 multiplexing/mac malathi veeraraghavan univ. of virginia outline types of links multi-access...
TRANSCRIPT
1
Multiplexing/MAC
Malathi VeeraraghavanUniv. of Virginia
• Outline• Types of links
• Multi-access (shared single) link • Point-to-point link
• Types of multiplexing techniques• Circuit-based multiplexing• Packet-based multiplexing
2
Purpose of multiplexing/MAC
• To share link bandwidth
3
MAC
• MAC: Medium Access Control or Media Access Control– Set of functions to support the sharing of a single link
by multiple endpoints
• MAC vs. Multiplexing (MUX)– The term "MAC" is used to describe sharing techniques
on multi-access links
– The term "multiplexing" is used to describe sharing techniques on point-to-point links
4
Types of links
• Multi-access links– Typically used to connect multiple hosts to a switch
– Cheaper than point-to-point links
– Mostly used in wireless networks
– Sometimes in wired networks through hub
• Point-to-point links– Typically used between switches
– Increasingly typical between hosts and switches in wired networks (port costs are decreasing)
Host Host Host......
Switch
Host Switch Host
Host
5Courtesy: http://mars.gmu.edu/dspace/bitstream/1920/2497/1/pca_608_23_16n.jpg
Analogy of a MULTI-ACCESS LINK
- several driveways attached to one road
6
Host Host
HostHost
Switch Switch
Recall our multiple-link network
e.g., roadways network (an intersection is comparable to a switch)
Switch
Point-to-point link Point-to-point link shared using MUX techniques
7
Host
Host
HostHost
Switch Switch
Multi-access wireless link between hosts and switch
Switch
Multi-access wireless link
802.11 wirelessaccess point
Image courtesy: http://compnetworking.about.com
Host Host Host......
SwitchEquivalent to:
8
Multi-access wireless link(cell phones)
Base station/cell site
Images courtesy of cnet.com and wikipedia
Switch Switch
Switch
9
Host
Host
Host
Host
Switch Switch
Multi-access wired link between hosts and switch
Switch
Multi-access wired link
Ethernet hub
Image courtesy: wikipedia
Recall a hub is a multipoint repeaterfrom tasks/layers class notes: shared single-link network
10
Usage of links
• Point-to-point links– Host-to-switch, or more generally endpoint-to-
switch (e.g., telephone, video camera)– Switch-to-switch
• Multi-access links– Endpoint-to-switch
11
Back to outline (status check)
• Outline• Types of links
• Multi-access link • Point-to-point link
Types of multiplexing techniques• Circuit-based multiplexing• Packet-based multiplexing
12
Classification of Multiplexing/MAC techniques
Multiplexing/MAC techniques
Circuit-based multiplexing
Position based: • space• time • frequency
Each multiplexed data stream occupies a different position
Packet-based multiplexing
Packet header based:• header carries destination address
Each multiplexed data stream consists of packets with headers carrying corresponding destination addresses
13
Circuit-based multiplexing
• Frequency Division Multiplexing (FDM)– Called Wavelength Division Multiplexing
(WDM) in the optical range
• Time Division Multiplexing (TDM)
• Space Division Multiplexing (SDM)– Each fiber in a fiber bundle
14
Frequency Division Multiplexing
(c) The multiplexed signal Tanenbaum
(a) The original signals
(b) The signals modulated on to different carrier frequencies
Signal 1
Signal 2
Signal 3
Signal 1Signal 2
Signal 3
15
Frequency Division Multiplexing (FDM)
• Each communication session is assigned its own frequency for the session
• A few control channels (frequencies) are set aside to allow users to send requests for frequencies for their communication sessions (these requests are called "call setup signaling protocol messages")
• Frequencies are released upon completion of the session (with "call release signaling protocol messages")
• Modulation technique determines the required carrier spacing (e.g., 30 kHz for analog cellular) and correspondingly the number of simultaneous sessions
• Examples– Each broadcast radio and TV station is assigned a different carrier
frequency – long-held “sessions”– Analog cellular systems: two frequencies are assigned – one for reception,
another for transmission to each cellular caller
16
Time Division Multiplexing (TDM)
• Each communication session is assigned time slots for its session on one or more frequencies
• A few control channels (time slots) are set aside to allow users to use for signaling messages, i.e., to send requests for timeslots for their communication sessions
• Timeslots are released upon completion of the session• Examples
– Classroom being shared by multiple classes one after another in time
– Digital cellular systems: US system has three users sharing one carrier frequency for a cellular call
17
Frequency and time:many practical systems are hybrid
Fre
quen
cy
Time
CarrierFDM
Time
Fre
quen
cy
TDM
Time
Fre
quen
cy
Hybrid FDM/TDM
Basic principle of communication: Two regions in the time-frequency plane with equal areas can carry the same amount of information
18
Use of circuit-based multiplexing on different types of links
• Multi-access wireless link– Cellular phones
• Point-to-point links between switches
19
Use of FDM and TDM techniques on a multi-access link
• FDM sharing on a multi-access link is referred to as FDMA (Frequency Division Multiple Access)
• TDM sharing on a multi-access link is referred to as TDMA (Time Division Multiple Access)
20
Forward and reverse channels
Base station/cell site
Images courtesy of cnet.com, wikipedia, google
Switch Switch
SwitchReverse
channels
Forward channels
21
Example of FDMA scheme: Advanced Mobile Phone System (AMPS)
• FDMA/FDD– Spectrum allocation by FCC: A and B allocations to
different providers
A B
825 845
A B
870 890channels
kHz
MHz666
30
20Original
Reverse Forward
A B
825 845
A
824 849
BA A B
870 890
A
869 894
BA channelskHz
MHz832
30
25Extended
20 MHz is the width of the allocated band: 845-825 and 890-87030 kHz is the per-channel bandwidth required for an AMPS phone call
22
Duplex techniques
• Separates signals transmitted by base stations from signals transmitted by terminals– Frequency Division Duplex (FDD): use
separate sets of frequencies for forward and reverse channels (upstream and downstream)
– Time Division Duplex (TDD): same frequencies used in the two directions, but different time slots
23
Dimension of space
• Reuse the frequencies used at a cell C at another cell D that is far enough from C
24
Hexagonal cell frequency plan
R D
• D: Distance between a base station and the nearest base station that uses the same channels
• R: Radius of a cell• Reuse distance = D/R• Channel plan: method of assigning
channels to cells to guarantee a minimum reuse distance between cells that use the same channel
• S/I: Signal to Interference Ratio
reqI
S
I
S
reqR
D
R
D
which is the minimum reuse distance for which
25
Reuse factor(frequencies are reused every N cells)
• Divide the set of available channels into N groups• N: reuse factor; select N such that cells assigned the same
frequencies will have a D:R ratio greater than (D:R)req
• For hexagons, reuse factor N is given by
2
31
reqRD
N
• Practical values of N – range from 3 to 21
– most commonly used: 7 (D/R = 4.6)
26
Different reuse patterns (factors)
27
Service provider A
• Has a total of 832/2 = 416 channels
• Set aside 21 for control channels for each provider
• Therefore 416-21 = 395 traffic channels per provider
• Per cell, we can have 56 and 3/7 channels if N=7
• Four cells are given 56 channels and three cells are given 57 channels
28
Practice: IS136 NA-TDMA
• NA-TDMA is a hybrid FDMA/TDMA scheme• Therefore each frequency will have time slots that
are shared by multiple calls• Typical: three calls share one frequency• NA-TDMA is three times as efficient• Same frequency allocation as for AMPS• Carriers are 30 kHz apart - Bandwidth
29
The TDMA aspect: frames and time slots
• Every frame is 40ms long and consists of 6 time slots
6 1 652 3 4 1 2 3 4
6 1 652 3 4 1 2 3 4 5
40ms
45 MHz or
80 MHz
base station to mobile
mobile to base station
30
What data (transmission) rate can be used at each carrier frequency?
• Each time slot carries 324 bits• There are 6 timeslots/frame• 1 frame is 40ms• Therefore, data rate per carrier (frequency) is:
skbframems
frametimeslotstimeslotbits/6.48
/40
/6/324
31
Data rate of a carrier (frequency)
• Voice calls in NA-TDMA– Speech codec rate: 7.95kbps– Channel coding rate: 13kbps– Fits within 16.2kbps– One voice call needs two timeslots per frame– So three calls can be carried at each carrier frequency
32
Use of circuit-based multiplexing on different types of links
• Multi-access wireless link– Cellular phones
Point-to-point links between switches
33
Techniques used in practice today
• Time-division multiplexing– Plesiochronous Digital Hierarchy (PDH)
• DS0, DS1, DS3 (one phone call: DS0)
– Synchronous Optical Network (SONET) - US– Synchronous Digital Hierarchy (SDH) - others
• Wavelength-division multiplexing (on fiber)
34
Time Division Multiplexing: The T1 carrier (1.544 Mbps)
.
.
1
24
8 bitsevery 125s
RATE: ?
1 24
2
...........2
8 * 24 + 1 = 193 bitsevery 125s
RATE: ?Round-robin cycle through andtransmit 8 bits each from input 1 through 24onto output link and then start again from input 1
Input links
Output link
35
North American Digital Multiplexing Hierarchy
• DS0, 64 kbps channel• DS1, 1.544 Mbps channel (T1)• DS2, 6.312 Mbps channel• DS3, 44.736 Mbps channel (T3)• DS4, 274.176 Mbps channel
1
24
1
4
1
7
1
6
Mux
Mux
Mux
Mux
DS1 signal, 1.544Mbps
DS2 signal, 6.312Mbps
DS3 signal, 44.736Mpbs
DS4 signal
274.176Mbps
24 DS04 DS1
7 DS2
6 DS3
36
810 x 8 bits/125 sec = 51.84MbpsSTS-1 rate = 51.84Mbps
9 rows
90 columns
1
2Order of transmission
Overhead (3 columns): error detection bits,
etc.Line overhead +
Section overhead
Payload called Synchronous Payload Envelope (SPE)
Synchronous Transport Signal (STS-1) Frame
90 x 9 = 810 bytes
Frame period = 125 sec
SPE is 87 columns
Path overhead: one column inside SPE
Byte Byte
37
SONET/SDH rates(number is the multiplier)
Tanenbaum
How many bits are carried within a single SONET frame of an OC48 signal?How many bits of the above number can be used to carry user data (payload)?Verify that the SPE data rate in the table above is correct for the OC48 signal.
OpticalCarrier
38
Back to outline (status check)
• Outline• Types of links
• Multi-access link • Point-to-point link
• Types of multiplexing techniques• Circuit-based multiplexingPacket-based multiplexing
39
Packet-based multiplexing
• For point-to-point links– Scheduling techniques
• For multi-access links– Random access MAC schemes
40
Packet-based multiplexer
A
B
C
Input links
Output link
Header Data payload
Packet-based multiplexing on a point-to-point link
Packet: a string of bitsPayload: user-data bits being sentHeader: overhead added by protocol
Scheduling algorithms: FCFS, priority
41
Packet buffering
• Buffers hold packets waiting to be transmitted on output link– FCFS: Single buffer
– Priority: As many buffers as there are priority classes
• When the transmitter is ready to choose the next packet for transmission– FCFS: Select next packet in line if buffer is non-empty
– Priority: Check buffers in order of priority and transmit packet from the first non-empty buffer
42
Rules for order of packet transmission
• If a packet P arrives when the transmitter is free, and all buffers are empty, then the packet will be transmitted immediately. Add packet transmission time to packet arrival time to determine packet departure time.
• If a packet P arrives into a buffer while another packet Q is being transmitted, packet P is served only after– Packet Q is fully transmitted (non-preemption), and
– Higher-or-equal priority packets that are already in the buffers are transmitted.
– Based on scheduling discipline, and the number of packets ahead of packet P in the buffers, determine departure time for P.
43
Examples of packet multiplexing
• Point-to-point links between switches
• Point-to-point link between endpoint and switch
44
Packet-based multiplexing on a point-to-point link between switches
Host 1 Host 2
Switch
Switch
Host 3 Host 4Packet-basedmultiplexer
inputlink
inputlink
outputlink
45
Packet-based multiplexing on a point-to-point link between switches
App. 2 App. 2Host 1 Host 2
Switch
Switch
App. 1
Host 3
App. 1Host 4
Two communicationsessions sharing this switch-to-switch link
46
Packet-based multiplexing on a point-to-point link between a host and a switch
App. 2
App. 2
Host 1
Host 2
Switch Switch
Host 3 Host 4
App. 3
App. 3
Packet-basedmultiplexer
47
Packet-based multiplexing on a point-to-point link between a host and a switch
App. 2
App. 2
Host 1
Host 2
Switch
Host 3 Host 4
App. 3
App. 3
Two communications sessions sharing this host-to-switch link
48
Back to outline (status check)
• Outline• Types of links
• Multi-access link • Point-to-point link
• Types of multiplexing techniques• Circuit-based multiplexing• Packet-based multiplexing
o For point-to-point links
- Scheduling techniques For multi-access links
- Random access schemes
49
Random access MAC protocols
• No reservations are made; instead a host just sends data packets
• What can happen?– Collision (recall multi-access)
• Need to avoid collisions or detect collisions and retransmit
– What’s the cost of being too careful to avoid collisions?• Utilization will be sacrificed
50Courtesy: http://mars.gmu.edu/dspace/bitstream/1920/2497/1/pca_608_23_16n.jpg
Analogy of a MULTI-ACCESS LINK: a car pulls up to a road; driver looks right/left before entering - called "carrier sensing"
Random-access MAC (packet based sharing on multi-access links)
• ALOHA: just send & wait for ACK
• Slotted ALOHA: send in slots
• CSMA: sense carrier, but wait for ACK
• CSMA/CD: detect collisions instead of waiting for ACK
• CSMA/CA
51
ALOHA
• Simplest scheme• True free-for-all. When a node needs to send, it
does so. It listens for an amount of time equal to the maximum round trip delay plus a fixed increment. If it hears an acknowledgment, fine; otherwise it resends after waiting a random amount of time. After several attempts, it gives up.
• Low delay if light load• Max. utilization: 18%
52
Slotted ALOHA
• All frames are of same size L
• If link rate is C, time is divided into slots of size L/C (a slot equals the time to transmit one frame)
• Nodes can transmit frames only at the beg. of slots
• Nodes are sync’ed so each node knows when slots start
• If more than one node sends, all nodes detect the collision even before the slot ends
• Vulnerable period is one-way prop. delay, not two-way as in ALOHA. So maximum throughput is double: 37%.
53From Kurose and Ross
CSMA
• Carrier Sense Multiple Access– sense carrier– if idle, send
• wait for ack– If there isn’t one, assume there was a collision, retransmit
– if busy, wait
• Vulnerable period: one tprop
54
Types of CSMA schemes
• 1-persistent: – if busy, constantly sense channel– if idle, send immediately– if collision is detected, wait a random amount of time before retransmitting
• Non-persistent:– sense channel when station has a packet to send– if busy, wait a random amount of time before sensing again;– if idle, send immediately– collisions reduced because sensing is not rescheduled immediately – drawback: more delay
• p-persistent: combines 1-persistent goal of reduced idle channel time with the non-persistent goal of reduced collisions.
– sense constantly if busy and the station needs to send a packet– if the channel is idle, transmit packet with probability p– with probability 1-p station waits an additional tprop before sensing again
55
CSMA/CD
• CSMA/Collision Detection (CSMA/CD): – In CSMA, if collision occurs, need to wait until
damaged frames have fully propagated. For long frames compared to propagation delay, this could lead to significant waste of capacity. So add collision detection.
– Listen for collision and immediately suspend sending data if collision is detected.
– Rule: Frames should be long enough to allow collision detection prior to the end of transmission
56
CSMA/CA: 802.11
• Why CA (Collision Avoidance) and not CD?– difficult to receive (sense collisions) when
transmitting due to weak received signals (fading)– hidden station problem:
• Two mutually far away stations A and C want to send to B.
• At A and C, channel appears idle• But collision occurs at B
Kurose and Ross’ slides
57
58
Random-access MAC protocols used in practice today
• Multi-access link• Wired: Ethernet
– CSMA/CD scheme
• Wireless: IEEE 802.11• Wireless and mobile networks class
59
Example of CSMA/CD: Ethernet
Ethernet protocol:
1. Each station listens before it transmits.
2. If the channel is busy, it waits until the channel goes idle, and then it transmits.
3. If the channel is idle it transmits immediately. Continue sensing.
4. If collision is detected, transmit a brief jamming signal, then cease transmission, wait for a random time, and retransmit.
• collision detection is not by waiting for an ACK
60
Collisions in Ethernet
• The collision resolution process of Ethernet requires that a collision is detected while a station is still transmitting.
• Assume: Maximum propagation delay on the bus is tprop.
A Begins TransmissionA B
B Begins TransmissionA B
t0
t0+tprop-
61
Collisions in Ethernet
• Restrictions: Frame should be at least as long as 2tpropr, where r is the transmission rate of
the link, and tprop is the max. one-way propagation delay
B Detects CollisionA B
t0+tprop
A Detects CollisionA BJust Before Endof Transmission
t0+2tprop
62
Exponential Backoff Algorithm
• If a station is involved in a collision, it waits a random amount of time before attempting a retransmission.
• The random time is determined by the following algorithm:
• Set “slot time” to 2tprop.• After first collision wait 0 or 1 slot time.• After i-th collision, wait a random number between 0 and 2i-1
time slots.• Do not increase random number range if i=10.• Give up after 16 collisions.
63
Ethernet performance
max: maximum efficiency under heavy load conditions
• S: length of frame; r: data rate
• tprop: one-way propagation delay
• e: average number of contention slots before success in getting the medium
• 2tprop is contention slot• Frame length assumed to be fixed in
deriving this formula; not true for Ethernet (approximation)
718.2
2max
e
ettrS
rS
propprop
64
Ethernet frame format
Example MAC address:04-3C-5A-11-26-78
Dst. Addr: Destination address (6-byte MAC address)Src. Addr: Source Address (6-byte MAC address)Type: What type of payload is being carried in frame
- e.g., IP datagram: 0800 (hexadecimal)CRC: Cyclic Redundancy Code (Error detection)
number of bytes
CRCSrc.Addr. Data
IPdatagram
Type
66 46-1500
0800
Type
2
2
46-1500
4
Dst.Addr.
65
Ethernet protocol support for DLL functions
• Destination and source MAC address fields– for multiplexing
• CRC – for error detection
• No sequence numbers/ACK numbers– for error correction
• Pause feature– for ON/OFF flow control (special control frame)
66
Summary
Circuit-based multiplexing
Packet-based multiplexing
Multi-access wireless link Cellular (FDMA/TDMA)
IEEE 802.11 (WiFi)
Multi-access wired link Ethernet hub
Point-to-point switch-to-switch link
PDH, SONET, WDM Ethernet switch
Point-to-point endpoint-to-switch link
Plain Old Telephone Service (POTS)(space division multiplexing)
Ethernet
Multiplexing/MAC schemesTypes of links
Phone links from residences carry only one phone call andhence it is space-division multiplexing; DSL: new technology for multiplexing data with voice
67
Supplemental reading
• Tanenbaum's 4th edition– Section 4.3.3 (The Ethernet MAC sublayer protocol)
– Section 4.3.4 (The binary exponential backoff algorithm)
• Leon-Garcia/Widjaja's 2nd edition– Section 4.1 (Multiplexing)
– Section 4.2.1 (SONET multiplexing)
– Section 5.7.1 (Statistical multiplexing)
– Section 6.4.1 (FDMA)
– Section 6.4.2 (TDMA)
68
Acknowledgment
• Few of the slides in this talk are taken from A. Tanenbaum’s textbook web site and a few from A. Leon-Garcia and I. Widjaja’s textbook web site.