[Notes] Computer Network - Layers and Protocols

发布于:2024-10-09 ⋅ 阅读:(112) ⋅ 点赞:(0)

1. Physical Layer

The Physical Layer is the bottom-most layer, dealing with the transmission of raw bits over a physical medium such as wires, fiber optics, or radio signals.

Responsibilities:

  • Defines hardware specifications (e.g., voltage levels, timing, data rates).
  • Concerned with the transmission of raw binary data (0s and 1s).
  • Converts digital data into signals (electrical, optical, or radio) that can be transmitted over the medium.

Examples of Physical Media:

  • Copper cables (Ethernet cables)
  • Fiber optic cables
  • Wireless communication (Wi-Fi, cellular networks)
  • Radio frequency (RF), Infrared, etc.

There are no specific protocols here, but rather standards like:

  • Ethernet (IEEE 802.3) for wired connections.
  • Wi-Fi (IEEE 802.11) for wireless connections.

2. Link Layer (Data Link Layer)

The Link Layer (also called the Data Link Layer) is responsible for managing communication between directly connected devices on the same local network. It ensures that data can be reliably transmitted over the physical link.

Responsibilities:

  • Framing: Breaks data into manageable units called frames.
  • Error Detection/Correction: Uses techniques like checksums and cyclic redundancy checks (CRC) to detect errors in the transmission.
  • Flow Control: Manages data flow to ensure that a sender does not overwhelm a receiver.
  • Medium Access Control (MAC): Determines how devices share access to the network medium. Each device on the network is assigned a unique MAC address.

Key Protocols:

  • Ethernet: The most widely used protocol for wired local area networks (LANs). It defines both physical and data link layer standards.
  • Wi-Fi (802.11): A protocol for wireless local area networks (WLANs).
  • PPP (Point-to-Point Protocol): Used in direct communication between two network nodes (e.g., over a phone line or fiber optic link).
  • ARP (Address Resolution Protocol): Maps an IP address to a MAC address.
  • HDLC (High-Level Data Link Control): Often used in WANs for point-to-point or point-to-multipoint communications.

3. Network Layer

The Network Layer is responsible for routing packets across multiple interconnected networks. It determines the best path for data to travel from the source to the destination. It also handles addressing and packet forwarding.

Responsibilities:

  • Logical Addressing: Assigns IP addresses to devices. An IP address is a logical identifier (e.g., 192.168.1.1).
  • Routing: Determines the best path for data to travel between networks. Routers operate at this layer.
  • Packet Forwarding: Forwards packets from one network to another, ensuring they reach the correct destination.
  • Fragmentation and Reassembly: If a packet is too large for a network, the Network Layer breaks it into smaller packets (fragments) and reassembles them at the destination.

Key Protocols:

  • IP (Internet Protocol): The fundamental protocol for sending data across multiple networks. It handles addressing and routing.
    • IPv4: The most widely used version of IP (192.168.1.1 format).
    • IPv6: The newer version of IP designed to overcome IPv4 address exhaustion (2001:0db8:85a3::8a2e:0370:7334 format).
  • ICMP (Internet Control Message Protocol): Used for diagnostics and error reporting. For example, the ping command uses ICMP to test connectivity.
  • IGMP (Internet Group Management Protocol): Manages multicast group memberships, which is useful for streaming media to multiple recipients.
  • Routing Protocols: These help routers learn the best routes for forwarding packets.
    • OSPF (Open Shortest Path First): A link-state routing protocol used within larger networks.
    • BGP (Border Gateway Protocol): The protocol that manages routing between autonomous systems (AS) on the Internet — essentially the “glue” of the Internet.
    • RIP (Routing Information Protocol): An older distance-vector routing protocol.

4. Transport Layer

The Transport Layer is responsible for providing end-to-end communication and ensuring that data is delivered reliably and in order. It manages flow control, error correction, and retransmission of lost data.

Responsibilities:

  • Segmentation and Reassembly: Breaks large data into smaller segments and reassembles them at the destination.
  • Connection Establishment: Sets up, maintains, and terminates connections between applications.
  • Error Detection and Recovery: Ensures that data is received correctly, with mechanisms for retransmitting lost or corrupted packets.
  • Flow Control: Manages the rate of data transmission to prevent the sender from overwhelming the receiver.

Key Protocols:

  • TCP (Transmission Control Protocol): Provides reliable, connection-oriented data transmission. It ensures that data is delivered in the correct order and without errors.

    • Three-way Handshake: TCP establishes a connection using a three-step process (SYN, SYN-ACK, ACK).
    • Reliable: TCP retransmits lost packets and ensures all data is received.
    • Use Cases: Web browsing (HTTP/HTTPS), email (SMTP), file transfers (FTP).
  • UDP (User Datagram Protocol): Provides connectionless, unreliable communication. It’s faster than TCP but does not guarantee that data will be delivered in the correct order or that errors will be corrected.

    • Use Cases: Real-time applications like video streaming, online gaming, and VoIP.
  • SCTP (Stream Control Transmission Protocol): A protocol that combines features of both TCP and UDP, providing reliable transmission of multiple streams of data simultaneously.


5. Application Layer

The Application Layer is the topmost layer and is where network applications and their protocols reside. This layer provides services directly to the user or applications and is responsible for handling communication between applications on different hosts.

Responsibilities:

  • User Interface: Interacts with software applications and provides network services to them.
  • Data Translation: Converts data from the application into a format suitable for transmission over the network.
  • Service Advertisement: Helps applications discover services on the network (e.g., DNS for domain name resolution).

Key Protocols:

  • HTTP (Hypertext Transfer Protocol): The protocol used by web browsers to request and retrieve web pages from a server.

    • HTTPS (HTTP Secure): Secured version of HTTP using SSL/TLS encryption for secure communication over the web.
  • FTP (File Transfer Protocol): Used for transferring files between a client and a server.

  • SMTP (Simple Mail Transfer Protocol): The standard protocol for sending emails.

  • DNS (Domain Name System): Translates human-friendly domain names (like www.example.com) into IP addresses that computers use to identify one another.

  • DHCP (Dynamic Host Configuration Protocol): Automatically assigns IP addresses to devices on a network.

  • SSH (Secure Shell): Provides secure, encrypted communication over an insecure network (often used for remote login to servers).

  • Telnet: A protocol for remote login, though it’s largely obsolete due to its lack of security.


Summary of the Layers and Protocols

Layer Function Key Protocols
Physical Layer Transfers raw bits over a physical medium Ethernet, Wi-Fi
Link Layer Connects devices on the same local network Ethernet, Wi-Fi, ARP, PPP
Network Layer Routes packets between networks IP (IPv4, IPv6), ICMP, IGMP, OSPF, BGP, RIP
Transport Layer End-to-end communication and error correction TCP, UDP, SCTP
Application Layer Provides network services to applications HTTP, HTTPS, FTP, SMTP, DNS, DHCP, SSH

网站公告

今日签到

点亮在社区的每一天
去签到