Link layer and IP
Diperkenalkan
Kosa kata
| English | Makna |
|---|---|
| MAC address/mæk əˈdres/ | MAC address |
| CRC | CRC |
| TTL | TTL |
| IP address/ˌaɪ ˈpiː əˈdres/ | IP address |
English
Two addresses, two scopes
- An Ethernet frame: 6-byte destination MAC address, 6-byte source, 2-byte type, payload, 4-byte CRC. The MAC names a neighbour and changes every hop.
- An IPv4 header: version/IHL, total length, TTL, protocol, checksum, 4-byte source and destination IP address. The IP names the stranger and never changes.

{exercise:uni-cs0902-scopes}
Latihan
Crossing 3 routers, the destination IP —
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
MAC names the neighbour and changes; IP names the stranger and never does.
English
Decode the course header
45 00 00 3C … 40 06 …: version 4, IHL 5 — $5 \times 4 = 20$ bytes of header; total length $0x003C = 60$ (20 header + 40 payload); TTL $0x40 = 64$; protocol 6 = TCP.- The CRC protects the whole frame link by link; the IP checksum protects only the header end to end — routers rewrite the header (TTL decrements) but not the data, so integrity is scoped to what its rewriter touches.
{exercise:uni-cs0902-decode}
Latihan
IHL = 5 means the header is —
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
IHL counts 32-bit words: 5 x 4 = 20 bytes.
English
Three routers, four frames
- Crossing 3 routers, a packet rides 4 frames and carries 4 different destination MACs — one per hop, chosen by IP — while its destination IP stays fixed the whole way.
- IHL counts 32-bit words, total length counts bytes: mixing the two units is the classic header bug.
{exercise:uni-cs0902-units}
Latihan
Total length 0x003C with IHL 5 leaves — payload bytes
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
60 total - 20 header = 40 payload bytes.