Điều gì xảy ra khi bạn mở một website?
Từ lúc nhấn Enter đến khi trang web xuất hiện, điều gì đã xảy ra?
Bạn gõ https://example.com, nhấn Enter, và một lát sau trang web xuất hiện.
Nhưng giữa hai thời điểm đó, máy tính phải tìm đúng máy chủ, đưa dữ liệu qua nhiều mạng khác nhau, thiết lập kết nối an toàn, gửi yêu cầu và nhận kết quả.
Những việc này không do một hệ thống duy nhất điều khiển. DNS, router, TCP, TLS, HTTP và máy chủ phối hợp với nhau, mỗi thành phần giải quyết một vấn đề riêng.
Thử nhấn Enter để xem toàn bộ hành trình.
Example Domain
Trang này dùng làm ví dụ trong tài liệu.
Xem thêm…
Trang đã hiện ra
Một lần Enter: DNS tìm địa chỉ, router đưa gói tin ra Internet, TCP và TLS mở kết nối an toàn, HTTP lấy HTML, trình duyệt dựng trang.
URL → DNS → NAT → Internet → TCP → TLS → HTTP → HTML → trang
Từ tên miền tới máy chủ
Trước khi bạn nhấn Enter, laptop đã có sẵn ba thứ: địa chỉ IP của chính nó 192.168.1.23, cổng mặc định 192.168.1.1 và địa chỉ của DNS resolver. Thường là DHCP cấp cho nó lúc vào Wi-Fi. DHCP không chạy lại mỗi lần mở trang.
Nhấn Enter, trình duyệt tách URL thành giao thức HTTPS, tên máy example.com và tài nguyên /.
Nhưng Internet không chuyển gói tin theo tên. Nó cần địa chỉ IP.
DNS đổi tên đó thành địa chỉ, trong ví dụ là 93.184.216.34.
Địa chỉ này không thuộc mạng 192.168.1.0/24, nên laptop không gửi thẳng được. Nó giao gói tin cho router nhà, chính là cổng mặc định.
Router dùng NAT đổi địa chỉ riêng 192.168.1.23 thành địa chỉ công cộng 203.0.113.20, và ghi nhớ cách đổi ngược. Đây là cách thường gặp ở mạng gia đình dùng IPv4.
Từ đó gói tin vào mạng của ISP, rồi đi qua nhiều mạng độc lập khác. Mỗi router chỉ chọn chặng kế tiếp, cho tới khi gói tới máy chủ, hoặc tới một máy CDN đứng trước máy chủ.
Các địa chỉ trong bài và trong mô phỏng đều là địa chỉ minh hoạ, không phải địa chỉ thật của website.
Từ kết nối tới phản hồi HTTP
Tìm được máy chủ rồi, trình duyệt vẫn chưa gửi yêu cầu.
Trước hết hai bên bắt tay ba bước TCP: SYN, SYN-ACK, ACK. Trong ví dụ này trang chạy HTTP/2 trên TCP, nên TCP lo cho trình duyệt một luồng byte tin cậy. Với HTTP/3, việc đó do QUIC chạy trên UDP đảm nhận.
Sau đó TLS kiểm tra chứng chỉ của máy chủ, rồi hai bên cùng tạo khoá phiên. Từ đây router trên đường vẫn thấy gói tin đi qua, nhưng không đọc được nội dung bên trong.
Giờ trình duyệt mới gửi yêu cầu HTTP đầu tiên: GET /.
Nếu yêu cầu tới một CDN, CDN xem mình đã có bản sao chưa. Chưa có (cache miss) thì nó hỏi máy chủ gốc. Máy chủ gốc trả HTML, CDN chuyển về.
Phản hồi đi ngược qua Internet tới router nhà. Bảng NAT cho router biết phải chuyển nó cho thiết bị nào.
Trình duyệt đọc HTML ngay khi những byte đầu tiên tới. Nó thấy trang cần thêm CSS, JavaScript và ảnh, và tải chúng trên kết nối đang có. Chữ, bố cục, màu rồi ảnh lần lượt hiện ra.
Vì sao lần mở sau thường nhanh hơn?
Không phải lần mở website nào cũng chạy đủ các bước trên.
Lần sau, địa chỉ của example.com có thể còn trong cache DNS. Kết nối TCP và TLS có thể vẫn mở, nên không phải bắt tay lại. CDN có thể đã giữ bản sao, nên không phải hỏi máy chủ gốc. CSS, JavaScript và ảnh có thể đã nằm trong cache của trình duyệt.
Chọn Lần sau trong mô phỏng để so với lần đầu.
Cache không làm đường truyền nhanh hơn. Nó giúp bỏ qua những việc hệ thống đã làm xong.
Không ai điều khiển cả hành trình
Trong cả lần mở trang đó, không có máy nào nắm toàn bộ hành trình.
DNS tìm địa chỉ.
Router chọn chặng kế tiếp.
TCP hoặc QUIC vận chuyển dữ liệu.
TLS bảo vệ dữ liệu.
HTTP diễn đạt yêu cầu và phản hồi.
Máy chủ trả nội dung.
Trình duyệt dựng trang.
Mỗi phần có thể do một tổ chức khác làm ra và vận hành: nhà mạng của bạn, các nhà mạng quốc tế, công ty CDN, chủ website, hãng làm trình duyệt. Họ không cần biết nhau. Họ chỉ cần nói cùng những giao thức chung.
Vì vậy một lần nhấn Enter đi qua được thiết bị của nhiều tổ chức không chung một chủ, và trang vẫn hiện ra.
Nguồn tham khảo
- RFC 9293 — Transmission Control Protocol (TCP) · IETF
- RFC 5681 — TCP Congestion Control · IETF
- RFC 6298 — Computing TCP's Retransmission Timer · IETF
- RFC 2018 — TCP Selective Acknowledgment Options · IETF
- RFC 3168 — The Addition of Explicit Congestion Notification (ECN) to IP · IETF
- RFC 768 — User Datagram Protocol · IETF
- RFC 9000 — QUIC: A UDP-Based Multiplexed and Secure Transport · IETF
- RFC 9114 — HTTP/3 · IETF
- RFC 9110 — HTTP Semantics · IETF
- RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3 · IETF
- RFC 9112 — HTTP/1.1 · IETF
- RFC 9113 — HTTP/2 · IETF
- RFC 7541 — HPACK: Header Compression for HTTP/2 · IETF
- RFC 9001 — Using TLS to Secure QUIC · IETF
- RFC 9002 — QUIC Loss Detection and Congestion Control · IETF
- RFC 5280 — Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile · IETF
- RFC 9525 — Service Identity in TLS · IETF
- RFC 9849 — TLS Encrypted Client Hello · IETF
- RFC 7568 — Deprecating Secure Sockets Layer Version 3.0 · IETF
- Let's Encrypt — Chains of Trust · Let's Encrypt
- RFC 1034 — Domain Names: Concepts and Facilities · IETF
- RFC 2131 — Dynamic Host Configuration Protocol · IETF
- RFC 1918 — Address Allocation for Private Internets · IETF
- RFC 1122 — Requirements for Internet Hosts: Communication Layers · IETF
- RFC 1812 — Requirements for IP Version 4 Routers · IETF
- RFC 791 — Internet Protocol · IETF
- RFC 826 — An Ethernet Address Resolution Protocol · IETF
- RFC 2003 — IP Encapsulation within IP · IETF
- Vì sao mạng chậm mà VPN lại nhanh · Znews
- RFC 4271 — A Border Gateway Protocol 4 (BGP-4) · IETF
- RFC 1930 — Guidelines for creation, selection, and registration of an Autonomous System · IETF
- RFC 6335 — IANA Procedures for Service Name and Transport Protocol Port Number Registry · IETF
- RFC 3022 — Traditional IP Network Address Translator (Traditional NAT) · IETF
- RFC 8200 — Internet Protocol, Version 6 (IPv6) Specification · IETF
- RFC 7094 — Architectural Considerations of IP Anycast · IETF
- RFC 20 — ASCII format for network interchange · IETF
- RFC 3629 — UTF-8, a transformation format of ISO 10646 · IETF
- RFC 8085 — UDP Usage Guidelines · IETF
- Root Server Technical Operations Association · Root Server System
- Revisiting Comparative Performance of DNS Resolvers in the IPv6 and ECS Era · Case Western Reserve University (arXiv)
- Performance Benefits · Google Public DNS
- Root Servers · IANA
- Gigabit Ethernet over Category 5 (IEEE 802.3ab tutorial) · IEEE 802.3 Working Group
- Guidelines for Use of Extended Unique Identifier (EUI), OUI · IEEE Registration Authority
- An Introduction to Computer Networks (Peter L. Dordal) · Loyola University Chicago
- Brief History of the Internet · Internet Society
- Paul Baran and the Origins of the Internet · RAND Corporation
- How browsers work · MDN Web Docs
- NIST SP 800-41 Rev. 1 — Guidelines on Firewalls and Firewall Policy · NIST
- Wireless RF Reference Guide (suy hao qua vật liệu) · Cisco
- FCC Opens 6 GHz Band to Wi-Fi and Other Unlicensed Uses (23/04/2020) · FCC
- OET Bulletin 70 — Millimeter Wave Propagation: Spectrum Management Implications (1997) · FCC
- Introduction to DWDM Technology · Cisco
- Digital communications — 2.2 Fibre types · The Open University (OpenLearn)
- Optical Fiber · The Fiber Optic Association
- Fiber Optic Wavelengths · The Fiber Optic Association
- PAM4 for 400G Optical Interfaces and Beyond (Part 1) · Cisco Blogs, 10/05/2018
- Submarine Cable FAQs · TeleGeography
- Submarine Cable Map (dữ liệu tuyến cáp Việt Nam) · TeleGeography
- Using submarine cables for climate monitoring and disaster warning: Engineering feasibility study · ITU-T, 07/2012
- About Submarine Telecommunications Cables · International Cable Protection Committee, 10/2011
- The FOA Reference For Fiber Optics - Telecommunication Networks · The Fiber Optic Association
- The Optical Submarine Repeater and Its Associated Technologies · NEC Technical Journal Vol.5 No.1, 2010
- Solar storms and submarine internet cables · Castellanos et al., Google LLC (arXiv:2211.07850), 11/2022
- Review of Submarine Cable Landing License Rules and Procedures (FCC 24-119), Technical Appendix · Federal Communications Commission, 22/11/2024
- Technology introduction — Optical Submarine Cable Repair Method · KDDI Cableships & Subsea Engineering
- Types of orbits · European Space Agency
- FCC 21-48 — SpaceX Starlink modification order (độ cao quỹ đạo) · Federal Communications Commission
- RFC 3135 — Performance Enhancing Proxies Intended to Mitigate Link-Related Degradations (§5.1.1) · IETF
- SpaceX STA Application 0983-EX-ST-2021 — Narrative Description (Starlink terminals) · Federal Communications Commission
- Improving Starlink's Latency · SpaceX, 03/2024
- Starlink nearing full FCC broadband compliance: Ookla report (Speedtest, nửa cuối 2025) · Telecompetitor, 08/05/2026
- Internet connection speed recommendations · Netflix Help Center
- Achieving 99% link uptime on a fleet of 100G space laser inter-satellite links in LEO (Travis Brashears, SpaceX) · SPIE Photonics West, 30/01/2024
- Gói Home Internet — cáp quang WiFi · VNPT
- FCC DA 26-113 — SpaceX Orbital Data Center System, accepted for filing (liên kết laser giữa vệ tinh) · Federal Communications Commission
- Phishing and Malware (certificate không bảo chứng website) · Let's Encrypt
- CDN reference architecture · Cloudflare Docs
- traceroute(8) — Linux manual page · man7.org
- Vietnam National Internet eXchange (VNIX) · Trung tâm Internet Việt Nam (VNNIC)
- IPv6 Adoption statistics · Google
- Wi-Fi CERTIFIED 6 · Wi-Fi Alliance
- CIDR Report — AS Summary · APNIC (Geoff Huston)
- An Internet Pioneer Ponders the Next Revolution (phỏng vấn Robert Taylor) · The New York Times
- Internet History of 1960s · Computer History Museum
- Internet History of 1970s · Computer History Museum
- The Day the Infant Internet Uttered its First Words · Leonard Kleinrock, UCLA
- Internet Việt Nam: 25 năm phát triển và những bước tiến vượt bậc · VietnamPlus (TTXVN)
- 25 năm phát triển Internet Việt Nam · VnExpress
- Người "mang" Internet vào Việt Nam · Công an Nhân dân
- Revolution: Connecting Over Phone Lines · Computer History Museum
- Teletype Model 33ASR (catalog X1557.98) · Computer History Museum
- On Distributed Communications: I. Introduction to Distributed Communications Networks (RM-3420, 1964) · RAND Corporation
- Packet Switching: The first steps on the road to the information society · National Physical Laboratory
- Computer Pioneers: Donald W. Davies · IEEE Computer Society
- May 22: Xerox Researcher Proposes "Ethernet" · Computer History Museum
- IEEE Milestone: Ethernet Local Area Network (LAN), 1973-1985 · IEEE History Center (ETHW)
- IEEE Milestone: Demonstration of the ALOHA Packet Radio Data Network, 1971 · IEEE History Center (ETHW)
- An Introduction to Computer Networks — 2 Ethernet (Peter L. Dordal) · Loyola University Chicago
- Cisco to Acquire Kalpana, Leading Ethernet Switching Company · Cisco
- A Protocol for Packet Network Intercommunication (Cerf & Kahn, IEEE Trans. Comm., 5/1974) · IEEE (bản in lại tại Princeton University)
- Internetworking (1977) · SRI International
- RFC 951 — Bootstrap Protocol (BOOTP) · IETF
- RFC 1531 — Dynamic Host Configuration Protocol · IETF
- RFC 5227 — IPv4 Address Conflict Detection · IETF
- Internet History of 1980s · Computer History Museum
- Interface Message Processor (IMP) Honeywell 516 — X105.82 · Computer History Museum
- Internet architect Leonard Kleinrock receives UCLA Medal · UCLA Newsroom
- The Design Philosophy of the DARPA Internet Protocols (David D. Clark, SIGCOMM '88) · ACM SIGCOMM
- Birth of the Commercial Internet · U.S. National Science Foundation
- Retiring the NSFNET Backbone Service: Chronicling the End of an Era · Merit Network
- Hành trình từ Internet đến kinh tế Internet và kinh tế số · Bộ Khoa học và Công nghệ
- Nạn độc quyền Internet ở Việt Nam (2001) · VnExpress
- Lịch sử và những mốc son phát triển Internet Việt Nam · Hiệp hội Internet Việt Nam (VIA)
- RFC 1058 — Routing Information Protocol · IETF
- RFC 1105 — A Border Gateway Protocol (BGP) · IETF
- The Two-Napkin Protocol · Computer History Museum
- More details about the October 4 outage · Engineering at Meta
- Understanding how Facebook disappeared from the Internet · Cloudflare
- RFC 608 — Host Names On-Line · IETF
- RFC 952 — DoD Internet Host Table Specification · IETF
- RFC 882 — Domain Names: Concepts and Facilities · IETF
- RFC 883 — Domain Names: Implementation and Specification · IETF
- ISI Timeline · USC Information Sciences Institute
- End-to-End Arguments in System Design (Saltzer, Reed, Clark, 1984) · ACM / MIT
- IEN 2 — Comments on Internet Protocol and TCP (Jon Postel, 1977) · RFC Editor
- TCP Split into TCP/IP · IEEE Communications Society
- Oral History of Danny Cohen · Computer History Museum
- Oral History of Vinton (Vint) Cerf · Computer History Museum
- Experimenting with QUIC · Chromium Blog (Google)
- RFC 349 — Proposed Standard Socket Numbers · IETF
- RFC 1700 — Assigned Numbers · IETF
- RFC 2468 — I Remember IANA · IETF
- Information Management: A Proposal (Tim Berners-Lee, CERN, 1989) · W3C
- The birth of the Web · CERN
- A short history of the Web · CERN
- 30 years of a free and open Web · CERN
- The Original HTTP as defined in 1991 · W3C
- RFC 6176 — Prohibiting Secure Sockets Layer (SSL) Version 2.0 · IETF
- RFC 6101 — The Secure Sockets Layer (SSL) Protocol Version 3.0 · IETF
- Firesheep (Eric Butler, 24/10/2010) · codebutler.com
- Leaving Beta, New Sponsors (12/4/2016) · Let's Encrypt
- A secure web is here to stay (8/2/2018) · Chromium Blog
- IEEE Milestone: ALOHAnet, 1971 · IEEE / ETHW
- FCC 02-328 — Additional Spectrum for Unlicensed Devices (Notice of Inquiry, 2002) · FCC
- Early Civil Spread Spectrum History (Michael Marcus) · Marcus Spectrum Solutions
- Wireless LAN 802.11 Wi-Fi · IEEE History Center / ETHW
- History · Wi-Fi Alliance
- The Nobel Prize in Physics 2009 — Press release · NobelPrize.org
- The Nobel Prize in Physics 2009 — Popular information · NobelPrize.org
- How Charles Kao Beat Bell Labs to the Fiber-Optic Revolution (Jeff Hecht) · IEEE Spectrum
- IEEE Milestone: World's First Low-Loss Optical Fiber for Telecommunications, 1970 · IEEE / ETHW
- IEEE Milestone: Landing of the Transatlantic Cable, 1866 · IEEE / ETHW
- 5 tuyến cáp quang biển đứt gần nửa năm chưa sửa xong (16/4/2023) · VnExpress
- Kết nối Internet quốc tế hết nghẽn từ đêm 10/2 (10/2/2023) · VnExpress
- Tuyến cáp biển thứ 5 gặp sự cố, người dùng Internet bị ảnh hưởng như thế nào? (21/2/2023) · Thanh Niên
- Google server assembly (catalog 102662167) · Computer History Museum
- Google "Corkboard" Server, 1999 · Smithsonian National Museum of American History
- Web Search for a Planet: The Google Cluster Architecture (IEEE Micro, 2003) · Google Research
- About Equinix · Equinix
- W3C Recommendations Reduce "World Wide Wait" (1999) · W3C
- Managing Flash Crowds on the Internet (MASCOTS 2003) · UC Santa Cruz
- Company History · Akamai
- RFC 790: Assigned Numbers · IETF / RFC Editor (J. Postel), 1981
- RFC 1166: Internet Numbers · IETF / RFC Editor, 1990
- IANA IPv4 Address Space Registry · IANA
- RFC 1380: IESG Deliberations on Routing and Addressing · IETF / RFC Editor, 1992
- RFC 1519: Classless Inter-Domain Routing (CIDR) · IETF / RFC Editor, 1993
- RFC 4632 — Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan · IETF / RFC Editor, 2006
- RFC 1631: The IP Network Address Translator (NAT) · IETF / RFC Editor, 1994
- RFC 1752: The Recommendation for the IP Next Generation Protocol · IETF / RFC Editor, 1995
- RFC 2460: Internet Protocol, Version 6 (IPv6) Specification · IETF / RFC Editor, 1998
- RFC 4213: Basic Transition Mechanisms for IPv6 Hosts and Routers · IETF / RFC Editor, 2005
- RFC 2993: Architectural Implications of NAT · IETF / RFC Editor, 2000
- RFC 6888: Common Requirements for Carrier-Grade NATs (CGNs) · IETF / RFC Editor, 2013
- Morris Worm · FBI (bản lưu Wayback Machine)
- RFC 1135: The Helminthiasis of the Internet · IETF / RFC Editor, 1989
- Simple and Flexible Datagram Access Controls for Unix-based Gateways (WRL Research Report 89/4) · Digital Equipment Corporation, Western Research Laboratory, 1989 (bản lưu Wayback của HP Labs)
- Congestion Avoidance and Control · Van Jacobson & Michael J. Karels, Lawrence Berkeley Laboratory, 1988
- Bufferbloat: Dark Buffers in the Internet · ACM Queue, 2011 (bản lưu Wayback)
- The Story of the PING Program · Mike Muuss, U.S. Army Research Laboratory
- traceroute (mã nguồn và trang man, LBL) · Lawrence Berkeley National Laboratory, Network Research Group
- Load Balancing at the Frontend (Site Reliability Engineering, chương 19) · Google
- Policy Brief: Internet Exchange Points (IXPs) · Internet Society
- Autonomous System (AS) Numbers · IANA
- RFC 792: Internet Control Message Protocol · IETF / RFC Editor (J. Postel), 1981
- Free Pool of IPv4 Address Space Depleted · Number Resource Organization (NRO), 03/02/2011
- APNIC IPv4 Address Pool Reaches Final /8 · APNIC, 15/04/2011