Unit 9 of 1015 min read

Data Communication & Computer Networks

Signals, OSI / TCP-IP, framing, IPv4/IPv6, WWW, network security, mobile, cloud and IoT.

Share:WhatsAppLinkedIn

Why this unit matters

Networks is one of the broadest units in UGC NET CS and consistently delivers 10, 15 questions per session. Questions test both conceptual understanding (what layer does ARP belong to?) and numerical ability (subnetting, Hamming distance, sliding window calculations). The layered model provides the organising structure, once you can confidently assign every protocol to its correct layer, most factual questions answer themselves.


Syllabus map

Area Key topics
Data communication Signals, transmission modes, channel capacity, encoding, modulation, multiplexing, media, errors
Network types LAN, MAN, WAN, topologies, wireless, internet
Network models OSI, TCP/IP, addressing, circuit/packet/message switching
Data link layer Framing, error detection/correction, flow/error control, sliding window, HDLC, multiple access
Network layer IPv4, IPv6, ARP, ICMP, fragmentation, routing algorithms
Transport layer TCP, UDP, SCTP, flow/error/congestion control
Application layer HTTP/WWW, DNS, email (SMTP/POP/IMAP), FTP, TELNET
Network security Malware, cryptography, steganography, digital signatures, VPN, firewalls
Mobile & wireless GSM, CDMA, mobile IP, ad-hoc networks, GPRS, satellites
Cloud & IoT IaaS/PaaS/SaaS, virtualisation, IoT basics

Data communication fundamentals

Transmission modes

Simplex, one direction only (e.g., TV broadcast, keyboard to CPU). Half-duplex, both directions but not simultaneously (e.g., walkie-talkie). Full-duplex, both directions simultaneously (e.g., telephone, Ethernet with separate TX/RX pairs).

Analog vs digital signals

Analog, continuous variation (sine wave). Characterised by: amplitude, frequency, phase. Digital, discrete values (0 or 1). Characterised by: bit rate, bit interval.

Bandwidth of an analog signal = highest frequency, lowest frequency (Hz). Bandwidth of a digital channel = maximum bit rate (bps).

Channel capacity

Nyquist theorem (noiseless channel): Max bit rate = 2 B log2(V) where B = bandwidth (Hz), V = number of signal levels.

Shannon's theorem (noisy channel): Max bit rate = B log2(1 + S/N) where S/N = signal-to-noise ratio.

Example: B = 3000 Hz (telephone), S/N = 1000 (30 dB). Shannon capacity = 3000 log2(1001) ≈ 3000 x 10 = 30,000 bps.

Encoding

Digital-to-digital: NRZ-L (Non-Return-to-Zero Level), NRZ-I (NRZ Inverted), Manchester (transition at middle of bit, used in 10Base-T Ethernet), Differential Manchester (transition at start for 0, no transition for 1, used in Token Ring), AMI (Alternate Mark Inversion, 0 is zero voltage, 1 alternates between +V and -V).

Analog-to-digital (PCM): Pulse Code Modulation, sample, quantise, encode. Sampling theorem: sample at >= 2 x max frequency (Nyquist rate).

Modulation

Digital-to-analog: ASK (amplitude), FSK (frequency), PSK (phase), QAM (amplitude + phase, used in ADSL, cable modems; 64-QAM, 256-QAM).

Analog-to-analog: AM, FM, PM.

Multiplexing

FDM (Frequency Division Multiplexing), divide bandwidth into channels by frequency (analog). Used in cable TV, FM radio. TDM (Time Division Multiplexing), divide time into slots; each channel gets a slot (digital). WDM (Wavelength Division Multiplexing), FDM applied to optical fibre; different wavelengths (colours) of light. CDM / CDMA (Code Division Multiple Access), each user gets a unique chipping code; signals overlap in time and frequency.


Network types and topologies

Topologies: Bus (single shared cable), Ring (token or data travels in a loop), Star (all connected to a central hub/switch, most common today), Mesh (every node connected to every other, full mesh; partial mesh for redundancy), Tree (hierarchical star).

LAN, limited area (building/campus), high speed (100 Mbps to 10 Gbps), low latency. MAN, city-wide (e.g., cable TV network, metro Ethernet). WAN, wide geographic area; uses public/private links (e.g., MPLS, leased lines, internet).


OSI and TCP/IP models

OSI model (7 layers)

Layer Name Key functions Example protocols
7 Application User-facing services HTTP, FTP, SMTP, DNS
6 Presentation Encryption, compression, translation SSL/TLS, JPEG, ASCII
5 Session Dialog control, synchronisation NetBIOS, RPC
4 Transport End-to-end delivery, error control TCP, UDP
3 Network Logical addressing, routing IP, ICMP, ARP*
2 Data Link Framing, MAC addressing, error detection Ethernet, PPP, HDLC
1 Physical Bit transmission RS-232, DSL, Wi-Fi PHY

*ARP is commonly placed at layer 2/3 boundary (or layer 2 in some classifications).

TCP/IP model (4 layers)

Application (layers 5-7) -> Transport (layer 4) -> Internet (layer 3) -> Network Access (layers 1-2).

TCP/IP is the model used on the actual internet; OSI is the reference model for understanding concepts.


Data link layer

Framing

Delimiting packets for transmission. Methods: character count, byte stuffing (flag byte + escape), bit stuffing (insert a 0 after five 1s in HDLC), physical layer coding violations.

Error detection and correction

Parity, single parity bit; detects odd number of errors, corrects none.

CRC (Cyclic Redundancy Check), most widely used. Treat message as polynomial; divide by generator polynomial; remainder = CRC. Detects all 1-bit errors, all odd-bit errors, all burst errors of length <= degree of generator.

Hamming code, corrects single-bit errors. For m data bits, need r parity bits where 2^r >= m + r + 1. Parity bit p_i covers all positions whose binary representation has bit i set.

Example: For 4 data bits, 2^3 = 8 >= 4+3+1 = 8, so r = 3 parity bits (positions 1, 2, 4). Total codeword length = 7 bits.

Hamming distance, number of bit positions where two codewords differ. To detect d errors: need distance d+1. To correct d errors: need distance 2d+1.

Flow and error control

Stop-and-wait, send one frame, wait for ACK. Efficiency = 1 / (1 + 2a) where a = propagation delay / transmission time.

Sliding window, multiple frames in flight. Window size W.

Go-Back-N (GBN), sender window size W = 2^n, 1; on error, retransmit the erroneous frame and all subsequent frames.

Selective Repeat (SR), sender and receiver window size W = 2^(n-1); only retransmit the erroneous frame.

Multiple access protocols

CSMA/CD (Carrier Sense Multiple Access / Collision Detection), used in wired Ethernet (802.3). Listen before transmit; if collision detected, send jam signal, backoff (binary exponential backoff), retry.

CSMA/CA (Collision Avoidance), used in Wi-Fi (802.11). Cannot detect collisions (hidden terminal problem); use RTS/CTS and random backoff to avoid collisions.

FDMA, frequency divided per user (cellular 1G, cable). TDMA, time slots per user (GSM, cellular 2G). CDMA, code per user (3G, WCDMA, CDMA2000).

Token ring / bus, token passed around; only holder can transmit. No collisions. IEEE 802.5.

HDLC

HDLC (High-level Data Link Control) is a bit-oriented protocol. Frame types: I-frame (information), S-frame (supervisory, RR, RNR, REJ, SREJ), U-frame (unnumbered, connection management). Uses bit stuffing.

VLANs

A VLAN logically partitions a physical LAN into multiple broadcast domains. Switch port is assigned to a VLAN. VLAN tagging (IEEE 802.1Q) adds a 4-byte tag to the Ethernet frame.


Network layer, IP

IPv4

IPv4 addresses are 32 bits, written in dotted decimal (e.g., 192.168.1.1).

Classful addressing:

Class Range Default mask Default hosts
A 0.0.0.0, 127.255.255.255 /8 ~16 million
B 128.0.0.0, 191.255.255.255 /16 ~65,534
C 192.0.0.0, 223.255.255.255 /24 254
D 224.0.0.0, 239.255.255.255 Multicast ,
E 240.0.0.0, 255.255.255.255 Reserved ,

Classless (CIDR), uses a prefix length (e.g., 192.168.10.0/28). Number of hosts = 2^(32, prefix), 2 (subtract network and broadcast addresses).

Example: 10.0.0.0/22, prefix = 22, host bits = 10, hosts = 2^10, 2 = 1022.

IPv4 datagram header (20 bytes minimum): Version, IHL, DSCP/ECN, Total Length, Identification, Flags (DF, MF), Fragment Offset, TTL, Protocol (6=TCP, 17=UDP, 1=ICMP), Header Checksum, Source IP, Destination IP, Options.

Fragmentation: If a datagram is larger than the MTU of a link, it is fragmented. Each fragment has the same Identification; More Fragments (MF) bit is set on all but the last; Fragment Offset = byte offset / 8.

IPv6

128-bit addresses written in eight groups of 4 hex digits (e.g., 2001:0db8:85a3::8a2e:0370:7334). Double colon :: replaces one run of all-zero groups.

IPv6 improvements over IPv4: larger address space, simplified header (fixed 40 bytes, no checksum, no fragmentation by routers), built-in IPsec support, auto-configuration (SLAAC).

ARP

Address Resolution Protocol maps an IP address to a MAC address within a local network. Sender broadcasts "Who has IP 192.168.1.5? Tell 192.168.1.1"; owner of that IP replies with its MAC. ARP cache stores recent mappings to reduce traffic.

Gratuitous ARP, a host ARPs for its own IP to announce itself and detect conflicts.

Routing

Distance Vector (RIP), each router advertises its routing table to neighbours; convergence via Bellman-Ford. Count-to-infinity problem; split horizon and poison reverse help.

Link State (OSPF), each router floods its link-state information to all routers; every router runs Dijkstra. Faster convergence; no count-to-infinity.

BGP (Border Gateway Protocol), path vector; used between Autonomous Systems (AS) on the internet. Policy-based routing.


Transport layer

TCP

Connection-oriented: 3-way handshake (SYN -> SYN-ACK -> ACK). 4-way close (FIN -> ACK -> FIN -> ACK).

Reliable: sequence numbers, acknowledgements, retransmission on timeout or 3 duplicate ACKs.

Flow control: sliding window; receiver advertises window size in each ACK.

Congestion control:

  • Slow start: window doubles each RTT until threshold (ssthresh)., Congestion avoidance: window grows linearly (additive increase)., On loss: ssthresh = window/2; window resets to 1 (timeout) or ssthresh (fast recovery after 3 dup ACKs).

Well-known TCP ports: 80 (HTTP), 443 (HTTPS), 22 (SSH), 25 (SMTP), 110 (POP3), 143 (IMAP), 21 (FTP control), 23 (TELNET), 53 (DNS, also UDP).

UDP

Connectionless: no handshake, no reliability guarantee. Low overhead (8-byte header vs 20-byte for TCP). Used where speed matters and application can tolerate loss: DNS, VoIP, video streaming, DHCP.

UDP header: Source Port (2 bytes), Destination Port (2 bytes), Length (2 bytes), Checksum (2 bytes).

SCTP

Stream Control Transmission Protocol: combines TCP reliability with UDP's message orientation. Supports multi-homing (multiple IP addresses per endpoint) and multi-streaming (multiple independent streams within one connection). Used in VoIP signalling (SS7 over IP).


Application layer

DNS, Domain Name System; resolves hostnames to IPs. Hierarchical: root -> TLD (. com, .in) -> authoritative. Queries: recursive (resolver does all work) or iterative (resolver queries each level separately). Runs on UDP port 53 (TCP for zone transfers).

HTTP, Hypertext Transfer Protocol. Port 80. Methods: GET, POST, PUT, DELETE, HEAD. HTTP/1.1 persistent connections; HTTP/2 multiplexing; HTTP/3 over QUIC.

Email:

  • SMTP (port 25 / 587), sending mail. Push protocol.
  • POP3 (port 110), download and delete (or download and keep). Does not sync.
  • IMAP (port 143), server-side folder management; sync across devices. Preferred.

FTP (ports 20/21), file transfer. Port 21 = control channel; Port 20 = data (active mode). Passive mode: client opens both connections.

TELNET (port 23), remote terminal emulation; plaintext (insecure). Replaced by SSH (port 22).


Network security

Threats

Malware: virus (attaches to files), worm (self-propagating across network), Trojan (disguised as legitimate), ransomware, spyware, adware, rootkit.

Attacks: DoS/DDoS, man-in-the-middle, phishing, SQL injection, replay attack, IP spoofing.

Cryptography

Symmetric (secret-key): same key for encryption and decryption. Fast. Examples: DES (56-bit key, broken), 3DES, AES (128/192/256-bit, current standard). Key distribution problem.

Asymmetric (public-key): key pair, public key (freely shared) + private key (secret). Encrypt with recipient's public key; decrypt with private key. Sign with private key; verify with public key. Example: RSA, ECC. Slow; typically used to exchange a symmetric session key.

Diffie-Hellman key exchange, allows two parties to establish a shared secret over a public channel without prior shared secret. Basis for TLS.

Digital signature

Hash the message with a hash function (SHA-256), then encrypt the hash with the sender's private key. Receiver decrypts with sender's public key and compares with recomputed hash. Provides: authentication, non-repudiation, integrity.

Steganography

Hiding the existence of a message (not just its content). Example: hiding data in the least-significant bits of image pixels.

Firewalls and VPN

Firewall, filters traffic based on rules (packet filter, stateful inspection, application proxy).

VPN (Virtual Private Network), creates an encrypted tunnel over a public network. Protocols: IPsec (Layer 3), SSL/TLS VPN (Layer 4/5), PPTP, L2TP.


Mobile technology

GSM (2G), digital cellular; TDMA-based; voice and SMS. Authentication and encryption built-in.

CDMA2000 (3G), CDMA-based; higher data rates; supports voice and packet data.

GPRS, General Packet Radio Service; adds packet switching to GSM; 2.5G.

Mobile IP, allows a mobile node to maintain its IP address as it moves. Home agent (HA) tunnels packets to the foreign agent (FA) at the current location.

Ad-hoc networks, no infrastructure; nodes route for each other. Protocols: AODV (reactive), OLSR (proactive).

Satellites: GEO (36,000 km, high latency ~250 ms), MEO (Galileo, GPS), LEO (low latency; Starlink).


Cloud computing and IoT

Service models

IaaS (Infrastructure as a Service), virtual machines, storage, networking (AWS EC2, Azure VMs). User manages OS and up.

PaaS (Platform as a Service), managed platform for deploying applications (Google App Engine, Heroku). User manages application only.

SaaS (Software as a Service), complete application delivered over the internet (Gmail, Salesforce, Office 365). User manages nothing.

Deployment models

Public cloud, owned by provider; shared multi-tenant environment. Private cloud, dedicated to a single organisation; can be on-premises or hosted. Hybrid cloud, mix of public and private. Community cloud, shared by organisations with common concerns.

Virtualisation

Hypervisor allows multiple VMs to share a physical host. Type 1 (bare-metal): runs directly on hardware (VMware ESXi, Hyper-V). Type 2 (hosted): runs on a host OS (VirtualBox, VMware Workstation).

Containers (Docker, Kubernetes), lighter than VMs; share the host kernel.

SLA

A Service Level Agreement defines the QoS commitments: availability (e.g., 99.9% = "three nines" = 8.76 hours downtime per year), response time, throughput, support response.

IoT

Internet of Things connects physical devices to the internet. Layers: Perception (sensors/actuators), Network (connectivity), Application (data processing). Protocols: MQTT (lightweight publish-subscribe), CoAP (constrained application protocol), Zigbee, Z-Wave (low-power wireless).


Worked examples

Example 1: Subnetting

Given: 192.168.5.0/26. Prefix = 26, host bits = 6, subnets in a /24 = 4, hosts per subnet = 2^6, 2 = 62.

Subnets: 192.168.5.0/26 (hosts .1, .62, broadcast .63), 192.168.5.64/26, 192.168.5.128/26, 192.168.5.192/26.

Example 2: Hamming code for 4 data bits

Data bits: d1 d2 d3 d4 = 1 0 1 1. Positions: 1(p1), 2(p2), 3(d1), 4(p3), 5(d2), 6(d3), 7(d4).

p1 covers positions 1, 3, 5, 7 -> p1 XOR d1 XOR d2 XOR d4 = p1 XOR 1 XOR 0 XOR 1 = p1 XOR 0 -> p1 = 0. p2 covers positions 2, 3, 6, 7 -> p2 XOR 1 XOR 1 XOR 1 = p2 XOR 1 -> p2 = 1. p3 covers positions 4, 5, 6, 7 -> p3 XOR 0 XOR 1 XOR 1 = p3 XOR 0 -> p3 = 0.

Codeword (positions 1, 7): 0 1 1 0 0 1 1.

Example 3: Sliding window efficiency

Transmission time = 1 ms. Propagation delay one-way = 10 ms. So a = 10/1 = 10.

Stop-and-wait efficiency = 1/(1+2a) = 1/21 ≈ 4.76%.

Go-Back-N with window W = 15 (4-bit sequence numbers, max W = 2^4, 1 = 15): Efficiency = W/(1+2a) = 15/21 ≈ 71.4%.

Example 4: IP fragmentation

Datagram of total length 4000 bytes (20-byte IP header, 3980-byte data) is to be sent over a link with MTU = 1500 bytes.

Each fragment's data field = 1500, 20 = 1480 bytes.

Fragment 1: bytes 0, 1479, offset = 0/8 = 0, MF = 1. Fragment 2: bytes 1480, 2959, offset = 1480/8 = 185, MF = 1. Fragment 3: bytes 2960, 3979, offset = 2960/8 = 370, MF = 0. Lengths: 1500, 1500, 1040.

Example 5: TCP 3-way handshake

Client IP: 10.0.0.1, Server IP: 203.0.113.5, Server port: 80 (HTTP).

  1. Client -> Server: SYN, Seq = 1000, SPort = 54321, DPort = 80.
  2. Server -> Client: SYN-ACK, Seq = 5000, Ack = 1001.
  3. Client -> Server: ACK, Seq = 1001, Ack = 5001.

Connection established. Data transfer begins at Seq = 1001 (client) / 5001 (server).


Quick-revision summary

  • OSI: 7 layers, All People Seem To Need Data Processing (Application to Physical)., TCP port 80 (HTTP), 443 (HTTPS), 25 (SMTP), 110 (POP3), 143 (IMAP), 53 (DNS), 21/20 (FTP), 22 (SSH)., IPv4: 32 bits; IPv6: 128 bits. CIDR: hosts = 2^(32-prefix), 2., Hamming distance d+1 to detect d errors; 2d+1 to correct d errors., GBN window = 2^n, 1; SR window = 2^(n-1)., TCP: connection-oriented, reliable, flow control, congestion control. UDP: connectionless, unreliable, fast., Symmetric (AES, DES): fast, shared key. Asymmetric (RSA): slow, public/private pair., IaaS: VMs. PaaS: platform. SaaS: application. Type 1 hypervisor: bare metal. Type 2: hosted., Shannon capacity = B log2(1 + S/N). Nyquist = 2B log2(V).

How to study this unit

  1. Build an "OSI protocol map", for every protocol you know (ARP, IP, TCP, HTTP, etc.), place it on the OSI model. This answers a large class of NET questions directly.
  2. Practice subnetting until you can compute network address, broadcast, host range, and number of hosts in under 2 minutes from any CIDR notation.
  3. Know the three email protocols cold: SMTP sends, POP3 downloads (delete from server), IMAP syncs (keeps on server). This is a favourite NET trap.
  4. For error detection: know Hamming, CRC, parity, their properties (what errors each detects/corrects) and the formula for Hamming code.
  5. TCP congestion control (slow start -> congestion avoidance -> fast recovery) appears in many forms. Trace through a few scenarios numerically.
  6. The security section rewards memorisation: AES = symmetric, RSA = asymmetric, SHA = hash, VPN = tunnel, firewall = filter. Map each to its purpose and NET questions become straightforward.

Test Your Knowledge

Quick MCQ check on this unit

Start Quiz →

Prefer watching over reading?

Subscribe for free.

Subscribe on YouTube