Download presentation
Presentation is loading. Please wait.
Published byJemimah Hodge Modified over 8 years ago
1
1 University of Calgary CS 441 Part 4 Medium Access Control 4.1 MAC Sublayer - CSMA 4.2 MAC Sublayer - Collision Free
2
2 University of Calgary CS 441 4.1 Data Link Layer - Medium Access Control Data Link layer Physical layer Logical Link Control (LLC) Medium Access Control (MAC) Physical layer MAC Data Link Sublayer
3
3 University of Calgary CS 441 MAC Protocols - Two Basic Approaches Scheduling +ready stations transmit on a schedule +wastes time/bandwidth when scheduled station does not need channel, current station could have sent immediately +stations are always guaranteed to get through on the predefined schedule Random Access +ready stations transmit anytime +collisions can result when transmissions from different stations overlap +stations not guaranteed to get through (collisions may continue to occur)
4
4 University of Calgary CS 441 Broadcast Networks LANs +Ethernet - CSMA/ CD LANs - token ring +FDDI +Domain +MAP/TOP MANs +SONET Satellite
5
5 University of Calgary CS 441 Random Access Protocols - Variations no carrier sensing - cannot see if line is in use +transmit any time +detect collisions via traditional error detection schemes (eg Nacks, timeouts) +eg, ALOHA, SLOTTED ALOHA carrier sense multiple access - CSMA +sense if channel is busy, send if idle +collisions if 2 stations send at same time CSMA / CD: with Collision Detection +sense if channel is busy or a collision occurs +stops sending if a collision is noticed +eg, IEEE 802.3
6
6 University of Calgary CS 441 Sheduling Protocols - Variations fixed assignment +station has designated time slot for sending +eg, TDMA: Time Division Multiple Access, each station assigned a specific time slot stations 'reserve' a slot, then send via TDMA +good when more stations than available slots +arbitrary protocol can be used for reservations central control (polling) +primary polls stations for data in sequence distributed control +eg, token passing, station with token can transmit, IEEE 802.4: Token Bus
7
7 University of Calgary CS 441 Token Ring - Collision Free receiverxmitter Ring Interface receive buffer xmit buffer Station
8
8 University of Calgary CS 441 MAC Protocol Assumptions Stations +each 'station' asynchronously transmits frames +station blocked until transmission succeeds Single Channel +all stations send and receive on one channel Carrier Sensing +can detect if another station is transmitting Collision +stations may be able to detect collisions Time +continuous or slotted
9
9 University of Calgary CS 441 1-Persistent CSMA stations detect if channel is in use +don't transmit if channel busy +expect fewer collisions than Aloha transmit immediately when +channel is idle +after channel is busy if a collision occurs, wait a random time +good at light loads as alway send immediately +poor at heavy loads due to many collisions
10
10 University of Calgary CS 441 Non-Persistent CSMA when ready and channel idle, transmit immediately, if busy wait a random time wait a random time after a collision better at moderate to high loads as collisions are less likely to occur poorer at low loads as may defer unnecessarily
11
11 University of Calgary CS 441 p - Persistent CSMA defer transmission to next slot with probability p +if channel is busy or collision has occurred, repeats above step with small p, excellent at heavy loads but wasted slots at light loads as p increases approaches performance of 1- persistent protocol
12
12 University of Calgary CS 441 Given n Stations Choose a Value for p at end of transmission, expect number of stations to attempt transmission is n*p if n*p > 1, will always be a collision (on average) +but probability of stations sending after collision is also n*p! +collisions continue, throughput drops to 0 therefore must choose n*p < 1 for expected peak loads of n. as p gets smaller +stations wait longer for transmission, but collisions reduced
13
13 University of Calgary CS 441 CSMA / CD (Collision Detection) sender listens to channel while sending +if collision detected, xmit noise burst and abort transmission +saves time and bandwidth most commonly used protocol on LANs +originally developed by Xerox (ETHERNET), 1976 +standardized by IEEE 802.3 (CSMA/CD protocols)
14
14 University of Calgary CS 441 CSMA / CD General algorithm +Do forever: -if channel idle, start transmitting frame -if collision detected during transmission stop frame transmission transmit brief jamming signal (makes sure all stations know about collision) wait random time
15
15 University of Calgary CS 441 Contention Period period of time when a station starts transmitting before other stations know that the line is busy +other stations, thinking the line is idle, may contend (start transmitting) for the line +due to propagation delay A B
16
16 University of Calgary CS 441 Length of Contention Period = 2 worst case: longest delay before a collision is detected, let A, B be furthest apart stations = propagation delay between them A transmits at t, B transmits at t + - (just before it detects the frame is busy) B detects collison, stops at t + it takes an additional seconds before A sees the collision and stops as well propagation delay depends upon cable length and throughput speed (1km ethernet ~ 5 s)
17
17 University of Calgary CS 441 CSMA/ CD and Collisions most CSMA/ CD protocols use a 1-persisent protocol to handle collisions +examples -Ethernet -MitreNet -IEEE 802.3 standard +although more collisons may occur, time to recover from them is shorter -as long as frames are long relative to propagation delay
18
18 University of Calgary CS 441 Backoff Algorithms retransmission delay after collision uses "binary exponential backoff" +adapts to load, reduces further chance of collision eg 1-persistent CSMA/CD +case Collision: /* sensed immediately */ -send jamming signal -wait_random exponential time -break;
19
19 University of Calgary CS 441 Ethernet (CSMA/ CD) developed by Xerox early 70's +commercialized mid/late 70's +de facto standard taken up and generalized as dejure standard IEEE 802.3 physical medium +baseband coax (thick and thin) +twisted pair (recent introduction) length restrictions - thicknet: -500m max distance between repeaters -up to 4 repeaters - 2.5 max length -restriction due to maximum limit of round-trip propagation delay of 51.2 s
20
20 University of Calgary CS 441 Length Restrictions cont’d thinnet +1/3 the distance is allowed between repeaters +~800 meters maximum length of network twisted pair +200 feet max allowed from station to tranceiver/hub converter +most phone lines < 200 feet from connector box
21
21 University of Calgary CS 441 Ethernet Physical Characteristics Continued Tranceivers - electronics: +transmit/receive signals on channel +recognize presence of signals when other stations transmit +recognize "collisions" +up to 100 tranceivers on 2.5km network +stations can be installed on the fly without bringing the network down Terminators +necessary to eliminate signal reflection at ends of the wire
22
22 University of Calgary CS 441 CSMA / CD Frame Structure (IEEE 802.3) Pre = preamble, 7 bytes = 56 bits sd = start delimiter dest, src = dest & src addresses, = 2 or 6 bytes lngth = length of data in bytes pad set so that data + pad is > some minimum, eg, 64 bytes, or 512 bits fcs = frame (error) check sequence, CRC-32 pre sd dest src lngth data pad fcs 7 1 2/ 6 2/ 6 2 var var 4
23
23 University of Calgary CS 441 Address Fields IEEE 802.3 addresses - 16 bit version +1st bit specifies individual or group address addresses - 48 bit version +1st bit specifies individual or group address 2nd bit specifies if assigned locally (16,000 addresses for each person on earth?) source address +unique address of transmitter +every ethernet board has a world-wide unique address 10BASE clock rate is 10 Mb/s =.1 s per bit
24
24 University of Calgary CS 441 Ethernet: Control Procedures defer - do not transmit if: +carrier present (manchester transitions) +within minimum spacing at end of frame transmit - if not deferring +transmit until completed or collision detected abort - if collision detected: +stop transmission +jam (4-6 bytes) to insure all stations detect retransmit - if collision detected: +wait random time - backoff algorithm -eg double delay with repeated collisions
25
25 University of Calgary CS 441 Packet Size Issues - minimum packet size? case 1: contention period << frame length +good throughput (as cost of collision is minimal) case 2: contention period ~= frame length +equivalent to CSMA case 3: contention period > frame length +sender may be able to transmit entire packet +but another sender, before seeing it, may transmit a frame and get a collision -sender will not detect the collision! -higher level protocol then necessary to detect collision
26
26 University of Calgary CS 441 Packet Size Issues receiver: +if frames are small, may not be able to detect collisions +if frame size > collision fragment size, this is easy +while error correction schemes will do this cannot distinguish between line state errors and errors due to collisions
27
27 University of Calgary CS 441 Effective Throughput of Ethernet e.g., using an editor over Ethernet, where every character must be remotely echoed +1 character per frame, assume light traffic -min frame length = 56 + 8 + 48 + 48 + 16 + 512 + 32 = 720 bits -packet spacing = 96 bits? -total = 816 bits for every 7 bit ascii character sent effective throughput < 1 % = ~ 100 kb/ s +will be worse with heavy traffic & collisions! +will be better as data size increases
28
28 University of Calgary CS 441 Ethernet Disadvantages much analog circuitry for collision detection minimum frame size of 64 bytes no priorities assigned +cannot guarantee that a packet will be successfuly transmitted, real time people (eg manufacturing) do not like this limited cable length +round trip delay determines slot time has poor performance at high loads does not scale well to high data rates +shorter frames within 2 contention interval implies less efficiency
29
29 University of Calgary CS 441 Ethernet Advantages widely used, good defacto commercial standard simple algorithm, inexpensive implementation can install new stations on the fly stations can disconnect or fail without disruption inexpensive standard interface on most computers selectable scalability becoming available
30
30 University of Calgary CS 441 Gigabit Ethernet fibre with 1 Gb/s transmission rates +near current limit of electroics/optical interface light on/ off for 1/ 0, respectively +200 million meters / second +1 nanosecond per bit +0.2 meters per bit for 200 meter station distance & 1,000 bit frame +200 meter frame = 1 microsecond, a = 1 +best utilization = T f / (T f + ) = 1/ (1+a) = 50% +shorter frame or longer distance is worse now have 10-100-1000 Mb/s = 100-10-1 nanosec/bit +does support standard selectable scalability
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.