Multiple Access Multiple Access Multiple hosts sharing the same medium What are the new problems? Readings: Kurose & Ross, 5.3, 5.5 Multiple Access protocols Shared Media Single shared broadcast channel Ethernet bus Two or more simultaneous transmissions by nodes: interference Radio channel Collision if node receives two or more signals at the same time Token ring network Multiple Access Protocol … Distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit Communication about channel sharing must use channel itself! No out-of-band channel for coordination Computer Network Channel Partitioning Characteristics Frequency Division Multiplexing Transmission needs vary Each node has a frequency band Between different nodes Time Division Multiplexing Over time Network is not fully utilized Each node has a series of fixed time slots What networks are these good for? 1
Ideal Multiple Access Protocol Random Access Protocols Broadcast channel of rate R bps When node has packet to send transmit at full channel data rate R. 1. When one node wants to transmit, it can no a priori coordination among nodes send at rate R. two or more transmitting nodes ➜ “collision”, 2. When M nodes want to transmit, each can random access MAC protocol specifies: send at average rate R/M how to detect collisions 3. Fully decentralized: how to recover from collisions (e.g., via delayed retransmissions) no special node to coordinate transmissions Examples of random access MAC protocols: no synchronization of clocks, slots slotted ALOHA 4. Simple ALOHA CSMA, CSMA/CD, CSMA/CA Slotted ALOHA Slotted ALOHA Assumptions Operation all frames same size when node obtains fresh time is divided into frame, it transmits in next equal size slots, time to slot transmit 1 frame no collision, node can nodes start to transmit send new frame in next Pros Cons frames only at slot single active node can collisions, wasting slots beginning of slots continuously transmit at full if collision, node idle slots nodes are synchronized rate of channel retransmits frame in each nodes may be able to if 2 or more nodes highly decentralized: only subsequent slot with prob. detect collision in less transmit in slot, all slots in nodes need to be in p until success sync than time to transmit nodes detect collision packet simple clock synchronization Slotted Aloha efficiency Optimal choice of p Efficiency is the long-run fraction of For max efficiency with N nodes, find p* that successful slots when there are many nodes, maximizes each with many frames to send Np(1-p) N-1 Suppose N nodes with many frames to send, For many nodes, take limit of Np*(1-p*) N-1 as N each transmits in slot with probability p goes to infinity, gives 1/e = .37 prob that node 1 has success in a slot = p(1-p) N-1 Efficiency is 37%, even with optimal p prob that any node has a success = Np(1-p) N-1 2
Pure (unslotted) ALOHA Pure Aloha efficiency unslotted Aloha: simpler, no synchronization P(success by given node) = P(node transmits) . when frame first arrives P(no other node transmits in [t 0 -1,t 0 ] . transmit immediately P(no other node transmits in [t 0 ,t 0 +1] collision probability increases: = p . (1-p) N-1 . (1-p) N-1 frame sent at t 0 collides with other frames sent in = p . (1-p) 2(N-1) [t 0 -1,t 0 +1] … choosing optimum p and then letting n -> ∞ ... Efficiency = 1/(2e) = .18 Even worse ! CSMA collisions Carrier Sense Multiple Access CSMA : listen before transmit: collisions can still occur: propagation delay means If channel sensed idle: transmit entire frame two nodes may not hear If channel sensed busy, defer transmission each other’s transmission collision: entire packet transmission time wasted Human analogy: don’t interrupt others! note: role of distance & propagation delay in determining collision probability CSMA/CD (Collision Detection) CSMA/CD collision detection CSMA/CD: carrier sensing, deferral as in CSMA collisions detected within short time colliding transmissions aborted, reducing channel wastage collision detection: easy in wired LANs: measure signal strengths, compare transmitted, received signals difficult in wireless LANs: receiver shut off while transmitting human analogy: the polite conversationalist 3
Ethernet Ethernet Topologies dominant wired LAN technology: cheap $20 for 100Mbs! first widely used LAN technology Bus Topology: Shared Simpler, cheaper than token LANs and ATM All nodes connected Kept up with speed race: 10 Mbps – 10 Gbps to a wire Star Topology: Metcalfe’s Ethernet sketch All nodes connected to a central repeater Ethernet Connectivity Ethernet Connectivity 10Base5 – 10Base2 – ThickNet ThinNet < 500m < 200m Controller Controller Transceiver Vampire Tap BNC T-Junction Bus Topology Bus Topology Transceiver Ethernet Frame Structure Ethernet Connectivity Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame 10BaseT < 100m Preamble: Controller 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 Star Topology Used to synchronize receiver, sender clock rates (Manchester encoding) 4
Ethernet Frame Structure (more) Ethernet Specifications Addresses: 6 bytes Coaxial Cable if adapter receives frame with matching destination Up to 500m address, or with broadcast address (eg ARP packet), it Taps passes data in frame to net-layer protocol > 2.5m apart otherwise, adapter discards frame Transceiver Type: indicates the higher layer protocol (mostly IP Idle detection but others may be supported such as Novell IPX Sends/Receives signal and AppleTalk) Repeater CRC: checked at receiver, if error is detected, the Joins multiple Ethernet segments frame is simply dropped < 5 repeaters between any two hosts < 1024 hosts Ethernet MAC Algorithm Ethernet MAC Algorithm Sender/Transmitter Node A Node B If line is idle (carrier sensed) Send immediately Send maximum of 1500B data (1527B total) At time almost T, node A’s Wait 9.6 µ s before sending again message has almost If line is busy (no carrier sense) arrived ⊗ Wait until line becomes idle Send immediately If collision detected Node A starts Node B starts transmission at time 0 transmission at time T Stop sending and jam signal Try again later How can we ensure that A knows about the collision? Collision Detection Ethernet MAC Algorithm Example Node A Node B Node A’s message reaches node B at time T Node B’s message reaches node A at time 2T For node A to detect a collision, node A must still be transmitting at time 2T At time almost T, node A’s 802.3 message has almost ⊗ arrived 2T is bounded to 51.2 µ s At 10Mbps 51.2 µ s = 512b or 64B Packet length ≥ 64B Node A starts Node B starts Jam after collision transmission at time 0 transmission at time T Ensures that all hosts notice the collision At time 2T, A is still transmitting and notices a collision 5
Retransmission Binary Exponential Backoff How long should a host wait to retry Choices after 2 collisions after a collision? Binary exponential backoff Maximum backoff doubles with each failure Choices after 1 collision After N failures, pick an N-bit number 0 Ts 2Ts 3Ts 2 N discrete possibilities from 0 to maximum Why use How long fixed time should the Time of collision slots? slots be? Binary Exponential Backoff CSMA/CD efficiency For 802.3, T = 51.2 µ s t prop = max prop between 2 nodes in LAN Consider the following t trans = time to transmit max-size frame k hosts collide Efficiency = 1/(1+5 * t prop / t trans ) Each picks a random number from 0 to 2 (N-1) For 10 Mbit Ethernet, t prop = 51.2 us, t trans = 1.2 ms If the minimum value is unique Efficiency is 82.6%! All other hosts see a busy line Much better than ALOHA, but still decentralized, Note: Ethernet RTT < 51.2 µ s simple, and cheap if the minimum value is not unique Hosts with minimum value slot collide again! Efficiency goes to 1 as t prop goes to 0 Next slot is idle Goes to 1 as t trans goes to infinity Consider the next smallest backoff value Collision Detection Frame Reception Techniques: Bus Topology Transceiver handles Sender handles all access control Carrier detection Receiver simply pulls the frame from the network Collision detection Ethernet controller/card Jamming after collision Sees all frames Transceiver sees sum Selectively passes frames to host processor of voltages Acceptable frames Transceivers Addressed to host Outgoing signal Addressed to broadcast Incoming signal Addressed to multicast address to which host belongs Transceiver looks for Anything (if in promiscuous mode) Voltages impossible for Need this for packet sniffers/TCPDump only outgoing 6
Recommend
More recommend