Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Data transmission · ⁨การส่งผ่านข้อมูล⁩

IGCSE Computer Science · ⁨Computer Science IGCSE⁩ · Topic 2 · ⁨หัวข้อ 2⁩

Video lesson for this topic · ⁨บทเรียนวิดีโอสำหรับหัวข้อนี้⁩ Open the video page · ⁨เปิดหน้าวิดีโอ⁩
10:56

การส่งข้อมูล

คุณส่งรูปภาพให้เพื่อนที่อยู่另一端ของโลก มันไม่ได้เดินทางเป็นก้อนเดียว มันถูกตัดเป็นแพ็กเก็ตเล็กๆ นับร้อยๆ ตัว แต่ละตัวมีฉลาก…

English narration · English + 中文 subtitles burned in · ⁨การบรรยายภาษาอังกฤษ · คำบรรยายภาษาอังกฤษ + 中文 ลอยตัวบนภาพ⁩

2.1

What is data transmission? · ⁨การส่งผ่านข้อมูลคืออะไร?⁩

English

Data transmission 数据传输 means moving data from one place to another — for example from your computer to a website, or from a phone to a printer.

Data often travels along a cable. Two common ones are shown below.

Before it is sent, the data is broken down into small, equal-sized pieces called packets 数据包. Each packet travels separately and they are put back together at the other end.

Using packets has benefits:

  • if one packet is lost or damaged, only that packet is sent again, not the whole file;
  • packets can take different routes, so a busy or broken route can be avoided;
  • many users can share the same connection at the same time.
ไทย

การส่งผ่านข้อมูล หมายถึงการย้ายข้อมูลจากที่หนึ่งไปยังอีกที่หนึ่ง — เช่น จากคอมพิวเตอร์ของคุณไปยังเว็บไซต์ หรือจากโทรศัพท์ไปยังเครื่องพิมพ์

ข้อมูลมักเดินทางผ่านสายเคเบิล สายสองประเภทที่พบบ่อยแสดงด้านล่างนี้

ภาพใกล้ๆ ของสายเครือข่ายที่จบลงด้วยปลั๊กพลาสติกใสพร้อมหมุดโลหะสีทอง
สายเคเบิล Ethernet พร้อมปลั๊ก RJ45 มักใช้ส่งข้อมูลบนเครือข่ายแบบมีสาย
สายเคเบิลที่เปิดออกเพื่อให้เห็นเส้นใยแก้วนำแสงด้านใน มีไม้บรรทัดประกอบเพื่อเปรียบเทียบขนาด
สายไฟเบอร์ออปติกส่งข้อมูลในรูปแบบของพัลส์แสงไปตามเส้นใยแก้วบางๆ

ก่อนจะถูกส่ง ข้อมูลจะถูกแบ่งออกเป็นชิ้นเล็กๆ ที่มีขนาดเท่ากันเรียกว่า แพ็กเก็ต แต่ละแพ็กเก็ตจะเดินทางแยกกันและถูกประกอบกลับเข้าด้วยกันที่ปลายทาง

การใช้แพ็กเก็ตมีประโยชน์ดังนี้:

  • หากมีแพ็กเก็ตใดสูญหายหรือเสียหาย จะมีการส่งแพ็กเก็ตนั้นใหม่เท่านั้น ไม่ใช่ทั้งไฟล์;
  • แพ็กเก็ตสามารถเลือกเส้นทางที่แตกต่างกันได้ ดังนั้นหากเส้นทางใดแออัดหรือชำรุด ก็สามารถหลีกเลี่ยงไปได้;
  • ผู้ใช้งานหลายคนสามารถใช้ช่องทางการสื่อสารเดียวกันได้พร้อมกัน
2.1

The structure of a packet · ⁨โครงสร้างของแพ็กเก็ต⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
1 (a) Understand that data is broken down into packets to be transmitted
(b) Describe the structure of a packet • A packet of data contains a: – packet header – payload – trailer • The packet header includes the: – destination address – packet number – originator’s address
(c) Describe the process of packet switching • Data is broken down into packets • Each packet could take a different route • A router controls the route a packet takes • Packets may arrive out of order • Once the last packet has arrived, packets are reordered
2 (a) Describe how data is transmitted from one device to another using different methods of data transmission • Including: – serial – parallel – simplex – half-duplex – full-duplex
(b) Explain the suitability of each method of data transmission, for a given scenario • Including the advantages and disadvantages of each method
3 Understand the universal serial bus (USB) interface and explain how it is used to transmit data • Including the benefits and drawbacks of the interface
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
1 (a) เข้าใจว่าข้อมูลถูกแบ่งออกเป็น แพ็กเก็ต เพื่อส่งผ่าน
(b) อธิบายโครงสร้างของแพ็กเก็ต • แพ็กเก็ตข้อมูลประกอบด้วย: – ส่วนหัวของแพ็กเก็ต –Names payload – trailer • ส่วนหัวของแพ็กเก็ตรวมถึง: – ที่อยู่ปลายทาง – หมายเลขแพ็กเก็ต – ที่อยู่ของผู้ส่ง
(c) อธิบายกระบวนการ packet switching • ข้อมูลถูกแบ่งออกเป็นแพ็กเก็ต • แต่ละแพ็กเก็ตอาจใช้เส้นทางที่แตกต่างกัน • Router ควบคุมเส้นทางที่แพ็กเก็ตใช้ • แพ็กเก็ตอาจมาถึงแบบไม่เรียงลำดับ • เมื่อแพ็กเก็ตตัวสุดท้ายมาถึงแล้ว แพ็กเก็ตจะถูกจัดเรียงใหม่
2 (a) อธิบายวิธีการส่งข้อมูลจากอุปกรณ์หนึ่งไปยังอีกอุปกรณ์หนึ่งโดยใช้วิธีการส่งผ่านข้อมูลที่แตกต่างกัน • รวมถึง: – serial – parallel – simplex – half-duplex – full-duplex
(b) อธิบายความเหมาะสมของแต่ละวิธีการส่งผ่านข้อมูล สำหรับสถานการณ์ที่กำหนด • รวมถึงข้อดีและข้อเสียของแต่ละวิธีการ
3 เข้าใจ universal serial bus (USB) interface และอธิบายวิธีการใช้งานเพื่อส่งผ่านข้อมูล • รวมถึงประโยชน์และข้อเสียของ interface นี้

Source: Cambridge International syllabus · ⁨แหล่งที่มา: หลักสูตร Cambridge International⁩

English

Every packet has three parts.

Part What it holds
packet header 包头 control information (see below)
payload 有效载荷 the actual data being carried
trailer 尾部 shows where the packet ends, plus an error check

The packet header holds:

  • the sender's IP address 地址 (where the packet came from),
  • the receiver's IP address (where it is going),
  • the packet number (so the packets can be put back in the right order).
ไทย

แพ็กเก็ตทุกชิ้นประกอบด้วยสามส่วน

แพ็กเก็ตที่แสดงเป็นสามบล็อกที่เชื่อมต่อกัน — หัวข้อ部分内容, Payload และท้ายpacket — พร้อมรายการเนื้อหาหัวข้อ部分内容อยู่ด้านล่าง
แพ็กเก็ตมีหัวข้อ部分内容, Payload (ข้อมูล) และท้ายpacket; หัวข้อ部分内容จะบรรจุที่อยู่และหมายเลขแพ็กเก็ต
ส่วน สิ่งที่บรรจุอยู่
หัวpacket ข้อมูลควบคุม (ดูด้านล่าง)
Payload ข้อมูลจริงที่กำลังถูกขนส่ง
ท้ายpacket แสดงว่าแพ็กเก็ตสิ้นสุดตรงไหน plus การตรวจสอบความผิดพลาด

หัวpacket บรรจุ:

  • ที่อยู่ IP ของผู้ส่ง (ที่มาของแพ็กเก็ต),
  • ที่อยู่ IP ของผู้รับ (ที่ไป),
  • หมายเลขแพ็กเก็ต (เพื่อให้สามารถประกอบแพ็กเก็ตเรียงลำดับให้ถูกต้อง)
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
data transmission/ˈdeɪtə trænˈsmɪʃn/ การส่งผ่านข้อมูล
packets/ˈpækɪts/ แพ็กเก็ต
packet header/ˈpækɪt ˈhedə/ หัวแพ็กเก็ต
payload/ˈpeɪləʊd/ ส่วนข้อมูล
trailer/ˈtreɪlə/ เทรลเลอร์
address/əˈdres/ ที่อยู่
2.1

Packet switching · ⁨การสลับแพ็กเก็ต⁩

English

Packet switching 数据包交换 is the way packets are sent across a network.

  • Special devices called routers 路由器 read each packet's header and choose the best route for it.
  • Each packet may take its own path, so packets can travel different ways.
  • Packets may arrive out of order.
  • When the last packet has arrived, the packets are reordered using their packet numbers.
ไทย

การสลับแพ็กเก็ต เป็นวิธีการที่แพ็กเก็ตถูกส่งข้ามเครือข่าย

แพ็กเก็ตสองชิ้นเดินทางจากผู้ส่งไปยังผู้รับ ผ่านเครือข่ายของเร้าเตอร์ โดยแต่ละชิ้นใช้เส้นทางสีต่างกัน *เร้าเตอร์ส่งต่อแพ็กเก็ต และแพ็กเก็ตที่แตกต่างกันสามารถเลือกเส้นทางที่ต่างกัน menuju ผู้รับคนเดียวกันได้

  • อุปกรณ์พิเศษที่เรียกว่า เร้าเตอร์ อ่านหัวpacket ของแต่ละแพ็กเก็ตและเลือกเส้นทางที่ดีที่สุดให้
  • แต่ละแพ็กเก็ตอาจใช้ เส้นทางของตนเอง ดังนั้นแพ็กเก็ตจึงสามารถเดินทางต่างทางกันได้
  • แพ็กเก็ตอาจ มาถึงไม่เรียงลำดับ
  • เมื่อแพ็กเก็ตตัวสุดท้ายมาถึงแล้ว แพ็กเก็ตจะถูก จัดเรียงลำดับใหม่ โดยใช้หมายเลขแพ็กเก็ต
Explore · ⁨สำรวจ⁩

How data travels in packets · ⁨วิธีการเดินทางของข้อมูลในแพ็กเก็ต⁩

Step through packet switching. Splitting a file into addressed packets is why one lost packet only needs resending, and why many users can share the same line. · ⁨ขั้นตอนการทำงานของการสลับแพ็กเก็ต การแบ่งไฟล์ออกเป็นแพ็กเก็ตที่มีที่อยู่คือเหตุผลที่หากแพ็กเก็ตหนึ่งหายไปต้องส่งใหม่เพียงครั้งเดียว และเหตุว่าผู้ใช้หลายคนสามารถแชร์สายเดียวกันได้⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
packet switching/ˈpækɪt ˈswɪtʃɪŋ/ การสลับแพ็กเก็ต
routers/ˈruːtəz/ เราเตอร์
2.1

Methods of data transmission · ⁨วิธีการส่งผ่านข้อมูล⁩

English

Serial and parallel

Serial 串行 Parallel 并行
How one bit at a time, down one wire several bits at once, down several wires
Distance good over long distances good over short distances only
Cost cheaper (fewer wires) more expensive (more wires)
Errors bits stay in order bits can arrive at slightly different times over long wires

Serial sends one bit after another along a single wire. Parallel sends several bits at the same time along several wires, so it is faster over short distances.

Simplex, half-duplex and full-duplex

These describe the direction data can travel.

Method Direction
simplex 单工 one direction only (e.g. computer → printer)
half-duplex 半双工 both directions, but only one at a time (e.g. walkie-talkie)
full-duplex 全双工 both directions at the same time (e.g. phone call)

Choosing a method

The choice depends on the distance, the speed needed, the cost, and whether data must travel both ways at once.

ไทย

แบบอนุกรมและแบบขนาน

แบบอนุกรม แบบขนาน
วิธี บิตละหนึ่งบิต ตามสายเดียว หลายบิตพร้อมกัน ตามหลายสาย
ระยะทาง ดีสำหรับระยะไกล ดีสำหรับระยะสั้นเท่านั้น
ค่าใช้จ่าย 是被 (สายน้อย) แพงกว่า (สายมาก)
ความผิดพลาด บิตอยู่ในลำดับที่แน่นอน บิตอาจมาถึงด้วยความล่าช้าแตกต่างกันเล็กน้อยบนสายยาว

แบบอนุกรม ส่งบิตหนึ่งตามอีกบิตหนึ่งไปตามสายเดียว แบบขนาน ส่งหลายบิตพร้อมกันไปตามหลายสาย ดังนั้นจึงเร็วขึ้นในระยะสั้น

การส่งแบบอนุกรมแสดงเป็นบิตเรียงกันบนสายเดียว และการส่งแบบขนานแสดงเป็นหลายบิตเดินทางพร้อมกันบนหลายสาย *แบบอนุกรมส่งบิตละหนึ่งบิตตามสายเดียว; แบบขนานส่งหลายบิตพร้อมกันตามหลายสาย

แบบ simplex, half-duplex และ full-duplex

สิ่งเหล่านี้อธิบายถึง ทิศทาง ที่ข้อมูลสามารถเดินทางได้

อุปกรณ์สองเครื่อง A และ B พร้อมลูกศรแสดงการส่งข้อมูลแบบ simplex (ทางเดียว), half-duplex (สองทางแต่ทีละด้าน) และ full-duplex (สองทางพร้อมกัน) *แบบ simplex เป็นทางเดียวเท่านั้น; half-duplex เป็นสองทางแต่ทีละทาง; full-duplex เป็นสองทางพร้อมกัน

วิธีการ ทิศทาง
simplex ทางเดียวเท่านั้น (เช่น คอมพิวเตอร์ → เครื่องพิมพ์)
half-duplex สองทิศทาง แต่เพียงอย่างเดียวทีละทาง (เช่น วิทยุสื่อสาร)
full-duplex สองทิศทางพร้อมกัน (เช่น การโทร)

การเลือกวิธีการ

การขึ้นอยู่กับ ระยะทาง, ความเร็ว ที่ต้องการ, ค่าใช้จ่าย, และการที่ข้อมูลต้องเดินทางสองทางพร้อมกันหรือไม่

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
serial/ˈsɪərɪəl/ แบบอนุกรม (serial)
parallel/ˈpærəlel/ 并联电路中
simplex/ˈsɪmpleks/ simplex
half-duplex/hɑːf ˈdjuːpleks/ half-duplex
full-duplex/fʊl ˈdjuːpleks/ full-duplex
universal serial bus/ˌjuːnɪˈvɜːsl ˈsɪərɪəl bʌs/ บัสแบบสากล
interface/ˈɪntəfeɪs/ อินเทอร์เฟซ
interference/ˌɪntəˈfɪərəns/ การแทรกแซง
2.1

USB

English

The universal serial bus 通用串行总线 (USB) is a common interface 接口 (a connection point) for joining devices to a computer.

Benefits:

  • the same connector is used by many devices (one standard);
  • the device is detected automatically and the correct driver is loaded;
  • it carries power, so it can charge or run a device;
  • the connector only fits one way, so it is hard to plug in wrongly.

Drawbacks:

  • the cable can only be a limited length (a few metres);
  • older USB versions are slower than newer ones;
  • transfer speeds can be lower than some other connection types.
ไทย

บัสแบบอนุกรมสากล (USB) เป็น อินเทอร์เฟซ (จุดเชื่อมต่อ) ที่พบบ่อยสำหรับการเชื่อมต่ออุปกรณ์เข้ากับคอมพิวเตอร์

ประโยชน์:

  • ใช้ขั้วต่อเดียวกันกับอุปกรณ์จำนวนมาก (มาตรฐานเดียว);
  • ตรวจจับอุปกรณ์อัตโนมัติและโหลดไดรเวอร์ที่ถูกต้อง;
  • ส่งพลังงานไปด้วย จึงสามารถชาร์จหรือจ่ายไฟให้กับอุปกรณ์ได้;
  • ตัวเชื่อมต่อสามารถเสียบได้ทางเดียวเท่านั้น ดังนั้นจึงยากที่จะเสียบผิดทาง

ข้อเสีย:

  • สายเคเบิลมีความยาวจำกัด (เพียงไม่กี่เมตร);
  • เวอร์ชัน USB เก่ามีความเร็วต่ำกว่าเวอร์ชันใหม่;
  • ความเร็วในการถ่ายโอนข้อมูลอาจต่ำกว่าการเชื่อมต่อแบบอื่นบางประเภท
รูปทรงปลั๊ก USB ที่แตกต่างกัน 5 แบบเรียงข้างกัน — micro, mini, type-B และ type-A — พร้อมสเกล 5 ซม.
ตัวอย่างรูปร่างของขั้วต่อ USB บางส่วน ใช้มาตรฐาน USB เดียวกัน ดังนั้นอุปกรณ์จะถูกตรวจจับอัตโนมัติ
2.2

Why we check for errors · ⁨ทำไมเราต้องตรวจสอบความผิดพลาด⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
1 Understand the need to check for errors after data transmission and how these errors can occur • Errors can occur during data transmission due to interference, e.g. data loss, data gain and data change
2 Describe the processes involved in each of the following error detection methods for detecting errors in data after transmission: parity check (odd and even), checksum and echo check • Including parity byte and parity block check
3 Describe how a check digit is used to detect errors in data entry and identify examples of when a check digit is used, including international standard book numbers (ISBN) and bar codes
4 Describe how an automatic repeat query (ARQ) can be used to establish that data is received without error • Including the use of: – positive/negative acknowledgements – timeout
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
1 เข้าใจความจำเป็นในการตรวจสอบข้อผิดพลาดหลังจากการส่งผ่านข้อมูลและวิธีที่ข้อผิดพลาดเหล่านี้เกิดขึ้น • ข้อผิดพลาดสามารถเกิดขึ้นระหว่างการส่งผ่านข้อมูลเนื่องจากสัญญาณรบกวน เช่น การสูญเสียข้อมูล การเพิ่มข้อมูล และการเปลี่ยนแปลงข้อมูล
2 อธิบายกระบวนการที่เกี่ยวข้องในแต่ละวิธีการตรวจจับข้อผิดพลาดต่อไปนี้用于 detect errors in data after transmission: parity check (odd and even), checksum และ echo check • รวมถึง parity byte และ parity block check
3 อธิบายการใช้ check digit ในการตรวจจับข้อผิดพลาดในการป้อนข้อมูลและระบุตัวอย่างของการใช้ check digit รวมถึง international standard book numbers (ISBN) และ bar codes
4 อธิบายการใช้ automatic repeat query (ARQ) เพื่อตรวจสอบว่าข้อมูลได้รับโดยไม่มีความผิดพลาด • รวมถึงการใช้: – positive/negative acknowledgements – timeout

Source: Cambridge International syllabus · ⁨แหล่งที่มา: หลักสูตร Cambridge International⁩

English

While data travels, interference 干扰 can change it. Three things can go wrong:

  • data loss — some bits do not arrive;
  • data gain — extra bits are added;
  • data change — some bits are flipped.

So the receiver checks whether the data arrived correctly.

ไทย

ขณะข้อมูลถูกส่ง สัญญาณรบกวน อาจทำให้ข้อมูลเปลี่ยนแปลงได้ มีสามสิ่งที่อาจผิดพลาด:

  • การสูญเสียข้อมูล — บิตบางตัวไม่ถึงปลายทาง;
  • การเพิ่มข้อมูล — มีบิตเพิ่มเติมเข้ามา;
  • การเปลี่ยนแปลงข้อมูล — บิตบางตัวถูกสลับค่า

ดังนั้น ผู้รับจึงตรวจสอบว่าข้อมูลมาถึงถูกต้องหรือไม่

Watch lesson · ⁨ดูบทเรียน⁩
2.2

Error detection methods · ⁨วิธีตรวจจับความผิดพลาด⁩

English

Parity check

A parity check 奇偶校验 adds one extra bit, the parity bit 奇偶校验位, to each byte. There are two types:

  • even parity — the total number of 1s in the byte (including the parity bit) must be even;
  • odd parity — the total number of 1s must be odd.

Example (even parity): the data 1011001 has four 1s, which is already even, so the parity bit is 0:

To find an error: the receiver counts the 1s. If even parity was agreed but a byte arrives with an odd number of 1s, an error has happened during transmission.

A parity check cannot find every error. If two bits flip, the count may still look correct.

Worked example. A single parity bit tells you that an error happened, but not where. A parity block 奇偶校验块 can find the exact bit. Several bytes are sent together, each with a row parity bit, and one extra parity byte 奇偶校验字节 at the bottom holds a parity bit for each column. Even parity is used below, and one bit was flipped during transmission. Find it.

Row byte 3 breaks even parity, and column b3 breaks even parity. The flipped bit is where they cross: byte 3, bit b3. Changing it back from 1 to 0 repairs the data. A single parity bit only says an error happened; a parity block says exactly where, so the receiver can even fix it.

Checksum

A checksum 校验和 is a value worked out from all the data before sending. The receiver works out the checksum again from the data it received. If the two values do not match, an error has occurred and the data is resent.

Echo check

In an echo check 回送校验, the receiver sends the data back to the sender. The sender compares it with the original. If they differ, an error happened. (This needs the data to be sent twice, so it is slow.)

Automatic Repeat reQuest (ARQ)

Automatic Repeat reQuest 自动重传请求 (ARQ) uses messages called acknowledgements 确认.

  • The receiver sends a positive acknowledgement if a packet arrived correctly, or a negative acknowledgement if it did not.
  • The sender starts a timeout 超时 timer. If no positive acknowledgement comes back in time, the sender sends the packet again.

Check digit

A check digit 校验码 is an extra digit placed at the end of a number, worked out from the other digits. It is used to find mistakes when a number is typed in.

When the number is entered, the check digit is calculated again and compared. It can catch:

  • an incorrect digit entered,
  • a transposition error 换位错误 (two digits swapped, e.g. 21 typed as 12),
  • a digit left out or an extra digit added,
  • a phonetic error (a digit that sounds similar, e.g. 13 and 30).

Check digits are used in barcodes 条形码 and ISBNs (book numbers).

ไทย

การตรวจสอบพาริตี้

การตรวจสอบพาริตี้ เพิ่มบิตหนึ่งตัวที่เรียกว่า บิตพาริตี้ เข้าไปในแต่ละไบต์ มีสองชนิด:

ข้อมูลที่ประกอบด้วย 1 สี่ตัว (คู่); บิตพาริตี้เป็น 0 เพื่อรักษาความเป็นคู่
Parity bit ถูกเพิ่มเข้าไปเพื่อให้จำนวนของ 1 เป็นคู่ (หรือคี่)
  • พาริตี้คู่ — จำนวนรวมของ 1 ในไบต์ (รวมถึงบิตพาริตี้) ต้องเป็น คู่;
  • พาริตี้คี่ — จำนวนรวมของ 1 ต้องเป็น คี่.

ตัวอย่าง (พาริตี้คู่): ข้อมูล 1011001 มี 1 สี่ตัว ซึ่งเป็นคู่อยู่แล้ว ดังนั้นบิตพาริตี้คือ 0:

parity bit + data
    0        1011001

ในการหาความผิดพลาด: ผู้รับจะนับจำนวน 1 หากตกลงใช้พาริตี้คู่แต่ได้รับไบต์ที่มีจำนวน 1 เป็น คี่ แสดงว่าเกิดความผิดพลาดระหว่างการส่งข้อมูล

การตรวจสอบพาริตี้ไม่สามารถตรวจจับความผิดพลาดได้ทุกกรณี หากบิตสองตัวถูกสลับ ค่ารวมอาจยังคงดูถูกต้องอยู่

ตัวอย่างที่แสดงวิธีทำ. บิตพาริตี้ตัวเดียวบอกได้ว่า มี ความผิดพลาดเกิดขึ้น แต่บอกไม่ได้ว่า อยู่ที่ไหน บล็อกพาริตี้ สามารถระบุตำแหน่งบิตที่ผิดพลาดได้โดยชัดเจน มีการส่งไบต์หลายตัวพร้อมกัน โดยแต่ละไบต์จะมีบิตพาริตี้ในแถว และมี ไบต์พาริตี้ เพิ่มเติมหนึ่งตัวด้านล่างซึ่งเก็บบิตพาริตี้สำหรับแต่ละคอลัมน์ ด้านล่างนี้ใช้พาริตี้คู่ และมีการสลับบิตหนึ่งตัวระหว่างการส่ง ให้หา位置和นั้น

          b1 b2 b3 b4 b5 | parity
 byte 1    1  0  1  1  0 |   1
 byte 2    0  1  1  0  1 |   1
 byte 3    1  1  1  1  0 |   1    <- row: odd number of 1s
 byte 4    0  0  1  1  0 |   0
 ------------------------------
 parity    0  0  1  1  1 |   1
                 ^ column b3: odd number of 1s

แถว byte 3 ขาดพาริตี้คู่ และคอลัมน์ b3 ขาดพาริตี้คู่ บิตที่ถูกสลับคือจุดตัดกันระหว่างทั้งสอง: byte 3, bit b3 การเปลี่ยนกลับจาก 1 เป็น 0 จะซ่อมแซมข้อมูลได้ บิตพาริตี้ตัวเดียวบอกเพียงว่ามีข้อผิดพลาดเกิดขึ้น ส่วนบล็อกพาริตี้ระบุว่าerrorsที่ตำแหน่งใดอย่างชัดเจน ทำให้ผู้รับ thậm chíสามารถแก้ไขได้เอง

Checksum

Checksum คือค่าที่คำนวณจากข้อมูลทั้งหมดก่อนการส่ง ผู้รับจะคำนวณ checksum ใหม่จากข้อมูลที่รับมา หากค่าทั้งสองไม่ตรงกัน แสดงว่าเกิดความผิดพลาดและข้อมูลจะถูกส่งใหม่

Echo check

ใน echo check ผู้รับจะส่งข้อมูลกลับไปยังผู้ส่ง ผู้ส่งจะเปรียบเทียบกับต้นฉบับ หากไม่ตรงกัน แสดงว่าเกิดความผิดพลาด (วิธีการนี้ต้องใช้การส่งข้อมูลสองครั้ง จึงมีความช้า)

Automatic Repeat reQuest (ARQ)

Automatic Repeat reQuest (ARQ) ใช้ข้อความที่เรียกว่า การยืนยันการรับ

  • ผู้รับจะส่ง การยืนยันเชิงบวก หากแพ็กเก็ตมาถึงถูกต้อง หรือส่ง การยืนยันเชิงลบ หากไม่ถูกต้อง
  • ผู้ส่งเริ่มจับเวลา timeout หากไม่มีการยืนยันเชิงบวกกลับมาภายในเวลาที่กำหนด ผู้ส่งจะส่งแพ็กเก็ตอีกครั้ง

Check digit

Check digit คือตัวเลขเสริมที่วางไว้ท้ายชุดตัวเลข ซึ่งคำนวณจากตัวเลขอื่นๆ ใช้เพื่อตรวจสอบข้อผิดพลาดเมื่อมีการ พิมพ์ตัวเลข

เมื่อกรอกตัวเลขแล้ว จะคำนวณ check digit ใหม่และเปรียบเทียบกับค่าเดิม สามารถตรวจจับได้:

  • ตัวเลขที่พิมพ์ผิด,
  • ความผิดพลาดจากการสลับตำแหน่ง (ตัวเลขสองตัวสลับที่ เช่น พิมพ์ 21 เป็น 12),
  • ตัวเลขที่ขาดหายไปหรือมีตัวเลขเกินมา,
  • ความผิดพลาดทางการออกเสียง (ตัวเลขที่อ่านเสียงคล้ายกัน เช่น 13 กับ 30).

Check digit ถูกใช้ใน บาร์โค้ด และ ISBN (เลขหนังสือ)

Explore · ⁨สำรวจ⁩

Computing concept lab · ⁨ห้องปฏิบัติการแนวคิดการคำนวณ⁩

Classify concrete examples by the computing idea they demonstrate. · ⁨จัดกลุ่มตัวอย่างที่เป็นรูปธรรมตาม idea การคำนวณที่แสดงออก⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
parity check/ˈpærɪti tʃek/ parity check
parity bit/ˈpærɪti bɪt/ บิตพาริตี้
parity block/ˈpærɪti blɒk/ บล็อกพาริตี้
parity byte/ˈpærɪti baɪt/ ไบต์พาริตี้
checksum/ˈtʃeksəm/ ค่าตรวจสอบความถูกต้อง
echo check/ˈekəʊ tʃek/ การตรวจสอบ回声 echo check
automatic repeat request/ˌɔːtəˈmætɪk rɪˈpiːt rɪˈkwest/ การขอส่งซ้ำอัตโนมัติ
acknowledgements/əkˈnɒlɪdʒmənts/ การยืนยัน
timeout/ˈtaɪmaʊt/ เวลาหมดอายุ
check digit/tʃek ˈdɪdʒɪt/ ตัวเลขตรวจสอบ
transposition error/trænspəˈzɪʃn ˈerə/ ข้อผิดพลาดของการเรียงลำดับ
barcodes/ˈbɑːkəʊdz/ บาร์โค้ด
2.3

Encryption · ⁨การเข้ารหัสข้อมูล⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
1 Understand the need for and purpose of encryption when transmitting data
2 Understand how data is encrypted using symmetric and asymmetric encryption • Asymmetric encryption includes the use of public and private keys
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
1 เข้าใจความจำเป็นและวัตถุประสงค์ของ encryption เมื่อส่งผ่านข้อมูล
2 เข้าใจวิธีการเข้ารหัสข้อมูลโดยใช้ symmetric และ asymmetric encryption • Asymmetric encryption รวมถึงการใช้ public และ private keys

Source: Cambridge International syllabus · ⁨แหล่งที่มา: หลักสูตร Cambridge International⁩

English

Why we need encryption

Encryption 加密 scrambles data so that it cannot be understood if it is intercepted 拦截 (caught) by the wrong person. The readable data is called plaintext 明文; after encryption it becomes ciphertext 密文.

Encryption does not stop data from being intercepted. It only stops the data from being understood.

Symmetric encryption

Symmetric encryption 对称加密 uses a single key 密钥 to both encrypt and decrypt the data. The sender and receiver must share this same secret key. The risk is that the key itself could be stolen while being shared.

Asymmetric encryption

Asymmetric encryption 非对称加密 uses two different keys:

  • a public key 公钥 that anyone can have, used to encrypt;
  • a private key 私钥 that is kept secret, used to decrypt.

Data encrypted with the public key can only be decrypted with the matching private key, so the key never has to be shared. This is safer than sharing one secret key.

ไทย

ทำไมเราต้องการการเข้ารหัสข้อมูล

การเข้ารหัสข้อมูล ทำลายรูปแบบข้อมูลให้ไม่สามารถเข้าใจได้หากถูก ** intercepted** (ดักจับ) โดยบุคคลที่ไม่เหมาะสม ข้อมูลที่อ่าน理解的ได้เรียกว่า plaintext; หลังการเข้ารหัสจะกลายเป็น ciphertext

การเข้ารหัสข้อมูล ไม่ ป้องกันไม่ให้ข้อมูลถูก intercept แต่ป้องกันไม่ให้ข้อมูลถูกเข้าใจ

การเข้ารหัสแบบสมมาตร

การเข้ารหัสแบบสมมาตร ใช้ key เดียวกันทั้งในการเข้ารหัสและการถอดรหัส ผู้ส่งและผู้รับต้องแบ่งปัน key ลับเดียวกันนี้ ความเสี่ยงคือ key เองอาจถูกขโมยระหว่างกระบวนการแบ่งปัน

Asymmetric encryption

Asymmetric encryption ใช้ key สองตัวต่างกัน:

  • public key ที่ใครก็ได้สามารถมีได้ ใช้สำหรับการเข้ารหัส;
  • private key ที่เก็บเป็นความลับ ใช้สำหรับการถอดรหัส

ข้อมูลที่ถูกเข้ารหัสด้วย public key สามารถถอดรหัสได้ด้วย private key ที่สอดคล้องกันเท่านั้น ดังนั้น key จึงไม่ต้องถูกแบ่งปัน สิ่งนี้ปลอดภัยกว่าการแบ่งปัน key ลับตัวเดียว

การเข้ารหัสแบบสมมาตรที่ใช้ key เดียวกันสำหรับทั้งสองขั้นตอน และการเข้ารหัสแบบอสมมาตรที่ใช้ public key สำหรับเข้ารหัสและ private key สำหรับถอดรหัส *แบบสมมาตรใช้กุญแจร่วมเดียว; แบบอสมมาตรใช้กุญแจสาธารณะเพื่อเข้ารหัสและกุญแจส่วนตัวเพื่อถอดรหัส

Explore · ⁨สำรวจ⁩

The Caesar cipher · ⁨凯撒密码⁩

Shift each letter to encrypt a message — the simplest idea of a cipher and its key. · ⁨เลื่อนตัวอักษรแต่ละตัวเพื่อเข้ารหัสข้อความ — ความคิดพื้นฐานที่สุดของรหัสลับและ กุญแจ ของมัน⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
encryption/enˈkrɪpʃn/ การเข้ารหัส
intercepted/ˌɪntəˈseptɪd/ ถูกดักจับ
plaintext/ˈpleɪntekst/ plaintext
ciphertext/ˈsaɪfətekst/ ciphertext
symmetric encryption/sɪˈmetrɪk enˈkrɪpʃn/ symmetric encryption
key/kiː/ คีย์
asymmetric encryption/ˌeɪsɪˈmetrɪk enˈkrɪpʃn/ asymmetric encryption
public key/ˈpʌblɪk kiː/ public key
private key/ˈpraɪvət kiː/ กุญแจส่วนตัว
2.3

Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

English
  • Data is sent in packets (a header with the addresses and packet number, a payload, and a trailer). Packets can take different routes and arrive out of order, then are reordered by their packet numbers.
  • Match the transmission types: serial (one bit at a time, good over long distances) vs parallel (several bits at once, short distances); simplex / half-duplex / full-duplex describe the direction.
  • A single parity bit only shows that an error happened; a parity block locates the exact wrong bit — the row and the column that both fail.
  • Learn the error-detection methods and what each does: parity check, checksum, echo check, ARQ, and the check digit (for typed-in numbers).
  • Symmetric encryption uses one shared key; asymmetric uses a public key to encrypt and a private key to decrypt, so no secret key is ever shared.
ไทย
  • ข้อมูลถูกส่งในรูปแบบ แพ็กเก็ต (ส่วนหัวที่มีที่อยู่และหมายเลขแพ็กเก็ต ส่วนเนื้อหา และส่วนท้าย) แพ็กเก็ตสามารถเดินทางผ่านเส้นทางที่แตกต่างกันและอาจมาถึงตามลำดับที่ผิด จากนั้นจะถูกจัดลำดับใหม่ตามหมายเลขแพ็กเก็ต
  • จับคู่ประเภทการส่งข้อมูล: serial (ส่งทีละบิต เหมาะกับระยะไกล) เทียบกับ parallel (ส่งหลายบิตพร้อมกัน ระยะสั้น); simplex / half-duplex / full-duplex อธิบายทิศทาง
  • บิตพาริตี้ ตัวเดียวบอกได้เพียงว่า มี ข้อผิดพลาดเกิดขึ้น; บล็อกพาริตี้ สามารถระบุตำแหน่งบิตที่ผิดได้อย่างแม่นยำ — ทั้งแถวและคอลัมน์ที่ล้มเหลว
  • เรียนรู้วิธีตรวจจับความผิดพลาดและหน้าที่ของแต่ละวิธี: การตรวจสอบพาริตี้, checksum, echo check, ARQ และ check digit (สำหรับตัวเลขที่พิมพ์เข้า)
  • การเข้ารหัสแบบสมมาตร ใช้ key เดียวกันที่แบ่งปัน; การเข้ารหัสแบบอสมมาตร ใช้ public key สำหรับการเข้ารหัสและ private key สำหรับการถอดรหัส ดังนั้นจึงไม่มี key ลับ nàoถูกแบ่งปัน

Interactive lessons on this topic · ⁨บทเรียนเชิงโต้ตอบสำหรับหัวข้อนี้⁩

Work through it step by step, with instant-check exercises. · ⁨ทำทีละขั้นตอน พร้อมแบบฝึกหัดตรวจสอบผลทันที⁩

Past Papers · ⁨ข้อสอบย้อนหลัง⁩

More topics in IGCSE Computer Science · ⁨Computer Science IGCSE⁩ · ⁨หัวข้อเพิ่มเติมใน IGCSE Computer Science · ⁨Computer Science IGCSE⁩⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP