Networking, Control Systems, DNS, and Cryptography Basics
IPv4 Header Structure
The IPv4 header is essential for routing packets across networks.
- Version: 4 bits (IP version 4)
- IHL: 4 bits (Header length in 32-bit words, min=5)
- TOS/DSCP: 8 bits (Type of service / QoS priority)
- Total Length: 16 bits (Header + Data, max 65535 bytes)
- Identification: 16 bits (Unique ID for fragmentation)
- Flags: 3 bits (DF: don’t fragment, MF: more fragments)
- Fragment Offset: 13 bits (Position of fragment in original datagram)
- TTL: 8 bits (Hop count limit; decremented at each router)
- Protocol: 8 bits (Upper layer: TCP=6, UDP=17, ICMP=1)
- Header Checksum: 16 bits (Error checking for header only)
- Source IP: 32 bits (Sender’s IP address)
- Destination IP: 32 bits (Receiver’s IP address)
- Options: Variable (Security, routing)
IPv6 Header Structure
IPv6 simplifies the header for more efficient processing.
- Version: 4 bits (IP version 6)
- Traffic Class: 8 bits (QoS / priority)
- Flow Label: 20 bits (Identifies packet flow for QoS)
- Payload Length: 16 bits (Length of data after header)
- Next Header: 8 bits (Type of next header)
- Hop Limit: 8 bits (Decremented at each router)
- Source Address: 128 bits
- Destination Address: 128 bits
Control Systems
Open Loop Control System
Definition: Output has no effect on input. No feedback is used.
Diagram: Input → [Controller] → [Plant] → Output
Examples: Toaster, Fan, Traffic light, Washing machine
Closed Loop Control System
Definition: Output is fed back and compared with input to minimize error.
Diagram: Input → (Σ) → [Controller] → [Plant] → Output; Feedback loop returns to (Σ).
Examples: AC, Thermostat, Cruise control, Refrigerator
DNS (Domain Name System)
DNS is the “Phone book of the Internet”, converting domain names (e.g., www.google.com) into IP addresses.
How DNS Works
- User types domain in browser.
- Query goes to DNS Resolver (ISP).
- Resolver asks Root Server for TLD server address.
- Resolver asks TLD Server for Authoritative Server.
- Resolver asks Authoritative Server for the actual IP.
- IP returned to browser; connection established.
Cryptography Basics
Cryptography secures information by converting it into an unreadable form.
- Symmetric Key: Uses the same key for encryption and decryption (e.g., AES, DES).
- Asymmetric Key: Uses a public key to encrypt and a private key to decrypt (e.g., RSA, ECC).
- Hash Function: One-way encryption with fixed-size output (e.g., MD5, SHA-256).
Subnetting Example (198.168.16.0/26)
To create 4 subnets from a /26 network:
- New Prefix: /28
- Hosts per Subnet: 14 usable
- Subnet Mask: 255.255.255.240
