Broadcast Network Jaringan Komputer Medium Access Control Sublayer 2 network categories: point-to-point connections broadcast channels Key issue in broadcast network: how to determine who gets to use the channel when there is competition for it? Broadcast channel: Multi-access channels Random access channels 2 MAC: MAC (Medium Access Control) protocols used to determine who goes next on a multi-access channel belong to a sublayer of the data link layer important in LANs (many use a multi-access channel as the basis for communication) WAN uses P2P (except satellite) Outline Channel Allocation Problem Multiple Access s Ethernet Wireless LANs Broadband Wireless Bluetooth Data Link Layer Switching 3 4 Channel Allocation Problem Static Channel Allocation Traditional FDM: divide channel into static subchannels TDM: divide channel into time slots Problem: large number of user, varying & burstly traffic wasted channel (inefficient), delay Dynamic Channel Allocation is required 5 Dynamic Channel Allocation Station Model Consists of N independent stations/terminals Each with program or user that generates frames for transmission Once a frame has been generated, the station is blocked and does nothing until the frame has been successfully transmitted Single Channel Assumption: single channel is available for all communication Collision Assumption: if two frames are transmitted simultaneously Continuous Time vs Slotted Time transmission can begin at any instant vs transmissions always begin at the start of a time slot Carrier Sense: sense the channel before trying to use it 6
Multiple Access s Pure ALOHA ALOHA Pure ALOHA & Slotted ALOHA Carrier Sense Multiple Access s Persistent & Nonpersistent CSMA CSMA with Collision Detection Collision-Free s Bit-Map Binary Countdown Limited-Contention s Adaptive Tree Walk Wavelength Division Multiple Access s Wireless LAN s MACA & MACAW 7 Basic idea: let users transmit whenever they have data to be sent Station does not listen to the channel before transmitting There will be collisions Colliding frames will be damaged Sender can always find out whether its frame was destroyed by listening to the channel With a LAN, the feedback is immediate With a satellite, there is a delay of 270 msec before the sender knows if the transmission was successful If listening while transmitting is not possible: need acknowledgements If the frame was destroyed, the sender waits a random amount of time and sends it again The waiting time must be random or the same frames will collide over and over Contention systems: multiple users share a common channel in a way that can lead to conflicts 8 Pure ALOHA Pure ALOHA In pure ALOHA, frames are transmitted at completely arbitrary times (same length). Throughput of ALOHA systems is maximized by having a uniform frame size rather than by allowing variable length frames 9 Frame Collision 10 Slotted ALOHA ALOHA Idea: Divide time into discrete intervals Each interval corresponding to one frame Requires the users to agree on slot boundaries One way to achieve synchronization would be to have one special station emit a pip at the start of each interval, like a clock. A computer is not permitted to send whenever a carriage return is typed Instead, it is required to wait for the beginning of the next slot The continuous pure ALOHA is turned into a discrete one Used in a few experimental systems, then almost forgotten 11 Pure & Slotted ALOHA Comparison 12
Carrier Sense Multiple Access s Without paying attention to what the other stations are doing, there are bound to be many collisions It is possible for stations to detect what other stations are doing, and adapt their behavior accordingly to achieve a much better utilization and improving performance s in which stations listen for a carrier (i.e., a transmission) and act accordingly are called carrier sense protocols 13 Idea: 1-persistent CSMA When a station has data to send, it first listens to the channel to see if anyone else is transmitting If channel busy, the station waits until it becomes idle When the station detects an idle channel, it transmits a frame If a collision occurs, the station waits a random amount of time and starts all over again The protocol is called 1-persistent because the station transmits with a probability of 1 when it finds the channel idle 14 1-persistent CSMA Problem: propagation delay Just after a station begins sending, another station will become ready to send and sense the channel If the first station's signal has not yet reached the second one, the latter will sense an idle channel and will also begin sending, resulting in a collision The longer the propagation delay the worse the performance of the protocol If propagation delay = 0 there will still be collisions If two stations become ready in the middle of a third station's transmission, both will wait politely until the transmission ends and then both will begin transmitting exactly simultaneously 15 Idea: nonpersistent CSMA Less greedy (persistent) Before sending, a station senses the channel If no one else is sending, station begins doing so itself However, if the channel is already in use, the station does not continually sense it for the purpose of seizing it immediately upon detecting the end of the previous transmission Instead, it waits a random period of time and then repeats the algorithm Better channel utilization but longer delays than 1- persistent CSMA 16 p-persistent CSMA Comparison of CSMA Applies to slotted channels Idea: When a station becomes ready to send, it senses the channel. If it is idle, it transmits with a probability p With a probability q = 1 - p, it defers until the next slot If that slot is also idle, it either transmits or defers again, with probabilities p and q This process is repeated until either the frame has been transmitted or another station has begun transmitting If the station initially senses the channel busy, it waits until the next slot and applies the algorithm 17 18
Idea: CSMA with Collision Detection Stations abort their transmissions as soon as they detect a collision If two stations sense the channel to be idle and begin transmitting simultaneously, they will both detect the collision almost immediately Rather than finish transmitting their frames, which are irretrievably garbled anyway, they should abruptly stop transmitting as soon as the collision is detected. Quickly terminating damaged frames saves time and bandwidth Basis of the popular Ethernet LAN 19 CSMA with Collision Detection CSMA/CD consist of alternating contention and transmission periods, with idle periods occurring when all stations are quiet 20 CSMA with Collision Detection Collision detection is an analog process Station's must listen to the cable while it is transmitting If what it reads back is different from what it is putting out, it knows that a collision is occurring Signal encoding must allow collisions to be detected - special encoding is used Sending station must continually monitor the channel, listening for noise bursts that might indicate a collision half-duplex impossible for a station to transmit and receive frames at the same time because the receiving logic is in use, looking for collisions during every transmission Idea Collision-free: Bit-Map Each contention period consists of exactly N slots Station j may announce that it has a frame to send by inserting a 1 bit into slot j After all N slots have passed by, each station has complete knowledge of which stations wish to transmit At that point, they begin transmitting in numerical order Overhead is 1 bit per station 21 22 Collision-free: Bit-Map The basic bit-map protocol After the last ready station has transmitted its frame, an event all stations can easily monitor, another N bit contention period is begun 23 Idea Collision-free: Binary Countdown Similar to Bit-Map, but using binary station addresses A station wanting to use the channel now broadcasts its address as a binary bit string, starting with the highorder bit All addresses are assumed to be the same length The bits in each address position from different stations are BOOLEAN ORed together Higher-numbered stations have a higher priority than lower-numbered stations, which may be either good or bad, depending on the context Example stations 0010, 0100, 1001, and 1010. The winner is 1010 24
Limited-Contention s Combine the best properties of the contention and collisionfree protocols, new protocol that used contention at low load to provide low delay, but used a collision-free technique at high load to provide good channel efficiency Divide the stations into (not necessarily disjoint) groups. Only the members of group 0 are permitted to compete for slot 0. If one of them succeeds, it acquires the channel and transmits its frame Assign stations to slots dynamically, with many stations per slot when the load is low and few (or even just one) station per slot when the load is high The Adaptive Tree Walk Simple way of performing the necessary assignment is to use the algorithm devised by the U.S. Army for testing soldiers for syphilis during WWII The Army take a blood sample from N soldiers A portion of each sample is poured into single test tube This mixed sample is tested for antibodies If none are found, all the soldiers in the group are declared healthy If antibodies are present, two new mixed samples were prepared, one from soldiers 1 through N/2 and one from the rest The process was repeated recursively until the infected soldiers were determined 25 26 The Adaptive Tree Walk If a collision occurs the entire tree is searched, depth first, to locate all ready stations 27 Wavelength Division Multiple Access s Each station is assigned two channels A narrow channel is provided as a control channel to signal the station A wide channel is provided so the station can output data frames Supports three traffic classes : constant data rate connection-oriented traffic, such as uncompressed video variable data rate connection-oriented traffic, such as file transfer datagram traffic 28 Wavelength Division Multiple Access s Wireless LAN s Problems: hidden station problem exposed station problem 29 30
MACA (Multiple Access with Collision Avoidance) Idea: sender Stimulate the receiver into outputting a short frame, so stations nearby can detect this transmission and avoid transmitting for the duration of the upcoming (large) data frame MACAW (MACA for Wireless) Improvement over MACA Introducing an ACK frame after each successful data frame Also observed that CSMA has some use, to keep a station from transmitting an RTS at the same time another nearby station is also doing so to the same destination, so carrier sensing was added 4/5/2006 31 32 Ethernet Ethernet ''Ethernet'' refers to the cable (the ether) Three kinds of Ethernet cabling. (a) 10Base5. (b) 10Base2. (c) 10Base-T. 33 34 Ethernet Ethernet Cable topologies. (a) Linear. (b) Spine. (c) Tree. (d) Segmented (a) Binary encoding. (b) Manchester encoding (Ethernet) (c) Differential Manchester encoding (Token Ring) 35 36
Ethernet MAC Sublayer Frame formats (a) Original DIX Ethernet (b) IEEE 802.3 Ethernet MAC Sublayer Preamble 64 bits of alternating 1s and 0s, ending with a 11 Produces a 10Mhz clock for 5.6 µsec, allowing the receivers to synchronize with the sender Two address fields Destination address Source Address These addresses are known as MAC addresses and have their own format 37 38 Ethernet MAC Sublayer Length Field Tells how many bytes are present in the data field Range: 0-1500 bytes 0 bytes is a valid entry, but causes problems because it would cause the frame to be shorter than the 64 byte minimum Pad is added to ensure 64 by minimum frame Checksum 32 bits (4 bytes) Ethernet MAC Sublayer Collision Detection 39 40 MAC Addresses Assigned by IEEE 6 byte addresses First 3 bytes are manufacturer specific 080020 Sun Microsystems 080009 Hewlett Packard 0030c7 Compaq Computers Last 3 bytes are assigned by manufacturer. Typical format: 1 byte for model number 2 bytes for serial number Each MAC address is supposed to be unique Ethernet Frame Transmission The Physical Medium Attachment (PMA) sends a silence indication to the Physical Signaling (PLS) component when it sees no signal on the medium If the PLS doesn t see a silence signal, it enters a deferring state (waits for the silence signal) Upon receiving the silence signal, it waits 9.6 µsec If still silent, it begins passing the 8 bytes of the preamble followed by the bits in the frame 41 42
Ethernet Frame Transmission While transmitting, the PMA is receiving the bits back that are being sent out Signal Comparison Twisted Pair networks Data Comparison UTP, Fiber networks If the MAC doesn t have the minimum number of bits, the PLS is responsible for padding Finally, the PLS sends out the 32 bit CRC Collision If the PMA discovers that the received bits don t match the sent bits, or it discovers an invalid Manchester signal it aborts the transmission and sends the collision presence indicator (CPI) to the PLS When the PLS receives the CPI, it immediately ceases sending bits and begins the backoff process 43 44 Backoff Process The PLS uses the network interface card address as a random number seed value and computes a random value from 0 to 1 Next, the PLS calculates 2 n where n is the count of the number of times the PLS has attempted to retransmit the frame Backoff Process Finally, the PLS multiples all this stuff by a value referred to as the slot time. The slot time is defined as the time required to transmit 512 bits. The PLS now backs off (waits) this amount of time After the backoff time has elapsed, the PLS returns to the normal transmit mode in which it is waiting for the presence of the silence indicator from the PMA. 45 46 Ethernet Efficiency Efficiency of Ethernet at 10 Mbps with 512-bit slot times Ethernet Ethernet Improvement: Switched Ethernet Fast Ethernet Gigabit Ethernet 47 48
Switched Ethernet Fast Ethernet A simple example of switched Ethernet. The original fast Ethernet cabling. 100Base-T4 Signaling speed of 25Mhz Uses 4 twisted pairs of wires 100Base-TX Signaling speed of 125Mhz Different encoding is used (4B/5B) 49 50 Gigabit Ethernet Gigabit Ethernet Gigabit Ethernet cabling (a) A two-station Ethernet. (b) A multistation Ethernet 51 52 IEEE 802.2: Logical Link Control Error-controlled, flow-controlled data link protocol Hides the differences between the various kinds of 802 networks by providing a single format and interface to the network layer Closely based on the HDLC protocol LLC forms the upper half of the data link layer, with the MAC sublayer below it IEEE 802.2: Logical Link Control (a) Position of LLC. (b) formats 53 54
Summary Channel allocation methods and systems for a common channel 55