1 / 66

Topic 2 Data Link Layer Part C

Topic 2 Data Link Layer Part C.

jazlynn
Download Presentation

Topic 2 Data Link Layer Part C

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. Topic 2Data Link LayerPart C The majority of the slides in this course are adapted from the accompanying slides to the books by Larry Peterson and Bruce Davie and by Jim Kurose and Keith Ross. Additional slides and/or figures from other sources and from Vasos Vassiliou are also included in this presentation. DataLink Layer

  2. Media Access Control • Where • Central • Greater control • Simple access logic at station • Avoids problems of co-ordination • Single point of failure • Potential bottleneck • Distributed • How • Synchronous • Specific capacity dedicated to connection • Asynchronous • In response to demand DataLink Layer

  3. Asynchronous Systems • Round robin • Good if many stations have data to transmit over extended period • Reservation • Good for stream traffic • Contention • Good for bursty traffic • All stations contend for time • Distributed • Simple to implement • Efficient under moderate load • Tend to collapse under heavy load DataLink Layer

  4. Multiple Access Links and Protocols Two types of “links”: • point-to-point • PPP for dial-up access • point-to-point link between Ethernet switch and host • broadcast (shared wire or medium) • traditional Ethernet • upstream HFC • 802.11 wireless LAN DataLink Layer

  5. Multiple Access protocols • single shared broadcast channel • two or more simultaneous transmissions by nodes: interference • collision if node receives two or more signals at the same time 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 DataLink Layer

  6. Ideal Mulitple Access Protocol Broadcast channel of rate R bps 1. When one node wants to transmit, it can send at rate R. 2. When M nodes want to transmit, each can send at average rate R/M 3. Fully decentralized: • no special node to coordinate transmissions • no synchronization of clocks, slots 4. Simple DataLink Layer

  7. MAC Protocols: a taxonomy Three broad classes: • Channel Partitioning • divide channel into smaller “pieces” (time slots, frequency, code) • allocate piece to node for exclusive use • Random Access • channel not divided, allow collisions • “recover” from collisions • “Taking turns” • Nodes take turns, but nodes with more to send can take longer turns DataLink Layer

  8. Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access • access to channel in "rounds" • each station gets fixed length slot (length = pkt trans time) in each round • unused slots go idle • example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle • TDM (Time Division Multiplexing): channel divided into N time slots, one per user; inefficient with low duty cycle users and at light load. • FDM (Frequency Division Multiplexing): frequency subdivided. DataLink Layer

  9. Channel Partitioning MAC protocols: FDMA FDMA: frequency division multiple access • channel spectrum divided into frequency bands • each station assigned fixed frequency band • unused transmission time in frequency bands go idle • example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle • TDM (Time Division Multiplexing): channel divided into N time slots, one per user; inefficient with low duty cycle users and at light load. • FDM (Frequency Division Multiplexing): frequency subdivided. time frequency bands DataLink Layer

  10. Random Access Protocols • When node has packet to send • transmit at full channel data rate R. • no a priori coordination among nodes • two or more transmitting nodes ➜ “collision”, • random access MAC protocol specifies: • how to detect collisions • how to recover from collisions (e.g., via delayed retransmissions) • Examples of random access MAC protocols: • slotted ALOHA • ALOHA • CSMA, CSMA/CD, CSMA/CA DataLink Layer

  11. Assumptions all frames same size time is divided into equal size slots, time to transmit 1 frame nodes start to transmit frames only at beginning of slots nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation when node obtains fresh frame, it transmits in next slot no collision, node can send new frame in next slot if collision, node retransmits frame in each subsequent slot with prob. p until success Slotted ALOHA DataLink Layer

  12. Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization Slotted ALOHA DataLink Layer

  13. Suppose N nodes with many frames to send, each transmits in slot with probability p probability that node 1 has success in a slot = p(1-p)N-1 probability that any node has a success = Np(1-p)N-1 For max efficiency with N nodes, find p* that maximizes Np(1-p)N-1 For many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives 1/e = .37 Slotted Aloha efficiency Efficiency is the long-run fraction of successful slots when there are many nodes, each with many frames to send At best: channel used for useful transmissions 37% of time! DataLink Layer

  14. Pure ALOHA (2) Vulnerable period for the shaded frame. DataLink Layer

  15. Pure Aloha efficiency P(success by given node) = P(node transmits) . P(no other node transmits in [p0-1,p0] . P(no other node transmits in [p0-1,p0] = p . (1-p)N-1 . (1-p)N-1 = p . (1-p)2(N-1) … choosing optimum p and then letting n -> infty ... = 1/(2e) = .18 Even worse ! DataLink Layer

  16. ALOHA Efficiency Throughput versus offered traffic for ALOHA systems. DataLink Layer

  17. CSMA (Carrier Sense Multiple Access) • Propagation time is much less than transmission time • All stations know that a transmission has started almost immediately • First listen for clear medium (carrier sense) • If channel sensed busy, defer transmission • If channel sensed idle: transmit entire frame • Wait reasonable time (round trip plus ACK contention) • No ACK then retransmit • If two stations start at the same instant, collision • Max utilization depends on propagation time (medium length) and frame length • Longer frame and shorter propagation gives better utilization DataLink Layer

  18. CSMA collisions spatial layout of nodes collisions can still occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted note: role of distance & propagation delay in determining collision probability DataLink Layer

  19. Nonpersistent CSMA • If medium is idle, transmit; otherwise, go to 2 • If medium is busy, wait amount of time drawn from probability distribution (retransmission delay) and repeat 1 • Random delays reduces probability of collisions • Consider two stations become ready to transmit at same time • While another transmission is in progress • If both stations delay same time before retrying, both will attempt to transmit at same time • Capacity is wasted because medium will remain idle following end of transmission • Even if one or more stations waiting • Nonpersistent stations deferential DataLink Layer

  20. 1-persistent CSMA • To avoid idle channel time, 1-persistent protocol used • Station wishing to transmit listens and obeys following: • If medium idle, transmit; otherwise, go to step 2 • If medium busy, listen until idle; then transmit immediately • 1-persistent stations selfish • If two or more stations waiting, collision guaranteed • Gets sorted out after collision DataLink Layer

  21. P-persistent CSMA • Compromise that attempts to reduce collisions • Like nonpersistent • And reduce idle time • Like1-persistent • Rules: • If medium idle, transmit with probability p, and delay one time unit with probability (1 – p) • Time unit typically maximum propagation delay • If medium busy, listen until idle and repeat step 1 • If transmission is delayed one time unit, repeat step 1 • What is an effective value of p? DataLink Layer

  22. Value of p? • Avoid instability under heavy load • n stations waiting to send • End of transmission, expected number of stations attempting to transmit is number of stations ready times probability of transmitting • n x p • If n x p > 1 on average there will be a collision • Repeated attempts to transmit almost guaranteeing more collisions • Retries compete with new transmissions • Eventually, all stations trying to send • Continuous collisions; zero throughput • So nxp < 1 for expected peaks of n • If heavy load expected, p small • However, as p made smaller, stations wait longer • At low loads, this gives very long delays DataLink Layer

  23. Persistent and Nonpersistent CSMA Comparison of the channel utilization versus load for various random access protocols. DataLink Layer

  24. Which Persistence Algorithm? • IEEE 802.3 uses 1-persistent • Both nonpersistent and p-persistent have performance problems • 1-persistent (p = 1) seems more unstable than p-persistent • Greed of the stations • But wasted time due to collisions is short (if frames long relative to propagation delay • With random backoff,unlikely to collide on next tries • To ensure backoff maintains stability, IEEE 802.3 and Ethernet use binary exponential backoff DataLink Layer

  25. CSMA/CD (Collision Detection) • With CSMA, collision occupies medium for duration of transmission • Stations listen whilst transmitting • If medium idle, transmit, otherwise, step 2 • If busy, listen for idle, then transmit • If collision detected, jam then cease transmission • After jam, wait random time then start from step 1 DataLink Layer

  26. CSMA/CD 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 DataLink Layer

  27. CSMA/CD collision detection DataLink Layer

  28. CSMA/CD DataLink Layer

  29. CSMA/CDOperation DataLink Layer

  30. “Taking Turns” MAC protocols Token passing: • control token passed from one node to next sequentially. • token message • concerns: • token overhead • latency • single point of failure (token) Polling: • master node “invites” slave nodes to transmit in turn • concerns: • polling overhead • latency • single point of failure (master) DataLink Layer

  31. Summary of MAC protocols • What do you do with a shared media? • Channel Partitioning, by time, frequency or code • Time Division, Frequency Division • Random partitioning (dynamic), • ALOHA, S-ALOHA, CSMA, CSMA/CD • carrier sensing: easy in some technologies (wire), hard in others (wireless) • CSMA/CD used in Ethernet • CSMA/CA used in 802.11 • Taking Turns • polling from a central site, token passing DataLink Layer

  32. Summary of MAC protocols Channel partitioning MAC protocols: • share channel efficiently and fairly at high load • inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols • efficient at low load: single node can fully utilize channel • high load: collision overhead “taking turns” protocols look for best of both worlds! DataLink Layer

  33. Ethernet Overview • History • developed by Xerox PARC in mid-1970s • roots in Aloha packet-radio network • standardized by Xerox, DEC, and Intel in 1978 • similar to IEEE 802.3 standard Metcalfe’s Ethernet sketch DataLink Layer

  34. Ethernet “dominant” wired LAN technology: • cheap $20 for 100Mbs! • first widely used LAN technology • Simpler, cheaper than token LANs and ATM • Kept up with speed race: 10 Mbps – 10 Gbps DataLink Layer

  35. Star topology • Bus topology popular through mid 90s • Now star topology prevails • Connection choices: hub or switch (more later) hub or switch DataLink Layer

  36. Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: • 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 • used to synchronize receiver, sender clock rates DataLink Layer

  37. Ethernet Frame Structure (more) • Addresses: 6 bytes • if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to net-layer protocol • otherwise, adapter discards frame • Type: indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk) • CRC: checked at receiver, if error is detected, the frame is simply dropped DataLink Layer

  38. Unreliable, connectionless service • Connectionless: No handshaking between sending and receiving adapter. • Unreliable: receiving adapter doesn’t send acks or nacks to sending adapter • stream of datagrams passed to network layer can have gaps • gaps will be filled if app is using TCP • otherwise, app will see the gaps DataLink Layer

  39. No slots adapter doesn’t transmit if it senses that some other adapter is transmitting, that is, carrier sense transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection Before attempting a retransmission, adapter waits a random time, that is, random access Ethernet uses CSMA/CD DataLink Layer

  40. 1. Adaptor receives datagram from net layer & creates frame 2. If adapter senses channel idle, it starts to transmit frame. If it senses channel busy, waits until channel idle and then transmits 3. If adapter transmits entire frame without detecting another transmission, the adapter is done with frame ! 4. If adapter detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, adapter enters exponential backoff: after the mth collision, adapter chooses a K at random from {0,1,2,…,2m-1}. Adapter waits K·512 bit times and returns to Step 2 Ethernet CSMA/CD algorithm DataLink Layer

  41. Jam Signal: make sure all other transmitters are aware of collision; 48 bits Bit time: .1 microsec for 10 Mbps Ethernet ;for K=1023, wait time is about 50 msec Exponential Backoff: Goal: adapt retransmission attempts to estimated current load heavy load: random wait will be longer first collision: choose K from {0,1}; delay is K· 512 bit transmission times after second collision: choose K from {0,1,2,3}… after ten collisions, choose K from {0,1,2,3,4,…,1023} Ethernet’s CSMA/CD (more) See/interact with Java applet on AWL Web site: highly recommended ! DataLink Layer

  42. Collision Detection • On baseband bus, collision produces much higher signal voltage than signal • Collision detected if cable signal greater than single station signal • Signal attenuated over distance • Limit distance to 500m (10Base5) or 200m (10Base2) • For twisted pair (star-topology) activity on more than one port is collision • Special collision presence signal DataLink Layer

  43. Algorithm (cont) • If collision… • jam for 32 bits, then stop transmitting frame • minimum frame is 64 bytes (header + 46 bytes of data) • delay and try again • 1st time: 0 or 51.2us • 2nd time: 0, 51.2, or 102.4us • 3rd time51.2, 102.4, or 153.6us • nth time: k x 51.2us, for randomly selected k=0..2n - 1 • give up after several tries (usually 16) • exponential backoff DataLink Layer

  44. Binary Exponential Backoff • Attempt to transmit repeatedly if repeated collisions • First 10 attempts, mean value of random delay doubled • Value then remains same for 6 further attempts • After 16 unsuccessful attempts, station gives up and reports error • As congestion increases, stations back off by larger amounts to reduce the probability of collision. • 1-persistent algorithm with binary exponential backoff efficient over wide range of loads • Low loads, 1-persistence guarantees station can seize channel once idle • High loads, at least as stable as other techniques • Backoff algorithm gives last-in, first-out effect • Stations with few collisions transmit first DataLink Layer

  45. Ethernet MAC Sublayer Protocol (2) DataLink Layer

  46. Ethernet Performance Efficiency of Ethernet at 10 Mbps with 512-bit slot times. DataLink Layer

  47. CSMA/CD efficiency • Tprop = max prop between 2 nodes in LAN • ttrans = time to transmit max-size frame • Efficiency goes to 1 as tprop goes to 0 • Goes to 1 as ttrans goes to infinity • Much better than ALOHA, but still decentralized, simple, and cheap DataLink Layer

  48. Ethernet Cabling The most common kinds of Ethernet cabling. DataLink Layer

  49. Ethernet Cabling (2) Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T. DataLink Layer

  50. Ethernet Cabling (3) Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented. DataLink Layer

More Related