data and computer communications chapter 11 local area...
TRANSCRIPT
Data and Computer Communications
Chapter 11 – Local Area Network
Computer Engineering Kyungpook National University
LAN Topologies Refers to the way in
which the stations attached to the network are interconnected
Computer Engineering Kyungpook National University
Bus Topology
Used with multipoint medium
All stations share capacity of bus
Heard by all stations
Only one station can transmit at a time
Need to regulate transmission to avoid collisions
Terminator absorbs frames at end of medium
Computer Engineering Kyungpook National University
Star Topology
Each station connects to central node
Usually via two point to point links
One for transmission and one for reception
Central node can act as hub or frame switch
Central Hub,
switch,
or repeater
Figure 11.2 Star Topology
Computer Engineering Kyungpook National University
Hubs Each station connected to hub
by two lines
Physically a star, logically a bus
Operate in broadcast fashion Hub acts as a repeater
Transmission from any station received by hub and retransmitted on all outgoing lines
Only one station can transmit at a time (hub) If two stations transmit at the
same time, there will be a collision
Station Station Station Station
Station
HHUB
Figure 11.10 Two-Level Star Topology
IHUBIHUB
Two cables
(twisted pair or
optical fiber)
Transmit
Receive
Computer Engineering Kyungpook National University
Hub vs Switch
Hub
Frame handling done in software
Analyzes and forwards one
frame at a time
Uses store-and-forward operation
Switch
Performs frame forwarding in
hardware
Can handle multiple frames
at a time
Can be viewed as full-duplex hub
Computer Engineering Kyungpook National University
The important ones are marked with *. The ones marked with are
hibernating. The one marked with † gave up.
IEEE 802 Standards Working Groups
Computer Engineering Kyungpook National University
IEEE 802 Standards
Physical
Data Link
Medium
Network
Transport
Session
Presentation
Application
OSI ReferenceModel
Physical
Medium AccessControl
Medium
Logical Link Control
( ) ( ) ( )
UpperLayer
ProtocolsLLC ServiceAccess Point
(LSAP)
Scopeof
IEEE 802Standards
Figure 11.3 IEEE 802 Protocol Layers Compared to OSI Model
IEEE 802Reference
Model
Computer Engineering Kyungpook National University
LAN Protocol Architecture
Computer Engineering Kyungpook National University
Encoding/decoding of signals
Preamble generation/removal
Bit transmission/reception
Physical Layer
Computer Engineering Kyungpook National University
Govern access to transmission medium
Encapsulation & Decapsulation On transmit, assemble data into frame
On reception, disassemble frame
PDU is referred to as a MAC frame
Perform address recognition Physical address (MAC address)
Detects errors and discards frames LLC optionally retransmits unsuccessful frames
Media Access Control
Computer Engineering Kyungpook National University
Reliable transmission of link level PDUs between stations
Flow and error control
Logical Link Control
Computer Engineering Kyungpook National University
Types of MAC
Round robin
• Each station given turn to transmit data
Reservation
• Divide medium into slots
• Good for stream traffic
Contention
• All stations contend for time
• Good for bursty traffic
• Simple to implement
• Tends to collapse under heavy load
Computer Engineering Kyungpook National University
Aloha
When station has frame, it immediately transmits its frame completely
Then listens for a bit over max round trip time
If receive ACK, then fine
If not, retransmit after a random backoff time
Frame may be damaged by noise or by another station transmitting at the same time (collision)
If no ACK after repeated transmissions, give up
Maximum utilization of channel about 18%
ACK
ACK ACK
ACK
Computer Engineering Kyungpook National University
DATA
Frame generation
Send immediately
ACK
DATA
Frame generation
Send immediately
No ACK
DATA
Backoff
Aloha
Computer Engineering Kyungpook National University
Example
Backoff
Computer Engineering Kyungpook National University
Slotted Aloha
Time divided into discrete intervals (slot) 1 slot → 1 frame
transmission time
Transmission begins at slot boundary The sending station
waits until the beginning of the next slot
Need central clock (or other sync mechanism)
Frames either miss or overlap totally
Increased utilization to about 37%
DATA
Frame generation
Send at slot beginning
ACK
Frame generation No ACK
Backoff
DATA DATA
Computer Engineering Kyungpook National University
CSMA (Carrier Sense Multiple Access)
First listen for channel to determine if there is another transmission in progress
If idle, transmit and wait for ACK
If no ACK in a reasonable time, then collision is assumed and retransmit
If two stations start at the same instant, collision
Utilization far exceeds ALOHA
Computer Engineering Kyungpook National University
Collision
channel
propagation
delay
Computer Engineering Kyungpook National University
Example
Backoff
Computer Engineering Kyungpook National University
Types of CSMA
Computer Engineering Kyungpook National University
Nonpersistent CSMA
1. If channel idle, transmit immediately
2. If channel busy, random backoff & retry
Random backoff reduces probability of collisions
Capacity is wasted because the medium will generally remain idle following the end of a transmission even if there are one or more stations waiting to transmit
DATA
DATA
Frame generation
Backoff
Sense channel again
If idle, send immediately
Defer
Computer Engineering Kyungpook National University
1-persistent CSMA
1. If channel idle, transmit immediately;
2. If channel busy, listen until idle; then transmit immediately
Avoids idle channel time
If two or more stations waiting, a collision is guaranteed
1-persistent stations are selfish 1-persistent seems more
unstable because of greed of the stations
DATA
DATA
Frame generation
Defer
Send immediately
If idle, send immediately
Computer Engineering Kyungpook National University
P-persistent CSMA 1. If channel idle, transmit with
probability p, and delay one time slot with probability (1–p)
2. If channel busy, listen until idle and repeat step 1
3. If transmission is delayed one time slot, repeat step 1
A compromise to try and reduce collisions and idle time
DATA
Frame generation slot
DATA Delay Delay Delay
DATA Delay Delay
Computer Engineering Kyungpook National University
Value of p?
Have n stations waiting to send, at end of transmission, expected number of sending stations is np If np > 1 on average there will be a collision
To avoid catastrophe np < 1
If heavy load expected, p must be small
Smaller p means stations wait longer
Computer Engineering Kyungpook National University
Which Persistence Algorithm?
IEEE 802.3 uses 1-persistent
Both nonpersistent and p-persistent have performance problems
• Because of greed of the stations
• Wasted time due to collisions is short
• With random backoff unlikely to collide on next attempt to send
1-persistent seems more unstable than p-persistent
Computer Engineering Kyungpook National University
CSMA/CD
Carrier sense multiple access with collision detection (CSMA/CD)
Simple rules for a polite human conversation
Listen before talking
If someone else begins talking at the same time as you, stop talking : CD (collision detection)
Most widely used LAN standard
Developed by
Xerox - original Ethernet
IEEE 802.3
Computer Engineering Kyungpook National University
CSMA/CD
If the medium is
idle, transmit;
otherwise, go to step 2
If the medium is busy,
continue to listen until the channel is idle, then transmit immediately
(1-persistent )
If a collision is detected, transmit a
brief jamming signal to
assure that all stations know that there has
been a collision and
cease transmission
After transmitting the jamming signal, wait a random amount of
time, referred to
as the backoff,
then attempt to transmit
again
Computer Engineering Kyungpook National University
CSMA/CD
DATA
Frame generation
Defer Send immediately as channel goes idle
DATA
Jam
If collision, stop & jam & backoff
Backoff
Contention window
slot
Retry
DATA
If idle, send immediately
Computer Engineering Kyungpook National University
CSMA/CD
Computer Engineering Kyungpook National University
Example
At time t0, station A begins transmission
At t1, both B and C are ready to transmit.
B senses a transmission and so defers.
However, C begins its own transmission
since C is still unaware of A’s transmission
When A’s transmission reaches C, at t2,
C detects the collision and ceases
transmission
The effect of the collision propagates
back to A, where it is detected by A at t3,
at which time A ceases transmission.
Computer Engineering Kyungpook National University
CSMA/CD Operation
CSMA/CD can be in one of the three states:
contention, transmission, or idle
Computer Engineering Kyungpook National University
Collision – Worst Case
tt A begins transmission
ttt p B begins transmission just before the frame sent from A arrives at B
ptt B is aware of collision immediately after it starts transmission
ptt 2 A is aware of collision after 2Tp
A B
A B
A B
A B
pt:delay nPropagatio
Collisions can occur only during 2Tp after transmission After 2Tp , the sender is guaranteed successful transmission without collision
Computer Engineering Kyungpook National University
Slot time
Slot_Time = 2Tp (round trip propagation delay) + safety margin
Time domain during which there is a possibility of collision
For 10Mbps Ethernet (d=2.5km),
2Tp = 2*(d/V)=25us → Slot_Time = 51.2us
Slot_Size = Slot_Time * Data_Rate = 512 bits (64byets)
The sender should be able to cease its transmission before completing its frame when it is aware of collision. So,
Frame Transmission Time (TX = L/R) > Slot_Time
Frame Length (L) > Slot_Size
Computer Engineering Kyungpook National University
Comparison
When channel idle
When channel busy
When collision
Nonpersistent Transmit immediately
Backoff & retry
N/A
P-persistent
Transmit with probability p or delay one slot with probability (1-p)
Listen until idle and transmit with p or delay one slot with (1-p)
N/A
1-persistent
Transmit immediately
Listen until idle, and then transmit
N/A
CSMA/CD
Stop transmission and backoff & retry
Computer Engineering Kyungpook National University
Binary Exponential Backoff
CW = 2k, k = min[n, 10] for nth retransmission
On first 10 attempts, contention window (CW) is doubled
Mean backoff time doubled
Value then remains the same for 6 further attempts
After 16 unsuccessful attempts, station gives up and reports
error
1-persistent algorithm with binary exponential backoff is
efficient over wide range of loads
But, backoff algorithm has last-in, first-out effect
TimeSlotCWUNIFORMTimeBackoff _)1,0(_
Computer Engineering Kyungpook National University
Example
Data rate = 10Mbps, Propagation delay = 12.5us
Slot_Time = 2* Propagation delay + safety margin =51.2us
Slot_Size = 51.2us*10Mbps = 512bit = 64Byte
1. Assuming that station A and B collide, they independently choose random backoff delays by
Backoff_Time = UNIFORM{0,1} * Slot_Time
2. If they collide again at the 2nd trial, they again choose random backoff delays by
Backoff_Time = UNIFORM{0,1,2,3} * Slot_Time
Computer Engineering Kyungpook National University
Example
A1 C2
C1 D1 C2 B1 B2 C1
B1
A2
A2
D1
A2
D1 D1 A2
A1 B1 C1 D1 C2 B2 A2
D1’s Waiting time = 31 Backoff time
0 10 13 30 34 39 50 70
A B C 1 2
1 2
1 t=0
30
t=13
50
t=10
34
Frame generation time
B and C collide and backoff
2 D 1 t=39
0
1
0
1
2
1 1
6
4
A, C, and D collide and backoff
A and D collide and backoff
A and D again collide and backoff
Computer Engineering Kyungpook National University
Collision Detection
Computer Engineering Kyungpook National University
Summary
LAN Topologies
Hubs and Layer 2 switches
LAN protocol architecture
IEEE 802 reference model
Logical link control
Medium access control
CSMA
CSMA/CD