120 likes | 133 Views
Explore the communication problem handled by Link Layer (LL) & Physical Layer (PL) protocols, addressing frame delivery, error detection/recovery, media access control, and MAC addressing in broadcast links. Learn about MAC protocols categories, random access schemes, CSMA, CSMA/CD, and Taking Turns MAC protocols.
E N D
Problem: Given a message M at a node A consisting of several packets, how do you send the packets to a “neighbor” node B Neighbor: A node attached to the same link Link can be point-to-point or broadcast Link can be guided media (a copper, coax, fiber wire) or unguided media (wireless) Link Layer B A Message M
This communication problem is handled by 2 protocols A Link Layer (LL) that sits on top of the physical layer (PL) and deals with Packet Encapsulation, Mux/Demux Framing – Detecting frame boundaries Error Detection/Recovery – Detecting corrupt frames Media Access Control (if the link is multi-access or broadcast) Reliable delivery, flow control? – Optional A Physical Layer (PL) deals with encoding/decoding bits of a frame to/from the link Message M A B link physical link physical Link and Physical Layers
link physical C Message M A B link physical link physical Broadcast Links, Addressing and Media Access Control • In a broadcast link, there are two additional issues that must be resolved • How do the nodes agree on who gets to use the link next? • Called the Media Access Control problem • How does A tell that the frame is destined to B not to C? • Addressing problem: Each station must have a UNIQUE address, called the Media Access Control (MAC) address
Broadcast Link (LAN) MAC Addresses • Typically 48 bit (for most LANs) • burned in adapter ROM • Flat addresses, i.e., no hierarchical organization • Address space assigned and managed by IEEE • Manufacturer buys portion of MAC address space to ensure GLOBAL uniqueness • Special LAN broadcast address • FF-FF-FF-FF-FF-FF
Media Access Control Protocols Three broad categories: • Channel Partitioning • divide channel into smaller “pieces” (time slots, frequency), allocate piece to node for exclusive use • TDM, FDM • Random Access • allow collisions • “recover” from collisions • “Taking turns” • tightly coordinate shared access to avoid collisions Goal: efficient, fair, simple, decentralized
Random Access MAC 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: • ALOHA , slotted ALOHA, CSMA, CSMA/CD
CSMA: Carrier Sense Multiple Access • Listen before transmit: • If channel sensed idle: transmit entire pkt • If channel sensed busy, defer transmission • Persistent CSMA: • retry immediately with probability p when channel becomes idle • Non-persistent CSMA: • retry after random interval
CSMA Collisions spatial layout of nodes along ethernet collisions can occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted note: role of distance and propagation delay in determining collision prob.
CSMA/CD (Collision Detection) • CSMA/CD: carrier sense multiple access/collision detect • collisions detected within short time • colliding transmissions aborted, reducing channel wastage • persistent or non-persistent retransmission • collision detection: • For wired LANs: measure signal strengths, compare transmitted, received signals
“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 (USB) • Request to Send, Clear to Send msgs (802.11) • concerns: • polling overhead • latency • single point of failure (master) • Used in USB
Datagram Datagram H Datagram H Datagram Y H Datagram EDC LL Frame LL LL Add Framing Information Y D-MAC == MyMAC || D-MAC == FFFFFFFFFFFF All bits in D’ OK? N Media Access Control Detected error N Drop the frame D’ EDC‘ Encode Bits to the Link PL Decode Bits from the Link PL Link Link Functionality of a LL With MAC Protocol