Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Link Layer Message M A B 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:

Similar presentations


Presentation on theme: "1 Link Layer Message M A B 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:"— Presentation transcript:

1 1 Link Layer Message M A B 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)

2 2 Link and Physical Layers 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

3 3 Broadcast Links, Addressing and Media Access Control Message M A C link physical link physical link physical B 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

4 4 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 Broadcast Link (LAN)

5 5 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

6 6 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

7 7 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

8 8 CSMA Collisions collisions can occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted spatial layout of nodes along ethernet note: role of distance and propagation delay in determining collision prob.

9 9 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

10 10 CSMA/CD Collision Detection

11 11 “Taking Turns” MAC protocols 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 Token passing: control token passed from one node to next sequentially. token message concerns: –token overhead –latency –single point of failure (token)

12 12 Functionality of a LL With MAC Protocol Datagram H HEDC Add Framing Information LL Frame Encode Bits to the Link Link LL Media Access Control PL Datagram H Decode Bits from the Link D-MAC == MyMAC || D-MAC == FFFFFFFFFFFF N Drop the frame All bits in D’ OK? N Detected error Y D’EDC‘ Y Link LL PL


Download ppt "1 Link Layer Message M A B 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:"

Similar presentations


Ads by Google