Notes on Networking Protocols (TCP, UDP, DNS)
Introduction to Protocols in Networking
- Protocol: A set of rules that dictate how data should be transmitted between devices for communication.
- Significance: Helps prevent miscommunication and ensures data integrity during transmission.
- Examples of protocols: TCP (Transmission Control Protocol), UDP (User Datagram Protocol)
Types of Networking Protocols
- Network Access Layer:
- Ethernet: Wired connection protocol.
- DCP (Dynamic Configuration Protocol), ARP (Address Resolution Protocol), DHCP (Dynamic Host Configuration Protocol): Associated with internet packet transmission.
- Transport Layer:
- Handles the transmission of data packets. Focus on TCP and UDP.
- Application Layer:
- Examples include Telnet, SMTP (Simple Mail Transfer Protocol), POP3, FTP (File Transfer Protocol).
TCP Overview
- Three-Way Handshake Process:
- SYN (synchronize): Initiates the connection.
- SYN-ACK: Acknowledges receipt of SYN request.
- ACK: Confirms the connection establishment.
- Characteristics of TCP:
- Reliable: Guarantees the delivery of data packets without drops.
- Maintains sequence of packets to avoid data misarrangement.
- Uses flags for control:
- SYN: Initiates connection.
- ACK: Acknowledges received packets.
- PUSH: Forces buffered data to the receiving side.
- URG: Marks urgent data.
- FIN: Indicates the end of a connection.
- RST: Resets connection in case of errors.
UDP Overview
- Often misunderstood as connectionless; UDP does maintain a form of connection but lacks reliable delivery guarantees.
- Comparison to TCP:
- Faster but less reliable. Suitable for time-sensitive applications like video calls or gaming.
- Data packets may be dropped without acknowledgment, making it less secure.
- Use Cases:
- Video calls (e.g., Zoom, WhatsApp) often employ UDP due to the need for speed.
Common Misconceptions about UDP
- Misconception 1: UDP is only for wireless communication. In reality, UDP operates equally well in wired connections.
- Misconception 2: UDP is entirely connectionless. It's better described as lacking a guaranteed delivery mechanism.
Attacks and Hacking Protocols
- Understanding the vulnerabilities within TCP/UDP can inform how attacks can be structured.
- Focused Strategy: Start with TCP for secure data transfer followed by UDP for faster retrieval.
- Always remember both protocols can be exploited depending on their configuration and nature of attack.
Domain Name System (DNS)
- Facilitates human-friendly addresses corresponding to machine-readable IP addresses.
- DNS translates domain names into IP addresses via zone files which store records in a structured way.
- Important Records:
- A Record: Maps domain names to IP.
- DNS enumeration helps find vulnerabilities in the DNS setup.