1 / 51

Computer Networks

Local Area Networks and Medium Access Control. Computer Networks. Dr C. C. Constantinou ( originally prepared by N.J.Flowers). Reading. Chapter 6 of Leon-Garcia and Widjaja In particular §6.1, §6.2, §6.4, §6.4 Self-study §6.5 Chapters 3 and 4 of Tanenbaum Chapter 5 of Kurose and Rose

leyna
Download Presentation

Computer Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Local Area Networks and Medium Access Control Computer Networks Dr C. C. Constantinou (originally prepared by N.J.Flowers)

  2. Reading • Chapter 6 of Leon-Garcia and Widjaja • In particular §6.1, §6.2, §6.4, §6.4 • Self-study §6.5 • Chapters 3 and 4 of Tanenbaum • Chapter 5 of Kurose and Rose • Chapter 6 is on the peculiarities of wireless LANs – optional reading, but really important these days

  3. Basic network types • Switched networks – multiple networks connected via multiplexers and switches which direct (route) packets from source to destination – usually Wide Area Networks • Broadcast networks – data is received by all receivers. Usually Local Area Networks • This lecture will concentrate on Broadcast Networks – also called Multiple Access Networks since the medium is shared

  4. Broadcast Networks • Advantages • No routing • Simple, flat addressing scheme, hence low overhead • Cheap and simple • Disadvantages • Not scalable • Need some control – like in a meeting

  5. Broadcast Networks • Radio communications – walkie-talkies • Satellite communications • Mobile telephones • Coaxial cable networks • Bluetooth (2.4GHz radio) • Topology can be Ring, Star or Bus

  6. Directly connected, wire-like Losses & errors, but no out-of-sequence frames Applications: Direct Links; LANs; Connections across WANs Data Links Services Framing  Physical addressing Error control  Flow control Multiplexing  Link Maintenance  Security: Authentication & Encryption Examples PPP HDLC Ethernet LAN IEEE 802.11 (Wi Fi) LAN Packets Packets Data link layer Data link layer Frames A B Physical layer Physical layer Data Link Protocols

  7. Collisions • With broadcast networks we can have collisions when two transmissions occur at the same time and interfere • We need a protocol to prevent or minimise collisions • This is a Medium Access Control protocol – MAC • All devices that share the medium are in the same broadcast domain • All devices need to agree on the MAC and be coordinated even if not involved in the current message on the network

  8. MAC Schemes • Two basic ways to control access • Random Access – like a meeting without a chairman. Collisions occur but the protocol does something to fix it • Scheduling – slots are allocated to each device in turn like a meeting with a chairman

  9. What is a collision? • When two stations transmit at the same time - but we need to consider the propagation delay • Even if the channel is empty collisions can occur • For a collision B must transmit between 0 and tprop but A doesn’t detect collision until 2tprop (worse case)

  10. Setup time • A must wait at least 2tprop before it knows the channel is free – this is the negotiation or coordination time • If bit rate is R bps, then setup time uses 2tpropR bits – these are effectively wasted. • If the average packet length is L, the efficiency in use of the channel is

  11. Random access MAC • Simplest form is just to transmit when desired – don’t listen for silence first • First system was ALOHA – University of Hawaii needed to connect terminals on different islands • Used radio transmitters that send data immediately – this gives no setup delay • Transmitters detect collision by waiting for a response – if a collision occurs, there will be data corruption and the receiver says ‘send again’ • Collisions result in complete re-transmission • For light traffic, low probability of collision so re-transmissions are infrequent

  12. ALOHA • Problem is a collision involves at least two devices – both need to re-transmit • If both devices re-transmit immediately (or after the same delay) another collision will occur…. and again…. and again • ALOHA requires a random delay after collision before re-transmission • Since devices don’t listen for silence before transmission this delay must allow one transmitter to complete its transmission – delay is long to ensure this • Likelihood of collision is increased after each collision

  13. Collision limit • For lightly loaded network, get very few collisions so throughput is high • As traffic increases, more and more collisions generate more and more collisions…… wasting bandwidth

  14. Collision dominated • For heavily loaded networks the collisions cause collisions and every packet takes many attempts to get through – intimately network becomes collision dominated and throughput goes down to zero • Peak throughput is 18.4% of channel capacity

  15. Slotted ALOHA • Need to reduce collisions to improve throughput • Slotted ALOHA constrains stations to transmit in specific synchronised time slots • Time slots are all the same and packets occupy one slot • All devices share the slots – collisions are reduced since the can only occur at the start of the slot – cannot have a collision half way through a transmission • A ‘Don’t interrupt me once I’ve started’ protocol !

  16. Slotted ALOHA • Better performance under light load than pure ALOHA • Maximum throughput is 36.8%

  17. ALOHA problem • Channel bandwidth is wasted due to collisions • We can reduce collisions by avoiding transmissions that are certain to cause a collision • ALOHA transmits without first without listening to check the channel is free • Can sense the medium for presence of a signal before transmitting • Carrier Sense Multiple Access – CSMA MAC scheme

  18. CSMA • Station A transmits – as other stations detect the signal, they defer any transmissions • After tprop station A has captured the channel • Vulnerable period is t= tprop

  19. CSMA – when to stop waiting • If the channel is busy, station wishing to transmit waits until what happens? • 1-Persistent CSMA • Wait until channel is free and transmit immediately – but it’s likely more than one transmitter is waiting so a collision is likely • ‘Greedy’ access mechanism resulting in high collision rate

  20. Non-persistent CSMA • Stations wanting to transmit sense the channel • If busy, they re-schedule another sense for later • Re-scheduling method is called the Backoff algorithm • If channel is free at re-sense, transmit, else re-schedule again • Since stations do not persist in sensing the channel and ‘come back later’ for another look, collisions are reduced • The drawback is the re-sense may be scheduled for a lot longer than needed – channel may be free before backoff algorithm times out so efficiency is lower than 1-Persistent CSMA

  21. p-Persistent CSMA • A combination of 1-Persistent and Non-Persistent • Stations wanting to transmit sense the channel • If busy, they continuously re-sense until it becomes idle • With a probability p, the station transmits immediately • With a probability 1-p, the station re-schedules another sense (often delay is tprop) • Note - delay is from channel becoming free – with Non-Persistent the delay was from first sense time

  22. Advantages of p-Persistent • Efficiency is good since there is a probability p of instant transmission when channel is free – the higher p the better (ultimately p=1 becomes 1-Persistent CSMA) • Probability p of two devices transmitting causing a clash – the lower p the better (ultimately p=0 becomes 0-Persistent or Non-Persistent CSMA) • …. hence the value of p is a compromise and depends on many factors

  23. CSMA performance • CSMA is sensitive to propagation delay and other factors – typical performance 53 to 81% - better than ALOHA (18 to 37%) 1-Persistent Non-Persistent

  24. CSMA and ALOHA problem • Both CSMA and ALOHA collisions involve an entire packet – the collision is not detected until the entire packet is sent • E.g. a 1500 bit packet, collision occurs after 10 bits, the remaining 1490 bytes are still sent and will be corrupted • The receiver will detect this (via a checksum) and respond with a Negative Acknowledgement (NAK) and the data will be sent again • This is inefficient – the last 1490 bits are a waste of channel capacity

  25. CSMA-CD • Better channel usage if we detect the collision when it occurs rather than waiting until the end of the packet • Carrier Sense Multiple Access with Collision Detection - CSMA-CD • Performed by the transmitting station listening to itself and if what it hears is different from what it sends then there is a collision • If this occurs, transmitter sends a short jamming signal which notifies all stations there has been a collision – without this the receiver will not know there has been a collision and will continue to listen • Then the transmission is aborted and a re-try scheduled

  26. Protocol - Without a chairman = CSMA-CD • One person speaks, all others listen • Before someone speaks, they check that nobody else is talking, then they talk • If two people start talking at the same time, both stop and apologise, and one of them re-starts talking • Multiple Access – MA • Carrier Sense – CS • Collision Detect - CD

  27. MAC – the scheduling approach • Previous MAC’s have been random access • Simple to implement, good performance EXCEPT under heavy load – collision dominated • Scheduling Systems are a way of controlling access to the media – like a meeting with a chairman • Each station has a reserved slot when it can transmit so no collisions • Disadvantage is some stations may not want to transmit and this slot is wasted

  28. Reservation Systems • To overcome this, we have a special timeslot where devices say if they want to talk – this is a minislot within the reservation interval

  29. Reservation Systems • Listeners pickup the reservation packet and can work out who said what in subsequent packets • Talkers also know when to talk since they also pickup the reservation packet r • Time between r and next r is a frame • Wasted bandwidth is only length of r per frame – the larger the frame, the higher the efficiency. Typically 95% for 20 packets per frame

  30. Polling • Reservation requires stations make explicit reservation ahead of time • Polling is where stations take turn to access the medium • The right to access is then passed to the next station via some mechanism • This does not occur in fixed time slots – the access control mechanism is flexible

  31. Centrally controlled polling • A master controller sends a polling message to one station, this then sends the data (which may be nothing) and finishes with a go-ahead message • Central controller then polls the next station – this may be round-robin or some otherorder

  32. Token Passing Networks • Another way of polling – the right to access is a token that is passed from one station to the next (no central controller) • When listening, devices copy data from input to output hence passing everything along • When transmitting, devices receive data coming in, modify or add to it and send this on to the next station

  33. How to transmit • A station that wants to transmit waits for a free token • The ‘free token’ is the polling message that allows access to the medium • Station then modifies the token to say the medium is no longer free, adds its data and sends this on • This full packet eventually reaches the destination where it is read • Packet must be removed from the ring – either: • Receiver does this and does not forward the packet • Receiver marks the token as read and sends it on – the transmitter then removes the packet. This is an acknowledgment that the packet was read OK

  34. Token re-insertion • After transmission is complete, a new free token needs to be re-inserted • Most common form is whoever removed the full packet re-inserts a new free token • Another problem – since devices re-generate the data, what if device is switched off during this? Free token is lost… • Normally there is a nominated controller that re-starts the ring if the token is lost

  35. Typical MAC Efficiencies Normalized Delay-Bandwidth Product Propagation delay Time to transmit a frame • If a<<1, then efficiency close to 100% • As a approaches 1, the efficiency becomes low CSMA-CD (Ethernet) protocol: Token-ring network a΄= latency of the ring (bits)/average frame length

  36. Typical Delay-Bandwidth Products • Max size Ethernet frame: 1500 bytes = 12000 bits • Long and/or fat pipes give large a

  37. MAC protocol features • Delay-bandwidth product • Efficiency • Transfer delay • Fairness • Reliability • Capability to carry different types of traffic • Quality of service • Cost

  38. MAC Delay Performance • Frame transfer delay • From first bit of frame arrives at source MAC • To last bit of frame delivered at destination MAC • Throughput • Actual transfer rate through the shared medium • Measured in frames/sec or bits/sec • Parameters R bits/sec & L bits/frame X=L/R seconds/frame l frames/second average arrival rate Load r = l X, rate at which “work” arrives Maximum throughput (@100% efficiency): R/L fr/sec

  39. E[T]/X Transfer delay 1 r rmax 1 Load Normalized Delay versus Load E[T] = average frame transfer delay • At low arrival rate, only frame transmission time • At high arrival rates, increasingly longer waits to access channel • Max efficiency typically less than 100% X = average frame transmission time

  40. a > a E[T]/X a a Transfer Delay 1 r rmax rmax 1 Load Dependence on Rtprop/L

  41. Comparison of MAC approaches • Aloha & Slotted Aloha • Simple & quick transfer at very low load • Accommodates large number of low-traffic bursty users • Highly variable delay at moderate loads • Efficiency does not depend on a • CSMA-CD • Quick transfer and high efficiency for low delay-bandwidth product • Can accommodate large number of bursty users • Variable and unpredictable delay

  42. Comparison of MAC approaches • Reservation • On-demand transmission of bursty or steady streams • Accommodates large number of low-traffic users with slotted Aloha reservations • Can incorporate QoS • Handles large delay-bandwidth product via delayed grants • Polling • Generalization of time-division multiplexing • Provides fairness through regular access opportunities • Can provide bounds on access delay • Performance deteriorates with large delay-bandwidth product

  43. What is a LAN? Local area means: • Private ownership • freedom from regulatory constraints of WANs • Short distance (~1km) between computers • low cost • very high-speed, relatively error-free communication • complex error control unnecessary • Machines are constantly moved • Keeping track of location of computers a chore • Simply give each machine a unique address • Broadcast all messages to all machines in the LAN • Need a medium access control protocol

  44. RAM RAM Typical LAN Structure • Transmission Medium • Network Interface Card (NIC) • Unique MAC “physical” address Ethernet Processor ROM

  45. Medium Access Control Sublayer • In IEEE 802.1, Data Link Layer divided into: • Medium Access Control Sublayer • Coordinate access to medium • Connectionless frame transfer service • Machines identified by MAC/physical address • Broadcast frames with MAC addresses • Logical Link Control Sublayer • Between Network layer & MAC sublayer

  46. OSI IEEE 802 Network layer Network layer 802.2 Logical link control LLC Data link layer 802.11 Wireless LAN Other LANs 802.3 CSMA-CD 802.5 Token Ring MAC Physical layer Various physical layers Physical layer MAC Sub-layer

  47. C A Reliable frame service A Unreliable Datagram Service C LLC LLC LLC MAC MAC MAC MAC MAC MAC PHY PHY PHY PHY PHY PHY Logical Link Control Layer • IEEE 802.2: LLC enhances service provided by MAC

  48. Logical Link Control Services • Type 1: Unacknowledged connectionless service • Unnumbered frame mode of HDLC • Type 2: Reliable connection-oriented service • Asynchronous balanced mode of HDLC • Type 3: Acknowledged connectionless service • Additional addressing • A workstation has a single MAC physical address • Can handle several logical connections, distinguished by their SAP (service access points).

  49. LLC PDU Structure 1 1 or 2 bytes 1 byte 1 Source SAP Address Destination SAP Address Control Information Source SAP Address Destination SAP Address C/R I/G 1 7 bits 7 bits 1 Examples of SAP Addresses: 06 IP packet E0 Novell IPX FE OSI packet AA SubNetwork Access protocol (SNAP) I/G = Individual or group address C/R = Command or response frame

  50. IP Packet IP LLC Header LLC PDU Data MAC Header FCS Encapsulation of MAC frames

More Related