Computer NetworksStudy companion

BTech Computer Networks · Chapters 1, 3 and 4

Study the network as a system, not a list of definitions.

This syllabus-first resource connects architectures, services, protocols, diagrams, and numerical methods. Core explanations stay visible; derivations and practice sets expand when you need them.

Scope decision: Chapter 3 error-control coding (Hamming distance, CRC, and Hamming code) is intentionally excluded because your syllabus explicitly marks it out of scope. Wireless LAN, bridging, VLAN, and network-layer tutorials are also excluded from the core course.
01

Chapter 1

Introduction to Computer Networks

Why networks exist, how they are classified, how protocol layers cooperate, and how the OSI and TCP/IP models organize communication.

1.1

Uses of Computer Networks

A computer network connects autonomous devices so they can exchange information and share services. Its value comes from communication, access, coordination, and resource sharing rather than from the cables or radio links alone.

Business applications

  • Resource sharing: printers, storage, databases, and applications.
  • Client-server systems for web, email, enterprise software, and cloud services.
  • Remote access through virtual private networks.
  • Communication using email, messaging, voice, and video.

Home applications

  • Internet access and information retrieval.
  • Peer-to-peer communication and file exchange.
  • Streaming, social media, online learning, and e-commerce.
  • Smart-home services and connected devices.

Mobile applications

  • Cellular data, Wi-Fi hotspots, GPS navigation, and mobile commerce.
  • Wearables and sensor networks.
  • Connectivity while the user or device changes location.
Lecture slide grouping business and home uses of computer networks
Uses of computer networks grouped into business and home applications.
Client-server network with clients requesting services from a central server
Client-server model: clients initiate requests; servers provide shared services.
Peer-to-peer network in which computers act as both clients and servers
Peer-to-peer model: each peer can request and provide resources.

Client-server versus peer-to-peer

AspectClient-serverPeer-to-peer
ControlCentralized service and administrationDistributed among peers
ScalabilityServer capacity can become a bottleneckResources may grow with peers, but coordination becomes harder
SecurityPolicies are easier to enforce centrallyTrust and consistency are harder to manage
ExampleWeb application and database serverDirect file sharing
Exam focus

Define a computer network, list business/home/mobile uses, and distinguish client-server from peer-to-peer architecture.

Quick revision
  • Networks enable communication and resource sharing.
  • Client-server centralizes service; peer-to-peer distributes it.
  • Mobile networking adds location change, wireless access, and mobility management.

1.2

Network Hardware: PAN, LAN, MAN, WAN, and the Internet

Network hardware is commonly classified by transmission technology and geographical scale. A broadcast link is shared by many devices; a point-to-point link directly connects a pair of devices. Delivery may be unicast, multicast, broadcast, or anycast.

Table classifying networks by interprocessor distance and geographical scale
Classification by scale: personal, local, metropolitan, wide-area, and global networks.
NetworkTypical scopeOwnership / purposeTypical example
PANA few metres around a personPersonal device interconnectionBluetooth peripherals
LANRoom, building, or campusUsually privately owned; high data rateOffice Ethernet or Wi-Fi
MANCity or metropolitan areaConnects sites across a cityMetro Ethernet or cable network
WANCountry or continentLong-distance interconnection using carrier linksEnterprise branch network
InternetGlobalInterconnection of independently administered networksThe public Internet
Personal area network with Bluetooth-connected devices
PAN
Local area network connecting computers to a central network device
LAN
Metropolitan area network connecting homes through a city network
MAN
Wide area network connecting distant locations
WAN

Internet as a network of networks

The Internet does not use one single owner or one physical technology. Internet service providers, enterprise networks, access networks, data centres, and backbone networks exchange packets using the TCP/IP protocol suite. Routers connect networks and choose packet paths.

Worked numerical: bits in a cable

Problem: A 1000 km cable operates at 1 Mbps. Propagation speed is 2/3 of the speed of light. How many bits fit in the cable?

Given: distance = 1000 km; speed = 2 × 108 m/s; rate = 106 bit/s.

Propagation delay: 106 / (2 × 108) = 5 ms.

Bits in flight: rate × delay = 106 × 5 × 10-3 = 5000 bits.

Final answer: 5000 bits.

Source: CN_Numericals_Data_Communication.pdf and Tutorial 3.
Quick revision
  • PAN → person, LAN → building/campus, MAN → city, WAN → large geographical region.
  • The Internet joins heterogeneous networks using routers and TCP/IP.
  • Bits in flight = data rate × propagation delay.

1.3

Network Software and Protocol Hierarchies

Network software is organized into layers. Each layer performs a related set of functions, offers services to the layer above it, and uses services of the layer below it. A protocol specifies the rules and formats used by peer entities in the same layer; an interface defines how adjacent layers interact.

Layered architecture showing protocols between peer layers and interfaces between adjacent layers
Protocols act horizontally between logical peers; interfaces act vertically between neighbouring layers.

Why layering is used

  • Reduces design complexity by separating concerns.
  • Allows a layer implementation to change without redesigning every other layer, provided its service interface remains stable.
  • Promotes interoperability and standardization.
  • Makes testing, troubleshooting, and protocol evolution easier.

Encapsulation and virtual communication

When data moves downward, each layer may add control information called a header (and sometimes a trailer), creating its protocol data unit. At the receiver, the process is reversed. Peer layers appear to communicate directly, but actual bits travel through lower layers and the physical medium.

Philosopher translator secretary analogy for layered communication
The philosopher-translator-secretary analogy separates logical peer communication from physical delivery.
Virtual communication between peer layers with nested headers
Each layer treats the lower-layer path as a virtual channel to its peer.
Three terms that must not be mixed
  • Service: what a layer provides.
  • Interface: how the service is accessed.
  • Protocol: how peer entities cooperate to provide it.
Quick revision
  • Layering separates responsibilities.
  • Protocols connect peers; interfaces connect adjacent layers.
  • Encapsulation adds headers as data descends the stack.

1.4

Common Network Design Issues

Although layers have different purposes, several design questions recur throughout a network architecture.

Identification and delivery

  • Addressing: identify sender, receiver, and sometimes application endpoints.
  • Routing: select paths through intermediate networks.
  • Multiplexing: let many conversations share a link or protocol.
  • Fragmentation: divide data to fit a lower layer's size limit.

Correctness and performance

  • Error control: detect loss, corruption, or duplication where required.
  • Flow control: prevent a fast sender from overrunning a slow receiver.
  • Ordering: preserve or reconstruct the correct sequence.
  • Connection management: establish, maintain, and release state.
Exam focus

A design issue is a recurring problem to be solved; a protocol is one concrete rule set that solves part of that problem.

Quick revision
  • Addressing answers “who”; routing answers “which path”.
  • Flow control protects receivers; error control protects correctness.
  • Multiplexing lets multiple logical users share resources.

1.5

Connection-Oriented vs Connectionless Service

A service describes the behaviour visible to the service user. It may be connection-oriented, where state is established before transfer, or connectionless, where each message is treated independently.

Comparison of connection-oriented and connectionless service types
Both service families can be reliable or unreliable depending on the contract provided.
AspectConnection-orientedConnectionless
SetupConnection established before data transferNo prior setup
StateEndpoints or network maintain connection stateEach message carries enough information to be handled independently
OrderingOften preserves orderMessages may take different paths or arrive out of order
Typical formsReliable byte stream, reliable message stream, unreliable connectionUnacknowledged datagram, acknowledged datagram, request-reply
AnalogyTelephone callPostal letters
Common mistake

Connection-oriented does not automatically mean reliable, and connectionless does not automatically mean unreliable. Reliability is a separate property of the service contract.

Quick revision
  • Connection-oriented service usually has setup, transfer, and release phases.
  • Connectionless service handles messages independently.
  • Reliability and connection style are independent dimensions.

1.6

Service Primitives and the Relationship of Services to Protocols

A service is accessed through operations called service primitives. A simple connection-oriented interface may use LISTEN, CONNECT, RECEIVE, SEND, and DISCONNECT.

PrimitivePurpose
LISTENWait for an incoming connection.
CONNECTActively establish a connection with a peer.
RECEIVEWait for or obtain incoming data.
SENDTransfer data to the peer.
DISCONNECTRelease the connection.
Client and server interaction using service primitives
Service primitives describe the operations visible at the interface.
Diagram showing a service provided by a layer and a protocol between peers
A layer provides a service upward while using a protocol to cooperate with its peer.
Key relationship

Services define what operations a layer offers. Protocols define how peer entities exchange messages to implement those services. A service can remain unchanged even if its underlying protocol is replaced.

Quick revision
  • Primitives are interface operations.
  • A protocol is hidden behind the service interface.
  • Do not describe LISTEN or SEND as layers; they are service operations.

1.7

OSI Reference Model

The ISO Open Systems Interconnection model organizes networking into seven conceptual layers. It is primarily a reference and teaching model: each layer groups well-defined functions and communicates through interfaces.

Seven-layer OSI reference model with peer protocols and protocol data units
OSI layers and their peer-to-peer logical communication.
LayerPrimary responsibilityTypical unit
7 ApplicationNetwork services for user applicationsData / message
6 PresentationData representation, translation, compression, encryptionData
5 SessionDialogue management, synchronization, checkpointsData
4 TransportEnd-to-end delivery, segmentation, reliability, flow controlSegment
3 NetworkLogical addressing and routingPacket
2 Data LinkFraming, MAC addressing, link reliabilityFrame
1 PhysicalRaw bit transmission and signal characteristicsBit
Exam focus

Long answers usually require the seven layers in order, the responsibility of each layer, and the distinction between end-to-end (transport) and hop-to-hop/link-local (data link) operation.

Quick revision
  • OSI has seven layers.
  • Network routes packets; data link carries frames across one link.
  • Transport provides process-to-process end-to-end service.

1.8

TCP/IP Reference Model

The TCP/IP model grew from operational internetworking and the ARPANET. In the four-layer version used by the course, the layers are Link, Internet, Transport, and Application.

TCP IP four-layer reference model with example protocols
TCP/IP layers and representative protocols.
TCP/IP layerRoleExamples
ApplicationApplication protocols and data formatsHTTP, SMTP, DNS
TransportEnd-to-end process communicationTCP, UDP
InternetBest-effort packet delivery across networksIP, ICMP
LinkLocal delivery over the attached networkEthernet, Wi-Fi, PPP

IP provides an unreliable best-effort datagram service. Reliability, ordering, and congestion/flow functions may be added at the transport layer by TCP. UDP provides a lighter connectionless transport service.

Quick revision
  • TCP/IP is the practical architecture of the Internet.
  • IP is at the Internet layer; TCP and UDP are transport protocols.
  • Application protocols use transport services.

1.9

Comparison and Critique of OSI and TCP/IP

DimensionOSITCP/IP
OriginReference model designed before its protocol suite maturedModel abstracted from working protocols and operational networks
LayersSevenUsually four (sometimes shown as five)
Service/interface/protocol distinctionExplicit and conceptually clearLess sharply separated in the original model
Network serviceCould describe connection-oriented and connectionless approachesInternet layer is connectionless; reliability mainly belongs to transport
AdoptionWidely used for teaching and analysisDominant deployed Internet protocol architecture

Critique of OSI

  • Bad timing: the protocol suite competed with already-growing TCP/IP deployment.
  • Bad technology: some functions and layer boundaries were considered complex or awkward.
  • Bad implementations: early implementations were large and slow.
  • Bad politics: TCP/IP was associated with open academic/Internet growth while OSI was perceived as committee-driven.

Critique of TCP/IP

  • The model does not cleanly distinguish services, interfaces, and protocols.
  • The host-to-network/link layer is underspecified.
  • It is less general as a reference model because it closely follows one protocol suite.
  • Some layer functions are not separated as cleanly as in OSI.
Key takeaway

OSI is stronger as a conceptual model; TCP/IP is stronger as a deployed architecture. In exams, avoid claiming that OSI “failed completely” or that TCP/IP has no model—it remains the basis of Internet protocol organization.

Quick revision
  • OSI: cleaner abstractions, seven layers.
  • TCP/IP: working protocol suite, four layers, global adoption.
  • Both use layering but draw boundaries differently.

1.10

Example Networks and Important Network Standards

Example networks show how architectural ideas become real systems. ARPANET demonstrated packet switching and internetworking; NSFNET expanded academic backbone connectivity; the modern Internet is a hierarchy of access networks, regional providers, backbone providers, Internet exchange points, and data centres.

Map of the NSFNET backbone
NSFNET expanded high-speed academic backbone connectivity.
Internet architecture with access networks providers backbone and data centres
The Internet is an interconnection of many independently managed networks.

Why standards matter

Standards let equipment and software from different vendors interoperate. De facto standards become accepted through widespread use; de jure standards are formally approved by recognized organizations.

Organization / familyRoleExamples
IEEE 802LAN and MAN standards802.3 Ethernet, 802.11 wireless LAN, 802.1 bridging
IETFInternet protocol standards through open RFC processIP, TCP, DNS, HTTP specifications
ISOInternational standards and reference modelsOSI reference model
ITU-TTelecommunication standardsTransmission and signalling recommendations
List of important IEEE 802 network standards
Representative IEEE 802 standards covered by the lecture material.

Worked numerical: Nyquist bandwidth

Problem: A digital system operates at 9600 bit/s. Each signal element encodes a 4-bit word. Find the minimum channel bandwidth.

Symbols: 4 bits/symbol, so the number of signal levels is 24 = 16.

Nyquist: C = 2B log2L.

Substitute: 9600 = 2B × 4, therefore B = 1200 Hz.

Final answer: 1200 Hz.

Verified from CN_Numericals_Data_Communication.pdf.

Worked numerical: Shannon capacity

Problem: Find the maximum data rate for B = 4 kHz and S/N = 10000.

Formula: C = B log2(1 + S/N).

Calculation: C = 4000 log2(10001) ≈ 53,151 bit/s.

Final answer: approximately 53.2 kbit/s.

The course slide rounds this to 5.3 × 104 bit/s; verified result agrees.
Practice from the supplied tutorials
  1. A 10 km channel has propagation delay 10 μs/km. If RTT equals packet transmission time and packet size is 125 bytes, find the data rate.
  2. A two-level signal with baud rate 50 symbols/s is extended to eight levels. What happens to the baud rate if the symbol rate is held fixed?
  3. Match OSI layers with functions such as compression, routing, dialogue management, and physical transmission.
Quick revision
  • ARPANET and NSFNET are important stages in Internet evolution.
  • Standards enable interoperability.
  • IEEE 802 covers LAN/MAN technologies; IETF publishes Internet RFCs.

Chapter 1 revision

Definitions

Network, protocol, service, interface, encapsulation, reference model.

Core comparisons

PAN/LAN/MAN/WAN; client-server/P2P; connection-oriented/connectionless; OSI/TCP-IP.

Diagrams to practise

Layered architecture, OSI stack, TCP/IP stack, network scale.

Numerical patterns

Propagation delay, bits in flight, Nyquist capacity, Shannon capacity.

03

Chapter 3

Data Link Layer

Services to the network layer, frame boundaries, flow control, elementary protocols, sliding windows, SONET, and ADSL.

3.1

Services Offered to the Network Layer

The data link layer converts the raw service of the physical layer into a link service for the network layer. It accepts packets, places them in frames, coordinates transmission over one link, and hands received packets upward.

Virtual and actual communication showing the data link service to the network layer
The network layer sees a logical link service; actual data crosses the physical medium as frames and bits.
ServiceConnection?Acknowledgement?Typical use
Unacknowledged connectionlessNoNoReliable low-error links or time-sensitive traffic
Acknowledged connectionlessNoEach frameUnreliable links where local recovery is useful
Acknowledged connection-orientedYesYes, with sequencingReliable ordered frame delivery
Scope note

The chapter explains reliable protocols, but error-control coding techniques such as CRC and Hamming code are excluded from this syllabus.

Quick revision
  • Packets are network-layer units; frames are data-link units.
  • Data-link services differ by connection state and acknowledgement behaviour.
  • Frame management is the layer's central job.

3.2

Framing

The physical layer supplies a continuous bit stream. Framing divides that stream into recognizable units so headers, payload, and trailer information can be interpreted correctly and the receiver can resynchronize after disturbances.

1. Byte count

A header field gives the frame length. The receiver counts that many bytes to find the next frame. Its weakness is loss of synchronization when the count field is corrupted.

Byte count framing showing frame lengths in the header
A damaged count can make the receiver locate later frame boundaries incorrectly.

2. Flag bytes with byte stuffing

Special FLAG bytes mark the beginning and end. If FLAG or ESC occurs inside the data, the sender inserts ESC before it. The receiver removes the inserted ESC during destuffing.

Examples of byte stuffing with FLAG and ESC bytes
Byte stuffing keeps payload bytes from being mistaken for delimiters.

Worked example: byte stuffing

Problem: Data fragment: A B ESC C ESC FLAG FLAG D. Find the stuffed data and complete frame.

Rule: Insert ESC before every data ESC and every data FLAG.

Stuffed data: A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D

Complete frame: FLAG A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D FLAG

Source: CN_Numericals_Data_Link_Layer.pdf and Tutorial 1.

3. Flag bits with bit stuffing

A bit pattern, commonly 01111110, acts as a flag. After five consecutive 1s in payload data, the sender inserts a 0. The receiver removes that 0. Thus the flag pattern cannot appear unintentionally inside data.

Bit stuffing example with zeros inserted after five consecutive ones
Inserted zeros are protocol overhead and are removed by the receiver.

Worked example: bit stuffing

Problem: Stuff 0111101111101111110.

Scan: insert a 0 after every run of five 1s.

Final transmitted data: 011110111110011111010.

Verified against CN_Numericals_Data_Link_Layer.pdf and Tutorial 1.

4. Physical-layer coding violations

Some line codes reserve signal patterns that cannot appear in valid encoded data. A data-link protocol can use those illegal patterns as unambiguous frame boundaries without byte or bit stuffing.

MethodBoundary mechanismMain weakness / requirement
Byte countLength fieldCorrupted count destroys synchronization
Byte stuffingFLAG byteByte-oriented; extra ESC overhead
Bit stuffingFlag bit patternBit scanning and stuffed-bit overhead
Coding violationUnused physical signalRequires a line code with invalid/reserved symbols
Quick revision
  • Framing provides boundaries and synchronization.
  • Stuffing makes delimiter values transparent to payload data.
  • Byte count is simple but vulnerable to a corrupted length field.

3.3

Flow Control

Flow control prevents a fast sender from delivering frames faster than a receiver can accept, buffer, and process them. It concerns receiver capacity; it must not be confused with congestion control, which concerns overload inside the network.

Feedback-based rate-based and credit-based flow control approaches
Three ways to constrain the sender: explicit feedback, an agreed rate, or receiver-issued credits.

Feedback-based

The receiver sends information telling the sender when or how much to send. Stop-and-wait and sliding-window acknowledgements are examples.

Rate-based

The sender is limited to an agreed average or peak rate without requiring continuous per-frame feedback.

Credit-based

The receiver grants credits representing available buffer space. Sending consumes credits; new credits reopen capacity.

Key distinction

Flow control answers “Can the receiver keep up?” Congestion control answers “Can the network carry the offered load?”

Quick revision
  • Feedback reacts to receiver information.
  • Rate control limits long-term sending speed.
  • Credit control directly represents available receiving capacity.

3.4

Elementary Data Link Protocols

Utopian simplex protocol

Assumes data travels in one direction, the channel never damages or loses frames, the receiver is always ready, and its buffer is unlimited. The sender repeatedly obtains a packet, places it in a frame, and transmits. It is a baseline rather than a practical protocol.

Simplex stop-and-wait for an error-free channel

Removes the assumption of an infinitely fast receiver. The sender transmits one frame and waits for an acknowledgement before taking the next packet. This provides feedback-based flow control but wastes capacity on long-delay links.

Simplex stop-and-wait for a noisy channel

Adds sequence numbers, acknowledgements, a timer, and retransmission. If a data frame or ACK is lost, the sender eventually times out and sends again. A one-bit sequence number is sufficient because only one frame can be outstanding; it lets the receiver detect duplicates.

  1. Sender gets a packet and builds the next numbered frame.
  2. Sender transmits and starts a timer.
  3. Receiver accepts an undamaged expected frame, delivers it once, and returns an ACK.
  4. Correct ACK arrives → advance the sequence number.
  5. Timeout → retransmit; duplicate data is acknowledged but not delivered twice.

Worked numerical: stop-and-wait transfer time

Problem: Each packet carries 1000 data bits. Send 1,000,000 bits over 5000 km at propagation speed 2 × 108 m/s. Ignore transmission and processing delays.

Packets: 106/103 = 1000.

One-way delay: 5 × 106/(2 × 108) = 25 ms; RTT = 50 ms.

Total: 1000 × 50 ms = 50,000 ms.

Final answer: 50 seconds.

Source: CN_Numericals_Data_Link_Layer.pdf and Tutorial 2.

Worked numerical: stop-and-wait utilization

Problem: 1 Mbit/s link, 20 ms one-way propagation delay, 1 kB frame.

Transmission time: 8000/106 = 8 ms. RTT: 40 ms.

Utilization: U = Tt/(Tt + RTT) = 8/(8 + 40) = 0.1667.

Final answer: 16.67%.

Quick revision
  • Utopian protocol assumes everything is ideal.
  • Error-free stop-and-wait adds receiver pacing.
  • Noisy stop-and-wait adds timer, ACK, retransmission, and a one-bit sequence number.

3.5

Sliding Window and One-Bit Sliding Window Protocol

A sliding-window protocol allows sequence numbers within a moving range. The sender window contains frames that may be transmitted or are awaiting acknowledgement; the receiver window contains sequence numbers it is prepared to accept.

Sender and receiver sliding windows advancing through sequence numbers
Windows move as frames are sent, received, and acknowledged.

Piggybacking

On a full-duplex link, an acknowledgement can be carried in the header of a reverse-direction data frame rather than sent separately. A short timer prevents an ACK from being delayed indefinitely when reverse traffic is absent.

One-bit sliding window

With sequence numbers 0 and 1 and maximum window size 1, both sides alternate expected numbers. This is essentially bidirectional stop-and-wait with piggybacking. Duplicate frames are recognized by the sequence bit.

One-bit sliding window message exchange for normal and simultaneous-start cases
Alternating sequence bits prevent a retransmission from being delivered as new data.
Stop-and-wait utilization

U = 1 / (1 + 2a), where a = Tprop / Ttrans, when ACK transmission and processing are negligible.

Worked numerical: window for full utilization

Problem: Earth-to-planet distance = 9 × 1010 m, rate = 64 Mbit/s, frame = 32 kB, propagation speed = 3 × 108 m/s. Find the sender window for 100% utilization.

One-way delay: 300 s. Frame transmission: 262,144/(64 × 106) = 0.004096 s.

a: 300/0.004096 ≈ 73,242. Full utilization requires W ≥ 1 + 2a ≈ 146,485 frames.

Course-material answer: 150001, using 32 kB ≈ 256 kbit and Ttrans = 0.004 s. Verified exact binary-kilobyte result: approximately 146485. Both use the same formula; the difference is unit rounding.

Quick revision
  • Windows permit multiple outstanding frames.
  • Piggybacking combines data and ACK information.
  • One-bit sliding window is stop-and-wait in both directions.

3.6

Go-Back-N

Go-Back-N pipelines frames. The sender may have up to W unacknowledged frames, while the receiver window is 1. The receiver accepts only the next expected frame and discards later out-of-order frames. ACKs are cumulative.

Go-Back-N timeline showing an error and retransmission of a sequence of frames
When a frame is missing, later frames are discarded and the sender retransmits from the missing frame onward.

Window-size rule

For an m-bit sequence number, Go-Back-N normally uses a sender window no larger than 2m − 1. Reserving one sequence number prevents an old frame from being confused with a new frame after wraparound.

Worked numerical: sequence-number bits

Problem: A 3000 km T1 trunk sends 64-byte frames. Propagation is 6 μs/km. How many sequence-number bits keep the pipe full?

Propagation: 18 ms one way; ACK returns after roughly 36 ms.

Frame transmission: 512/1.536 Mbit/s ≈ 0.333 ms.

Outstanding frames: about 36.33/0.333 ≈ 109; therefore at least 110 sequence positions are useful.

Final answer: 7 bits (128 sequence values). The course slide approximates 0.300 ms and 121 frames; the bit-width conclusion is unchanged.

Worked example: window after damage

A uses W = 7 and 3-bit sequence numbers. Frames 0–6 are sent; frame 4 is damaged. The sender's next window after earlier cumulative acknowledgements advances modulo 8.

Course answer: 4, 5, 6, 7, 0, 1, 2.

Source: CN_Numericals_Data_Link_Layer.pdf and Tutorial 2.
Quick revision
  • Receiver window = 1.
  • ACKs are cumulative.
  • An error can cause many correct later frames to be retransmitted.

3.7

Selective Repeat

Selective Repeat retransmits only frames that are lost or damaged. The receiver accepts and buffers valid out-of-order frames, acknowledges them individually, and delivers them upward after the missing gap is filled.

Selective Repeat sender and receiver windows showing the half sequence-space limit
Sender and receiver windows must not overlap old and new interpretations of the same sequence number.
AspectGo-Back-NSelective Repeat
Receiver window1Greater than 1
Out-of-order framesDiscardedBuffered
RetransmissionMissing frame and later outstanding framesOnly missing/damaged frame
Receiver complexityLowerHigher
Bandwidth on noisy linksMay be wastedMore efficient
Window limit

With m sequence bits, sequence space S = 2m. For Selective Repeat, sender and receiver window sizes must normally satisfy W ≤ S/2 = 2m−1.

Common mistake

Using a Selective Repeat window larger than half the sequence space can make an old delayed frame indistinguishable from a new frame with the same wrapped sequence number.

Quick revision
  • Selective Repeat buffers out-of-order frames.
  • Only missing frames are resent.
  • Window size is limited to half the sequence space.

3.8

Brief Introduction: Packet over SONET and ADSL

Packet over SONET

SONET is a synchronous optical transport system used in backbone networks. IP packets can be carried through PPP framing over SONET. The encapsulation path is conceptually IP packet → PPP frame → SONET payload.

Packet over SONET protocol stack and frame relationships
Packet over SONET uses PPP as the data-link framing mechanism over an optical transport.

ADSL

Asymmetric Digital Subscriber Line uses existing telephone copper to provide a higher downstream rate than upstream rate. A typical path is PC → Ethernet → DSL modem → local loop → DSLAM at the provider → ISP network. ADSL systems may carry PPP over ATM/AAL5 in the architecture shown in the lecture.

ADSL architecture from customer PC and DSL modem to DSLAM and Internet
ADSL access network showing the customer premises, copper local loop, DSLAM, and ISP.
Quick revision
  • Packet over SONET carries IP/PPP over an optical backbone.
  • ADSL is asymmetric and reuses telephone copper.
  • DSLAM aggregates subscriber lines at the provider side.

Chapter 3 revision

Definitions

Frame, stuffing, flow control, ACK, sequence number, window.

Core comparisons

Byte/bit stuffing; connectionless/connection-oriented link service; Go-Back-N/Selective Repeat.

Diagrams to practise

Framing examples, sliding windows, Go-Back-N timeline, ADSL architecture.

Numerical patterns

RTT, utilization, full-utilization window, sequence-number bits.

04

Chapter 4

Medium Access Control Layer

How multiple stations share one broadcast medium, avoid or resolve collisions, and implement Ethernet.

4.1

Channel Allocation Problem

When many stations share one broadcast channel, the MAC sublayer decides who may transmit. If two stations transmit at an interfering time, a collision can destroy useful work.

Comparison of static and dynamic channel allocation approaches
Static allocation reserves capacity; dynamic allocation assigns it when stations actually have traffic.
AllocationHow it worksStrengthWeakness
Fixed / staticPartition channel by frequency, time, code, or fixed ownershipPredictable; no contention after assignmentIdle users waste reserved capacity; inefficient for bursty traffic
DynamicStations contend or coordinate when they have framesAdapts to bursty demandRequires collision handling, reservation, or scheduling

Assumptions used to analyse dynamic protocols

  • Independent stations generate frames.
  • One shared channel is available.
  • Collisions are observable or inferable.
  • Time may be continuous or slotted.
  • Carrier sensing may be present or absent.

Worked derivation: fraction of slots wasted by collisions

With n hosts, each transmitting in a slot with probability p:

  • Probability exactly one specified host succeeds: p(1−p)n−1.
  • Probability exactly one of n hosts succeeds: np(1−p)n−1.
  • Probability no host transmits: (1−p)n.

Collision fraction: 1 − np(1−p)n−1 − (1−p)n.

Source: CN_Numericals_MAC_Layer.pdf.
Quick revision
  • Static allocation suits stable demand.
  • Dynamic allocation suits bursty demand.
  • A MAC protocol coordinates access to a shared channel.

4.2

ALOHA: Pure and Slotted

ALOHA is a random-access protocol: a station transmits when it has a frame and retransmits after a random delay if a collision is inferred.

Pure ALOHA

Transmission may begin at any time. A frame of duration T is vulnerable to another frame beginning during the interval from T before its start to T after its start, so the vulnerable period is 2T.

Pure ALOHA transmissions from multiple stations with collisions
Pure ALOHA permits arbitrary start times.
Pure ALOHA vulnerable period spanning two frame times
A pure-ALOHA frame is vulnerable for 2T.

Slotted ALOHA

Time is divided into slots of one frame duration and transmission begins only at a slot boundary. Synchronization reduces the vulnerable period to T, improving maximum throughput.

Throughput

Pure ALOHA: S = G e−2G, maximum 1/(2e) ≈ 18.4% at G = 0.5.

Slotted ALOHA: S = G e−G, maximum 1/e ≈ 36.8% at G = 1.

Throughput curves comparing pure and slotted ALOHA
Slotted ALOHA doubles the theoretical peak throughput by halving the vulnerable period.

Worked numerical: slotted ALOHA success

Problem: 50 requests/s are generated; slot duration is 40 ms. Find first-attempt success and exactly k collisions followed by success.

Offered load: 25 slots/s, so G = 50/25 = 2 attempts/slot.

Success in a slot: e−G = e−2 ≈ 0.1353.

Exactly k collisions then success: (1 − e−2)ke−2 ≈ 0.1353(0.8647)k.

Verified against CN_Numericals_MAC_Layer.pdf and Tutorial 3.
Common mistake

Do not swap the exponents: Pure ALOHA uses e−2G; Slotted ALOHA uses e−G.

Quick revision
  • Pure ALOHA transmits immediately; Slotted ALOHA waits for slot boundaries.
  • Vulnerable periods: 2T and T.
  • Peak throughputs: 18.4% and 36.8%.

4.3

CSMA/CD

Carrier Sense Multiple Access listens before sending. Collision Detection adds the ability to monitor the medium while transmitting, abort when a collision is detected, send a jam signal, and retry after binary exponential backoff.

CSMA CD frame showing preamble data collision jam abort and backoff
CSMA/CD shortens wasted time by aborting a collided frame rather than finishing it.
  1. Sense the channel.
  2. If idle, transmit; if busy, defer according to the persistence rule.
  3. Continue listening while transmitting.
  4. On collision, abort and send a jam signal.
  5. Choose a random backoff interval from a range that grows after repeated collisions.
  6. Retry until success or the attempt limit is reached.
Flowchart of transmit monitor collision abort jam and retry in CSMA CD
Classic shared Ethernet CSMA/CD decision flow.

Why the minimum frame length exists

The sender must still be transmitting when a worst-case collision propagates back from the farthest station. Therefore frame transmission time must be at least the round-trip propagation time: L/R ≥ 2Tprop, or Lmin = 2RTprop.

Worked numerical: contention slot

(a) 2 km twin-lead, speed = 0.82c = 2.46 × 108 m/s. One-way delay = 8.13 μs; slot = 2Tprop = 16.26 μs.

(b) 40 km fibre, speed = 0.65c = 1.95 × 108 m/s. One-way delay = 205.13 μs; slot = 410.26 μs.

Final answers: 16.26 μs and 410.26 μs.

Worked numerical: minimum frame length

Problem: 1 Mbit/s, 10 km span, propagation delay 4.5 ns/m.

One-way delay: 4.5 × 10−9 × 104 = 45 μs; round trip = 90 μs.

Minimum bits: 106 × 90 × 10−6 = 90 bits = 11.25 bytes.

Final answer: 90 bits (11.25 bytes); therefore the requirement is not excessive for this rate/span.

Worked numerical: effective data rate

For the supplied 1 km, 10 Mbit/s LAN: seize cable 10 μs; send 256 bits 25.6 μs; far-end propagation 5 μs; receiver seize 10 μs; send 32-bit ACK 3.2 μs; return propagation 5 μs.

Total cycle: 58.8 μs. Useful data = 224 bits.

Effective rate: 224/58.8 μs ≈ 3.81 Mbit/s.

Quick revision
  • Listen before and during transmission.
  • Collision → abort, jam, binary exponential backoff.
  • Minimum frame time must cover round-trip propagation.

4.4

Collision-Free Protocol: Bit Map

In the basic bit-map protocol, a contention period contains one reservation bit per station. Station i sets bit i if it has a frame. After the reservation phase, ready stations transmit in numerical order without collisions.

Bit map protocol with reservation bits followed by ordered frame transmissions
Reservations consume N bit slots; the following data phase is collision-free.

Performance intuition

  • At high load, reservation overhead is shared across many transmitted frames.
  • At low load, scanning N reservation bits for only a few frames creates significant delay.
  • The protocol is fair by station order but higher-numbered stations may wait longer.

Worked derivation: worst-case waiting

If all N stations have frames of d bit times and the highest-numbered station becomes ready just after its reservation bit passes, it waits for:

  • (N−1)d bit times for other frames in the current round,
  • N reservation bit times for the next bitmap,
  • (N−1)d bit times before its turn in the next data phase.

Worst-case wait: N + 2(N−1)d bit times.

Quick revision
  • One reservation bit belongs to each station.
  • No collisions occur in the data phase.
  • High-load efficiency is better than low-load efficiency.

4.5

Collision-Free Protocol: Token Ring

Stations are logically arranged in a ring. A special control frame called a token circulates. Only the station holding the token may transmit, so simultaneous transmissions do not collide.

Logical token ring with a circulating token and multiple stations
Exclusive possession of the token grants temporary permission to transmit.

Operation

  1. A station with no frame passes the token.
  2. A station with data captures the token and sends within the token-holding limit.
  3. After completing transmission, it releases a new token.
  4. Monitoring procedures recover from a lost token or duplicate tokens.

Practice numerical: token holding time

Problem: A 4 Mbit/s token ring permits a token holding time of 10 ms. What is the longest frame?

Method: frame bits = rate × holding time.

Answer: 4 × 106 × 10 × 10−3 = 40,000 bits = 5,000 bytes (ignoring overhead).

Question from cn_tutorial.pdf, Tutorial 5.
Quick revision
  • The token is permission to transmit.
  • Token passing is deterministic and collision-free.
  • Token loss and station failure require recovery mechanisms.

4.6

Collision-Free Protocol: Binary Countdown

Ready stations transmit their binary addresses one bit at a time, usually from the most significant bit. A dominant bit value overwrites the other value on the shared channel. A station that observes a higher-priority bit withdraws; the highest address remains and transmits.

Binary countdown arbitration with stations withdrawing as dominant bits are observed
Bitwise arbitration resolves contention without destroying the winner's transmission opportunity.

Characteristics

  • Collision resolution requires log2N address-bit times.
  • Priority is deterministic, so fixed addresses can starve low-priority stations.
  • Rotating or virtual priorities can improve fairness.
Quick revision
  • Stations arbitrate using address bits.
  • The dominant address wins without a destructive collision.
  • Efficiency is good, but fairness needs attention.

4.7

Limited Contention Protocols and Adaptive Tree Walk

Contention protocols perform well at low load because a station can transmit quickly. Collision-free protocols perform well at high load because they schedule access. Limited-contention protocols adapt between these extremes.

Evolution from random access through limited contention to reservation methods
Protocol choice balances low-load delay against high-load collision overhead.

Adaptive tree walk

Stations correspond to leaves of a binary tree. A contention slot tests a node representing a group of stations. No transmission means the group is empty; one transmission succeeds; a collision causes the algorithm to test the node's child groups. Group size can be chosen according to load.

Adaptive tree walk dividing sixteen stations into smaller contention groups
Colliding groups are recursively split until individual ready stations are isolated.

Worked example: prime-numbered stations

Stations 2, 3, 5, 7, 11, and 13 among 1–16 become ready. Following the supplied tree traversal, the contention groups tested are:

{2,3,5,7,11,13} → {2,3,5,7} → {2,3} → {2} → {3} → {5,7} → {5} → {7} → {11,13} → {11} → {13}

Final answer: 11 bit slots.

Verified against CN_Numericals_MAC_Layer.pdf and Tutorial 4.
Quick revision
  • Limited contention mixes random access with structured reservation.
  • Adaptive tree walk splits only groups that collide.
  • It adjusts the collision group size to load.

4.8

Classic Ethernet (IEEE 802.3)

Classic Ethernet used a shared coaxial cable or hubs, Manchester encoding at 10 Mbit/s, and 1-persistent CSMA/CD. Every station in the collision domain saw the shared signal.

Classic Ethernet frame format with preamble addresses type length data pad and checksum
Ethernet frame fields and their sizes.
FieldSizePurpose
Preamble + SFD8 bytesClock synchronization and start delimiter
Destination address6 bytesIntended receiver or group
Source address6 bytesSender
Type/Length2 bytesUpper-layer type or payload length
Payload46–1500 bytesCarried data
Pad0–46 bytesEnsures minimum frame length
FCS/CRC4 bytesError detection

The frame from destination address through FCS is at least 64 bytes and at most 1518 bytes without VLAN tagging. The minimum keeps a CSMA/CD sender active long enough to detect a worst-case collision.

Ethernet CSMA CD flow from carrier sensing through backoff and successful transmission
Classic shared Ethernet combines frame rules with the CSMA/CD access algorithm.

Worked example: is padding required?

An IP packet is 60 bytes. Without LLC, Ethernet adds destination (6), source (6), type/length (2), and FCS (4): 18 bytes.

Total: 60 + 18 = 78 bytes.

Final answer: No padding is needed because 78 bytes exceeds the 64-byte minimum.

Source: CN_Numericals_MAC_Layer.pdf and Tutorial 4.
Exam focus

Draw and label the Ethernet frame, state the 64-byte minimum and 1518-byte standard maximum, and relate the minimum to collision detection.

Quick revision
  • Classic Ethernet is a shared collision-domain system.
  • It uses CSMA/CD and a 64-byte minimum frame.
  • Payload is 46–1500 bytes.

4.9

Switched, Fast, and Gigabit Ethernet

A hub repeats signals into one shared collision domain. A switch learns MAC addresses and forwards frames only toward the appropriate port, giving each full-duplex link its own collision domain. Full-duplex switched Ethernet does not need CSMA/CD.

Comparison of a hub single collision domain and a switch with one collision domain per port
Switching separates collision domains and permits simultaneous full-duplex conversations.
GenerationRateExamplesImportant point
Classic Ethernet10 Mbit/s10BASE-TOriginally shared, CSMA/CD
Fast Ethernet100 Mbit/s100BASE-TX, 100BASE-FXRetains frame format; reduces cable/repeater constraints
Gigabit Ethernet1 Gbit/s1000BASE-T, 1000BASE-SX/LXCommonly switched full duplex
Table comparing Fast Ethernet and Gigabit Ethernet media and segment limits
Representative Fast and Gigabit Ethernet physical variants from the lecture.

Concept numerical: faster Ethernet and collision detection

If a network transmits 10 times faster but keeps the same minimum frame size, its frame finishes 10 times sooner. To preserve collision detection, the maximum round-trip propagation time must also be about 10 times smaller.

Conclusion: reduce the maximum shared-cable diameter (or repeater path) roughly in proportion to the speed increase. Modern switched full-duplex links remove collisions entirely.

Quick revision
  • Switch: one collision domain per port; hub: one shared collision domain.
  • Fast and Gigabit Ethernet preserve the Ethernet frame format.
  • Full-duplex switched Ethernet does not use CSMA/CD.

Chapter 4 revision

Definitions

MAC, collision, vulnerable period, contention slot, token, collision domain.

Core comparisons

Static/dynamic allocation; Pure/Slotted ALOHA; contention/collision-free; hub/switch.

Diagrams to practise

ALOHA timeline, CSMA/CD flow, bitmap, token ring, adaptive tree, Ethernet frame.

Numerical patterns

ALOHA probability, slot time, minimum frame, effective rate, adaptive-tree slots.

Problem solving

Numerical index

Filter the solved and practice problems, then jump to the complete solution inside its syllabus topic.

Revision tool

Formula sheet

Visual revision

Diagram index

Open a diagram in context; click any course image there to enlarge it.

Completeness audit

Syllabus coverage

Every listed item links to its teaching section.

Terminology

Compact glossary

ACK
Acknowledgement confirming successful reception.
ALOHA
Random-access protocol family in which stations transmit with minimal coordination.
CSMA/CD
Carrier Sense Multiple Access with Collision Detection.
DSLAM
Digital Subscriber Line Access Multiplexer aggregating DSL subscriber lines.
Encapsulation
Adding layer-specific control information around data.
Frame
Data-link-layer protocol data unit.
Interface
Boundary and operations between adjacent layers.
MAC
Medium Access Control; rules for sharing a communication medium.
MAN
Metropolitan Area Network.
PAN
Personal Area Network.
Protocol
Rules and message formats used by peer entities.
RTT
Round-Trip Time from sender to receiver and back.
Service
Capability a layer exposes to the layer above.
SONET
Synchronous Optical Network transport standard.
WAN
Wide Area Network.

Final revision

Master review

High-value definitions

  • Protocol vs service vs interface
  • Connection-oriented vs connectionless
  • Frame, stuffing, flow control
  • Collision, contention slot, collision domain

Must-draw diagrams

  • OSI and TCP/IP layers
  • Byte/bit stuffing
  • Sliding windows
  • ALOHA vulnerable period
  • CSMA/CD flow
  • Ethernet frame

Must-know comparisons

  • OSI vs TCP/IP
  • Go-Back-N vs Selective Repeat
  • Pure vs Slotted ALOHA
  • Hub vs switch
  • Static vs dynamic channel allocation

Numerical checklist

  • Propagation delay and bits in flight
  • Stop-and-wait utilization
  • Sequence space and window size
  • ALOHA probability/throughput
  • CSMA/CD slot and minimum frame
Source-aligned practice set
  1. Explain why services and protocols are independent concepts.
  2. Compare all four framing methods and state one weakness of each.
  3. For a 10 kbit/s link with 40 ms propagation, find the stop-and-wait frame size for 50% utilization.
  4. Derive the maximum window sizes of Go-Back-N and Selective Repeat for m sequence bits.
  5. Derive the maximum throughput of Pure and Slotted ALOHA.
  6. Explain why Ethernet has a minimum frame size and how faster Ethernet preserves collision detection.
  7. Trace adaptive tree walk for a specified set of ready stations.
  8. Draw and explain the classic Ethernet frame.
Primary sources used

Ch 1 Introduction lecture material; Ch 3 Data Link Layer lecture material; Ch 4 MAC Layer lecture material; CN_Numericals_Data_Communication.pdf; CN_Numericals_Data_Link_Layer.pdf; CN_Numericals_MAC_Layer.pdf; cn_tutorial.pdf.