CSC 498 · Computer Network and Data Communications
Our notes
3 min readParallel and serial
- Parallel: several bits at once on several wires (old printer cables, the internal buses of a computer). Fast over short distances but suffers skew (bits arriving at slightly different times) and crosstalk, and needs many wires.
- Serial: one bit after another on one line. Used for almost all communication links (USB, SATA, PCIe lanes, Ethernet), because high-speed serial is now faster and cheaper.
Asynchronous transmission (start-stop)
Each character is sent on its own: line idle at 1 → start bit (0) → 5-8 data bits (least significant first) → optional parity bit → stop bit(s) (1). The receiver resynchronises at each start bit, so the clocks need only be roughly the same.
Worked example. At 9,600 bps with 8 data bits, no parity, 1 stop bit (8N1), each character takes 10 bits: 960 characters per second; efficiency = 8/10 = 80%.
Simple and cheap: keyboards, serial (RS-232) ports, GPS modules, Arduino-to-PC links.
Synchronous transmission
Data is sent in large blocks (frames) with no start/stop bits per character; sender and receiver keep their clocks in step using sync characters or flag patterns (01111110 in HDLC) and the transitions in the signal itself.
Worked example. A frame of 1,000 data bytes with 6 bytes of header, CRC and flags: efficiency = 1,000/1,006 = 99.4%.
Used for high-speed links (Ethernet, SONET/SDH, HDLC).
Line coding (digital data to digital signal)
| Code | Rule | Notes |
|---|---|---|
| NRZ-L | high = 0 (or 1), low = the other | simple; long runs lose clock sync |
| NRZ-I | a 1 is a transition, a 0 none | runs of 0s still a problem |
| Manchester | transition in the middle of every bit (low-to-high = 1 in IEEE 802.3) | self-clocking; needs double the bandwidth; 10 Mbps Ethernet |
| Differential Manchester | transition at the start for 0 | token ring |
| Bipolar AMI | 0 = no pulse, 1s alternate + and − | no DC component; used in T1 |
| 4B/5B, 8B/10B, 64B/66B | code blocks with enough transitions | Fast and Gigabit Ethernet, USB 3 |
Error detection
- Parity bit: makes the number of 1s even (or odd). Detects any odd number of bit errors; misses errors in pairs. Two-dimensional parity (rows and columns) detects more and can correct a single error.
- Checksum: add the data words (16-bit one's complement sum in IP, TCP and UDP); the receiver adds everything and should get all 1s.
- Cyclic redundancy check (CRC): treat the data as a polynomial; divide (modulo-2, XOR) by an agreed generator; send the remainder with the data. The receiver divides the whole frame: a zero remainder means no detected error. Detects all single and double errors and all bursts shorter than the CRC. Ethernet uses CRC-32.
Worked example. Data 1101, generator 1011 (x³ + x + 1). Append 3 zeros: 1101000. Divide by XOR: 1101 ⊕ 1011 = 0110 → bring down 0: 1100 ⊕ 1011 = 0111 → bring down 0: 1110 ⊕ 1011 = 0101 → bring down 0: 1010 ⊕ 1011 = 0001. Remainder 001; send 1101001. Dividing 1101001 by 1011 leaves 000, so it checks.
Error correction
- Backward error correction (ARQ): detect and ask for a resend (stop-and-wait, go-back-N, selective repeat).
- Forward error correction (FEC): add enough redundancy to fix errors without a resend (Hamming codes, Reed-Solomon in CDs and QR codes, convolutional, turbo and LDPC codes in mobile networks). Used where resends are slow (satellite) or impossible (broadcast).
- Hamming code: to correct one error in m data bits you need r check bits with 2ʳ ≥ m + r + 1. For m = 4: r = 3 (Hamming (7,4)); for m = 8, r = 4.
Exams usually ask: parallel versus serial; asynchronous versus synchronous with efficiency calculations; draw line codes (NRZ, Manchester) for a bit pattern; parity, checksum and CRC (work a CRC by hand); Hamming bits; ARQ versus FEC.
Common mistake: in a CRC, forgetting to append (degree of generator) zeros before dividing, or using ordinary subtraction. Modulo-2 division uses XOR and has no carries or borrows.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Computer Networks: A Systems Approach, 2.4 Error detection
(opens book.systemsapproach.org in a new tab)
Peterson and Davie, Computer Networks: A Systems Approach, Computer Networks: A Systems Approach, 2.4 Error detection, CC BY 4.0 · licence
-
Computer Networks: A Systems Approach, 2.3 Framing
(opens book.systemsapproach.org in a new tab)
Peterson and Davie, Computer Networks: A Systems Approach, Computer Networks: A Systems Approach, 2.3 Framing, CC BY 4.0 · licence
-
Computer Networks: A Systems Approach, 2.5 Reliable transmission
(opens book.systemsapproach.org in a new tab)
Peterson and Davie, Computer Networks: A Systems Approach, Computer Networks: A Systems Approach, 2.5 Reliable transmission, CC BY 4.0 · licence
-
MIT 6.02 notes: Coping with bit errors using error correction codes
MIT course notes chapter (PDF): fuller than our notes, with worked examples.
(opens ocw.mit.edu in a new tab)
MIT OpenCourseWare, MIT 6.02 notes: Coping with bit errors using error correction codes, CC BY-NC-SA 4.0 · licence
-
Asynchronous serial communication
(opens en.wikipedia.org in a new tab)
Wikipedia, Asynchronous serial communication, CC BY-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.