Protocols and the TCP/IP model
แนะนำใหม่
11:12
ทำไมต้องมีการกำหนดโปรโตคอล
คอมพิวเตอร์สองเครื่องต้องการสื่อสารกัน แต่เครื่องหนึ่งส่งข้อมูลในทิศทางหนึ่งและอีกเครื่องคาดหวังต่างออกไปมาก ผลลัพธ์คือข้อมูลไร้ความหมาย — เหมือนคนสองคนที่พูด…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| byte/baɪt/ | A group of eight bits, commonly used as a unit of data storage. |
| protocol/ˈprəʊtəkɒl/ | โปรโตคอล |
| stack/stæk/ | A set of network protocol layers arranged so each layer performs a particular job. |
| layered/ˈleɪəd/ | Describes a system divided into levels, each with a particular job. |
| TCP/IP | A set of network protocols organised into four layers for communication across networks. |
| TCP/ˌtiː siː ˈpiː/ | โปรโตคอลควบคุมการส่งข้อมูล (TCP) |
| UDP/ˌjuː diː ˈpiː/ | โปรโตคอล_DGRAM ผู้ใช้ (UDP) |
| addresses | Numbers that identify specific locations in a computer's memory. |
| payload/ˈpeɪləʊd/ | The data being carried in a message, excluding information added to deliver it. |
| acknowledge/əkˈnɒlɪdʒ/ | To send a message confirming that data has been received. |
| timeouts | Periods after which a sender stops waiting for a response and takes action. |
| retransmissions | The sending of data again, usually because no acknowledgement arrived in time. |
| Modularity/ˌmɒdjʊˈlærɪti/ | One layer can be replaced without touching the others, so swapping Ethernet for Wi-Fi changes nothing above the link layer. |
| Ethernet/ˈiːθənet/ | A technology used to connect devices and transfer data over wired networks. |
| Wi-Fi | A set of rules for sending data across a wireless local network. |
| link layer/lɪŋk ˈleɪə/ | ชั้นลิงก์ |
| Standardisation/ˌstændədaɪˈzeɪʃn/ | Establishing or using consistent specifications, procedures or measures. |
| interface/ˈɪntəfeɪs/ | A way for users or programs to communicate with the computer's hardware. |
| Abstraction/əbˈstrækʃn/ | Representing essential features while leaving out unnecessary detail. |
| web app/web æp/ | A program that users access through a web browser. |
| application layer/ˌæplɪˈkeɪʃn ˈleɪə/ | ชั้นแอปพลิเคชัน |
| HTTP/ˌeɪtʃ tiː tiː ˈpiː/ | Hypertext Transfer Protocol: an application-layer request/response protocol used to transfer web resources. |
| FTP/ˌef tiː ˈpiː/ | A protocol used to transfer files between computers over a network. |
| SMTP/ˌes em tiː ˈpiː/ | A protocol used to send email between computers over a network. |
| IMAP/ˈaɪmæp/ | A protocol used to access and manage email stored on a server. |
| transport layer/ˈtrænspɔːt ˈleɪə/ | ชั้นการส่งผ่านข้อมูล |
| end-to-end delivery | The transfer of data from a process on one host to a process on another. |
| processes/ˈprəʊsesɪz/ | Programs that are running and can send or receive data. |
| port numbers/pɔːt ˈnʌmbəz/ | หมายเลขพอร์ต |
| internet layer/ˈɪntənet ˈleɪə/ | |
| packets/ˈpækɪts/ | แพ็กเก็ต |
| hosts | Devices connected to a network that can send or receive data. |
| IP address/ˌaɪ ˈpiː əˈdres/ | ที่อยู่ไอพี |
| routers/ˈruːtəz/ | เราเตอร์ |
| bits/bɪts/ | The smallest units of data, each having a value of zero or one. |
| physical link | The physical connection that carries signals between directly connected network devices. |
| framing/ˈfreɪmɪŋ/ | The process of putting data into frames for sending across a link. |
| MAC addresses/mæk əˈdresɪz/ | ที่อยู่ MAC |
| browser | A program used to access and display pages on the web. |
| server/ˈsɜːvə/ | A computer or program that provides services or resources in response to requests from clients. |
| HTTP request/ˌeɪtʃ tiː tiː ˈpiː rɪˈkwest/ | A message sent to a server to ask for a web resource. |
| segments/ˈseɡmənts/ | Units of data created by TCP for transport between processes. |
| hop/hɒp/ | One step in a packet's journey between directly connected network devices. |
| networks/ˈnetwɜːks/ | A set of connected devices or nodes that can exchange information. |
| frame/freɪm/ | A discrete unit in a sequence or transmission; in video, one complete image, and in networking, a link-layer data unit. |
| connection-oriented/kəˈnekʃn ˈɔːrɪəntɪd/ | แบบมีสถานะการเชื่อมต่อ |
| overhead/ˌəʊvəˈhed/ | Extra data or work needed to manage communication. |
| delay/dɪˈleɪ/ | The time taken for data to travel from sender to receiver. |
| HTTPS/ˌeɪtʃ tiː tiː piː ˈes/ | A secure set of rules for transferring web pages and other web content. |
| connectionless/kəˈnekʃənləs/ | แบบไร้สถานะการเชื่อมต่อ |
| acknowledgements/əkˈnɒlɪdʒmənts/ | Messages sent to confirm that data has been received. |
| live streaming | The sending of audio or video over a network as it happens. |
| DNS/ˌdiː en ˈes/ | A system that translates domain names into IP addresses. |
| reliability/rɪˌlaɪəˈbɪlɪti/ | How consistently a system supplies the required output. |
| video frame | One still image in a sequence that makes up a video. |
| layering/ˈleɪərɪŋ/ | การแบ่งชั้น |
| error handling | The actions taken when an error occurs during communication. |
ข้อความสองคำที่ทำให้เริ่มอินเทอร์เน็ต
- ในวันที่ 29 ตุลาคม 1969 นักศึกษาที่ UCLA พิมพ์คำว่า LOGIN ไปยังเครื่องที่ Stanford ตัวอักษรต่อตัวอักษร โดยมีเพื่อนร่วมชั้นโทรยืนยันทีละตัว หลัง L และ O ระบบพัง
- ปัญหาไม่ใช่สายเคเบิล แต่เป็นเพราะสองเครื่องที่สร้างโดยบริษัทต่างกัน ไม่มีข้อตกลงร่วมกันว่า byte หมายความว่าอะไร ควรพูดเมื่อไหร่ หรือทำอะไรเมื่อเกิดข้อผิดพลาด
- ทุกอย่างตั้งแต่บัดมาคือการจดบันทึกกฎเหล่านั้น โปรโตคอล คือข้อตกลงนั้น และอินเทอร์เน็ตคือกองซ้อนของโปรโตคอลเหล่านี้
- บทเรียนนี้คือเหตุผลที่ว่าทำไมโปรโตคอลจึงมีอยู่ ทำไมจึงเป็น ชั้น, สี่ชั้นของ TCP/IP และความแตกต่างระหว่าง TCP และ UDP
โปรโตคอลกำหนดอะไร
- โปรโตคอล คือ ชุดกฎ สำหรับการสื่อสารระหว่างอุปกรณ์ ปลายทั้งสองต้องปฏิบัติตามกฎเดียวกันหรือไม่สัญญาณจากฝั่งหนึ่งจะเป็นความหมายต่ออีกฝั่งหนึ่ง
- มันกำหนด รูปแบบ ของข้อมูล ที่ที่อยู่ตั้งอยู่และที่ payload เริ่มต้น; ลำดับ ของข้อความ ใครพูดก่อนและเมื่อไหร่จะยอมรับ; ความหมาย ของแต่ละข้อความ; เวลา, Timeouts และการส่งใหม่; และ สิ่งที่ต้องทำเมื่อเกิดข้อผิดพลาด
- Without one, communication fails completely, the way two people with no shared language fail.

กฎที่ตกลงกันล่วงหน้า โดยทั้งสองฝ่าย

A network protocol is:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
A protocol defines the format, order, meaning, timing and error handling of messages — both ends must agree.
What does a protocol define? Select ทั้งหมด that apply.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Format, order, meaning, timing and error handling. The cable's speed is a property of the hardware, not of the agreement.
เหตุผลที่โปรโตคอลถูกแบ่งเป็นชั้น
- การสื่อสารผ่านเครือข่ายซับซ้อนเกินไปที่จะใช้กฎชุดเดียว จึงถูกแยกออกเป็น ชั้น (layers) โดยแต่ละชั้นมีหน้าที่เฉพาะเจาะจง และสื่อสารได้เพียงกับชั้นที่อยู่ด้านบนและด้านล่างเท่านั้น การนำไปปฏิบัติจริงจะจัดเรียงเป็น สแต็ก (stack)
- ความยืดหยุ่น: สามารถเปลี่ยนชั้นหนึ่งโดยไม่กระทบชั้นอื่น ทำให้การเปลี่ยนจาก Ethernet เป็น Wi-Fi ไม่ส่งผลกระทบต่อชั้นที่สูงกว่า link layer
- มาตรฐาน: อุปกรณ์จากผู้ผลิตต่างกันสามารถทำงานร่วมกันได้ เพราะอินเทอร์เฟซของแต่ละชั้นมีความตกลงกัน การนามธรรม: นักเขียนโปรแกรมที่สร้างเว็บแอปพลิเคชันไม่จำเป็นต้องรู้รายละเอียดว่าชั้นล่างๆ ทำงานอย่างไร

สี่ชั้น แต่ละชั้นมีหน้าที่เดียว

A benefit of splitting networking into layers is:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Each layer has one job and a clear interface, so (e.g.) Ethernet can be swapped for Wi-Fi without touching higher layers.
สี่ชั้นของ TCP/IP
| ชั้น | วัตถุประสงค์ | ตัวอย่าง |
|---|---|---|
| ชั้นแอปพลิเคชัน | บริการสำหรับโปรแกรมผู้ใช้ และโปรโตคอลที่ใช้งานอยู่ | HTTP, FTP, SMTP, IMAP |
| ชั้นการขนส่ง | การส่งข้อมูลระหว่างกระบวนการจากต้นทางถึงปลายทาง โดยระบุด้วย หมายเลขพอร์ต | TCP, UDP |
| ชั้นอินเทอร์เน็ต | การส่ง แพ็กเก็ต ระหว่างโฮสต์โดยใช้ ที่อยู่ IP IP จะถูกส่งต่อโดย เร้าเตอร์ | IP |
| ชั้นลิงก์ | การส่งบิตผ่านลิงก์ฟิสิกส์หนึ่งครั้ง โดยใช้ MAC addresses สำหรับการจัดเฟรม MAC | Ethernet, Wi-Fi |
- ชั้นอินเทอร์เน็ต ไม่ได้ รับประกันการส่งข้อมูลสำเร็จ หน้าที่นี้คือของชั้นการขนส่ง และเกิดขึ้นก็ต่อเมื่อใช้ TCP เท่านั้น
Tap the four layers of the TCP/IP model
Explore each layer. Data travels DOWN the stack as it's sent (each layer adds its header) and back UP as it's received — and any layer can be swapped without touching the others.
Match each TCP/IP layer to its job.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Application = user protocols; Transport = TCP/UDP delivery; Internet = IP routing; Link = bits on the medium.
The internet layer (IP) guarantees that every packet arrives.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
IP forwards packets and does not guarantee delivery. Reliability is added above it, by TCP, and UDP deliberately does without it.
ตัวอย่างโจทย์: ข้อความข้ามอินเทอร์เน็ต
- อธิบายสิ่งที่เกิดขึ้นในแต่ละชั้นเมื่อเบราว์เซอร์ขอหน้าเว็บจากเซิร์ฟเวอร์
- ชั้นแอปพลิเคชัน: เบราว์เซอร์สร้างคำขอ HTTP สำหรับหน้านั้น
- ชั้นการขนส่ง: TCP แบ่งข้อมูลออกเป็นส่วนย่อยๆ เพิ่มหมายเลขพอร์ต และจะยืนยันการรับและส่งใหม่หากส่วนไหนหายไป
- ชั้นอินเทอร์เน็ต: IP เพิ่มที่อยู่ IP ของผู้ส่งและผู้รับลงในแต่ละแพ็กเก็ต และเร้าเตอร์จะส่งต่อทีละขั้นข้ามเครือข่าย
- ชั้นลิงก์: แต่ละขั้นจะใส่แพ็กเก็ตลงในเฟรมพร้อม MAC addresses แล้วส่งบิตผ่านสายหรือคลื่นวิทยุ ที่เซิร์ฟเวอร์ ชั้นต่างๆ จะถอดรหัสกลับเป็นลำดับย้อนกลับ

Put the TCP/IP layers in order, from the user's program down to the wire.
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Each layer wraps the one above; at the far end they are unwrapped in reverse order.
TCP และ UDP
- TCP is connection-oriented: it sets up a connection first, ensures all data arrives and in order, retransmits lost packets and controls flow. Reliable, at the cost of overhead and delay. Used by HTTP, HTTPS, SMTP and FTP.
- UDP is connectionless: it sends and forgets, with no acknowledgements, no ordering and no retransmission. Low overhead, no guarantees.
- UDP ใช้สำหรับการสตรีมสด DNS และการเล่นเกมออนไลน์ ซึ่ง ความเร็วสำคัญกว่าความน่าเชื่อถือ: เฟรมวิดีโอที่ถูกส่งใหม่จะมาถึงช้ากว่าเวลาที่จำเป็น ดังนั้นการทิ้งเฟรมนั้นจึงดีกว่าการรอคอย

รับประกันแต่ช้า หรือเร็วแต่ไม่รับประกัน

How does TCP differ from UDP?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
TCP sets up a connection and ensures reliable, ordered delivery (with overhead); UDP is fire-and-forget.
TCP is connection-oriented and guarantees ordered, complete delivery (with overhead), while UDP is fire-and-forget — faster but with no delivery guarantee.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
That's why UDP suits live streaming, gaming and DNS, but TCP is used for files, email and secure web pages where every byte must arrive.
Live video streaming uses ____ because speed matters more than retransmitting lost packets.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
A resent frame would arrive after the moment it was needed, so dropping it beats waiting. TCP's guarantees are worth their cost for a payment page.
ตัวอย่างโจทย์: เลือกโปรโตคอลการขนส่ง
- บริษัทหนึ่งกำลังสตรีมการแข่งขันกีฬาสด และขายบัตรผ่านหน้าเว็บ โปรโตคอลการขนส่งใดควรใช้สำหรับแต่ละอย่าง และทำไม?
- การสตรีมสด: UDP. เฟรมที่หายไปแล้วไม่มีค่าเมื่อถึงเวลาที่จะส่งใหม่ ดังนั้นความเร็วและความหน่วงต่ำจึงสำคัญกว่าความครบถ้วน ผู้ชมจะยอมเสียเฟรมหนึ่งเฟรมมากกว่าดูภาพหยุดนิ่ง
- หน้าขายบัตร: TCP. ข้อมูลทุกไบต์ของการชำระเงินและการจองต้องมาถึงถูกต้องและเป็นลำดับ ดังนั้นการยืนยันการรับและส่งใหม่จึงคุ้มค่าต่อปริมาณข้อมูลที่เพิ่มขึ้น
- ระบุชื่อโปรโตคอล แล้วบอกคุณสมบัติของข้อมูลที่กำหนดให้ใช้โปรโตคอลนั้น
คะแนนที่หลุดหายไป
- โปรโตคอลคือ ชุดกฎ ไม่ใช่โปรแกรมหรือสายเคเบิล ระบุอย่างน้อยสองสิ่งที่มันกำหนดไว้
- ประโยชน์ของการแบ่งชั้นคือ ความยืดหยุ่น มาตรฐาน และการนามธรรม ไม่ใช่ "มันเร็วกว่า"
- IP ไม่ได้รับประกันการส่ง; TCP ทำเช่นนั้น อย่าให้คะแนนชั้นอินเทอร์เน็ตด้วยความน่าเชื่อถือ
- UDP ไม่ใช่ "แย่" มันถูกเลือกเมื่อ ความเร็วสำคัญกว่าความน่าเชื่อถือ และคำตอบต้องระบุว่าข้อมูลประเภทใดที่ใช้เหตุผลนี้
คุณเข้าใจแล้ว
- a protocol is agreed rules for format, order, meaning, timing and error handling, followed by both ends
- โปรโตคอลสร้างเป็น สแต็ก ของ ชั้น ให้มาซึ่ง ความยืดหยุ่น มาตรฐาน และการนามธรรม
- ชั้น TCP/IP: แอปพลิเคชัน (HTTP, SMTP), การขนส่ง (TCP, UDP, หมายเลขพอร์ต), อินเทอร์เน็ต (ที่อยู่ IP, เร้าเตอร์), ลิงก์ (Ethernet, Wi-Fi, MAC addresses)
- TCP เชื่อมต่อได้ เรียงลำดับได้ และเชื่อถือได้; UDP ไม่เชื่อมต่อและไม่มีการรับประกัน ใช้สำหรับการสตรีม DNS และการเล่นเกม
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้