240 likes | 422 Views
U 628 Computer Networks. CLASS 10, Wed. Sep. 28 2005 Stefano Basagni Fall 2005 M,W,T 4:35pm-5:40pm. Carrier Sense Multiple Access (CSMA). Slotted Aloha scarce channel utilization (1/e) In LAN a terminal can check what other terminals are doing Carrier sense protocols
E N D
U 628Computer Networks CLASS 10, Wed. Sep. 28 2005 Stefano Basagni Fall 2005 M,W,T 4:35pm-5:40pm
Carrier Sense Multiple Access (CSMA) • Slotted Aloha scarce channel utilization (1/e) • In LAN a terminal can check what other terminals are doing • Carrier sense protocols • A terminal listen for a transmission before using the channel
Persistent CSMA, 1 • 1-persistent CSMA • A terminal check the channel • Idle: Transmits • Busy: Waits till it is idle • Collision: The terminal starts again after a random time • The terminal transmits with a probability of 1 when the channel is idle
Persistent CSMA, 2 • Propagation delay affects the protocol • Two terminals may both start transmitting if the signals have not been mutually detected • Even if the delay is 0 collisions may occur • Two terminal both waiting for a third to finish transmitting
Non-persistent CSMA • If the channel is idle, a terminal transmit • If the channel is busy, a terminal waits for a random time • Instead of keep testing • Better utilization, longer delays
p-Persistent CSMA • Slotted channel • If channel is idle, terminal transmits with probability p • With probability 1-p it waits for the next slot • If the channel is busy, terminal waits a random time and tries again
CSMA Channel Utilization Comparison of the channel utilization versus load for various random access protocols
CSMA with Collision Detection • CSMA/CD • A terminal aborts transmission as soon as it detects a collision • Saves time and bandwidth • Used on LANs • Ethernet
CSMA/CD • A terminal finishes transmitting a frame • Some other terminal starts transmitting immediately • Collisions are detected by looking at what is on the channel • Compared to what has been transmitted • After a collision has been detected a terminal waits a random time and tries again
CSMA/CD, the Model CSMA/CD can be in one of three states: contention, transmission, or idle
Timing Issues • How long it takes to realize that there is collision? • It is important for the contention duration • Minimum time: Propagation between two terminals • Be τ the maximum • A terminal cannot be sure it has the channel before having transmitted for 2τ
Contention Interval • Modeled as a slotted Aloha system • Each slot is long 2τ • Example • Coax cable 1Km long τ = 5μsec • Note: Collision detection is inherently an analog process • Sometimes coding is needed for detection • CSMA/CD is half-duplex • A terminal cannot send and receive frames at the same time • It has to keep checking for collisions
CSMA/CD: Problems • Collisions occur during the contention period • They adversely affect the performance • Especially for large τs and short frames • Also, collision detection is not universally applicable • E.g., wireless networks
Collision-Free Protocols • Contention is resolved without collisions • Not even in the contention period • Scenario • N terminals • Addresses from 0 to N-1 • Propagation delay is negligible
A Bit-Map Protocol • Each contention period consists of exactly N slots • If terminal i has a frame to transmit, it sends a 1 in the i-th slot • After the contention period is passed, every terminal knows who will transmit • Transmissions are in numerical order • No collision ever occurs
Bit-Map Functioning The basic bit-map protocol
Reservation Protocols • Like the bit-map • The desire to transmit is broadcast before the actual transmission • Drawbacks • If a terminal becomes ready to transmit after its slot is passed, tough • It must wait till the next contention period comes around
Performance Analysis, 1 • Time unit = contention slot • Data frame = d time units • Under low traffic, the map is repeated over and over • For lack of data frames • Low numbered terminals (e.g., 0 or 1) • When they get ready the current map could be in the middle • They have to wait an average of N/2 bit slots for the current scan to finish and a N bit slots for another full scan to complete
Performance Analysis, 2 • High numbered terminals • Will wait an average of N/2 bit slots • Average wait for all: N bit slots • 1.5N for low numbered terminals • 0.5N for high numbered terminals • Channel efficiency at low load • Overhead for frame is N bits • Amount of data is d bits • Efficiency: d / ( N + d )
Binary Countdown • Bit-Map does not scale well • Overhead of 1 bit per station • Solution: Use (fixed size) terminal addresses • Terminal that has a frame transmits its address bit by bit (from leftmost) • Corresponding bits are ORed
Binary Countdown Arbitration Rule • A terminal gives up if a high-order bit position that is 0 in its address is overwritten by a 1 • Example: Competing terminals have addresses 0010, 0100, 1001 and 1010 • In the first bit time they transmit 0,0,1,1 • The OR gives a 1 • Terminals 0010 and 0100 give up • The other two continue with the second bit • The winner sends its frame, and the bidding cycle starts again
Binary Countdown, Example The binary countdown protocol. A dash indicates silence
Binary Countdown, Pro and Cons • High-numbered stations have higher priority • Can be good or bad, depending on the context • Channel efficiency: d / ( d + log2 N ) • The address could be the first bits of the data frame 100% efficiency
Assignments • Textbook, Chapter 4 till page 261 • Updated information in the class Blackboard page