Networking and Protocols Lecture
Moving a Box Metaphor
- Moving Truck: Represents Internet Protocol (IP)
- Network Road: Represents the network (e.g., wireless, DSL, cable modem, Ethernet)
- Box: Encapsulates data being transported
Understanding Encapsulation
- Application Data: Placed inside a box
- IP Truck: Transports the box across the network
- Delivery: Box is unloaded and data extracted
Visual Representation: Network Flow
- Device: Workstation, client, laptop
- Server: Web server, mail server, etc.
Ethernet Frame Structure
- Ethernet Payload: Contains IP header and IP payload
- IP Payload: Contains TCP/UDP data, which can further contain other data like HTTP
- Encapsulation Order: Ethernet > IP > TCP > HTTP
IP Packet Breakdown
- TCP and UDP Protocols: Inside IP packets
- OSI Model: TCP/UDP operate at Transport Layer (Layer 4)
TCP (Transmission Control Protocol):
- Connection-Oriented: Formal setup and teardown of connections
- Reliable Delivery: Ensures data sent is received; can reorder messages; supports retransmission and flow control
UDP (User Datagram Protocol):
- Connectionless: No formal setup; just sends data
- Unreliable: No acknowledgment or receipt verification; suitable for real-time communication (e.g., VoIP)
TCP vs. UDP
TCP: Reliable Delivery
- Setup and teardown process
- Retransmission if data is lost
- Flow control to manage data rate
UDP: Fast, Unreliable Delivery
- Used for real-time communication
- No retransmission or flow control
Examples of Protocols
- TCP: HTTP(S), SSH
- UDP: DHCP, TFTP
IP Address and Port Numbers
- Unique IP Address: Like a unique house address
- Port Numbers: Indicate specific applications/services (e.g., HTTP on port 80, HTTPS on port 443)
- Multiplexing: Multiple services on same IP via different ports
Port Number Examples:
- HTTP: Port 80
- HTTPS: Port 443
- Mail: Port 25
- Time: Port 123
Client-Server Communication:
- Source Port: Temporary, chosen by client (ephemeral)
- Destination Port: Well-known, for specific service on server
Ephemeral vs. Non-Ephemeral Ports
- Non-Ephemeral: Permanent, well-known ports (0-1023)
- Ephemeral: Temporary, chosen for specific session (1024-65535)
Scenario Example:
- Client (IP: 10.0.0.1) communicates with Server (IP: 10.0.0.2)
- Different services (HTTP, VoIP, Email) use different source/destination ports
- Random source ports picked; use well-known destination ports on the server
Handling Multiple Services Simultaneously
- Server correctly routes traffic using IP address and port numbers