Core Networking Protocols: TCP/IP, IPv4/IPv6, and DNS Resolution
					
		Posted  on Nov 3, 2025 in Contemporary Music Composition	
				
							
										
											
								
				TCP/IP Reference Model Features
The TCP/IP reference model (Transmission Control Protocol / Internet Protocol) is the conceptual framework used for network communication over the internet. It describes how data should be packaged, addressed, transmitted, routed, and received.
Key Features of the TCP/IP Model
- 1. Based on Standard Protocols: Uses open, standard protocols such as TCP and IP, which are vendor-independent and interoperable across devices and operating systems.
 - 2. End-to-End Communication: Ensures that data sent from one host can be reliably delivered to another host, even across multiple networks.
 - 3. Supports Connection-Oriented and Connectionless Services:
- TCP: Connection-oriented, reliable communication.
 - UDP: Connectionless, faster but without guaranteed delivery.
 
 - 4. Flexible and Scalable: Can handle networks of all sizes, from small LANs to the global Internet. Allows easy addition of new protocols and technologies without redesigning the whole system.
 - 5. Addressing and Routing: Uses IP addressing (IPv4/IPv6) to uniquely identify devices. Supports routing so that data can travel across multiple interconnected networks.
 
TCP/IP vs. OSI Reference Model Comparison
| Aspect | OSI Reference Model | TCP/IP Reference Model | 
|---|
| Full Form | Open Systems Interconnection | Transmission Control Protocol / Internet Protocol | 
| Layers | 7 layers: 1. Physical 2. Data Link 3. Network 4. Transport 5. Session 6. Presentation 7. Application | 4 layers: 1. Network Access 2. Internet 3. Transport 4. Application | 
| Approach | Theoretical and conceptual model, protocol-independent. | Practical model based on standard protocols. | 
| Development | Developed by ISO (International Organization for Standardization). | Developed by DARPA (U.S. Department of Defense). | 
| Protocol Specification | Does not specify protocols; only a guideline for designing network architecture. | Specifies standard protocols (TCP, IP, UDP, etc.). | 
| Flexibility | More rigid, designed as a universal standard. | More flexible, designed for real-world communication and scalability. | 
| Example Protocols | OSI doesn’t define protocols (examples from TCP/IP can be mapped to OSI). | HTTP, FTP, SMTP, DNS (Application); TCP, UDP (Transport); IP, ICMP (Internet); Ethernet, Wi-Fi (Network Access). | 
Common Network Topologies
| Topology | Description | Advantages | Disadvantages | 
|---|
| Bus | All devices share a single cable. | Easy to install, low cost. | One cable failure affects the whole network. | 
| Star | Devices connect to a central hub. | Easy to manage, failure of one device doesn’t affect others. | Hub failure brings down the network. | 
| Ring | Devices form a closed loop. | Predictable performance. | Failure in one device affects all. | 
| Mesh | Every device connects to every other. | High reliability and redundancy. | Expensive and complex. | 
| Tree | Hierarchical, combines star + bus. | Scalable and easy to manage. | If the main cable fails, the network fails. | 
| Hybrid | Mix of two or more topologies. | Flexible and scalable. | Complex and costly. | 
Understanding IPv4 and Packet Format
IPv4 is the fourth version of the Internet Protocol, and it is one of the core protocols used to identify devices on a network and route data between them. It is widely used for assigning IP addresses in most networks.
IPv4 Packet Format
| Field | Size (bits) | Description | 
|---|
| Version | 4 | IP version (always 4 for IPv4) | 
| Header Length | 4 | Length of header in 32-bit words | 
| Type of Service (ToS) | 8 | Priority of the packet (QoS) | 
| Total Length | 16 | Entire packet size (header + data) | 
| Identification | 16 | Used for fragmenting packets | 
| Flags | 3 | Control flags (e.g., don’t fragment) | 
| Fragment Offset | 13 | Position of a fragment in the original packet | 
| Time to Live (TTL) | 8 | Maximum hops before packet is discarded | 
| Protocol | 8 | Protocol used in the data portion (e.g., TCP = 6) | 
| Header Checksum | 16 | Error checking of the header | 
| Source IP Address | 32 | Sender’s IP address | 
| Destination IP Address | 32 | Receiver’s IP address | 
| Options (Optional) | Variable | Extra features like security or routing | 
| Data | Variable | Actual payload (e.g., message or file data) | 
IPv4 Address Format
- Consists of 4 octets (8 bits each), separated by dots.
 - Example: 
192.168.0.1 - Each number ranges from 0 to 255 (since 8 bits = 0 to 255).
 
IPv6 Protocol and Address Format
IPv6 is the successor to IPv4, designed to solve the problem of limited IP addresses. It offers a much larger address space and improved features for modern networks.
IPv6 Address Format
- Total length: 128 bits.
 - Divided into 8 groups of 16 bits (each group = 4 hexadecimal digits).
 - Leading zeros can be omitted, and long sequences of zeros can be shortened using 
:: once. 
Example:
Full form: 2001:0db8:0000:0000:0000:0000:1428:57ab
Compressed: 2001:db8::1428:57ab
IPv6 Header Structure
| Field | Size (bits) | Description | 
|---|
| Version | 4 | IP version (always 6) | 
| Traffic Class | 8 | Packet priority information | 
| Flow Label | 20 | Identifies packet flows | 
| Payload Length | 16 | Size of the data after the header | 
| Next Header | 8 | Type of the next protocol (e.g., TCP, UDP) | 
| Hop Limit | 8 | Like TTL in IPv4 | 
| Source Address | 128 | Sender’s IPv6 address | 
| Destination Address | 128 | Receiver’s IPv6 address | 
RIP vs. OSPF Routing Protocols
| Feature | RIP (Routing Information Protocol) | OSPF (Open Shortest Path First) | 
|---|
| Routing Type | Distance Vector | Link State | 
| Metric | Hop Count | Cost (bandwidth-based) | 
| Max Hop Count | 15 | No fixed limit | 
| Updates | Every 30 seconds | On change (event-driven) | 
| Speed | Slower | Faster | 
| Best for | Small/simple networks | Large/complex networks | 
TCP vs. UDP Comparison
| Aspect | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | 
|---|
| Connection Type | Connection-oriented (establishes a connection before data transfer) | Connectionless (no setup before sending data) | 
| Reliability | Reliable – ensures data is delivered correctly and in order | Unreliable – no guarantee of delivery or order | 
| Error Checking | Yes, with acknowledgment and retransmission | Yes, but no retransmission or acknowledgment | 
| Speed | Slower due to overhead from reliability features | Faster, with minimal overhead | 
| Data Transfer | Stream-based (continuous flow) | Message-based (sends discrete packets) | 
| Use Cases | Web browsing (HTTP/HTTPS), Email (SMTP), File transfer (FTP) | Streaming (video/audio), Online games, VoIP, DNS | 
| Header Size | Larger (20 bytes or more) | Smaller (8 bytes) | 
| Flow Control & Congestion Control | Yes | No | 
UDP Header Format and Structure
UDP is a simple, connectionless transport layer protocol used for fast, lightweight data transmission. It adds only minimal overhead by using a small 8-byte header.
UDP Header Structure (8 bytes total)
| Field | Size (bits) | Description | 
|---|
| Source Port | 16 | Port number of the sender | 
| Destination Port | 16 | Port number of the receiver | 
| Length | 16 | Total length of the UDP header and data | 
| Checksum | 16 | Error-checking for header and data | 
Explanation of UDP Fields
- Source Port: Identifies the port of the sending application. Optional in some cases.
 - Destination Port: Specifies the port of the receiving application.
 - Length: The length in bytes of the entire UDP packet (header + data). Minimum is 8 bytes.
 - Checksum: Ensures data integrity. If an error is found, the packet is discarded.
 
Types of Network Switching
Switching is the process of forwarding data packets between devices in a network. It determines how data travels from the source to the destination.
Switching Methods
- Circuit Switching: Establishes a dedicated path for the entire communication. Reliable but wastes bandwidth. Example: Traditional telephone calls.
 - Packet Switching: Data is broken into packets that travel independently. Efficient and flexible but can have delays. Example: The Internet.
 - Message Switching: The entire message is sent to each node, stored, then forwarded. No dedicated path, but slower due to storage delays. Example: Email systems (older method).
 
Circuit Switching vs. Packet Switching
| Aspect | Circuit Switching | Packet Switching | 
|---|
| Connection | Dedicated path established for the entire session | No dedicated path; data sent in packets independently | 
| Data Transfer | Continuous, real-time communication | Data broken into packets, sent separately | 
| Efficiency | Inefficient; bandwidth reserved even if idle | Efficient; bandwidth shared among users | 
| Delay | Low delay once the circuit is set up | Variable delay due to routing and congestion | 
| Example | Traditional telephone networks | Internet, LANs | 
| Reliability | High reliability during connection | Possible packet loss or delay | 
Datagram vs. Virtual Circuit Switching
| Aspect | Datagram Switching | Virtual Circuit Switching | 
|---|
| Path Setup | No prior path setup; each packet routed independently | Path is established before data transfer begins | 
| Packet Routing | Each packet may take a different route | All packets follow the same pre-established path | 
| Packet Numbering | Packets may arrive out of order | Packets arrive in order | 
| Connection Type | Connectionless | Connection-oriented | 
| Reliability | Less reliable; possible out-of-order or lost packets | More reliable due to fixed path and order | 
| Example | Internet Protocol (IP) | Frame Relay, ATM networks | 
TCP Header Format and Key Fields
TCP is a connection-oriented, reliable transport layer protocol. Its header is larger than UDP’s because it includes mechanisms for error checking, flow control, sequencing, and acknowledgment.
TCP Header Structure
| Field | Size (bits) | Description | 
|---|
| Source Port | 16 | Sender’s port number | 
| Destination Port | 16 | Receiver’s port number | 
| Sequence Number | 32 | Number of the first byte in the segment | 
| Acknowledgment Number | 32 | Next expected byte from sender | 
| Data Offset | 4 | Header length in 32-bit words | 
| Reserved | 3 | Reserved for future use | 
| Flags | 9 | Control bits (URG, ACK, PSH, RST, SYN, FIN) | 
| Window Size | 16 | Amount of data receiver can accept (Flow Control) | 
| Checksum | 16 | Error checking of the header and data | 
| Urgent Pointer | 16 | Indicates urgent data if URG flag is set | 
| Options + Padding | Variable | Optional features (e.g., MSS, timestamps) | 
Explanation of Key TCP Fields
- Sequence Number: Ensures data is received in order.
 - Acknowledgment Number: Confirms receipt of data.
 - Flags: Control connection state (e.g., SYN for start, FIN for end).
 - Window Size: Used for flow control, indicating buffer space available.
 - Checksum: Ensures data integrity.
 - Urgent Pointer: Points to urgent data (rarely used).
 
Steps of the RSA Algorithm
The RSA algorithm is a public-key cryptosystem widely used for secure data transmission.
- Choose two large prime numbers: p and q.
 - Compute the modulus: n = p × q.
 - Compute Euler’s totient function: φ(n) = (p − 1)(q − 1).
 - Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1 (usually e = 65537 for efficiency).
 - Compute the private key exponent d such that d × e ≡ 1 (mod φ(n)).
 - Public key: (e, n)
 - Private key: (d, n)
 
DNS: Working Process and Resolution
The Domain Name System (DNS) is like the phonebook of the internet. It translates human-readable domain names (e.g., www.example.com) into IP addresses (e.g., 93.184.216.34) that computers use to locate each other on a network.
DNS Working Process (Step-by-Step)
- Step 1 – Browser Cache: The browser first checks if it already knows the IP address from its cache.
 - Step 2 – OS Cache: If not found, the operating system checks its own DNS cache.
 - Step 3 – Recursive Resolver Query: Your computer sends the request to a recursive DNS resolver (usually provided by your ISP or a public DNS like Google 
8.8.8.8). - Step 4 – Root Server Query: If the resolver doesn’t know the IP, it asks a root DNS server for the location of the Top-Level Domain (TLD) server (e.g., 
.com). - Step 5 – TLD Server Query: The root server responds with the IP address of the appropriate TLD server.
 - Step 6 – Authoritative Name Server Query: The resolver asks the authoritative name server for 
www.example.com. The authoritative server returns the actual IP address. - Step 7 – Response to Client: The resolver sends the IP address back to your computer. Your browser then connects to that IP and loads the website.