Unit 4 of 4 · B.Sc IT Sem 4

Unit 4: MAC sublayer and network layer

Computer Networks notes · PTU syllabus (BSIT404/BSBC603)

3 min read8 topics10 exam questions
On this page
  1. Unit summary
  2. The MAC sublayer and multiple access
  3. CSMA/CD and CSMA/CA
  4. IEEE 802.3 Ethernet and Gigabit Ethernet
  5. IEEE 802.4 Token Bus and 802.5 Token Ring
  6. Network layer design issues
  7. Routing algorithms
  8. Congestion control policies
  9. Internetworking concept
  10. Key terms
  11. Quick revision
  12. Important questions

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
ComparisonCSMA/CD vs CSMA/CA
CSMA/CD
CSMA/CA

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

1

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.
ClassificationMultiple access protocols
Multiple access
  • Random access

    ALOHA, CSMA, CSMA/CD, CSMA/CA

  • Controlled access

    Reservation, polling, token passing

  • Channelisation

    FDMA, TDMA, CDMA

2

Topic 2

CSMA/CD and CSMA/CA

ProcessCSMA/CD (wired Ethernet)
  1. 1Sense the carrier
  2. 2If idle, transmit; if busy, wait
  3. 3Listen while transmitting
  4. 4On collision, send a jam signal and stop
  5. 5Wait a random time (binary exponential backoff) and retry
ComparisonCSMA/CD and CSMA/CA
CSMA/CD
CSMA/CA

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

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 fieldSize
Preamble + SFD8 bytes
Destination MAC6 bytes
Source MAC6 bytes
Type/Length2 bytes
Data46–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).

ComparisonEthernet generations
Speed
Media

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

Topic 4

IEEE 802.4 Token Bus and 802.5 Token Ring

ComparisonToken Bus and Token Ring
Token Bus (802.4)
Token Ring (802.5)

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

Topic 5

Network layer design issues

Key termsNetwork 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
ComparisonDatagram and virtual-circuit subnets
Datagram
Virtual circuit

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

6

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.
ProcessDijkstra's shortest path algorithm
  1. 1Mark the source with distance 0, others infinity
  2. 2Pick the unvisited node with the smallest distance and make it permanent
  3. 3Update distances of its neighbours via this node
  4. 4Repeat until all nodes are permanent
  5. 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.
7

Topic 7

Congestion control policies

  • Congestion: too many packets in the subnet, so performance degrades — queues overflow and packets are lost.
ComparisonCongestion control approaches
Open loop (prevention)
Closed loop (removal)

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

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.
Key termsInternetworking devices
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

  1. Q1.Expand CSMA/CD.
  2. Q2.Why does Wi-Fi use CSMA/CA?
  3. Q3.Distinguish Token Bus and Token Ring.
  4. Q4.State the optimality principle.
  5. Q5.Distinguish leaky bucket and token bucket.
  6. Q6.What is a gateway?

Long-answer questions

  1. Q1.Explain CSMA/CD and CSMA/CA.
  2. Q2.Explain the IEEE 802.3, 802.4 and 802.5 standards.
  3. Q3.Explain network layer design issues and the shortest path routing algorithm.
  4. 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.

WhatsApp us