csc581 communication networks ii chapter 6a: local area network (ethernet - 802.3) dr. cheer-sun...
TRANSCRIPT
CSC581Communication Networks II
Chapter 6a: Local Area Network
(Ethernet - 802.3)
Dr. Cheer-Sun Yang
2
Motivation
• Up to this point, we’ve talked about point-to-point communication.
• We may need to connect many computers together.
• Local Area Network(LAN): if they are located in a relatively close geographic area.
• Metropolitan Area Network (MAN) : extends over entire city
• Wide Area Network (WAN) : extends across public switching network.
3
Motivation(cont’d)
• Traditionally, LAN is considered a broadcast network, while WAN is considered a switched network.
• After ATM, a cell switching network, is introduced to connect LANs, the taxonomy cannot be used.
• To support LAN, data link layer is split into Medium Access (MAC) Sublayer and Logical Link Control (LLC) Sublayer.
4
Topics
• LAN protocol stack: general discussion on MAC and LLC
• MAC: Contention Protocols and Contention-Free Protocols
• Contention Protocols: ALOHA (pure ALOHA and slotted ALOHA), CSMA(p-persistent), CSMA-CD
• Contention-Free Protocols: reversation systems, polling, Token-Ring (next set of lecture slides)
5
Multiple Access vs. Point-to-Point
• Multiple hosts are involved • Sharing communication media
– channelization schemes or contention free protocols : static and collision-free
– MAC schemes or contention protocols
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
6
12
3
4
5M
Shared MultipleAccess Medium
Figure 6.1
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
7
Medium Sharing Techniques
Static Channelization
Dynamic Medium Access Control
Scheduling Random Access
Figure 6.2
8
Medium Access
• Satellite communications• Multidrop telephone line• Ring network: token ring, or FDDI• Multidrop bus: Ethernet or token bus• Wireless LAN
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
9
Satellite Channel = fin
= fout
Figure 6.3
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
10
Multidrop telephone lines
Inbound line
Outbound line
Figure 6.4
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
11
Ring networks
Multitapped Bus
Figure 6.5
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
12
Figure 6.6
13
Delay-Bandwidth Product
• What happens when a collision occurs?• What effect will delaying have on
efficiency?• How long will a station need to detect
collision after a transmission?
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
14
A transmits at t = 0
Distance d meterstprop = d / seconds
A B
B transmits before t = tprop and detectscollision shortlythereafter
A B
A BA detectscollision at t = 2 tprop
Figure 6.7
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
15
Tra
nsfe
r D
elay
Load
E[T]/E[X]
max 1
1
Figure 6.8
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
16
Tra
nsfe
r D
elay
Load
E[T]/E[X]
max 1
1
max
aa
a > a
Figure 6.9
17
LAN Structure
• NIC: Network Interface Card – handling medium access and addressing– each has a physical address of 48 bits (type
ifconfig/all on a DOS Command Prompt)
• LLC Sublayer: IEEE 802.2• MAC Sublayer: IEEE 802.3(Ethernet),
802.4(Token Bus), 802.5(Token Ring), 802.11(Wireless), FDDI
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
18
Data LinkLayer
802.3CSMA-CD
802.5Token Ring
802.2 Logical Link Control
PhysicalLayer
MAC
LLC
802.11Wireless
LAN
Network Layer Network Layer
PhysicalLayer
OSIIEEE 802
Various Physical Layers
OtherLANs
Figure 6.11
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
19
PHY
MAC
PHY
MAC
PHY
MAC
Unreliable Datagram Service
Figure 6.12
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
20
PHY
MAC
PHY
MAC
PHY
MAC
Reliable Packet Service
LLCLLC LLC
A C
A C
Figure 6.13
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
21
(a)
RAM
RAMROM
Ethernet Processor
(b)
Figure 6.10
22
802 Physical Layer Design Issues
• Encoding/decoding
• Preamble generation/removal
• Bit transmission/reception
• Transmission medium and topology
23
802 Physical Layer
• Required hardware for connecting a PC to Ethernet directly:– Transceiver
– Attachment Unit Interface (AUI) cable
– Network Interface Card (NIC) also known as Network Adapter
• Required hardware for connecting a PC to a remote computer: modem (with the help of PPP)
24
Transmission Media• Twisted pair
– Not practical in shared bus at higher data rates
• Baseband coaxial cable– Used by Ethernet
• Broadband coaxial cable– Included in 802.3 specification but no longer made
• Optical fiber– Expensive– Difficulty with availability– Not used
• Few new installations– Replaced by star based twisted pair and optical fiber
25
Baseband Coaxial Cable
• Uses digital signaling• Manchester or Differential Manchester encoding• Entire frequency spectrum of cable used• Single channel on cable• Bi-directional• Few kilometer range• Ethernet (basis for 802.3) at 10Mbps• 50 ohm cable
26
10Base5
• Ethernet and 802.3 originally used 0.4 inch diameter cable at 10Mbps
• Max cable length 500m• Distance between taps a multiple of 2.5m
– Ensures that reflections from taps do not add in phase
• Max 100 taps• 10Base5
27
10Base2• Cheapernet• 0.25 inch cable
– More flexible
– Easier to bring to workstation
– Cheaper electronics
– Greater attenuation
– Lower noise resistance
– Fewer taps (30)
– Shorter distance (200m)
28
Cable Specifications for 802.3
• 10BaseT: 10 Mbps, baseband, unshield twisted
• 10Base2: 10Mbps, Cat. 2 coaxial• 10Base5: 10 Mbps, Cat. 5, Cat. 5e coaxial• 100BaseTX: 100 Mbps, twisted cable (Fast
Ethernet)• 10Broad36: maximum segment length 3600
meters
29
Gigabit Ethernet
• 1000Base-SX– Short wavelength, multimode fiber
• 1000Base-LX– Long wavelength, Multi or single mode fiber
• 1000Base-CX– Copper jumpers <25m, shielded twisted pair
• 1000Base-T– 4 pairs, cat 5 UTP
• Signaling - 8B/10B
30
Connectors
• T-connector: used to form a bus topology
• RJ-45 connectors: for connecting a PC to another PC, Ethernet, or hub.– Cross-over: a direct connection to another PC– Straight-through: connection with the Ethernet
jack or hub.
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
31
(a)
(b)
transceivers
Figure 6.55
32
Repeaters
• Transmits in both directions• Joins two segments of cable• No buffering• No logical isolation of segments• If two stations on different segments send at
the same time, packets will collide• Only one path of segments and repeaters
between any two stations
33
Hub and Switch
• An Ethernet hub is a repeater.• An Ethernet switch is a bridge.
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
34
(a)
(b)
High-Speed Backplane or Interconnection fabric
Single collision domain
Figure 6.56
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
35
Ethernet Switch
Ethernet Switch
Server
100 Mbps links
10 Mbps links
Figure 6.57
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
36
DestinationSAP Address
Source SAP Address Information
1 byte 1
Control
1 or 2
Destination SAP Address Source SAP Address
I/G
7 bits1
C/R
7 bits1
I/G = Individual or group address C/R = Command or response frame
Figure 6.14
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
37
LLC Header
IP
Data
MAC Header
FCS
LLC PDU
IP Packet
Figure 6.15
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
38
Preamble SDDestination
AddressSource Address
Type Information Pad FCS
7 1 2 or 6 2 or 6 2 4
64 to 1518 bytesSynch Startframe
Ethernet Frame
Figure 6.53
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
39
Preamble SDDestination
AddressSource Address
Length Information Pad FCS
7 1 2 or 6 2 or 6 2 4
64 to 1518 bytesSynch Startframe
0 Single address
1 Group address
• Destination address is either single addressor group address (broadcast = 111...111)
• Addresses are defined on local or universal basis• 246 possible global addresses
0 Local address
1 Global address
802.3 MAC Frame
Figure 6.52
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
40
AA AA 03
Information
MAC Header
FCS802.3 Frame
LLC PDU
SNAP Header
TypeORG
SNAP PDU
3 2
1 1 1
Figure 6.54
41
Media Access Control Sublayer
• Assembly of data into frame with address and error detection fields
• Disassembly of frame– Address recognition
– Error detection
• Govern access to transmission medium– Not found in traditional layer 2 data link control
– Also known as Contention protocols (section 6.3)
42
Collision vs. Contention
• When the communication link is used by one station to transmit a frame, another station connecting to the same link tries to send a packet– collision
• Contention: accessing the medium with the consideration that a collision may occur.
• Contention Protocols: the protocol is designed to deal with collision using contention.
• Collision-free Protocols: the protocol is designed so that collision will not occur.
43
Contention Protocols
• Pure ALOHA
• Slotted ALOHA
• Carrier Sense Multiple Access (CSMA)
• Persistent and non-persistent CSMA
• CSMA with Collision Detection (CSMA/CD)
44
Collision-Free Protocols
• A Bit-Map Protocol: reservation protocol
• Polling
• Token Passing Ring
45
Pure Aloha• Packet Radio• When station has frame, it sends• Station listens (for max round trip time)plus small
increment• If ACK, fine. If not, retransmit• If no ACK after repeated transmissions, give up• Frame check sequence (as in HDLC)
46
Pure Aloha(cont’d)
• If frame OK and address matches receiver, send ACK
• Frame may be damaged by noise or by another station transmitting at the same time (collision)
• Any overlap of frames causes collision• Max utilization 18% (WHY?)
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
47
tt0t0-X t0+X t0+X+2tprop
t0+X+2tprop
Vulnerableperiod
Time-out Backoffperiod
Retransmission if necessary
First transmission Retransmission
Figure 6.16
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
48
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.01
563
0.03
125
0.06
25
0.12
5
0.25 0.5 1 2 4 8
Ge-G
Ge-2G
G
S0.184
0.368
Figure 6.17
49
The Efficiency of Pure Aloha
G = the traffic measured as the average number of frames generated per slot
S = the success rate, success frame / slot
= G e –2G (pure Aloha)
S = G e –G (slotted Aloha)
S = Pr[no frame is generated]= e -G
Pr[k frames are generated] = G k e –G / k !
This is called a probability distribution function(pdf) forPoisson distribution. (e = 2.7818…)
50
The Efficiency of Pure Aloha
= G e –2G (pure Aloha)S = G * P 0
If there is no negative acknowledgement frame received after sending out one frame, the transmission is successful. SoP0 = Pr[no frames are generated in 2 time slots] = e -G * e –G
= e –2G
51
The Efficiency of Pure Aloha
S = G * P 0= G e –2G (pure Aloha)
We need to find the value of G such that S is maximized.S’ = G (-2) e –2G + e –2G = (1 – 2G) * e –2G
Let S’ = 0 => G = ½ When G = ½, S = 1/ 2e = 0.184 = 18%
52
Slotted ALOHA
• A computer is not allowed to send until the beginning of the next slot.
• Time in uniform slots equal to frame transmission time
• When a frame is allowed to be transmitted, there is no collision.
• Need central clock (or other sync mechanism)• Transmission begins at slot boundary• Max utilization 37% (WHY?)
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
53
t(k+1)XkX t0 +X+2tpropt0 +X+2tprop
Figure 6.18
Vulnerableperiod
Time-out Backoffperiod
Retransmission if necessary
54
The Efficiency of Slotted Aloha
= G e –G (slotted Aloha)S = G * P 0
If there is no other frame received after sending out one frame, the transmission is successful. SoP0 = Pr[no frames are generated in one time slots] = e -G
55
The Efficiency of Slotted Aloha
S = G * P 0= G e –G (slotted Aloha)
We need to find the value of G such that S is maximized.S’ = G (-1) e –G + e –G = (1 –G) * e –G
Let S’ = 0 => G = 1 When G = 1, S = 1/ e = 0.368 = 37%
56
Carrier Sense Multiple Access (CSMA) Protocols
• Protocols in which stations listen for a carrier (i.e., a transmission) and act accordingly are called carrier sense protocols.– 1-persistent CSMA– Non-persistent CSMA– p-persistent CSMA
57
CSMA
• Propagation time is much less than transmission time
• All stations know that a transmission has started almost immediately
• First listen for clear medium (carrier sense)
58
If Busy?
• If medium is idle, transmit
• If busy, listen for idle then transmit immediately
• No ACK then retransmit
• If two stations are waiting, it is called a collision.
59
1-persistent CSMA
• When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that moment.
• If the channel is busy, the station waits until it becomes idle.
• The station retransmits with a probability of 1 when it finds that the channel is idle.
60
Non-persistent CSMA
• When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that moment.
• If the channel is busy, the station waits until it becomes idle.
• The station does not keep trying. It waits for a random number of time and retries.
61
P-persistent CSMA
• This applies to slotted channels. When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that moment.
• If the channel is idle, it transmits with a probability p. With a probability of 1-p, it defers until the next slot.
• If the next slot is also idle, it transmits or defers again with probability p and q.
62
CSMA
• Max utilization depends on propagation time (medium length) and frame length. Longer frame and shorter propagation gives better utilization.
• Collisions still can be a problem, especially with p-persistent CSMA.
• One way to reduce the frequency of collision with CSMA is to lower the probability that a station will send when a previous is done.
• Smaller values of p => fewer collision.
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
63
A
Station A begins transmission at t=0
A
Station A captureschannelat t=tprop
Figure 6.19
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
64
sensing
Figure 6.20
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
65
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.0
2
0.0
3
0.0
6
0.1
3
0.2
5
0.5 1 2 4 8 16
32
64
Non-PersistentCSMA
0.81
0.51
0.14
S
G
0.01
0.1
1
Figure 6.21 - Part 1
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
66
0
0.1
0.2
0.3
0.4
0.5
0.6
0.0
2
0.0
3
0.0
6
0.1
3
0.2
5
0.5 1 2 4 8 16
32
64
1-PersistentCSMA
0.53
0.45
0.16
S
G
0.01
0.1
1
Figure 6.21 - Part 2
67
Any Other Way?
• Is there another way to improve the successful rate?
• Yes if there is a way to detect collision prior to transmission.
• Why is this faster?
68
Collisions with and without Detection
• Without collision detection, a station must send and then wait for 2 time slots before another attempt to send.
• With collision detection, a station can stop transmission if collision detection requires less time than sending a frame.
69
Collision Detection
• On baseband bus, collision produces much higher signal voltage than signal
• Collision detected if cable signal greater than single station signal
• Signal attenuated over distance• Limit distance to 500m (10Base5) or 200m
(10Base2)• For twisted pair (star-topology) activity on more
than one port is collision• Special collision presence signal
70
CSMA/CD
• With CSMA, collision occupies medium for duration of transmission
• Stations listen while transmitting
• If medium idle, transmit• If busy, listen for idle, then transmit• If collision detected, jam then ease transmission• After jam, wait random time then start again
– Binary exponential back off
71
CSMA/CDOperation
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
72
A begins to transmit at t=0
A BB begins to transmit at t= tprop-B detectscollision at t= tprop
A B
A B
A detectscollision at t= 2 tprop-
It takes 2 tprop to find out if channel has been captured
Figure 6.22
73
Binary Exponential Back Off
• If a station’s frame collides for the first time, wait 0 or 1 time slot (chosen randomly) before trying again.
• If it collides a second time, wait 0, 1, 2, or 3 slots (again, chosen randomly).
• After a third collision, wait anywhere from 0 to 2 n –1 slots if n <= 10, if n > 10, wait between 0 to 1024 (2 10) slots.
• After 16 collisions, give up. Further recovery is up to the upper layer, such as a user.
74
Frame Format (802.3)
• Start of frame delimiter: 10101011• Destination address• Source address• Data length field• Data field• Pad field: the data field must be at least 46 octets.• Frame check sequence: using 32-bit CRC.
75
Efficiency of 802.3(p.363)
P: the probability that a frame is sent without a collisionPs: the probability that a station sendsThe probability of a collision = 1 – P.The probability of a transmission requiring exactly N attempts == N-1 collisions followed by a success= N * Ps * ( 1- Ps) N - 1
76
Efficiency of 802.3
We would like to know under what conditions the largest number of frames are sent successfully.
77
Efficiency of 802.3
The probability of a transmission requiring exactly N attempts =P= N * Ps * ( 1- Ps) N – 1
dP/dPs = N(1-Ps)N-1 + N Ps (N-1)(1-Ps)N-2
= N (1-Ps) N-2 [1- Ps – Ps (N –1) ]Let dP/dPs = 0 => Ps = 1/N
78
Efficiency of 802.3
How many time slots has passed before a frame is sent successfully?
79
The Efficiency of 802.3
The contention period = the number of time slots passed before a successful transmission
80
The Efficiency of 802.3
Assume that the probability of a success in each attempt = p.The probability of a collision = 1 – p.The probability of a transmission requiring exactly i+1 attempts = P(i+1)
= i collisions followed by a success= p (1- p) i
81
The Efficiency of 802.3
The contention period
=
= (1-p)/p
0
2)1/(*i
i xxxiGiven
0
2/)1(**)1(*i
i pppppi
82
The Efficiency of 802.3
The contention period (C)
= (1/p) –1
0 <= p <= 1 (p: the successful rate)If p -> 1 C -> 0If p -> 0, C = largeWe’ve found that when Ps=1/N, p is maximized.So, C = (1-1/N)1-N -1 when p is maximized. If N->large, C = 2.718 – 1 = 1.718 (close to 2).
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
83
Probability of 1 successful transmission:
frame contention frame
Psuccess np(1 p)n 1
Psuccess is maximized at p=1/n:
Psuccess
max n(11
n)n 1
1
e
00.10.20.30.40.50.6
2 4 6 8 10 12 14 16
n
Pmax
Figure 6.23
84
The Utilization Rate of Ethernet
The percent utilization (U) does not depend on the number of stations in practice. A station will try to send regardless of how many other stations there are. The previous result often is used as benchmarks against which measures are made to estimate efficiency.
85
The Utilization Rate of Ethernet
The percent utilization (U) is defined as the amount of time spent on transmitting a frame as a percentage of the total time spent on contending and transmitting. Assume:R = transmission rateF = number of bits in a frameT = slot timeSo U = %100*
*CTRF
RF
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
86
05
1015202530
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
E[T
]
M=16
M=8
M=4
M=2
M=1
Figure 6.50
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
87
CSMA-CD
0
5
10
15
20
25
30
0
0.06
0.12
0.18
0.24 0.3
0.36
0.42
0.48
0.54 0.6
0.66
0.72
0.78
0.84 0.9
0.96
Load
Avg
. T
ran
sfe
r D
ela
y
a = 0.01a = 0.1a = 0.2
Figure 6.51
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
88
0
0.2
0.4
0.6
0.8
1
0.01 0.1 1
Aloha
Slotted Aloha
1-P CSMANon-P CSMA
CSMA/CD
a
max
Figure 6.24
89
Contention Free Protocols
* Reservation Systems* Polling* Token Passing Ring
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
90
time1 frame
Reservationinterval
Data Transmissions
r d d d r d d d
1 frame
r = 1 2 3 M Each station has ownminislot for making reservations
Figure 6.25
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
91
tr 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
(a) Negligible Propagation Delay
tr 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
8
Non-Negligible Propagation Delay(b)
Figure 6.26
Copyright 2000 McGraw-Hill Leon-Garcia and Widjaja Communication Networks
92
Shared inbound line
Outbound lineCentralController
(a)
(b) (c)
CentralController
Figure 6.27
93
Required Reading
• Section 6.1, 6.2, 6.3, 6.4.1, 6.4.2, 6.6.1