Understanding Networking and Protocols

Sep 21, 2024

Lecture Notes on Networking: Internet Protocol and Data Transmission

Introduction to Networking

  • Moving Truck Analogy: Moving a box using a moving truck is analogous to sending data over a network.
    • Network as the Road: Different types of networks (wireless, DSL, cable, Ethernet) serve as the roads.
    • Internet Protocol as the Truck: IP acts as the truck transporting data.
    • Data as the Box: Data is encapsulated in packets (boxes) within the IP (truck).

Data Encapsulation in Networking

  • Encapsulation allows various types of data to be moved across networks efficiently.
  • Data is placed inside a 'box' (packet), sent over the network, and unpacked at the destination.

Network Data Flow

  • Ethernet Frame: Data travels in Ethernet packets, which contain payloads and headers.
    • IP Header: Contains details about the IP packet.
    • TCP Data: Transmission Control Protocol data is within the IP packet.
    • HTTP Data: HTTP information is within the TCP payload.

Transport Layer Protocols

  • TCP (Transmission Control Protocol):

    • Connection-oriented.
    • Reliable delivery with acknowledgment and flow control.
    • Reorders messages and handles retransmission if needed.
  • UDP (User Datagram Protocol):

    • Connectionless.
    • Unreliable, no acknowledgment of receipt.
    • Often used for real-time communication (e.g., VoIP, DHCP).

Port Numbers and Multiplexing

  • Purpose of Port Numbers: Port numbers direct data to the correct application on the server.

    • Each service (e.g., HTTP, HTTPS, Mail) runs on specific ports.
    • Well-known ports (e.g., 80, 443, 25) are standardized for specific services.
  • Ephemeral Ports: Temporary ports used on the client for establishing connections.

    • Range: 1024 to 65535, assigned dynamically.

TCP vs UDP

  • TCP Features:

    • Reliable, connection-oriented, with error-checking.
    • Used for applications where data integrity is critical (e.g., HTTPS, SSH).
  • UDP Features:

    • Faster, less overhead, ideal for real-time applications.
    • Used when occasional loss of packets is acceptable (e.g., streaming, VoIP).

Security and Port Numbers

  • Port Scanning: Port numbers are not for security but for service identification.
    • Easily scanned; not secure by obscurity.

Networking Scenarios

  • Client-Server Communication:

    • Each device has a unique IP address.
    • Communication involves specific port numbers for different services.
  • Protocol and Port Number Examples:

    • HTTP uses TCP port 80, HTTPS uses TCP port 443.
    • Email might use TCP port 143.
  • Service Differentiation: TCP and UDP can use the same port numbers for different services, but itโ€™s not common practice.

Summary

  • IP as a Delivery Service: Moves data between IP addresses.
  • Port Numbers as Room Numbers: Direct data to specific services on a host.
  • Understanding Protocols: Critical for managing data flow and ensuring correct delivery on networks.