Local Networks Lecture 4 6-Apr-2016
Roadmap of the Course So far Basic telecom concepts General study of LANs LAN topologies Flow and error control Today we continue the general study of LANs Medium access methods Logical link control
Medium Access Control (MAC) Methods
Medium Access Methods In LANs all stations are connected to a shared transmission medium Simultaneous attempts to access the medium by more than 1 station possible (=> collision) To prevent the above situation, each protocol has a MAC method (Medium Access Control) Station follows some procedure when it needs to send frames No conflicts between stations thus ensured
Types of methods
Random access methods No station controls other stations Also named contention methods Stations compete with each other A station with data to send Applies a protocol-related procedure for deciding whether or not to transmit Decision may depend on medium state (idle or busy)
Collision When more than one station tries to transmit => access conflict => frames will be destroyed or modified This access conflict is called collision
Procedures issues When should station access the medium? What should station do if medium is busy? How should station determine success or failure of a transmission? What should station do when there is an access conflict? Note: Broadcasting provides feedback A sender can always find out whether its transmitted frame was destroyed, by listening to the channel, as all the other stations do LAN immediate feedback, satellite system about 270 ms delay
Random access methods
Multiple access (MA) methods ALOHA-type methods Earliest and simplest, least efficient Designed in early 70s, to be used in communication at University of Hawaii Wireless (radio) LAN
ALOHA Originally: ground-based radio broadcasting, on 2 frequencies one for sending data, one for receiving ACKs Basic idea works for any system with uncoordinated users competing for a single shared channel Two versions: pure and slotted
ALOHA rules Multiple access No carrier sense No checking for collision Acknowledgement (explicit or implicit) Ack should arrive in the allotted time (two times the maximum propagation delay) Otherwise frame has to be resent After waiting a random amount of time
Pure ALOHA Users transmit whenever they have data to send There will be collisions, collided frames damaged Sender finds out if transmission was successful With feedback property With acknowledgements If frame collided, sender waits random amount of time and sends again Called backoff strategy Efficiency of such channel allocation: 18%
Pure ALOHA procedure
Pure ALOHA s vulnerable time Time interval during which collision can occur
Slotted ALOHA Time divided into slots, each slot corresponds to one frame Agreement on slot boundaries needed (synchronization) One special station can emit a beep at the start of each slot Users send at the beginning of slots only Vulnerable period is halved when compared to pure ALOHA => double efficiency: 37%
Slotted ALOHA illustration
Slotted ALOHA s vulnerable time
Carrier Sense Multiple Access (CSMA) methods The medium is sensed by each station before trying to use it Chance of collision reduced => performance increased Collisions can still appear Due to propagation delays Vulnerable time in CSMA = propagation time T prop Time needed for a signal to propagate from one end of the medium to the other
Collisions in CSMA
CSMA methods Several types Persistent (and p-persistent) Non-persistent CSMA with collision detection (CSMA/CD) CSMA with collision avoidance (CSMA/CA)
Non-persistent CSMA Station senses the channel If channel idle station starts transmitting If channel busy, station waits a random amount of time and then it senses the channel again Better efficiency than persistent CSMA s Unlikely that two stations wait the same amount of random time Reduces the network s efficiency Idle medium while stations have frames to send
Non-persistent CSMA illustration
(1-)Persistent CSMA When a station has to send, it first listens to the channel If channel busy, station waits until it becomes idle If channel idle, station transmits frame (probability 1) If collision occurs, a random amount of time passes and everything starts over again Better than ALOHAs; used in Ethernet
(1-)Persistent CSMA illustration
p-persistent CSMA Applies to slotted channels Station senses channel and if idle: Transmits with probability p Defers transmission until next slot with probability q=1-p At next slot, if idle, same thing Algorithm repeated until frame transmitted or another station begins transmission If channel busy, station waits a random time and senses again Better performances for small p
p-persistent CSMA illustration
Channel utilization versus load
CSMA / CD Different improvement when compared to ALOHA Stations abort transmission as soon as they detect a collision => saves time and bandwidth Widely used on LANs MAC (basis of Ethernet) Model At t 0 some station finished transmission Any other station may start transmitting => collisions may occur After a detected collision, stations wait a random time and start sending again, sensing the channel first When does a frame know it sent successfully?
CSMA/CD 2 Minimum time to detect a collision Time needed for a signal to propagate from a station to another Worst case scenario τ the time needed for a signal to propagate between farthest stations It takes 2τ until a station is certain it seized the channel (if transmits for 2τ without hearing a collision, then it is sure) A sending station must continually monitor the channel To listen for noise bursts indicating a collision CSMA/CD inherently a half-duplex system
Collision detection
CSMA/CD illustration
(Truncated) binary exponential backoff algorithm Used by all collision-detecting stations to calculate their individual retransmission delay (backoff delay) after 1 st collision each station waits 0 or 1 slot times before trying again; if each station picks the same random number, they will collide again after 2 nd collision each station picks 0,1,2, or 3 slot times before trying again, and waits that number of slot times if a 3 rd collision occurs, the next time number of slots to wait is chosen randomly by each station from the interval 0 to 2 3-1 after i collisions, a random number between 0 to 2 i -1 is chosen, and that number of slots is skipped after 10 collisions the randomization interval is frozen at a maximum of 1023 slots after 16 collisions a failure is reported and recovery is up to higher layers
(Truncated) binary exponential backoff algorithm 2 The algorithm dynamically adapts to the number of stations trying to send If randomization interval for all collisions was 1023 the chance for two stations to collide for a second time: negligible the average wait after a collision: hundreds of slot times => delay If each station always delayed for 0 or 1 slots stations would collide again and again The algorithm ensures a low delay when only few stations collide Also ensures collision is resolved in reasonable interval when many stations collide Truncating the backoff at 1023 keeps the bound from growing too large
CSMA/CA No collision, collisions are avoided If line idle, it waits an Inter Frame Gap (IFG) time interval, then a random amount of time, then sends frame and sets timer Station waits for ACK from receiver If received before timer expires => success If not => failed; increases backoff parameter, waits a backoff time interval and senses line Used in wireless LANs
CSMA/CA illustration
Controlled access Stations consult each other to see which has the right to send One station then sends Being authorized by the rest Example: token passing
Token passing
Token passing illustration (simplified)
A Bitmap protocol Collision-free protocols avoid collisions entirely Senders must know when it is their turn to send The basic bit-map protocol: Sender set a bit in contention slot if they have data Senders send in turn; everyone knows who has data CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Binary Countdown protocol Binary countdown improves on the bitmap protocol Stations send their address in contention slot (log N bits instead of N bits) Medium ORs bits; stations give up when they send a 0 but see a 1 Station that sees its full address is next to send CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Limited-Contention Protocols Performance measures delay at low load channel efficiency at high load Contention strategies - Light load: contention preferred - it has low delay and collisions are rare - High load: contention less atractive - overhead associated with channel arbitration Collision-free - Light load - relatively high delay - High load - channel effciency improves, as overheads are fixed it would be nice to combine the advantages of both contention at low load to get low delay collision free at high load for good channel efficiency
Limited-Contention Protocols Idea is to divide stations into groups within which only a very small number are likely to want to send Avoids wastage due to idle periods and collisions Already too many contenders for a good chance of one winner CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Limited-Contention Protocols: how? To increase probability of success for station i Decrease competition amount Divide stations into groups Can be non-disjoint Only members of group 0 can compete for slot 0 If one succeeds, it transmits If not, or nothing to submit, group 1 contends for slot 1, etc Key: appropriate division into groups Dynamic is better many stations per slot when load is low Few (even one) stations per slot when load is high
Limited Contention Adaptive Tree Walk Tree divides stations into groups (nodes) to poll Depth first search under nodes with poll collisions Start search at lower levels if >1 station expected Level 0 Level 1 Level 2 CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Wireless LAN Protocols (1) Wireless has complications compared to wired Cannot detect collisions acknowledgements used A station may not be able to transmit to/to receive from all other stations limited radio range CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Wireless LANs (2) Hidden terminals Hidden terminals are senders that cannot sense each other but nonetheless collide at intended receiver Want to prevent; loss of efficiency A and C are hidden terminals when sending to B CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Wireless LANs (3) Exposed terminals Exposed terminals are senders who can sense each other but still transmit safely (to different receivers) Desirably concurrency; improves performance B A and C D are exposed terminals CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Wireless LANs (4) MACA MACA protocol grants access for A to send to B: A sends RTS to B [left]; B replies with CTS [right] C can send while the data frame is being sent if not interfering; D and E must be silent until data frame sent completely A sends RTS to B; C and E hear and defer for CTS B replies with CTS; D and E hear and defer for data CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011
Logical Link Control
IEEE 802 Project 1985: IEEE Computer Society started the 802 Project Standard to enable LAN intercommunication from a variety of manufacturers Specifies functions of PhL and DLL of major LAN Protocols
IEEE 802 working groups Number Topic 802.1 Overview and architecture of LANs 802.2 Logical link control 802.3 * Ethernet 802.4 Token bus (was briefly used in manufacturing plants) 802.5 Token ring (IBM's entry into the LAN world) 802.6 Dual queue dual bus (early metropolitan area network) 802.7 Technical advisory group on broadband technologies 802.8 Technical advisory group on fiber optic technologies 802.9 Isochronous LANs (for real-time applications) 802.10 Virtual LANs and security 802.11 * Wireless LANs (WiFi) 802.12 Demand priority (Hewlett-Packard's AnyLAN) 802.13 Unlucky number; nobody wanted it 802.14 Cable modems (defunct: an industry consortium got there first) 802.15 * Personal area networks (Bluetooth, Zigbee) 802.16 * Broadband wireless (WiMAX) 802.17 Resilient packet ring 802.18 Technical advisory group on radio regulatory issues 802.19 Technical advisory group on coexistence of all these standards 802.20 Mobile broadband wireless (similar to 802.16e) 802.21 Media independent handoff (for roaming over technologies) 802.22 Wireless regional area network
IEEE Standard and OSI model
IEEE Standards for LANs
Logical Link Control (LLC) - 802.2 Generic sublayer, part of the data link layer Allows interoperability between different LAN protocols
LLC functions LLC connects together LANs with different protocols LLC hides the LAN-specific aspects to upper layers Access method, encoding, signaling, transmission media LLC adds reliability by supervising MAC frames MAC sublayer provides a virtual unreliable link LLC can be present or not in a network
Multiplexing using LLC When stations use multiple upper layer protocols (e.g. IP and IPX)
LLC services LLC supplies services to the user of the LAN (typically the network layer)
LLC service types
Service primitives (message exchanges)
Unacknowledged connectionless service User passes data unit without making any connection nor expecting any ACK
Acknowledged connectionless service User gets ACK for data transfer
Connection-oriented service Connection established, data exchange, connection released
Connection-oriented service, data transfer
Connection-oriented service, disconnection
Connection-oriented service, other primitives Resetting the connection If either user believes something is wrong (e.g., synchronization) Flow control LLC user can indicate how much data should be passed between entities in the next data transfer
LLC protocol Defines the format of data units sent between 2 LLCs Data unit: PDU (protocol data unit) Information PDU: I-PDU Transport user data in connection-oriented services Supervisory PDU: S-PDU Flow and error control Unnumbered PDU: U-PDU Carry data in connectionless services and management information in connection-oriented services
PDUs
PDU format 4 fields: destination service access point (DSAP), source service access point (SSAP), control, and information
DSAP and SSAP Addresses used by LLC Identify protocol stacks on receiving and sending machine
Control field First one/two bits define the PDU type
I-PDU N(S) specifies number of PDU being sent Its own identifying number N(R) specifies number of PDU being expected Implies two-way exchange (with piggybacking) ACK field referring to a previous correct reception of PDUs until the next expected one NAK field referring to a previous incorrect reception of the respective PDU
S-PDU N(R) is used when receiver has no data of its own to send S-PDUs do not transmit data Hence do not need N(S) to identify them Code refers to some coded flow and error control information
U-PDU Has neither N(S) nor N(R) Has 2 code fields, one 2-bit long, another 3-bit long
P/F bit Stands for poll/final, single bit with dual purpose Has meaning only when set (bit=1) It means poll when a PDU is sent by a primary station to a secondary one Address field contains the receiver s address It means final when a PDU is sent by a secondary station to a primary one Address field contains the sender s address In some protocols is used to force the other machine to send a Supervisory frame immediately, rather than waiting for reverse traffic and piggyback
Information field Used to carry The data sent from an upper layer Management information needed for LLC operation Possible to include flow/error/other control information in I-PDUs Combining data to be sent with control information: piggybacking
More on PDUs I-PDU designed for user information transport and piggybacked ACKs S-PDU Used for ACKs, flow control, error control when piggybacking is not appropriate No information in the information field, but still carry messages to receiver Messages based on S-PDU type and transmission context
More on S-PDUs Receive ready (RR,00): receiving station returns ACK of a received I-PDU In this case receiver has no data of its own to send N(R) contains the sequence number of next expected PDU Receive not ready (RNR,01): receiver returns ACK for all PDUs except the one in N(R) Also requests that no more PDUs be sent until a RR S-PDU is issued Reject (REJ,10): NAK returned by a receiver in a goback-n ARQ system When receiver has no data on which to piggyback the response N(R) contains the number of damaged PDU => that PDU and all that follow need to be retransmitted Selective reject (SRJ,11): requires the retransmission of specified frame
More on U-PDUs Unnumbered PDUs used for exchanging User information Management and control information between connected devices Much of the carried information contained in the control field codes
PDUs in unacknowledged connectionless service This service uses 3 unnumbered PDUs UI, XID, TEST XID: exchange IDs; TEST: loopback test
PDUs in acknowledged connectionless service This service uses only one unnumbered PDU AC: acknowledged connectionless information
PDUs in connection-oriented service This service uses all 3 types of PDUs
Data transfer
Piggybacking
Disconnection