Data Communication and Computer Networks Study Notes

Unit I: Network Fundamentals

  • Introduction to Computer Networks

    • Network Definition: A collection of interconnected devices capable of communicating with each other over physical or wireless links.
    • Nodes and Hosts: Every connected device (computer, printer, server) is called a node or host. Each host possesses a unique network address designated in the hierarchical form n/hn/h, where nn specifies the network identifier and hh specifies the host identifier on network nn.
    • Key Uses of Computer Networks:
    • Business Applications: Resource sharing, enterprise database accessibility, and client-server collaboration.
    • Home Applications: Internet browsing, entertainment, personal communication, and smart home automation.
    • Mobile Users: Wireless connectivity, cellular communication, and mobile computing.
    • E-Mail Services: Asynchronous electronic messaging systems.
  • Client-Server Architecture

    • Client: The requesting device/process that initiates communication.
    • Server: The responding device/process that provides services or resources upon client request.
    • Request-Response Pattern: The standard interaction cycle where a client issues a service request and the server responds with the output.

Client Server Request Response

  • Categories of Networks
    • Local Area Network (LAN):
    • Scope: Designed for private communication over small geographic distances (within an office, building, campus, or home).
    • Advantages: High data speed, easy sharing of files and software, robust communication exchange.
    • Disadvantages: High installation cost, limited geographic reach, dependency on localized cable health.

LAN Diagram

  • Metropolitan Area Network (MAN):

    • Scope: Interconnects users across a larger geographical region than a LAN, up to 150 km150\text{ km}. Examples include cable television networks and regional telephone networks.
    • Advantages: High bandwidth across cities, capability to service large numbers of client nodes, lower transmission error rates.
    • Disadvantages: Slower data access relative to private LANs, large space and equipment requirements, substantial setup expenses.
  • Wide Area Network (WAN):

    • Scope: Provides long-distance transmission of data, voice, and video across countries, continents, or the entire globe.

    • Data Communication Model

  • Definition: The exchange of data between two devices via a transmission medium in binary format (0s0\text{s} and 1s1\text{s}).

  • Fundamental Characteristics:

    • Delivery: The system must deliver data accurately to the intended destination.
    • Accuracy: Data must be delivered without corruption or alteration.
    • Timeline: Data must be delivered in a timely, real-time manner without crippling delay.
    • Jitter: Refers to the variation in packet arrival time; inconsistent delay causes uneven voice/video quality.

Communication Model Source Transmission Medium Destination

  • Five Key Components of Data Communication
    1. Sender: The device that originates and sends the data message.
    2. Receiver: The device that receives the data message.
    3. Medium: The physical transmission path over which the message travels from sender to receiver.
    4. Message: The information or data being communicated (text, numbers, images, audio, video).
    5. Protocol: The set of rules and syntax that governs data communications between systems.

Components of Data Communication

  • Line Configuration and Connection Types

    • Point-to-Point Line Configuration: Provides a dedicated channel link between exactly two devices.
    • Multipoint (Multi-Drop) Line Configuration: A single physical link is shared among three or more devices simultaneously or in time-shared blocks.
  • Transmission Modes

    • Simplex Mode: Unidirectional data transmission; one node only transmits while the other only receives (e.g., mainframe to monitor, television/radio broadcasts).
    • Half-Duplex Mode: Bidirectional transmission, but only one direction at a time (e.g., walkie-talkies).
    • Full-Duplex Mode: Simultaneous bidirectional data transmission in both directions concurrently (e.g., modern telephone networks, full-duplex network switches).

Data flow simplex half-duplex full-duplex

  • Protocol Architecture Elements

    • Syntax: Structure or format of data, including the order in which bits are presented (e.g., first 8 bits8\text{ bits} = sender address, second 8 bits8\text{ bits} = receiver address, remaining = message).
    • Semantics: Meaning assigned to each section of bits (interpreting control vs. payload data).
    • Timing: Specifies when data should be sent and how fast it can be transmitted (e.g., transmission rate of 100 Mbps100\text{ Mbps}).
  • Networking Standards

    • De Facto Standards: Standards adopted by widespread market usage rather than official legal enactment. Divided into:
    • Proprietary: Wholly owned and controlled by a commercial entity.
    • Non-Proprietary: Developed by public consensus or open-source groups.
    • De Jure Standards: Standards legislated and formalized by officially recognized regulatory bodies (e.g., ISO, ANSI, IEEE).

Standards De Facto vs De Jure

  • The Open Systems Interconnection (OSI) Model

    • Developed by the International Organization for Standardization (ISO) as an open system framework permitting diverse equipment to communicate.
    • Consists of 7 layered framework sections:
    1. Layer 1 - Physical Layer: Transmits raw bit streams over physical medium.
    2. Layer 2 - Data Link Layer: Handles node-to-node frame delivery, physical addressing, error and flow control.
    3. Layer 3 - Network Layer: Manages host-to-host packet routing and logical IP addressing.
    4. Layer 4 - Transport Layer: Ensures end-to-end process-to-process message delivery and segment ordering.
    5. Layer 5 - Session Layer: Establishes, maintains, and synchronizes communication dialogs.
    6. Layer 6 - Presentation Layer: Manages data translation, formatting, encryption, and compression.
    7. Layer 7 - Application Layer: Provides direct network application interfaces and network services to users.
  • Detailed Functions of OSI Layers

    • Physical Layer:
    • Interface and media physical characteristics.
    • Bit representation (converting bits 0,10, 1 into electrical/optical signals).
    • Bit data rate control (bits per second).
    • Line configuration, physical topology, and transmission mode.

Physical Layer

  • Data Link Layer:
    • Framing: Divides network layer bits into manageable data units called frames.
    • Physical Addressing: Appends a header containing hardware (MAC) source and destination addresses.
    • Flow Control: Prevents fast senders from overwhelming slow receivers.
    • Error Control: Adds trailer fields (CRC) to detect corrupted or lost frames.
    • Access Control: Determines line control during shared channel access.
  • Network Layer:
    • Logical Addressing: Implements universal IP addressing scheme that remains constant across intermediate hops.
    • Routing: Selects optimal paths across multiple networks to transport packets to destination hosts.

Network Layer

  • Transport Layer:
    • Service-Point (Port) Addressing: Delivers data to a specific process running on the host.
    • Segmentation and Reassembly: Splits data into numbered sequence segments for ordered reconstruction.
    • Connection Control: Implements connectionless or connection-oriented modes.
    • End-to-End Flow and Error Control: Manages reliability across the whole path rather than single hops.
  • Session Layer:
    • Dialog Control: Manages half-duplex or full-duplex session exchanges.
    • Synchronization: Adds periodic checkpoints into data streams to allow session recovery without full retransmission.
  • Presentation Layer:
    • Translation: Converts between disparate internal encoding schemes (ASCII, EBCDIC).
    • Encryption: Converts plaintext into ciphertext for security.
    • Compression: Reduces data size for bandwidth efficiency.

Presentation Layer

  • Application Layer:

    • Direct access for user software (X.500 Directory Services, X.400 Message Handling, FTAM File Transfer Access and Management, Network Virtual Terminal).

    • Network Topologies

  • Mesh Topology:

    • Direct point-to-point connection between every pair of nodes.
    • Number of physical channels formula for nn nodes: Nlinks=n(n−1)2N_{\text{links}} = \frac{n(n - 1)}{2}.
    • Example: For n=5n = 5 nodes, Nlinks=5(4)2=10 linksN_{\text{links}} = \frac{5(4)}{2} = 10\text{ links}.
    • Advantages: Eliminates traffic contention, highly robust, secure, easy fault isolation.
    • Disadvantages: Extremely expensive cabling, complex multi-port requirements.
  • Star Topology:

    • Every node connects directly to a central controller or Hub.
    • Advantages: Less expensive than mesh, requires fewer cables, robust against individual node failures.
    • Disadvantages: Central point of failure (if Hub fails, whole network stops).
  • Tree Topology:

    • Hierarchical variation of star topology using active primary hubs and passive secondary hubs.
    • Advantages: Supports multiple devices per central hub, prioritizes traffic streams.
    • Disadvantages: Complex cable installation; primary hub failure disables connected subtrees.
  • Bus Topology:

    • Multipoint topology using a single backbone cable connected via drop lines and taps.
    • Advantages: Easy installation, minimal cabling, eliminates redundancy.
    • Disadvantages: Reconfiguration is difficult; a break in the backbone halts all communication.
  • Ring Topology:

    • Each device connects in a closed loop to two adjacent devices using repeaters.
    • Advantages: Easy setup, token-based collision avoidance, straightforward troubleshooting.
    • Disadvantages: Unidirectional traffic; a single cable/node break disrupts the entire loop.
  • Hybrid Topology:

    • Combination of two or more distinct topologies (e.g., Star-Bus or Star-Ring).

    • Transmission Media

  • Guided Media (Wired):

    • Twisted-Pair Cable: Consists of two insulated copper wires (1 mm1\text{ mm} thick) twisted together.
      • Unshielded Twisted Pair (UTP): Uses RJ-11 connectors (2-pair2\text{-pair}) or RJ-45 connectors (4-pair4\text{-pair}). Cheap, flexible, supports speeds up to 100 m100\text{ m} distance limits. Frequency range: 100 Hz100\text{ Hz} to 5 MHz5\text{ MHz}.
      • Shielded Twisted Pair (STP): Encased in metal foil or braided mesh to eliminate crosstalk and electromagnetic interference (EMI).
    • Coaxial Cable: Central copper conductor enclosed by insulator, foil/braided outer conductor shield, and outer plastic jacket. Frequency range: 100 kHz100\text{ kHz} to 500 MHz500\text{ MHz}. Uses BNC, BNC T, and BNC 50 Ω50\,\Omega terminators.

UTP and STP

BNC Connectors

* *Optical Fiber Cable:* Transmits light signals through glass or plastic threads. High bandwidth (>2 Gbps> 2\text{ Gbps}), immune to EMI, operational up to 50 km50\text{ km} without repeaters.
  * Propagation Modes:
    1. Multimode Step-Index: Multiple light rays reflect abruptly off the core-cladding boundary.
    2. Multimode Graded-Index: Core density varies, refracting light rays in smooth curves to minimize signal distortion.
    3. Single-Mode: Extremely small core diameter allows only a single direct ray of light to travel.

Propagation Modes in Fiber

  • Unguided Media (Wireless):
    • Radio Waves: Omnidirectional electromagnetic waves (3 kHz3\text{ kHz} to 1 GHz1\text{ GHz}) that penetrate walls easily. Used for multicasting, AM/FM radio, cellular networks, and Bluetooth (2400 MHz2400\text{ MHz} to 2480 MHz2480\text{ MHz}).
    • Microwaves: Line-of-sight directional signals (1 GHz1\text{ GHz} to 300 GHz300\text{ GHz}). Cannot penetrate walls.
      • Terrestrial Microwave: Dish antennas mounted high on towers (2 GHz2\text{ GHz} to 40 GHz40\text{ GHz}), requiring clear line-of-sight every 30 miles30\text{ miles}.
      • Satellite Microwave: Geostationary orbit located 36 000 km36\,000\text{ km} above the equator. Uses Uplink frequency of 6 GHz6\text{ GHz} and Downlink frequency of 4 GHz4\text{ GHz}.
    • Infrared: High-frequency waves (300 GHz300\text{ GHz} to 400 THz400\text{ THz}) for short-range communication (<1 km< 1\text{ km}). Cannot pass through walls, preventing outside sunlight interference.

Unit II: Data Link Control & Medium Access

  • Line Discipline Mechanisms
    • ENQ/ACK (Enquiry/Acknowledgment):
    • Used in peer-to-peer relationships.
    • The sender transmits an ENQ frame; the receiver responds with an ACK frame if ready, or NAK if busy.

ENQ ACK Protocol Handshake

  • Poll/Select:
    • Used in primary-secondary master-slave topologies.
    • Select Mode: Used when the primary device wants to send data. Primary transmits a SEL frame, waits for ACK, then transmits data.
    • Poll Mode: Used when the primary device solicits data from secondary devices sequentially. If a secondary has data, it sends it; if not, it returns NAK.

Select Line Discipline Diagram

  • Flow Control Protocols

    • Stop-and-Wait Flow Control: The sender transmits a single frame and waits for an explicit ACK before sending the next frame. Simple but inefficient over long distances.
    • Sliding Window Flow Control: The sender can transmit multiple frames up to a defined window size before requiring an ACK, dramatically improving channel utilization.
  • Error Detection Methods

    • Redundancy Principle: Extra bits (kk) are appended to information bits (nn) where k≪nk \ll n.

Error Detection Redundancy Check Diagram

  • Vertical Redundancy Check (VRC / Parity Check): Adds a parity bit to every data unit so total number of 1s1\text{s} is even (Even Parity) or odd (Odd Parity). Detects single-bit errors.
  • Longitudinal Redundancy Check (LRC): Organizes bits in a 2D matrix and calculates parity vertically across columns. Detects burst errors of length nn

Longitudinal Redundancy Check Diagram

  • Cyclic Redundancy Check (CRC):
    • Based on modulo-2 binary division without carries/borrows.
    • Generator polynomial/divisor (m bitsm\text{ bits}) operates on data appended with m−1m - 1 zeros.
    • Remainder of division becomes the CRC appended to the frame.
    • Receiver divides incoming frame by divisor; a zero remainder indicates no error.

Cyclic Redundancy Check Division Diagram

  • Checksum:
    • Sender divides data into n-bitn\text{-bit} segments (usually 16 bits16\text{ bits}), sums them using 1's complement arithmetic, and complements the sum to form the checksum.
    • Receiver sums all incoming segments including checksum and complements the result. If equal to 00, the packet is accepted.

Checksum Generator and Checker

  • Error Correction & Hamming Codes
    • Redundancy Bits Formula: To correct mm data bits using rr redundancy bits:     2r≥m+r+12^r \ge m + r + 1
    • Example: For m=7m = 7 data bits, the smallest valid rr is 44 because 2^4 = 16 \ge 7 + 4 + 1 = 12$.\n\n![Redundancy Bits Calculation](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/40.jpg)\n\n * **Hamming Code Bit Positioning:**\n * Parity bits (r)occupybitpositionsthatarepowersof2:) occupy bit positions that are powers of 2:1, 2, 4, 8, 16, 32, \dots\n * Data bits (d)occupyallremainingpositions:) occupy all remaining positions:3, 5, 6, 7, 9, 10, 11, \dots\n * Bit checking sequences:\n * Position 1: Checks 1, skips 1 (1, 3, 5, 7, 9, 11, \dots)\n * Position 2: Checks 2, skips 2 (2, 3, 6, 7, 10, 11, \dots)\n * Position 4: Checks 4, skips 4 (4, 5, 6, 7, 12, 13, \dots)\n * Position 8: Checks 8, skips 8 (8\text{--}15, 24\text{--}31, \dots)\n\n![Hamming Code Bit Positions](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/41.jpg)\n\n* **Automatic Repeat Request (ARQ) Error Control**\n * **Stop-and-Wait ARQ:** Combines stop-and-wait flow control with retransmission timers, sequence numbers (0andand1), and NAK frames.\n * **Go-Back-N ARQ:** Sliding window protocol where a single corrupted/lost frame forces retransmission of that frame and all subsequent frames in transit.\n * **Selective-Reject ARQ:** Sender retransmits *only* the specific corrupted frame. Requires complex buffering and reordering logic at the receiver.\n\n![Go-Back-N vs Selective-Reject ARQ](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/44.jpg)\n\n* **IEEE 802 LAN Standards & MAC Sublayer**\n * IEEE Project 802 splits Data Link Layer into:\n * *Logical Link Control (LLC - IEEE 802.2):* Handles flow/error control and multiplexes network layer protocols.\n * *Media Access Control (MAC):* Resolves shared medium contention, handles hardware addressing.\n\n![IEEE LAN Standard Sublayers](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/46.jpg)\n\n * **CSMA/CD (Carrier Sense Multiple Access with Collision Detection):**\n * Node listens to the channel before transmitting (Carrier Sense).\n * If idle, node transmits; if collision occurs, both stations abort, send a jam signal, and wait a random exponential backoff time.\n * **IEEE 802.3 Ethernet Frame:**\n * *Preamble:* 7\text{ bytes}((56\text{ bits}ofalternatingof alternating1\text{s}andand0\text{s}).\n * *SFD (Start Frame Delimiter):* 1\text{ byte} (`10101011`).\n * *Destination Address:* 6\text{ bytes} (MAC).\n * *Source Address:* 6\text{ bytes} (MAC).\n * *Length/Type:* 2\text{ bytes}.\n * *Data and Padding:* 46\text{ to } 1500\text{ bytes}.\n * *CRC / FCS:* 4\text{ bytes}.\n * **Ethernet Evolution Generations:**\n * *Standard Ethernet (10\text{ Mbps}):∗10Base5(ThickCoax,):* 10Base5 (Thick Coax,500\text{ m}),10Base2(ThinCoax,), 10Base2 (Thin Coax,185\text{ m}),10Base−T(Cat3UTP,), 10Base-T (Cat3 UTP,100\text{ m}),10Base−F(FiberOptic,), 10Base-F (Fiber Optic,2000\text{ m}).\n * *Fast Ethernet (100\text{ Mbps}):∗100Base−TX(Cat5UTP),100Base−FX(Fiber),100Base−T4(Cat3UTP,):* 100Base-TX (Cat5 UTP), 100Base-FX (Fiber), 100Base-T4 (Cat3 UTP,4\text{-pair}).\n * *Gigabit Ethernet (1\text{ Gbps}):* 1000Base-SX (Short-wave Fiber), 1000Base-LX (Long-wave Fiber), 1000Base-CX (STP), 1000Base-T (Cat5 UTP).\n * *10-Gigabit Ethernet (10\text{ Gbps}):* Full-duplex optical fiber standard.\n * **Token Ring (IEEE 802.5):** Uses a token passing control frame circulating around a physical loop to guarantee collision-free access.\n * **FDDI (Fiber Distributed Data Interface):** ANSI standard operating at 100\text{ Mbps} over dual counter-rotating fiber rings using Dual Attachment Stations (DAS) and Single Attachment Stations (SAS).\n\n* **Networking & Interconnecting Devices**\n * **Repeater:** Physical layer device that regenerates weak binary signals.\n * **Bridge:** Data link layer device that filters traffic based on MAC addresses using a bridge lookup table.\n\n![Bridge Interconnecting LANs](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/76.jpg)\n\n * **Router:** Network layer device that routes packets across different networks using logical IP addresses.\n * **Gateway:** Application layer converter that translates protocols between disparate system architectures (e.g., SNA to NetWare).\n\n# Unit III: Wireless LANs & Bluetooth\n\n* **IEEE 802.11 Wireless LANs**\n * **Basic Service Set (BSS):** The fundamental building block consisting of stationary or mobile wireless stations.\n * **Topologies:**\n * *Ad-Hoc Network:* Standalone BSS without an Access Point (Independent BSS / IBSS).\n * *Infrastructure Network:* BSS containing an Access Point (AP) connected to a wired distribution system.\n * **Station Mobility Types:**\n * *No-Transition Mobility:* Stationary or moving strictly within one BSS.\n * *BSS-Transition Mobility:* Station moves from one BSS to another within the same Extended Service Set (ESS).\n * *ESS-Transition Mobility:* Station moves between distinct ESS networks.\n * **CSMA/CA (Collision Avoidance):**\n * Wireless stations use Request to Send (RTS) and Clear to Send (CTS) handshake frames.\n * RTS frame contains duration time; surrounding stations set a Network Allocation Vector (NAV) timer during which they refrain from channel access.\n\n* **Bluetooth Technology (IEEE 802.15.1)**\n * An ad-hoc short-range wireless network architecture operating in the 2.4\text{ GHz}ISMband(ISM band (2400\text{ to } 2480\text{ MHz}).\n * **Network Topologies:**\n * *Piconet:* Contains 1 Master node and up to 7 active Slave nodes (plus 8 additional parked nodes).\n * *Scatternet:* Formed by interconnecting multiple piconets via shared slave/master nodes.\n * **Bluetooth Protocol Layers:**\n * *Radio Layer:* Uses Frequency-Hopping Spread Spectrum (FHSS) hopping 1600\text{ times/sec} with Gaussian Frequency Shift Keying (GFSK).\n * *Baseband Layer:* Implements Time-Division Multiple Access (TDMA) with slot duration = 625\,\mu\text{s}.\n * *L2CAP (Logical Link Control and Adaptation Protocol):* Provides multiplexing, segmentation, reassembly, and QoS management over Asynchronous Connectionless Links (ACL).\n * **Physical Links:**\n * *SCO (Synchronous Connection-Oriented):* Circuit-switched real-time link without retransmissions (for voice).\n * *ACL (Asynchronous Connectionless Link):* Packet-switched link with retransmissions for data integrity.\n\n# Unit IV: Network Layer & IP Addressing\n\n* **Switching Techniques**\n * **Circuit Switching:** Establishes a dedicated direct physical circuit prior to communication (e.g., telephone networks).\n * *Space-Division Switches:* Crossbar switches (requires n \times m crosspoints) and Multistage switches (reduces crosspoints but introduces blocking risk).\n * *Time-Division Switches:* Time-Slot Interchange (TSI) using RAM buffer reordering and TDM Bus structures.\n\n![Switched Network and Switching Methods](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/87.jpg)\n\n * **Packet Switching:** Divides messages into small discrete packets.\n * *Datagram Approach:* Connectionless mode; each packet is routed independently through different paths and may arrive out of order.\n * *Virtual Circuit Approach:* Connection-oriented mode; all packets follow a pre-established virtual route.\n * Switched Virtual Circuit (SVC): Dynamically established for session duration.\n * Permanent Virtual Circuit (PVC): Leased dedicated path maintained permanently.\n\n![Permanent Virtual Circuit Diagram](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/99.jpg)\n\n * **Message Switching:** Store-and-forward approach using secondary disk storage to buffer whole messages until links become idle.\n\n* **Routing Algorithms**\n * **Non-Adaptive Routing:** Static routes configured manually by network administrators.\n * **Adaptive Routing:** Dynamic routes updated automatically based on network traffic and topology changes.\n * **Distance Vector Routing (Bellman-Ford):**\n * Each router periodically transmits its complete routing table to immediate neighbors every 30\text{ seconds}.\n\n![Distance Vector Routing Concept](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/103.jpg)\n\n * **Link State Routing (Dijkstra):**\n * Each router floods Link State Packets (LSP) containing immediate link costs to all routers in the network.\n * Routers assemble a complete Link State Database and calculate shortest paths using Dijkstra's algorithm.\n\n* **IPv4 Addressing & Header Structure**\n * **IPv4 Address:** 32\text{-bit} logical address written in dotted-decimal notation (e.g., `192.168.1.1`).\n * **Classful Addressing:**\n * *Class A:* First bit = `0`, range `1.0.0.0` to `127.255.255.255` (8\text{ net bits}, 24\text{ host bits}).\n * *Class B:* First bits = `10`, range `128.0.0.0` to `191.255.255.255` (16\text{ net bits}, 16\text{ host bits}).\n * *Class C:* First bits = `110`, range `192.0.0.0` to `223.255.255.255` (24\text{ net bits}, 8\text{ host bits}).\n * *Class D:* First bits = `1110`, range `224.0.0.0` to `239.255.255.255` (Multicasting).\n * *Class E:* First bits = `1111`, range `240.0.0.0` to `255.255.255.255` (Experimental).\n\n![Classful Addressing IPv4 Ranges](https://assets.knowt.com/pdf-flow-prod/ef76068b-1070-4efe-88c4-2b0e3511d135-figures/111.jpg)\n\n * **Private IP Ranges:**\n * Class A: `10.0.0.0` to `10.255.255.255` (16\,777\,216\text{ hosts})\n * Class B: `172.16.0.0` to `172.31.255.255` (1\,048\,576\text{ hosts})\n * Class C: `192.168.0.0` to `192.168.255.255` (65\,536\text{ hosts})\n * **Classless Inter-Domain Routing (CIDR):** Replaces class boundaries with variable length network prefixes (e.g., `/27` prefix leaves 32 - 27 = 5\text{ host bits}oror32\text{ addresses}).\n * **IPv4 Datagram Header Fields:**\n * *Version:* 4\text{ bits} (IPv4 = `4`).\n * *IHL (Header Length):* 4\text{ bits}(multiplierof(multiplier of4\text{-byte}words,min=words, min =5,max=, max =15).\n * *Type of Service (TOS):* 8\text{ bits} for QoS priority.\n * *Total Length:* 16\text{ bits}(header+data,max=(header + data, max =65\,535\text{ bytes}).\n * *Identification, DF (Don't Fragment), MF (More Fragments), Fragment Offset:* Fields used for IP fragmentation.\n * *Time to Live (TTL):* Hop counter decremented by each router; discarded when TTL reaches 0$.
    • Protocol: Identifies upper transport protocol (e.g., 66 for TCP, 1717 for UDP).

IPv4 Header Structure

  • IPv6 Addressing
    • 128-bit128\text{-bit} address space represented as 8 groups of 4 hexadecimal digits separated by colons (e.g., 3FFE:085B:1F1F:0000:0000:0000:00A9:1234).
    • Zero compression rule: Consecutive zero blocks can be replaced once by :: (e.g., 3FFE:85B:1F1F::A9:1234).
    • Total addresses = 2128≈3.4×10382^{128} \approx 3.4 \times 10^{38}.
    • Key enhancements over IPv4: Fixed 40-byte40\text{-byte} base header, elimination of header checksum, removal of broadcast (replaced by multicast FF02::1), integrated IPSec, and Neighbor Discovery Protocol (NDP) replacing ARP.

Unit V: Transport Layer & Applications

  • Transport Layer Principles
    • Manages end-to-end, process-to-process message transport using Service Point Addresses (Port Numbers).
    • Berkeley UNIX Socket Primitives: socket(), bind(), listen(), accept(), connect(), send(), receive(), close().

Berkeley Service Primitives

  • Congestion Control & Traffic Management

    • Congestion Detection/Control:
    • Warning Bit: Router flags explicit congestion bits in packet headers.
    • Choke Packets: Router generates explicit ICMP Source Quench control packets forcing the sender to lower bitrates.
    • Load Shedding: Routers drop packets when buffers overflow (discarding old packets for real-time audio/video or new packets for file transfers).
    • Congestion Avoidance:
    • Random Early Discard (RED): Router calculates average queue length. Drops incoming packets probabilistically before buffers become completely full.
    • Leaky Bucket Algorithm: Regulates bursty traffic into a smooth, constant-rate output stream.
    • Token Bucket Algorithm: Accumulates tokens over time, allowing controlled traffic bursts when sufficient tokens exist.
  • Transmission Control Protocol (TCP)

    • Connection-oriented, reliable, full-duplex byte-stream transport protocol.
    • TCP Header Format: Minimum 20 bytes20\text{ bytes}, maximum 60 bytes60\text{ bytes}.
    • Ports: 16-bit16\text{-bit} Source Port, 16-bit16\text{-bit} Destination Port.
    • Sequence & Ack Numbers: 32 bits32\text{ bits} each for byte tracking.
    • Control Flags: NS, CWR, ECE, URG, ACK, PSH, RST, SYN, FIN.
    • Window Size: 16 bits16\text{ bits} for sliding window flow control.

TCP Well-Known Ports Table

  • Connection Establishment & Termination:
    • 3-Way Handshake Setup: Client sends SYN(seq=x), Server returns SYN+ACK(seq=y, ack=x+1), Client returns ACK(ack=y+1).
    • Connection Teardown: Active close sends FIN, passive close returns ACK and FIN, client confirms with final ACK.

TCP Connection Termination Three-Way Handshake

  • User Datagram Protocol (UDP)

    • Connectionless, lightweight, unreliable transport protocol.
    • Header length = 8 bytes8\text{ bytes} (Source Port, Destination Port, Total Length, Checksum).
    • Used for real-time applications requiring low latency (DNS, TFTP, SNMP, BOOTP, DHCP).
  • Real-Time Transport Protocol (RTP)

    • Runs on top of UDP to handle real-time audio/video streaming and VoIP.
    • Features timestamping, sequence numbering, and media payload identification.
  • Application Protocols

    • Domain Name System (DNS): Translates domain names (www.company.com) into numerical IP addresses (204.0.8.51).
    • File Transfer Protocol (FTP): Uses dual TCP connections — Control Connection on Port 2121 and Data Connection on Port 2020
    • Electronic Mail Protocols:
    • SMTP (Simple Mail Transfer Protocol): Push protocol on Port 2525 for sending emails between servers.

Components of SMTP

* *POP3 (Post Office Protocol v3):* Downloads full emails to local machine and deletes server copies.
* *IMAP (Internet Message Access Protocol):* Synchronizes and reads messages stored directly on remote mail servers.
  • SNMP (Simple Network Management Protocol): Application framework consisting of SNMP Manager, Managed Devices, SNMP Agent, and Management Information Base (MIB). Uses commands: GET, GETNEXT, GETBULK, SET, TRAP, INFORM, RESPONSE.

Unit VI: Network Security & Cryptography

  • Network Security Goals & Services
    • CIA Triad:
    1. Confidentiality: Protects private data from unauthorized interception.
    2. Integrity: Ensures data is not altered or tampered with during transmission.
    3. Availability: Guarantees network services remain accessible to legitimate users.
    • Security Services: Authentication, Non-Repudiation, Proof of Submission, Proof of Delivery.

Attributes of Web Security Testing

  • Threat Categories

    • Physical Threats: Internal (fire, power failure), External (floods, lightning), Human (theft, physical destruction).
    • Non-Physical Threats: Software attacks including Viruses, Worms, Trojans, Spyware, Keyloggers, Adware, DoS/DDoS, and Phishing.
  • Cryptography Concepts

    • Plaintext: Unencrypted human-readable message.
    • Ciphertext: Encrypted unintelligible string resulting from encryption.
    • Symmetric-Key Cryptography (Secret-Key): Sender and receiver share a single secret key for both encryption and decryption (e.g., DES, 3DES, AES).
    • Data Encryption Standard (DES):
    • 64-bit64\text{-bit} block cipher operating with a 56-bit56\text{-bit} key across 16 Feistel rounds.
    • Uses Initial Permutation (IP), 16 round key generators (48-bit48\text{-bit} subkeys), and Final Permutation (FP).
    • Demonstrates the Avalanche Effect (small change in plaintext massively alters ciphertext).

DES Algorithm Structure

  • Asymmetric-Key Cryptography (Public-Key): Uses a mathematically linked Key Pair — a Public Key for encryption and a Private Key for decryption.

  • RSA Algorithm (Rivest-Shamir-Adleman):

    1. Select two large prime numbers pp and qq
    2. Compute modulus N=p×qN = p \times q
    3. Compute Euler's totient function ϕ(n)=(p−1)(q−1)\phi(n) = (p - 1)(q - 1).
    4. Select public exponent ee such that 1<e<ϕ(n)1 < e < \phi(n) and gcd⁡(e,ϕ(n))=1\gcd(e, \phi(n)) = 1
    5. Calculate private exponent dd such that d×e≡1(modϕ(n))d \times e \equiv 1 \pmod{\phi(n)}.
    6. Public Key = (N,e)(N, e), Private Key = (N,d)(N, d).
    7. Encryption: C=Me(modN)C = M^e \pmod N.
    8. Decryption: M=Cd(modN)M = C^d \pmod N.
    • Web Security Protocols
  • SSL (Secure Sockets Layer) / TLS (Transport Layer Security):

    • Developed by Netscape in 1995 to secure HTTP traffic.
    • Uses cryptographic handshakes to establish server authentication, symmetric session key encryption, and message digital signatures.