Unit 4: MAC sublayer and network layer
Computer Networks notes · PTU syllabus (BSIT404/BSBC603)
On this page
Unit summary
When many stations share one channel, the MAC sublayer decides who transmits; the network layer then moves packets across many networks. This unit covers CSMA/CD and CSMA/CA, IEEE 802.3 Ethernet and Gigabit Ethernet, IEEE 802.4 Token Bus and 802.5 Token Ring, network layer design issues, routing algorithms, congestion control and internetworking.
After this unit you can
- Explain CSMA/CD and CSMA/CA
- Describe the IEEE 802 LAN standards
- Explain network layer design issues and routing algorithms
- Explain congestion control and internetworking
PTU syllabus topics
- CSMA/CD/CA
- IEEE 802.3 Ethernet
- Gigabit Ethernet
- IEEE 802.4 Token Bus
- IEEE 802.5 Token Ring
- network layer design issues
- routing algorithms (optimality principle, shortest path)
- congestion control policies
- internetworking concept
Full form
Collision detection
Collision avoidance
Used in
Wired Ethernet (IEEE 802.3)
Wi-Fi (IEEE 802.11)
Approach
Detect collision, stop, retry
Wait and signal to avoid collisions
Topic 1
The MAC sublayer and multiple access
- The medium access control (MAC) sublayer of the data link layer controls access to a shared (broadcast) channel.
Random access
ALOHA, CSMA, CSMA/CD, CSMA/CA
Controlled access
Reservation, polling, token passing
Channelisation
FDMA, TDMA, CDMA
Topic 2
CSMA/CD and CSMA/CA
- 1Sense the carrier
- 2If idle, transmit; if busy, wait
- 3Listen while transmitting
- 4On collision, send a jam signal and stop
- 5Wait a random time (binary exponential backoff) and retry
Used in
Classic wired Ethernet (IEEE 802.3)
Wireless LANs (IEEE 802.11 Wi-Fi)
Approach
Detect collisions and recover
Avoid collisions before they happen
Method
Listen while sending; jam and backoff
Wait IFS, random backoff, optional RTS/CTS, ACK for each frame
Why
Collisions can be detected on a cable
Wireless stations cannot hear collisions (hidden station problem)
- Minimum frame size: in CSMA/CD the frame must last at least two propagation delays so a collision is detected while sending — 64 bytes for 10 Mbps Ethernet.
Topic 3
IEEE 802.3 Ethernet and Gigabit Ethernet
Ethernet (IEEE 802.3) is the standard LAN technology: 10BASE-T (10 Mbps), Fast Ethernet (100 Mbps), Gigabit Ethernet (1 Gbps) and 10 Gigabit Ethernet. Classic Ethernet uses CSMA/CD (carrier sense multiple access with collision detection).
| Ethernet frame field | Size |
|---|---|
| Preamble + SFD | 8 bytes |
| Destination MAC | 6 bytes |
| Source MAC | 6 bytes |
| Type/Length | 2 bytes |
| Data | 46–1500 bytes |
| FCS (CRC) | 4 bytes |
A MAC address is a 48-bit hardware address burnt into a NIC, written in hex (00:1A:2B:3C:4D:5E). ARP (Address Resolution Protocol) finds the MAC address for a known IP address on the local network by broadcasting a request. Ethernet switching: a switch learns which MAC address is on which port, builds a MAC address table, and forwards frames only to the right port (flooding unknown destinations).
Standard Ethernet (10BASE5, 10BASE-T)
10 Mbps
Thick coax; UTP with hub
Fast Ethernet (100BASE-TX, FX)
100 Mbps
UTP Cat 5; fibre
Gigabit Ethernet (1000BASE-T, SX, LX)
1 Gbps
UTP Cat 5e and 6; multimode and single-mode fibre
10 Gigabit and beyond
10, 40, 100 Gbps and more
Cat 6a, fibre; full-duplex only
- Gigabit Ethernet keeps the 802.3 frame format, normally runs full-duplex through switches (no collisions); half-duplex used carrier extension and frame bursting.
Topic 4
IEEE 802.4 Token Bus and 802.5 Token Ring
Physical layout
Bus (linear or tree cable)
Ring (physically star-wired through an MAU)
Logical layout
Logical ring ordered by station address
Physical ring
Token passing
Token passed to the next address in the logical ring
Token circulates around the ring
Speed
1, 5, 10 Mbps
4 and 16 Mbps
Use
Factory automation (MAP)
IBM LANs; now obsolete
- Advantages of token passing: no collisions, predictable (deterministic) delay, priorities; disadvantages: token loss handling, complexity, monitor station needed in Token Ring.
Topic 5
Network layer design issues
- Store-and-forward packet switching
- Routers receive whole packets, check and forward them
- Services to the transport layer
- Independent of router technology; uniform addressing
- Connectionless service
- Datagrams routed independently (IP)
- Connection-oriented service
- Virtual circuits set up first (MPLS)
- Routing and congestion
- Choose paths and avoid overload
Setup
Not needed
Required
Addressing
Full address in each packet
Short VC number
Routing
Each packet routed independently
Route chosen once at setup
Router failure
Only lost packets affected
All circuits through it end
Congestion control
Difficult
Easier with reserved resources
Topic 6
Routing algorithms
- Routing algorithm: decides the output line for each incoming packet. Static (non-adaptive) routes are fixed in advance; dynamic (adaptive) routes change with traffic and topology (distance vector — RIP; link state — OSPF).
- Optimality principle: if router J is on the optimal path from I to K, then the optimal path from J to K lies on the same route. Hence optimal routes from all sources to a destination form a sink tree.
- 1Mark the source with distance 0, others infinity
- 2Pick the unvisited node with the smallest distance and make it permanent
- 3Update distances of its neighbours via this node
- 4Repeat until all nodes are permanent
- 5Read paths by following predecessors
Example
Links A–B 2, A–C 5, B–C 1, B–D 4, C–D 1. From A: B = 2; C = min(5, 2 + 1) = 3; D = min(2 + 4, 3 + 1) = 4. Shortest path A → B → C → D with cost 4.
- Other algorithms: flooding (send on every line; robust but wasteful), distance vector (Bellman–Ford; count-to-infinity problem), link state, hierarchical routing.
Topic 7
Congestion control policies
- Congestion: too many packets in the subnet, so performance degrades — queues overflow and packets are lost.
Idea
Good design so congestion does not occur
Monitor, detect and act after congestion starts
Policies
Retransmission, out-of-order caching, acknowledgement, discard and admission policies
Choke packets, backpressure, explicit congestion notification
Examples
Traffic shaping with leaky bucket and token bucket
Load shedding, random early detection (RED)
- Leaky bucket: outputs packets at a constant rate whatever the input burst. Token bucket: tokens accumulate at a fixed rate; bursts are allowed up to the bucket size.
Topic 8
Internetworking concept
- Internetworking: connecting different networks (LANs, WANs with different protocols) so they work as one — the internet is a network of networks.
- Repeater or hub
- Physical layer; extends a segment
- Bridge or switch
- Data link layer; connects LAN segments
- Router
- Network layer; connects different networks, chooses routes
- Gateway
- Up to the application layer; translates between different protocols
- Issues: different addressing, packet sizes (fragmentation), quality of service and security; solved by IP as a common protocol, tunnelling and fragmentation.
Key terms
- CSMA/CD
- Access method detecting collisions on wired Ethernet
- CSMA/CA
- Access method avoiding collisions on wireless LANs
- Token
- Special frame giving permission to transmit
- Optimality principle
- Sub-paths of optimal paths are optimal
- Congestion
- Excess packets degrading network performance
Quick revision
- MAC: random, controlled, channelisation access.
- CSMA/CD vs CSMA/CA; backoff; minimum frame.
- 802.3 Ethernet generations; Gigabit Ethernet; 802.4 Token Bus; 802.5 Token Ring.
- Datagram vs virtual circuit; static vs dynamic routing; sink tree; Dijkstra.
- Open- and closed-loop congestion control; leaky and token bucket; internetworking devices.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.Expand CSMA/CD.
- Q2.Why does Wi-Fi use CSMA/CA?
- Q3.Distinguish Token Bus and Token Ring.
- Q4.State the optimality principle.
- Q5.Distinguish leaky bucket and token bucket.
- Q6.What is a gateway?
Long-answer questions
- Q1.Explain CSMA/CD and CSMA/CA.
- Q2.Explain the IEEE 802.3, 802.4 and 802.5 standards.
- Q3.Explain network layer design issues and the shortest path routing algorithm.
- Q4.Explain congestion control policies and internetworking.
Stuck on this unit?
Message SBS on WhatsApp for help with Computer Networks, or to ask about studying B.Sc IT at Synetic.
