Link layer and IP
مُقدَّم
مفردات
| English | المعنى |
|---|---|
| MAC address/mæk əˈdres/ | A link-layer address associated with a network interface. |
| CRC | Cyclic redundancy check: an error-detection value calculated from transmitted bits. |
| TTL | The IP hop-limit field that routers reduce to stop packets circulating indefinitely. |
| IP address/ˌaɪ ˈpiː əˈdres/ | An address identifying an interface within an IP network. |
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}
تدريب
Crossing 3 routers, the destination IP —
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
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}
تدريب
IHL = 5 means the header is —
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
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}
تدريب
Total length 0x003C with IHL 5 leaves — payload bytes
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
60 total - 20 header = 40 payload bytes.