09 · Networks
09 · เครือข่าย
This chapter is the floor that dissolves the boundary of the single machine — everything above it can address something that is not itself.
ชั้นนี้ละลายขอบเขตของเครื่องเดี่ยวทิ้ง — ทุกอย่างที่อยู่เหนือขึ้นไปอ้างถึงสิ่งที่ไม่ใช่ตัวมันเองได้
How do machines that share nothing agree to talk?
เครื่องที่ไม่มีอะไรร่วมกันเลย ตกลงกันจนคุยกันได้อย่างไร
In October 1986, two sites four hundred yards apart stopped being able to talk to each other. Van Jacobson recorded the numbers: between Lawrence Berkeley Laboratory and the University of California at Berkeley — "separated by 400 yards and two IMP hops" — throughput fell from 32 Kbps to 40 bps (Jacobson & Karels, SIGCOMM '88). A factor of a thousand, across a distance a person could walk in four minutes. Nothing had broken. No cable was cut, no machine had failed, no attacker was present. The network had simply become so busy retransmitting the packets it was already failing to deliver that it left no room to deliver anything. It had eaten itself, and it would do so repeatedly for the next two years.
ในเดือนตุลาคม 1986 สองสถานที่ที่ห่างกันสี่ร้อยหลาคุยกันไม่ได้อีกต่อไป Van Jacobson บันทึกตัวเลขไว้: ระหว่าง Lawrence Berkeley Laboratory กับ University of California ที่ Berkeley — "ห่างกัน 400 หลา และสองช่วง IMP hop" ("separated by 400 yards and two IMP hops") — ปริมาณงานต่อเวลา (throughput) ตกจาก 32 Kbps เหลือ 40 bps (Jacobson & Karels, SIGCOMM '88) ต่างกันพันเท่า บนระยะที่คนเดินถึงในสี่นาที ไม่มีอะไรพัง ไม่มีสายถูกตัด ไม่มีเครื่องล่ม ไม่มีผู้โจมตี เครือข่ายแค่ยุ่งกับการส่งซ้ำ (retransmission) แพ็กเก็ต (packet) ที่มันส่งไม่สำเร็จอยู่แล้ว จนไม่เหลือที่ว่างให้ส่งอะไรได้อีก มันกินตัวเอง และจะกินตัวเองซ้ำไปอีกสองปี
That episode is the best introduction to this floor, because it shows what kind of thing a network is. Not a wire. An agreement — with no authority to enforce it.
เหตุการณ์นั้นคือบทนำที่ดีที่สุดของชั้นนี้ เพราะมันบอกว่าเครือข่าย (network) เป็นของแบบไหน ไม่ใช่สายไฟ แต่เป็นข้อตกลง — ที่ไม่มีอำนาจใดบังคับให้ทำตาม
The agreement starts with a decision made twice, independently, in the early 1960s. The telephone system worked by circuit switching: reserve a path end to end, hold it for the duration, and the conversation gets a private wire. Paul Baran at RAND, designing a communications system that could survive the loss of much of itself, proposed instead that messages be chopped into standard blocks that each find their own way and be reassembled at the far end (On Distributed Communications, RM-3420-PR, 1964). Donald Davies, at Britain's National Physical Laboratory, arrived at the same design for a different reason — computer traffic is bursty, and a reserved circuit sits idle most of the time — and gave the blocks the name that stuck: packets. Packet switching trades a guarantee for a statistic: no conversation is promised a path, all conversations share all paths, and they share well precisely because none talks continuously. The first message on the resulting ARPANET went from UCLA toward Stanford Research Institute on 29 October 1969; the operator typed the first two letters of "LOGIN" and the far end crashed (Kleinrock's account).
ข้อตกลงนี้เริ่มจากการตัดสินใจที่เกิดขึ้นสองครั้งแยกจากกัน ในช่วงต้นทศวรรษ 1960 ระบบโทรศัพท์ทำงานด้วย circuit switching: จองเส้นทางไว้ทั้งสาย ยึดไว้ตลอดการสนทนา บทสนทนาก็ได้สายส่วนตัวไปใช้ Paul Baran ที่ RAND กำลังออกแบบระบบสื่อสารที่รอดได้แม้ตัวมันเองจะถูกทำลายไปเป็นส่วนใหญ่ เขาเสนอตรงข้าม: สับข้อความเป็นก้อนมาตรฐาน ให้แต่ละก้อนหาทางไปเอง แล้วประกอบกลับที่ปลายทาง (On Distributed Communications, RM-3420-PR, 1964) Donald Davies ที่ National Physical Laboratory ของอังกฤษ มาถึงแบบเดียวกันด้วยเหตุผลคนละอย่าง — ทราฟฟิกของคอมพิวเตอร์มาเป็นห้วงๆ (bursty) และวงจรที่จองไว้ก็ว่างเปล่าเกือบตลอดเวลา — และเขาคือคนตั้งชื่อก้อนพวกนี้จนติดปากมาถึงทุกวันนี้ว่า แพ็กเก็ต (packet) packet switching แลกการรับประกันด้วยค่าสถิติ: ไม่มีบทสนทนาไหนได้รับสัญญาว่าจะมีเส้นทาง ทุกบทสนทนาใช้ทุกเส้นทางร่วมกัน และใช้ร่วมกันได้ดีเพราะไม่มีใครพูดต่อเนื่องตลอดเวลา ข้อความแรกบน ARPANET ที่โตขึ้นมาจากทั้งหมดนี้ ถูกส่งจาก UCLA ไปยัง Stanford Research Institute เมื่อวันที่ 29 ตุลาคม 1969 ผู้ควบคุมพิมพ์อักษรสองตัวแรกของ "LOGIN" ปลายทางก็ล่ม (Kleinrock's account)
The second structural decision is layering — the tower recapitulated inside one chapter. Each layer takes a job from above, does one part of it, and hands the rest down, knowing nothing of the implementation beneath. The formal version is the seven-layer OSI Basic Reference Model, standardized in 1984 (ISO/IEC 7498-1); the version the world runs is smaller and messier, four layers written down after the fact in RFC 1122 (1989). Keep that embarrassment in mind: the model designed by committee is the one taught in courses, and the model grown by implementers is the one carrying this sentence to you.
การตัดสินใจเชิงโครงสร้างข้อที่สองคือ การแบ่งชั้น (layering) — หอคอย (tower) ทั้งใบย่อลงมาอยู่ในบทเดียว แต่ละชั้นรับงานจากชั้นบน ทำแค่ส่วนของตัวเอง ส่งที่เหลือลงข้างล่าง โดยไม่รู้อะไรเลยเกี่ยวกับการ implement ที่อยู่ข้างใต้ เวอร์ชันทางการคือ OSI Basic Reference Model เจ็ดชั้น เป็นมาตรฐานในปี 1984 (ISO/IEC 7498-1) เวอร์ชันที่โลกจริงใช้อยู่เล็กกว่าและรกกว่า มีสี่ชั้น เขียนขึ้นหลังจากมันเกิดขึ้นจริงไปแล้วใน RFC 1122 (1989) จำความน่าอายนี้ไว้ให้ดี: โมเดลที่คณะกรรมการออกแบบคือโมเดลที่ถูกสอนในห้องเรียน โมเดลที่งอกขึ้นจากมือคนที่ implement จริงคือตัวที่กำลังพาประโยคนี้มาถึงคุณ
What makes the grown one work is the shape of its middle. The Internet Protocol offers almost nothing: it will attempt to deliver a packet toward an address, and it may drop it, duplicate it, delay it, or deliver it out of order without apology. Every network technology beneath can be different — fiber, radio, satellite, copper — and every application above can be different, and they meet at one deliberately impoverished layer. The principle behind that poverty was named by Jerome Saltzer, David Reed and David Clark: a function "can completely and correctly be implemented only with the knowledge and help of the application standing at the end points … providing that questioned function as a feature of the communication system itself is not possible" (end-to-end arguments, 1981/1984). Put the intelligence at the edges. A network that tried to guarantee delivery would still not spare an application from checking, and would tax every application that did not care.
สิ่งที่ทำให้เวอร์ชันที่งอกขึ้นมาใช้งานได้คือรูปทรงของส่วนกลาง Internet Protocol ให้อะไรแทบไม่ได้เลย: มันจะพยายามส่งแพ็กเก็ตไปยังที่อยู่หนึ่ง และมันอาจทำหาย ทำซ้ำ หน่วงเวลา หรือส่งถึงผิดลำดับ โดยไม่ขอโทษใคร เทคโนโลยีเครือข่ายข้างล่างต่างกันได้หมด — ไฟเบอร์ วิทยุ ดาวเทียม สายทองแดง — แอปพลิเคชันข้างบนก็ต่างกันได้หมด ทั้งสองฝั่งมาเจอกันที่ชั้นเดียวที่จนใจโดยตั้งใจ Jerome Saltzer, David Reed และ David Clark ตั้งชื่อหลักการเบื้องหลังความจนใจนั้น: ฟังก์ชันหนึ่งจะถูก implement ได้อย่างสมบูรณ์และถูกต้องก็ต่อเมื่อมีความรู้และความช่วยเหลือจากแอปพลิเคชันที่ยืนอยู่ที่จุดปลายทางทั้งสองฝั่งเท่านั้น การทำให้ฟังก์ชันที่ถูกตั้งคำถามนั้นเป็นฟีเจอร์ของระบบสื่อสารเองจึงเป็นไปไม่ได้ (end-to-end arguments, 1981/1984) วางความฉลาดไว้ที่ขอบ เครือข่ายที่พยายามรับประกันการส่งถึงก็ยังไม่ปลดแอปพลิเคชันจากการต้องตรวจสอบเองอยู่ดี แถมเก็บภาษีจากทุกแอปพลิเคชันที่ไม่สนใจเรื่องนี้ด้วย
So reliability is built on top of unreliability, by the endpoints, and that is TCP. Vint Cerf and Robert Kahn's 1974 design (IEEE Trans. Comm. COM-22(5): 637–648) numbers every byte, acknowledges what arrives, and retransmits what does not, manufacturing an ordered, gap-free stream out of a medium that promises none of those things. The ARPANET switched over to it wholesale on 1 January 1983, a date fixed two years in advance in RFC 801 — the last time the network was small enough to be changed on a single day.
ความน่าเชื่อถือจึงถูกสร้าง ซ้อนทับ ความไม่น่าเชื่อถือ โดยจุดปลายทางทั้งสองฝั่ง และนั่นคือ TCP การออกแบบของ Vint Cerf กับ Robert Kahn ในปี 1974 (IEEE Trans. Comm. COM-22(5): 637–648) ใส่หมายเลขให้ทุกไบต์ ยืนยันสิ่งที่มาถึง ส่งซ้ำสิ่งที่ไม่มาถึง ปั้นสตรีมที่เรียงลำดับและไม่มีช่องว่างขึ้นจากตัวกลางที่ไม่สัญญาสักอย่างเดียวในนั้น ARPANET เปลี่ยนมาใช้มันทั้งระบบในวันที่ 1 มกราคม 1983 วันที่กำหนดไว้ล่วงหน้าสองปีใน RFC 801 — ครั้งสุดท้ายที่เครือข่ายยังเล็กพอจะเปลี่ยนได้ในวันเดียว
Which returns us to 1986, because retransmission is exactly the behavior that ate the network. A sender that responds to congestion by trying harder makes congestion worse; ten thousand senders doing so collapse the commons. There is no central regulator to prevent it — no one owns the internet, and no one can be told to slow down. Jacobson's fix, which is still in the bones of every connection you make, was to have each sender infer the state of the whole from what it can see locally: treat a lost packet as evidence of congestion, cut your sending rate sharply, then probe upward again gently. Congestion control is voluntary restraint by parties who cannot see each other, and it holds because the alternative is that nobody gets anything. It is the most consequential piece of distributed politeness ever deployed.
เรากลับมาที่ปี 1986 ได้ตรงนี้ เพราะการส่งซ้ำ (retransmission) คือพฤติกรรมที่กินเครือข่ายไปนั่นเอง ผู้ส่งที่ตอบสนองต่อความแออัด (congestion) ด้วยการพยายามหนักขึ้น ทำให้ความแออัดแย่ลง ผู้ส่งหนึ่งหมื่นรายทำแบบนั้นพร้อมกันก็พังทรัพยากรส่วนรวมทั้งผืน ไม่มีหน่วยงานกลางไหนห้ามได้ — ไม่มีใครเป็นเจ้าของอินเทอร์เน็ต และไม่มีใครถูกสั่งให้ช้าลงได้ ทางแก้ของ Jacobson ยังฝังอยู่ในกระดูกของทุกการเชื่อมต่อที่คุณสร้างทุกวันนี้: ให้ผู้ส่งแต่ละรายอนุมานสถานะ (state) ของทั้งระบบจากสิ่งที่ตัวเองมองเห็นในพื้นที่ มองแพ็กเก็ตที่หายไปเป็นหลักฐานของความแออัด ตัดอัตราการส่งลงอย่างแรง ค่อยๆ ไต่ขึ้นใหม่อย่างนุ่มนวล congestion control คือการยับยั้งชั่งใจโดยสมัครใจของฝ่ายที่มองไม่เห็นกันและกัน และมันอยู่ได้เพราะทางเลือกอื่นคือไม่มีใครได้อะไรเลย มันคือชิ้นส่วนของความสุภาพแบบกระจายศูนย์ที่ส่งผลสำคัญที่สุดเท่าที่เคยถูกนำไปใช้จริง
The same structure — no authority, only agreement — governs how things are found. The Domain Name System, specified by Paul Mockapetris in 1983 and refined in RFCs 1034 and 1035 (1987), turns names into addresses by delegation: each zone is trusted to answer for the names beneath it. Routing between networks runs on BGP (RFC 4271), in which each network announces which addresses it can reach and its neighbors believe it. On 24 February 2008, Pakistan Telecom, complying with an order to block YouTube domestically, announced a route to a slice of YouTube's addresses more specific than YouTube's own — and because more specific wins, and because its upstream provider passed the claim on, the world's traffic to YouTube went to Pakistan for roughly two hours (RIPE NCC). Nothing was hacked. The system worked as designed, and the design assumes honesty.
โครงสร้างเดียวกัน — ไม่มีอำนาจ มีแต่ข้อตกลง — คุมว่าจะหาของเจอได้อย่างไร Domain Name System ที่ Paul Mockapetris เขียนสเปกไว้ในปี 1983 และปรับปรุงใน RFCs 1034 และ 1035 (1987) แปลงชื่อเป็นที่อยู่ด้วยการมอบอำนาจ (delegation): แต่ละโซนได้รับความไว้ใจให้ตอบแทนชื่อที่อยู่ใต้มัน การจัดเส้นทาง (routing) ระหว่างเครือข่ายวิ่งบน BGP (RFC 4271) แต่ละเครือข่ายประกาศว่าตัวเองไปถึงที่อยู่ไหนได้บ้าง เพื่อนบ้านก็เชื่อ เมื่อวันที่ 24 กุมภาพันธ์ 2008 Pakistan Telecom ทำตามคำสั่งให้บล็อก YouTube ในประเทศ ด้วยการประกาศเส้นทางไปยังที่อยู่ส่วนหนึ่งของ YouTube ที่จำเพาะกว่าของ YouTube เอง — เส้นทางที่จำเพาะกว่าชนะเสมอ และผู้ให้บริการต้นทางของมันส่งต่อคำประกาศนั้นออกไป ทราฟฟิกทั้งโลกที่มุ่งหา YouTube จึงวิ่งไปปากีสถานอยู่ราวสองชั่วโมง (RIPE NCC) ไม่มีอะไรถูกแฮ็ก ระบบทำงานตามที่ออกแบบไว้ทุกอย่าง และการออกแบบนั้นตั้งอยู่บนสมมติฐานว่าทุกฝ่ายซื่อสัตย์
On top of all this sits one application among many, proposed at CERN in March 1989 as a way to keep track of documents (Berners-Lee) and released to the public domain on 30 April 1993. For most people the Web is the network — which is what a well-built floor looks like from above.
บนสุดของทั้งหมดนี้คือแอปพลิเคชันหนึ่งในหลายๆ ตัว เสนอขึ้นที่ CERN ในเดือนมีนาคม 1989 เพื่อใช้ติดตามเอกสาร (Berners-Lee) และปล่อยสู่สาธารณสมบัติในวันที่ 30 เมษายน 1993 สำหรับคนส่วนใหญ่ เว็บ (the Web) คือ เครือข่าย (network) — นั่นแหละคือหน้าตาของชั้นที่สร้างมาดี เมื่อมองจากด้านบน
Connections
เชื่อมโยง
Below: chapter 03 sets the physical ceiling on any channel and supplies the error-detecting codes every layer uses; chapters 04 and 05 provide the machine and the operating system that actually move the bytes. Above: chapter 10 takes the machines connected here and asks what it means for them to agree on anything, a far harder question than making them talk; chapter 08 is often on the far side of one of these connections; chapter 11 is the one this floor keeps needing, since DNS and BGP were built for a network of colleagues.
ด้านล่าง: บทที่ 03 กำหนดเพดานทางกายภาพของช่องสัญญาณ (channel) ใดๆ และให้รหัสตรวจจับข้อผิดพลาด (error-detecting code) ที่ทุกชั้นใช้ บทที่ 04 กับ 05 ให้เครื่องและระบบปฏิบัติการที่ลงมือขยับไบต์จริงๆ ด้านบน: บทที่ 10 เอาเครื่องที่เชื่อมต่อกันในบทนี้ไปถามว่าการที่พวกมันตกลงอะไรกันสักอย่างแปลว่าอะไร คำถามนี้ยากกว่าการทำให้พวกมันคุยกันได้มาก บทที่ 08 มักอยู่อีกฟากหนึ่งของการเชื่อมต่อแบบนี้ บทที่ 11 คือบทที่ชั้นนี้ต้องพึ่งอยู่ตลอด เพราะ DNS กับ BGP ถูกสร้างมาสำหรับเครือข่ายของคนที่รู้จักกันเป็นเพื่อนร่วมงาน
Open questions
คำถามที่ยังเปิดอยู่
The end-to-end argument is under steady pressure: firewalls, address translators and content delivery networks all put intelligence back in the middle, and QUIC moved transport out of the kernel to escape the middle's grip. Is the narrow waist still the architecture, or a memory of one? Second: BGP's trust problem has had a technical answer for years — cryptographic validation of route origins — and deployment remains partial, which makes it less a research question than a study in why coordination fails when no one can be compelled. Third: congestion control now runs many algorithms at once, some far more aggressive than others, on a commons that assumed roughly equal restraint. What holds an agreement together when the parties no longer agree?
end-to-end argument ถูกกดดันอยู่ตลอด: firewall, address translator และ content delivery network ต่างพาความฉลาดกลับเข้าไปไว้ตรงกลาง ส่วน QUIC ย้าย transport ออกจาก kernel เพื่อหนีเงื้อมมือของตรงกลางนั้น เอวคอดแคบ (narrow waist) ยังเป็นสถาปัตยกรรมจริง หรือเป็นแค่ความทรงจำถึงมันแล้ว ข้อสอง: ปัญหาความไว้ใจของ BGP มีคำตอบทางเทคนิคมาหลายปีแล้ว — การตรวจสอบแหล่งที่มาของเส้นทางด้วยวิทยาการรหัสลับ (cryptographic validation) — แต่การใช้งานจริงยังทำได้แค่บางส่วน มันจึงไม่ใช่คำถามวิจัยเท่ากับเป็นกรณีศึกษาว่าทำไมการประสานงานถึงล้มเหลวเมื่อไม่มีใครถูกบังคับได้ ข้อสาม: congestion control ตอนนี้รันหลายอัลกอริทึมพร้อมกัน บางตัวก้าวร้าวกว่าตัวอื่นมาก บนทรัพยากรส่วนรวมที่ออกแบบมาโดยสมมติว่าทุกฝ่ายยับยั้งชั่งใจเท่าๆ กัน อะไรจะยึดข้อตกลงไว้ได้ เมื่อฝ่ายต่างๆ ไม่เห็นตรงกันอีกต่อไป
Go deeper
อ่านต่อ
- J. H. Saltzer, D. P. Reed & D. D. Clark, "End-to-End Arguments in System Design," ACM TOCS 2, no. 4 (1984): 277–288 — the shortest route to understanding why the Internet is shaped as it is; MIT PDF.
- Van Jacobson & Michael J. Karels, "Congestion Avoidance and Control," SIGCOMM '88 — PDF.
- Larry Peterson & Bruce Davie, Computer Networks: A Systems Approach — the systems-first textbook, kept current and free at systemsapproach.org. For the classic course treatment, Kurose & Ross, Computer Networking: A Top-Down Approach, 9th ed., 2025.
- J. H. Saltzer, D. P. Reed & D. D. Clark, "End-to-End Arguments in System Design," ACM TOCS 2, no. 4 (1984): 277–288 — เส้นทางสั้นที่สุดที่จะเข้าใจว่าทำไมอินเทอร์เน็ตถึงมีรูปทรงแบบที่เป็นอยู่; MIT PDF.
- Van Jacobson & Michael J. Karels, "Congestion Avoidance and Control," SIGCOMM '88 — PDF.
- Larry Peterson & Bruce Davie, Computer Networks: A Systems Approach — ตำราที่เริ่มจากมุมมองระบบ ปรับปรุงต่อเนื่องและอ่านฟรีที่ systemsapproach.org. ถ้าต้องการแนวทางแบบคอร์สคลาสสิก ดู Kurose & Ross, Computer Networking: A Top-Down Approach, 9th ed., 2025.