Download presentation
Presentation is loading. Please wait.
Published byRandell Glenn Modified over 9 years ago
1
Data Link Layer
2
Useful References r Wireless Communications and Networks by William Stallings r Computer Networks (third edition) by Andrew Tanenbaum r Computer Networking (second edition) by J. Kurose and K. Ross
3
Network protocol stack r application: supporting network applications m FTP, SMTP, STTP r transport: host-host data transfer m TCP, UDP r network: routing of datagrams from source to destination m IP, routing protocols r link: data transfer between neighboring network elements m PPP, Ethernet r physical: bits “on the wire” application transport network link physical
4
Links r A communication path consists of a series of communication links, starting at the source host, passing through a series of routers and ending at the destination host. r How are packets sent across individual links within the end-to-end communication path?
5
Multiple Access Links and Protocols Two types of “links”: r point-to-point m PPP for dial-up access m point-to-point link between Ethernet switch and host r broadcast (shared wire or medium) m traditional Ethernet m 802.11 wireless LAN
6
Multiple Access protocols r Single shared broadcast channel r Two or more simultaneous transmissions by nodes: interference m Only one node can send successfully at a time A multiple access protocol is characterized as follows: r Distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit r Communication about channel sharing must use channel itself!
7
Ideal Multiple 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: m no special node to coordinate transmissions m no synchronization of clocks, slots 4. Simple
8
MAC Protocols: a taxonomy Three broad classes: r Channel Partitioning m Divide channel into smaller “pieces” (time slots, frequency, code) m Allocate piece to node for exclusive use r Random Access m Channel not divided, allow collisions m “recover” from collisions r “Taking turns” m Tightly coordinate shared access to avoid collisions
9
Channel Partitioning MAC protocols: TDMA TDMA: Time Division Multiple Access r Access to channel in "rounds" r Each station gets fixed length slot (length = pkt trans time) in each round r Unused slots go idle r Example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle
10
Channel Partitioning MAC protocols: FDMA FDMA: Frequency Division Multiple Access r Channel spectrum divided into frequency bands r Each station assigned fixed frequency band r Unused transmission time in frequency bands go idle r Example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time
11
Channel Partitioning CDMA (Code Division Multiple Access) r Unique “code” assigned to each user; i.e., code set partitioning r Used mostly in wireless broadcast channels (cellular, satellite, etc) r all users share same frequency, but each user has own “chipping” sequence (i.e., code) to encode data r encoded signal = (original data) X (chipping sequence) r decoding: inner-product of encoded signal and chipping sequence
12
CDMA r Let d i be the value of the data bit for the i th bit slot. r For mathematical convenience, we represent a data bit with a o value as –1. r Each bit slot is further subdivided into M minislots. r In this example, M=8 (although usually it is higher).
13
CDMA r The CDMA code used by the sender consists of a sequence of M values: c 1 c 2 c 3 …c M each taking a +1 or –1 value. In the example, the CDMA code being used is (1,1,1,-1,1,-1,-1,-1).
14
CMDA Encode r For the m th minislot of the slot transmitting d i, the output of the CDMA encoder Z i,m, is the value of d i multiplied by the m th bit in the assigned CDMA code, c m : m Z i,m = d i *c m
15
CDMA Encode/Decode
16
CDMA Decode r The original data bit d i is recovered by computing: m d i = (1/M) Z i,m. C m (m=1…M)
17
CDMA Encode/Decode
18
CDMA: Two-Sender Interference r The world is far from ideal. r CDMA must work in the presence of interfering senders that are encoding and transmitting their data using a different assigned code. r How then does a CDMA receiver recover a sender’s original data bits when those data bits are being tangled with bits from other senders.
19
CDMA: Two-Sender Interference
20
CDMA r Codes must be carefully chosen so that there is minimal interference. r Codes must be orthogonal which means that the inner product of two distinct codes should be 0 r The inner product of a code with itself should be one. r The inner product of a code with its complement should be –1.
21
CDMA Assumptions r The codes satisfy the properties mentioned earlier. r The receiver knows who the sender is. r Our discussion made the assumption that the received signal strengths from various senders at a receiver are the same; this is difficult to achieve in practice.
22
Random Access Protocols r When node has packet to send m Transmit at full channel data rate R. m No a priori coordination among nodes r Two or more transmitting nodes -> “collision”, r Random access MAC protocol specifies: m How to detect collisions m How to recover from collisions (e.g., via delayed retransmissions) r Examples of random access MAC protocols: m Slotted ALOHA m ALOHA m CSMA, CSMA/CD, CSMA/CA
23
CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: r If channel sensed idle: transmit entire frame r If channel sensed busy, defer transmission r Human analogy: don’t interrupt others!
24
CSMA collisions Collisions can still occur: propagation delay means two nodes may not hear each other’s transmission Collision: entire packet transmission time wasted spatial layout of nodes Note: role of distance & propagation delay in determining collision probability
25
CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA m Collisions detected within short time m Colliding transmissions aborted, reducing channel wastage r Collision detection: m Easy in wired LANs: measure signal strengths, compare transmitted, received signals m Difficult in wireless LANs; can be costly r Human analogy: the polite conversationalist
26
CSMA/CD collision detection
27
CSMA/CA r Collision if 2 or more nodes transmit at same time r CSMA makes sense: m get all the bandwidth if you’re the only one transmitting m shouldn’t cause a collision if you sense another transmission r Collision detection doesn’t work: hidden terminal problem Location Signal Strength
28
CSMA/CA CSMA sender - if sense channel idle for DIFS sec. then transmit entire frame (no collision detection) -if sense channel busy then binary backoff CSMA receiver - if received OK return ACK after SIFS (ACK is needed due to hidden terminal problem)
29
Collision Avoidance: RTS-CTS exchange r Sender transmits short RTS (request to send) packet: indicates duration of transmission r Receiver replies with short CTS (clear to send) packet m Notifying (possibly hidden) nodes r Hidden nodes will not transmit for specified duration: NAV
30
Collision Avoidance: RTS-CTS exchange r RTS and CTS short: m Collisions less likely, of shorter duration m End result similar to collision detection
31
“Taking Turns” MAC protocols Channel partitioning MAC protocols: m Share channel efficiently and fairly at high load m Inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols m Efficient at low load: single node can fully utilize channel m High load: collision overhead “taking turns” protocols Look for best of both worlds!
32
“Taking Turns” MAC protocols Polling: r Master node “invites” slave nodes to transmit in turn r Concerns: m Polling overhead m Latency m Single point of failure (master) Token passing: r Control token passed from one node to next sequentially. r Token message r Concerns: m Token overhead m Latency m Single point of failure (token)
33
Summary of MAC protocols r What do you do with a shared media? m Channel Partitioning, by time, frequency or code Time Division,Code Division, Frequency Division m 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 CMSA/CA and CMSA can be used in 802.11 (discussed later) m Taking Turns polling from a central site, token passing
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.