[Notes] Computer Network - Layers and Protocols

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

LayerFunctionKey Protocols
Physical LayerTransfers raw bits over a physical mediumEthernet, Wi-Fi
Link LayerConnects devices on the same local networkEthernet, Wi-Fi, ARP, PPP
Network LayerRoutes packets between networksIP (IPv4, IPv6), ICMP, IGMP, OSPF, BGP, RIP
Transport LayerEnd-to-end communication and error correctionTCP, UDP, SCTP
Application LayerProvides network services to applicationsHTTP, HTTPS, FTP, SMTP, DNS, DHCP, SSH
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值