Medium access control and local area networks notes — Unit 3
Free unit-wise study notes on medium access control and local area networks for Computer Networks, Semester 5 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.
Explore the Medium Access Control (MAC) sublayer, random and controlled access protocols (CSMA/CD, Token Passing), and deep-dives into Wired Ethernet (802.3) and Wireless LAN (802.11).
Notebook — 20 pages
Page 1
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
1. Introduction to MAC Sublayer
When nodes are connected via a point-to-point link, there is no need for medium access control. However, when nodes share a common broadcast channel (like a single cable or the open air), a mechanism is needed to coordinate access and prevent signals from colliding.
⇒1.1 The MAC Sublayer
The Data Link Layer is divided into two sublayers: the Logical Link Control (LLC) sublayer and the Medium Access Control (MAC) sublayer. The MAC sublayer is strictly responsible for determining who gets to use the broadcast channel next.
⇒1.2 Categories of MAC Protocols
Random Access Protocols: Stations compete for the medium. (ALOHA, CSMA, CSMA/CD, CSMA/CA)
Controlled Access Protocols: Stations consult one another to determine who sends next. (Reservation, Polling, Token Passing)
Channelization Protocols: The available bandwidth is shared in time, frequency, or through codes. (FDMA, TDMA, CDMA)
Page 2
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
2. Random Access: ALOHA
ALOHA was the earliest random access method, developed at the University of Hawaii for radio communication.
⇒2.1 Pure ALOHA
Rule: Any station can transmit a frame at any time.
If two or more frames are sent at the same time, a collision occurs, and all colliding frames are destroyed.
After transmitting, a station waits for an acknowledgment. If it times out, it assumes a collision occurred, waits a random amount of time (backoff), and retransmits.
Efficiency: Very poor. Maximum channel utilization is about 18.4%.
⇒2.2 Slotted ALOHA
Introduced to improve the efficiency of Pure ALOHA.
Time is divided into discrete intervals called slots. Stations are synchronized.
Rule: A station is only permitted to begin transmitting at the exact beginning of a time slot.
This cuts the vulnerable period for collisions in half.
Efficiency: Doubles the maximum channel utilization to 36.8%.
Page 3
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
3. Carrier Sense Multiple Access (CSMA)
CSMA improves upon ALOHA by introducing the rule: "Listen before you talk." A station senses the medium (checks for a carrier signal) before transmitting.
⇒3.1 Persistence Methods
What does a station do if it senses the channel is busy?
1-Persistent CSMA: The station continuously senses the channel. The moment it becomes idle, it transmits with a probability of 1. (High chance of collision if multiple stations are waiting).
Non-Persistent CSMA: If the channel is busy, the station waits a random amount of time before sensing again. (Reduces collisions, but increases delay).
p-Persistent CSMA: Used in slotted channels. If the channel is idle, it transmits with probability p. With probability q = 1-p, it defers to the next slot.
Despite sensing the channel, collisions can still occur due to propagation delay. If Station A transmits, Station B might sense the channel as idle before A's signal physically reaches B.
Page 4
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
4. CSMA/CD (Collision Detection)
CSMA/CD is the protocol used in traditional Wired Ethernet. It augments CSMA with the rule: "Listen while you talk."
⇒4.1 The Protocol
A station senses the medium and transmits if it's idle.
While transmitting, it continuously monitors the energy level on the cable.
If the energy level spikes, it detects a collision.
The station immediately aborts transmission and sends a brief jam signal to notify all other stations of the collision.
The station then enters a random backoff period before trying again.
⇒4.2 The Minimum Frame Size Requirement
For CSMA/CD to work, a station must still be transmitting its frame when the collision signal returns to it. Therefore, the frame transmission time must be at least twice the maximum propagation delay (Round Trip Time). This dictates the minimum frame size in Ethernet (64 bytes).
Page 5
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
5. CSMA/CA (Collision Avoidance)
In wireless networks (like Wi-Fi), detecting a collision is impossible because the transmitted signal swamps the receiving antenna. Thus, wireless LANs use CSMA/CA to avoid collisions instead of detecting them.
⇒5.1 Collision Avoidance Strategies
Interframe Space (IFS): Even if the channel is idle, a station waits for a small period called IFS. If it remains idle, it proceeds.
Contention Window: The station chooses a random number of slots to wait before transmitting, essentially backing off before a collision can happen.
Acknowledgments: Because collisions can't be detected by the sender, positive acknowledgments (ACK) from the receiver are required to confirm successful delivery.
⇒5.2 Hidden Terminal Problem
If Station A and Station C are both in range of Station B, but hidden from each other (e.g., separated by a wall), they might both sense an idle channel and transmit to B, causing a collision at B. CSMA/CA solves this using optional RTS/CTS (Request to Send / Clear to Send) control frames.
Page 6
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
6. Controlled Access Protocols
In controlled access, stations do not compete. Instead, they coordinate to ensure only one station transmits at a time.
⇒6.1 Reservation
Time is divided into intervals. Before data transmission, stations send a tiny reservation frame in a specific slot to book their turn. Only stations that made a reservation can transmit data in the subsequent period.
⇒6.2 Polling
Requires a Primary (master) station and multiple Secondary (slave) stations.
Poll: The primary asks a secondary if it has data to send.
Select: The primary tells a secondary that it is about to send data to it.
Drawback: Single point of failure (the Primary). If it dies, the network dies.
⇒6.3 Token Passing
Stations are organized in a logical ring. A special control frame called a token circulates around the ring. A station can only transmit data if it is in possession of the token. Once done, it passes the token to the next station. Used in Token Ring and FDDI networks.
Page 7
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
7. Channelization Protocols
Channelization is a multiple-access method in which the available bandwidth of a link is shared in time, frequency, or through code, between different stations.
⇒7.1 FDMA (Frequency Division Multiple Access)
The available bandwidth is divided into frequency bands. Each station is allocated a continuous, specific frequency band to transmit its data. Commonly used in analog cellular networks (1G).
⇒7.2 TDMA (Time Division Multiple Access)
The entire bandwidth of the channel is available to each station, but only for a specific slice of time. Stations take turns transmitting in a round-robin fashion. Used in digital cellular networks like GSM (2G).
⇒7.3 CDMA (Code Division Multiple Access)
All stations can transmit simultaneously using the entire frequency spectrum. To prevent interference, each station uses a unique, orthogonal mathematical code (chip sequence) to encode its data. The receiver uses the same code to extract the desired signal from the combined transmissions. Used in 3G networks.
Page 8
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
8. Wired LANs: IEEE 802.3 (Ethernet) Overview
Ethernet is the dominant Wired Local Area Network (LAN) technology, defined by the IEEE 802.3 standard. It was originally developed by Xerox in the 1970s.
⇒8.1 Architecture
Standard Ethernet operates at 10 Mbps. It traditionally used a physical bus topology (thick coaxial cable) but later migrated to a star topology using twisted-pair cables and a central hub/switch.
⇒8.2 MAC Addressing
Every Ethernet Network Interface Card (NIC) has a unique 48-bit (6-byte) physical address called a MAC address, usually represented in hexadecimal format (e.g., `00:1A:2B:3C:4D:5E`).
Unicast Address: Sent to one specific MAC address.
Multicast Address: Sent to a group of devices.
Broadcast Address: Sent to all devices on the LAN (`FF:FF:FF:FF:FF:FF`).
Page 9
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
9. Ethernet MAC Frame Format
The IEEE 802.3 MAC frame structure is strictly defined to ensure compatibility across all hardware.
Field
Size
Description
Preamble
7 bytes
Alternating 1s and 0s for receiver synchronization.
SFD
1 byte
Start Frame Delimiter (`10101011`) marking the start.
Destination MAC
6 bytes
MAC address of the receiver.
Source MAC
6 bytes
MAC address of the sender.
Length/Type
2 bytes
Length of payload, or Type of Network protocol (e.g., IPv4).
Data and Padding
46 - 1500 bytes
The actual payload from the network layer. If data < 46 bytes, padding is added.
CRC / FCS
4 bytes
Cyclic Redundancy Check for error detection.
Note on Size: The minimum frame size is 64 bytes (excluding Preamble and SFD). The maximum frame size is 1518 bytes.
Page 10
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
10. Ethernet Evolution
Ethernet has continuously evolved to meet the demands for higher bandwidth.
⇒10.1 Standard Ethernet (10 Mbps)
10Base5: Thick coaxial cable, Bus topology.
10Base2: Thin coaxial cable, Bus topology.
10Base-T: Twisted pair cable, Star topology. The turning point for modern LANs.
⇒10.2 Fast Ethernet (100 Mbps - IEEE 802.3u)
Designed to upgrade bandwidth while keeping the same MAC format and frame sizes. It dropped the bus topology entirely, relying strictly on star topologies using switches.
⇒10.3 Gigabit (1 Gbps) and 10 Gigabit (10 Gbps) Ethernet
Gigabit Ethernet (802.3z) relies heavily on fiber optics for long distances and Cat-5e/Cat-6 UTP for short distances. 10 Gigabit Ethernet (802.3ae) completely removes the concept of collision detection (CSMA/CD) because it operates exclusively in full-duplex mode via switches.
Page 11
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
11. Wireless LANs: IEEE 802.11 (Wi-Fi)
IEEE 802.11 defines the specifications for Wireless Local Area Networks (WLANs), commonly known as Wi-Fi.
⇒11.1 Architecture Components
BSS (Basic Service Set): The fundamental building block. It contains wireless stations. A BSS with an Access Point (AP) is an infrastructure BSS. A BSS without an AP is an ad hoc network.
AP (Access Point): A central base station bridging the wireless network to a wired network.
ESS (Extended Service Set): Two or more BSSs interconnected by a Distribution System (usually a wired Ethernet LAN). This allows roaming.
⇒11.2 MAC Sublayer in 802.11
The 802.11 MAC sublayer is more complex than Ethernet. It features the DCF (Distributed Coordination Function) which uses CSMA/CA for contention-based access, and an optional PCF (Point Coordination Function) for contention-free polling by the AP.
Page 12
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
12. Bluetooth (IEEE 802.15)
Bluetooth is a Wireless Personal Area Network (WPAN) technology designed for short-range communication (devices like mice, keyboards, and headsets).
⇒12.1 Piconet
A Bluetooth network is called a piconet. It can have up to eight stations: exactly one Primary (Master) and up to seven Secondaries (Slaves).
All communication is strictly between the master and a slave. Slaves cannot communicate directly with each other.
The master dictates the hopping sequence and timing.
⇒12.2 Scatternet
Piconets can be combined to form a scatternet. A slave in one piconet can act as the master in a second piconet, relaying information between the two networks.
Page 13
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
13. Connecting Devices: Hubs and Bridges
Networks are interconnected using various devices that operate at different layers of the OSI model.
⇒13.1 Hubs / Repeaters (Physical Layer)
A repeater simply receives a degraded signal, regenerates it, and forwards it. A hub is a multiport repeater. It operates entirely at Layer 1. If data comes in on one port, it is blindly broadcast out of all other ports. It creates a single large collision domain.
⇒13.2 Bridges (Data Link Layer)
A bridge operates at Layer 2. It reads the MAC addresses in the frame headers and uses a forwarding table to filter traffic. It only forwards a frame to the specific port where the destination MAC resides, effectively breaking up collision domains.
Page 14
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
14. Connecting Devices: Switches and Routers
⇒14.1 Switches (Data Link Layer)
A switch is essentially a fast, multi-port bridge. It learns the MAC addresses of connected devices and forwards frames exclusively to the correct port.
Microsegmentation: Each port on a switch represents its own collision domain. This effectively eliminates collisions (enabling Full-Duplex communication).
Operates based on an internally maintained MAC Address Table.
⇒14.2 Routers (Network Layer)
Routers operate at Layer 3. They connect entirely different networks together (e.g., bridging your home LAN to the ISP's WAN).
They examine logical IP addresses (not MAC addresses).
They break up both collision domains and broadcast domains.
They use routing protocols (OSPF, BGP) to determine the absolute best path to forward a packet through the internetwork.
Page 15
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
15. Token Ring (802.5) and FDDI
While Ethernet (802.3) dominated the bus/star topologies, other LAN standards were built around the ring topology.
⇒15.1 IEEE 802.5 (Token Ring)
Developed by IBM, Token Ring physically wires stations in a star using a central Multistation Access Unit (MAU), but logically operates as a ring.
Access to the medium is strictly controlled by a circulating 3-byte frame called a token.
A station can only transmit if it seizes the free token.
A high-performance token-passing network using fiber optic cables.
Uses a dual-ring architecture (primary and secondary rings).
If a station or cable fails, the dual rings fold into a single ring to maintain connectivity (high fault tolerance).
Page 16
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
16. Virtual LANs (VLANs)
A Virtual LAN (VLAN) allows a network administrator to logically segment a single physical LAN into multiple broadcast domains using Layer 2 switches.
⇒16.1 Benefits of VLANs
Security: Isolates sensitive departments (e.g., HR traffic cannot be sniffed by Engineering) even if they are plugged into the same switch.
Reduced Broadcast Traffic: A broadcast frame in VLAN 10 is strictly contained within VLAN 10; it is not sent to ports assigned to VLAN 20.
Flexibility: Users can move their desks anywhere in the building, and as long as their switch port is assigned to their specific VLAN, they remain on the same logical network.
⇒16.2 IEEE 802.1Q Tagging
When a frame travels between switches across a 'trunk' link, it needs an identifier so the receiving switch knows which VLAN it belongs to. The IEEE 802.1Q standard inserts a 4-byte tag into the standard Ethernet header to carry the VLAN ID.
Page 17
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
17. Spanning Tree Protocol (STP)
To provide redundancy and high availability, network administrators wire redundant paths between switches. However, at Layer 2, this creates devastating switching loops and broadcast storms.
⇒17.1 How Loops Occur
Because Ethernet frames do not have a Time-To-Live (TTL) field like IP packets, a broadcast frame caught in a loop of switches will circulate infinitely, multiplying endlessly until the network collapses.
⇒17.2 The STP Solution (IEEE 802.1D)
Invented by Radia Perlman, STP prevents loops by mathematically identifying a loop-free subset of the network topology (a spanning tree).
Switches exchange Bridge Protocol Data Units (BPDUs) to elect a single Root Bridge.
Every other switch calculates the shortest path to the Root Bridge.
Any redundant links that would cause a loop are forced into a logical blocking state (they do not forward traffic).
If the active path fails, STP recalculates and unblocks a redundant path automatically.
Page 18
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
18. IEEE 802.11 (Wi-Fi) Frame Architecture
Unlike a simple Ethernet frame, an 802.11 wireless frame is highly complex because it must handle management, control, and multiple physical access points.
⇒18.1 The Four Address Fields
An 802.11 frame contains up to four MAC addresses depending on the direction of travel (To DS or From DS, where DS is the Distribution System).
Address 1: Receiver Address (the immediate device receiving the radio signal).
Address 2: Transmitter Address (the immediate device sending the radio signal).
Address 3: Destination Address (the final endpoint).
Address 4: Source Address (the original sender, used only in wireless bridge modes).
⇒18.2 Frame Types
Management Frames: Beacons, Probe Requests/Responses, Authentication, and Association.
Control Frames: RTS (Request to Send), CTS (Clear to Send), and ACKs.
Data Frames: The actual payload.
Page 19
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
19. Bluetooth (IEEE 802.15.1) Architecture
Bluetooth is a Wireless Personal Area Network (WPAN) standard designed for short-range communication.
⇒19.1 Piconets and Scatternets
Piconet: A small network consisting of one Primary (Master) device and up to 7 active Secondary (Slave) devices. All communication is strictly between the primary and a secondary; secondaries cannot talk directly to each other.
Scatternet: Multiple piconets combined. A secondary device in one piconet can act as the primary in another.
⇒19.2 Bluetooth Protocol Stack
Layer
Function
Radio Layer
Equivalent to physical layer. Uses 2.4 GHz ISM band and FHSS (Frequency Hopping).
Baseband Layer
Equivalent to MAC sublayer. Handles physical links (SCO for voice, ACL for data).
L2CAP
Logical Link Control and Adaptation Protocol. Handles multiplexing, segmentation, and assembly of larger packets.
Page 20
Wink Notes
B.Tech CSE — 5th Semester
Computer Networks
— Unit - 3 —
20. Gateways and Advanced Interconnection
While repeaters (Layer 1), bridges (Layer 2), and routers (Layer 3) connect networks operating under similar protocols, Gateways are designed to connect entirely different architectures.
⇒20.1 Protocol Conversion
A gateway operates at all seven layers of the OSI model. Its primary job is protocol translation.
Example: Connecting an ancient IBM SNA mainframe network to a modern TCP/IP internetwork.
The gateway unpacks the TCP/IP packet completely, extracts the raw application data, and repackages it entirely into the SNA protocol format.
⇒20.2 Layer 3 Switches vs Routers
A Layer 3 Switch is essentially a hardware-based router. Traditional routers evaluate routing tables using software (which can be slow for millions of packets). Layer 3 switches use specialized Application-Specific Integrated Circuits (ASICs) to route IP packets at wire speed.